Content-Type: text/plain; charset="UTF-8"
On Tue, 2013-04-23 at 12:47 +0200, hermann meyer wrote:
(Sorry for the late reply, I don't monitor LAD very closely these days)
You should be able to handle all the events in one loop.
However here you seem to be iterating over all events *for every frame*?
That would cause a problem with loading since you'll issue a ton of
identical load requests, but it also probably isn't what you want for
MIDI either. You'll trigger everything repeatedly and the timing is
wrong. I think you need to unify your two loops here.
The general pattern for sample-accurate event receiving is work through
time in the event loop, outputting everything up to the current event.
So you start with t=3D0. The next event loop in the loop is at t=3D5, so
render the output for 0..5, process the event (to e.g. trigger a voice
or whatever), then continue. After the loop output everything from the
last event to the end of the cycle.
So your event processing loop is your processing loop, and proceeds in
'chunks' delimited by events.
The magic of the worker extension is you can do non-RT things like load
new sample banks, which will happen RT-safe (with latency) if running
realtime, but if freewheeling (e.g. for export) the scheduled work will
execute immediately/synchronously. Thus you can get sample accurate
exporting, e.g. with a patch load at t=3D0 and a note on at t=3D1 the note
is guaranteed to play with the new patch (in the export). You don't
need to worry about this, but it's why things are the way they are...
plus it's pretty cool :)
Hopefully that makes sense, the simplest example of how to do this is in
the metro example:
tl;dr: Do that :)
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
-----END PGP SIGNATURE-----