Adds support for the VIBrato command to SampleInstrument#1234
Adds support for the VIBrato command to SampleInstrument#1234n1LS wants to merge 30 commits intoxiphonics:masterfrom
Conversation
n1LS
commented
Feb 4, 2026
- adds a 16bit, 64 step sine LUT with fast linear interpolation
- implements the Vibrato SRPUpdater class
- adds the InstrumentCommandVibrato definitions and help text
- vibrato depth is max. 4 semitones (0x00-0x40 is roughly the range for a soft musical vibrato above that it goes more into fx territory)
| result[1] = (char *)("send rel notes:+a,+b,+c,+d"); | ||
| break; | ||
| case FourCC::InstrumentCommandVibrato: | ||
| result[0] = (char *)("VIBrato:aabb"); |
There was a problem hiding this comment.
its not enough for this to be added to the onscreen help, it needs to be properly documented in both editions of the user manual.
In Trigger gets called from doKrateUpdate @ 441 Hz and from doTickUpdate depending on the bpm, at 120 bpm roughly 50 times -> 160k cycles per second.
In total that's 220k cycles/second so roughly 0.18% CPU per voice. |
|
@n1LS ok that seems reasonable but what I'd want is actual profiling numbers vs theoretical instruction usage, have a look at the existing timing code and let me know if you need help using it to time this. |
|
@maks Sure. This is the typical output. Averaged over 2-3 screens worth of collected data: Trigger: 0.77597695 µs@ 441 Hz → 342 µs / 1s UpdateSRP: 1.63623267 µs@ 441 Hz → 722 µs / 1s SetData: 2.2375 µsonly gets called on note on, negligible |
maks
left a comment
There was a problem hiding this comment.
Apart from the code comments, we are still missing user manual documentation for the command.
| uint8_t depth = value & 0xFF; | ||
| // setup the vibrato | ||
| rp->vibrato_.SetData(rate, depth); | ||
| if (!rp->vibrato_.Enabled()) { |
There was a problem hiding this comment.
This is likely not going to work well with VIB cmds in tables combined with phrases.
There was a problem hiding this comment.
It doesn't seem to cause any issues when applying a bunch of Vibrato commands from both tables and phrases simultaneously. What issue are you referring to?
| rate_ = 1 + (rate << 4); | ||
|
|
||
| // reset output and phase | ||
| phase_ = 0; |
There was a problem hiding this comment.
having reset here is likely to cause issues with cmd usage in a table, so we really want phase reset to be separate and do the phase reset only when a vibrato cmd first starts
There was a problem hiding this comment.
@maks I moved the vibrato reset to Start() so that a vibrato always starts at 0 without any jump in frequency. A second reset might helpful when calling ARP 0000 so that a later arp command cannot start with a jump in the frequency. What are your thoughts on that?
…p the update rate stable