Offset vs. Delay in HISE
-
Just to verify:
Synth.playNoteWithStartOffset()
takes in sample offset that is set in the sample editor and is not affected at all by the processing sample rate? It can take a value up to whatever I set under SampleStartMod, correct?While
Message.delayEvent()
works on processing sample rate level, and any input I make needs to take into account the current sampling rate viaEngine.getSampleRate()
? -
@aaronventure yes. each method works on the domain that makes sense - usually you know the samplerate of your samples and can pinpoint it exactly to the time value and the delayEvent function is agnostic to the sampler and works with any kind of sound generator.
-
@Christoph-Hart How do we use Synth.playNoteWithStartOffset()?
It is not making much sense to me. I have this in the MIDI Script Processor:
const var OffsetKnob = Content.getComponent("OffsetKnob"); function onNoteOn() { local channel = Message.getChannel(); local velocity = Message.getVelocity(); local number = Message.getNoteNumber(); local offset = OffsetKnob.getValue(); Synth.playNoteWithStartOffset(channel, number, velocity, offset); Console.print("Ch: "+ channel + " Vel: " + velocity + " Num: " + number + " Off: " + offset); }
I would expect this to offset all notes in this sampler by the amount set by the knob, but it is not affecting anything. What's procedure for using this, please?
-
@gorangrooves You need to have set some start offset value for them in the sampler.
-
@d-healey Thanks, Dave. I'll play around with it a bit more. It is kind of weird: setting an offset value to set an offset value?!
-
@gorangrooves thats because it needs to increase the preload buffer to be able to skip to the position so it needs to know the max offset you want to use in advance.
-
@Christoph-Hart Thanks, Christoph. Your explanation makes perfect sense, but the naming for that parameter not so much. I don't think it is intuitive. What do you think about renaming it to something like "OffsetBuffer"?
-
@gorangrooves StartOffset is kind of standard since Kontakt uses the same name.
-
@d-healey I am referring to the "SampleStartMod".
"StartOffset" is self-explanatory.
"SampleStartMod" is not. -
@gorangrooves Yeah it's the same in Kontakt. In fact I think it's shortened to S. Mod in Kontakt. It's short for Sample Start Modulation Range. But of course for someone who isn't familiar with that it does seem like a strange choice.
-
@d-healey "range" is the keyword here. "Buffer" or "range" would make it more self-explanatory and less confusing.
-
@gorangrooves The problem is that this name is hardcoded as ID into samplemaps so unless I'll make an ugly branch like this to the codebase
if(user == "goran" && id == "SampleStartMod") { id = "StartOffset"; }
I don't see a way of changing this without breaking every single HISE project :)
-
@Christoph-Hart
Nevermind.