midiCollector logic


#1

I can’t get this straight in my head…

I have parts of my code that run 2 x oversampled. These also take midi messages. When passing on a midi message to them I double the deltaTime to map it to the 2x buffer size.

Should I also set the midiCollector sample rate to 2x ? Or, just do that, and not double the deltas?


#2

Well the sample rate is used to convert the real time of incoming events into a timestamp in samples. So if you want the sample number of each event to be in your 2x frequency, then yes, just set the rate to be 2x and work at that speed, I guess.


#3

Ok, then doing both (2x SampleRate, and 2x DeltaTime on each message) would be wrong.


#4

Probably, but it depends on how you use the numbers, too. I always get very confused when I do things involving changing sample rates…


#5

Me too. The time is passed on to synth envelopes that then wait the specified number of samples before going into attack and release states. I think doubling the time would be enough.


#6