I think Cream has a bug setting the sample position of MIDI events

Official support for: kirnuarp.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi All,

First of all, a tl;dr: When debugging the sample steinberg synth in Visual Studio, I can see that cream is sending me MIDI events with an "intra buffer sample offset" (which is VstMidi::deltaFrames in VST2 and Event::sampleOffset in VST3) that is equal to my buffer size, which prevents some synths that I use from handling the event (which leads to undefined behavior).

I'm running Cream in three hosts: Cakewalk Sonar, Ableton Live 9, and Bitwig Studio 2. Each exhibits strange behavior, but it was in Bitwig 2 that I stepped in with a debugger and looked at the values.

With a sample rate of 44100 and a buffer size of 512, I see that Cream occasionally sends me a MIDI note on event with a sample offset of 512. I don't think this is allowed, as the values should be between 0 and 511.

This could be handled by a synth plugin by deferring any events like this to the next buffer call and setting the offset to zero (in other words, a value of 512 means the event is coming at the very beginning of the next buffer.)

However it does seem like a bug on Cream's end to send a MIDI event that isn't part of the current buffer being rendered.

Here is my recipe (though I'm not sure what's necessary, especially regarding specific notes):

1. Set up cream to route to a synth in your host of choice (that kind of varies)
2. Create a chord pattern and use the CHRDMEM tab to set it for all notes. The chord I used was G major 7 (G, B, D, F#).
3. Play a MIDI loop containing one measure of C3, followed by one measure of E3.

After some time the synth will receive an event with an offset equal to the buffer size (at least in my test, with at a sample rate of 44100 and a buffer size of 512.)

The reason this is bad is because, at least with Cakewalk Z3TA+ 2, events like this never get handled and end up blocking the input queue, which prevents the synth from sounding. Again this could be handled on the synth side by postponing these events till the next buffer, but the thing about life is that you can't trust strangers to follow the rules, so maybe it's best to handle it internally and assume everyone else won't.

Just to describe some of the "weird behavior I see":

In Ableton Live 9, using the recipe I described, the fourth note of every arpeggiated chord fails to play. The notes will play if I make them just a bit longer than one measure (because Live is probably throwing away events that don't fit in the buffer being rendered). This with every synth I tried (including their built in ones.)

Sonar plays fine in the Clips View, but in the matrix things occasionally get delayed by a buffer (I think they are postponing the events, but perhaps instead of moving it to the beginning of the next buffer they move it to the end.)

In Bitwig I get stuck notes with Z3TA+ 2, but things are actually stable with their other synths.
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “Kirnu”