Author Topic: BASSMIDI - Round Robin emulation  (Read 140 times)

DjTony

  • Posts: 67
BASSMIDI - Round Robin emulation
« on: 12 Nov '24 - 10:34 »
https://spitfireaudio.zendesk.com/hc/en-us/articles/360025864833-What-is-a-Round-Robin#:~:text=Round%2DRobins%20(RRs)%20allow,note%20has%20a%20different%20performance.

Hi Ian, glad to see the BASS project is going swimmingly. We ask you to evaluate the implementation of a "Round Robin" emulation on the reproduction of the various SF2 samples dedicated to percussion and drums, taking a look at the link I have inserted here. Since the SF2 format does not provide multiple samples for the same dynamics, perhaps you could act randomly on the "fine cents" pitch of the samples, perhaps adding slight cutoffs/resonances to the samples obviously net of the same NRPN settings. Let me know. A thousand thanks.  :D

Ian @ un4seen

  • Administrator
  • Posts: 26171
Re: BASSMIDI - Round Robin emulation
« Reply #1 on: 12 Nov '24 - 14:43 »
Is this for a custom soundfont? If so, could you make it SFZ instead of SF2? SFZ supports round-robin via the "seq_length" and "seq_position" opcodes. There are also "lorand" and "hirand" opcodes to play a random sample each time (with a configurable chance of each sample). Details here:

   https://sfzformat.com/opcodes/seq_position/
   https://sfzformat.com/opcodes/lorand/

DjTony

  • Posts: 67
Re: BASSMIDI - Round Robin emulation
« Reply #2 on: 12 Nov '24 - 16:43 »
I read the specifications of the SFZ format, but I was referring to generic sf2, do you think it is possible to emulate it by acting on the "fine cents" and cutoff/resonance parameters?

Ian @ un4seen

  • Administrator
  • Posts: 26171
Re: BASSMIDI - Round Robin emulation
« Reply #3 on: 13 Nov '24 - 14:22 »
If you would like to just randomise the tuning or filtering of drums, that should be possible via the MIDI_EVENT_DRUM_FINETUNE/CUTOFF/RESONANCE events. You could have a MIDIFILTERPROC callback function (set via BASS_MIDI_StreamSetFilter) randomise those things just before playing a drum note. For example, something like this:

Code: [Select]
BOOL CALLBACK MidiFilterProc(HSTREAM handle, int track, BASS_MIDI_EVENT *event, BOOL seeking, void *user)
{
if (event->event == MIDI_EVENT_NOTE && HIBYTE(event->param) > 0 // got a note-on event
&& BASS_MIDI_StreamGetEvent(handle, event->chan, MIDI_EVENT_DRUMS)) { // in a drum channel
int key = LOBYTE(event->param);
int tune = rand() & 127;
BASS_MIDI_StreamEvent(handle, event->chan, MIDI_EVENT_DRUM_FINETUNE, MAKEWORD(key, tune)); // set random finetuning for the note
}
return TRUE; // process the event
}

Please see the BASS_MIDI_StreamSetFilter and MIDIFILTERPROC documentation for details.