-
Notifications
You must be signed in to change notification settings - Fork 3
Audio Engine
B0ney edited this page Jun 7, 2023
·
15 revisions
Nothing here yet... Just dust and echos...
Check out core
todo: look at how LMMS, Hydrogen drum machine & Polyhhone editor does it.
todo: I forgot where I found this equation.
frames_per_tick = (sample_rate * 60) / beats_per_minute / resolution
Calculating the latency (in ms) of a given buffer size (in frames):
latency = buffer_size * (sample_rate / 1000)
256 * (44100 / 1000) = ~5.8 ms
For optimal performance, it's important to set the buffer size as small as it can without causing xruns.
...what are "xruns"?
( under | over )run, it's when the program fails process the required frames in time. xruns usually come out as audible clicks, pops, crackly audio, or repeating sounds. In most cases, they can be mitigated by increasing the buffer size.