Audio buffer size for live midi?

Pixilang programming language
Post Reply
ball2000
Posts: 11
Joined: Tue Nov 19, 2013 9:23 pm

Audio buffer size for live midi?

Post 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
ball2000
Posts: 11
Joined: Tue Nov 19, 2013 9:23 pm

Re: Audio buffer size for live midi?

Post by ball2000 »

and on SunVox 1.7.2b the responsiveness pleases me. So whatever you did there :)
User avatar
NightRadio
Site Admin
Posts: 3941
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: Audio buffer size for live midi?

Post 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.
ball2000
Posts: 11
Joined: Tue Nov 19, 2013 9:23 pm

Re: Audio buffer size for live midi?

Post 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
ball2000
Posts: 11
Joined: Tue Nov 19, 2013 9:23 pm

Re: Audio buffer size for live midi?

Post by ball2000 »

The other problem is it ignores 'running status' :fool:
Post Reply