How to code some intricate legato logic... use onTimer() ?
-
@tonewolf said in How to code some intricate legato logic... use onTimer() ?:
I thought I read something about the timer being limited to 40ms intervals, though
Looks like 4ms to me - https://github.com/christophhart/HISE/blob/develop/hi_core/hi_dsp/modules/ModulatorSynth.cpp#L410
-
@tonewolf said in How to code some intricate legato logic... use onTimer() ?:
Is there significant advantages to separating those all out into discrete MidiLists?
Yes, do this
-
@d-healey ah, great. So is this something different from…
https://docs.hise.dev/hise-modules/midi-processors/list/scriptprocessor.html#the-ontimer-callback
Which says it is limited to 40ms…?
-
@tonewolf said in How to code some intricate legato logic... use onTimer() ?:
Which says it is limited to 40ms…?
Well the code says otherwise, unless my maths is wrong and 0.004 seconds is not 4ms
-
@d-healey great! Just wanted to make sure we were talking about the same Timer.
Wonderful. That’s been super helpful, thanks! I’ll see what I can come up with using this method.
-
Perhaps missing something obvious, but how can I use MidiList to store times, when it only seems to be able to store integer values between -128 and 128?
-
@tonewolf said in How to code some intricate legato logic... use onTimer() ?:
store integer values between -128 and 128?
hmmm, integer yes, but you can store any value (well I'm sure there'll be an upper limit).
So yeah you'll probably need to use arrays for the time for the precision you need.
-
@d-healey I think I must have misunderstood the online docs (or they are out of date), as it appears to state the values must be between -128 and 128. But testing, it seems I can have 9 figure integers. Perhaps it means there are indexes between -128 and 128?
-
@tonewolf Not sure which doc but the indexes go from 0 to 127, so you get one value for each MIDI note - hence the name, MIDI list.
-
@d-healey this is the doc…
https://docs.hise.audio/scripting/scripting-api/midilist/index.html#setvalue
But in reality, I think it can store a 32bit integer
-
@tonewolf Ah yeah, that's confusing and wrong :)