From: Tom B. (Tehom) <te...@pa...> - 2012-03-28 19:31:27
|
I committed some changes to logical instruments functionality. They just fine-tune it. The first group of changes concerns how tightly channel intervals are fitted. Why: Segments weren't fitting as tightly as they could. That's because I had to put about a second of silence after each segment, because otherwise a sudden change to another instrument can make spurious sounds (even shortly after the final noteoff, a note can still be audibly affected by a change of instrument) But that meant that some very normal situations resulted in wasting as many as half the channels. For instance, after you split a segment, the start of the second segment was a second earlier than the end of the first segment, and during that one second of overlap they need two channels, which means they can't have the same channel. Fixes: 1. Now when we allocate a channel interval, we consider whether it will play on a different instrument than whatever instrument used the channnel previously or will use it next. If instrument is the same, the interval doesn't get a margin. Changing a segment's instrument forces a channel reallocation. 2. We select the least wasteful channel interval instead of the first one we see. 3. And channel intervals aren't wasted on muted tracks. If they get unmuted, they get one the first time they actually play a note. I didn't try to keep up with mute/unmute commands, so this only affects tracks that are muted for the whole session. Second change (bugfix): Sometimes there are controllers that neither the instrument nor the segment knows about. If one of them has been changed on that channel, it could continue into the segment's playing. So now when a segment starts we send 121 (All Controllers Off) first. Third change (bugfix): This bug hadn't actually manifested that I know of, but it was still wrong so I fixed it. We were treating the loop time of MappedBufMetaIterator as if it applied to all iterators. Actually it's only progressive per iterator; it can regress between iterators. Fix: Now iterators track their own progressive time. Tom Breton (Tehom) |