Ok, so as I've been spending some time studying the relatively specific field of "instruments that use both NPH's and IPH's" (ie. single-streamed, non-midi-based instruments, ie. SF2 & LB302 for now), I think I've identified another problem. And this problem also seems to affect MIDI-based instruments, because MIDI-events are generated from NPH's.
The problem is note release. Particularly, the frame offset of note release. When a note starts in the middle of the period, there's no problem: there's just an frame offset that is specified, so for example, if we have a period size of 256, and the tick happens in the middle of the period, the note starts with an offset of 128. That's all fine, we can pass the offset to the instruments, and have them delay that start of the note. But then, there's the problem with note release. Because the release may also happen in the middle of a period. And since the offset is kept during the lifetime of the note, and the NPH's periods are all offset from the global periods, that means that the actual point of release will be ( frame offset of release + frame offset of the NPH ). And this means, that it's entirely possible that the noteoff event may be pushed over to the next period. And this in turn is something that most instruments cannot handle: they work in periods, and anything that happens outside the period, can't be processed. So right now we have release happening too early for some instruments. So, there are a number of possible ways to solve this: 1. As discussed earlier: do not hold the offset for the lifetime of the note. Instead, just shorten the first period, so that the offset can be applied for the first period only, but the rest of the periods would be in sync with global. 2. For MIDI-instruments, implement a way to "postpone" the MIDI-event, ie. schedule it to be triggered at next period. Instruments that use the NPH/IPH combo would then just have to deal with the situation internally (they currently don't have sample-exact timing anyway). 3. I'm sure I had a #3 but now I seem to have forgotten it... oh well, I'll post it if it comes to mind again. ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ LMMS-devel mailing list LMMS-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lmms-devel