Page 1 of 1

Audio buffer size for live midi?

Posted: Wed Nov 20, 2013 4:30 am
by ball2000
Hi- Is there a way to set the audio buffer size for the callback? So as to increase the refresh rate?

Or some trick for interrupting and updating the output stream? Trying to play pixilang with a keyboard, but midi flubs if keys played quickly. Multithread or something? :unknown: me OSX 10.7.5 pixilang 3.4.4

Re: Audio buffer size for live midi?

Posted: Wed Nov 20, 2013 4:54 am
by ball2000
and on SunVox 1.7.2b the responsiveness pleases me. So whatever you did there :)

Re: Audio buffer size for live midi?

Posted: Wed Nov 20, 2013 8:27 am
by NightRadio
Unfortunately there is no possibility to change the buffer size in the current OSX version of Pixilang. So it is the same as in SunVox. But the SunVox sounds better due to MIDI events time distribution. In other words: i don't handle all MIDI events in the beginning of the buffer, but i handle them in different buffer positions according to the event time.
For example, the latency = 4
I have two MIDI events:
EVT1 with system timestamp = 1; output event time = 1 + latency = 5
EVT2 with system timestamp = 4; output event time = 4 + latency = 8
And i have audio buffer with the output time = 0
So there is the image how should i handle these events:
Buffer begin: [ 0 1 2 3 4 5 (handle EVT1 here) 6 7 8 (handle EVT2 here) 9 ..... ]
First, you need to render this piece of the buffer: 0 ... 5. Then handle EVT1. Then render 6 ... 8. Then handle EVT2. And then render the rest.

Re: Audio buffer size for live midi?

Posted: Sun Nov 24, 2013 1:18 pm
by ball2000
Ah yep I was changing all 'sampler' inputs on index 0 of each "$frames" - oops!
So now I use the midi EVT timestamp, add 256*6 for look-ahead, and render until $time == next event ... My midi parser still needs tweaking though
:)

http://www.mediafire.com/download/sragd ... eMidi4.zip

Re: Audio buffer size for live midi?

Posted: Sat Nov 30, 2013 3:42 am
by ball2000
The other problem is it ignores 'running status' :fool: