Author Topic: List of SF2 MODULATORS implemented in Virtualmidisynth/BASSMIDI  (Read 355 times)

syryo

  • Posts: 9
I noted that some soundfonts have defined modulators in them. As I use Virtualmidisynth with soundfonts I would like to know which modulators are recognized by BASS/BASSMIDI.
Please refer to:
http://www.synthfont.com/modulators.html
and
http://www.un4seen.com/doc/#bassmidi/BASS_MIDI_FontInit.html
Thank you.

Ian @ un4seen

  • Administrator
  • Posts: 23980
The modulators supported by the current BASSMIDI release (2.4.13) are those listed in the BASS_MIDI_FontInit documentation linked above. In addition to those, the latest builds include support for note velocity to start offset (startAddrsOffset) and note velocity to modulation envelope filter cutoff (modEnvToFilterFc), and the note velocity to initialAttenuation support is expanded to all curve types (not only negative unipolar concave). CC21-24 to initialFilterFc/initialAttenuation/attackVolEnv/decayVolEnv/releaseVolEnv/releaseModEnv/modEnvToFilterFc modulators are also now supported, but each CC can only have one destination per-preset, eg. you couldn't have CC21 to initialFilterFc and CC21 to initialAttenuation on the same preset.

You can get the latest BASSMIDI build from here:

   www.un4seen.com/stuff/bassmidi.zip

syryo

  • Posts: 9
Just a couple of clarifications:
  when you say CC#21 to CC#24, are they decimal or hex numbers?
  what about implementation of other modulators in the future?

Thank you for all.

Ian @ un4seen

  • Administrator
  • Posts: 23980
They're decimal. CC21-24 are undefined in the MIDI standard, so they're free for custom purposes. There are several other undefined CC but CC21-24 were chosen because they're included as modulator sources in the Vienna soundfont software.

There aren't any plans for other modulators currently but that could change if the demand arises. The existing modulators were pretty much all added following user requests.

syryo

  • Posts: 9
Hi Ian,
what about implementing:
CC#93 Chorus level  to Chorus send %
CC#91 Effect level  to Reverb send %

Thank you anyway :)

Ian @ un4seen

  • Administrator
  • Posts: 23980
Do you mean the default CC91/93 to reverb/chorus modulators in the SF2 spec? If so, they are used in BASSMIDI but the amounts are 75% rather than 20% (the latter seemed too low). The other default modulators in the SF2 spec are all used too, except the slightly strange note velocity to filter cutoff modulator.

Zenxia

  • Posts: 138
He refers to the cc#91 and cc#93 to reverb and chorus, im asking also this and cc#7 to initial attenuation, the ausence of this lastest doesn't allow to me measure 100% chippy bank.sf2

All this is included on the soundfont specifications. Is recommended to add this.

(offtopic)
and noteoff (4ms slope after this is too very short try a more higher value). This seems ok when only kill last noteon as noteoff event is enabled. idk why you doesn't try a beta with this for test. delay noteoff event that is implemented on omnimidi have problem due noteoff, always get random skipping and with this option disable, the delay noteoff doesn't work. noteoff also cuts instrument release.
« Last Edit: 2 Nov '21 - 08:24 by Zenxia »

Zenxia

  • Posts: 138
CC21-24 to initialFilterFc/initialAttenuation/attackVolEnv/decayVolEnv/releaseVolEnv/releaseModEnv/modEnvToFilterFc modulators are also now supported, but each CC can only have one destination per-preset, eg. you couldn't have CC21 to initialFilterFc and CC21 to initialAttenuation on the same preset.

CC7 need be to initialattenuation CC91 to reverb and cc93 to chorus. Doesn't is correct use cc21 (not specified in soundblaster)

Ian @ un4seen

  • Administrator
  • Posts: 23980
The SF2 spec allows modulators to be assigned to almost any CC (see section 8.2.1). BASSMIDI doesn't apply any modulators to CC21-24 by default - modulators are only applied to them if specified by the soundfont.

BASSMIDI does support the SF2 spec's default CC7 to initialAttenuation modulator. It just doesn't support custom CC7 modulators. The same applies to the CC91/93 modulators (except that BASSMIDI sets the amount to 750 instead of 200 because 200 seemed too low).

Zenxia

  • Posts: 138
The SF2 spec allows modulators to be assigned to almost any CC (see section 8.2.1). BASSMIDI doesn't apply any modulators to CC21-24 by default - modulators are only applied to them if specified by the soundfont.

BASSMIDI does support the SF2 spec's default CC7 to initialAttenuation modulator. It just doesn't support custom CC7 modulators. The same applies to the CC91/93 modulators (except that BASSMIDI sets the amount to 750 instead of 200 because 200 seemed too low).

Doesn't support CC custom mode

I can't assign to cc21 due all midi uses standard cc#7 to initial attenuation. That not will play all midi same as original synth. Even soundblaster creative card 1999-2002 support this and bassmidi 2021 doesn't support, is funny. Please try to fix help me plisss!. i mean that if support cc21 also support cc7.

In serious, what solution you says that is better way for measure cc#7 to attenuation, I measured this on my soundblaster and bassmidi send all work to trash.

In this case is own and follow soundblaster specifications partially.

I mean that this is only the modulators that you requires to match 100% bassmidi to soundblaster/dls GS in the modulators side.

This is other important performance request.
Try to kill notes at least after 20 ms, can be delayed or add 10ms linear slope release after noteoff.
« Last Edit: 5 Nov '21 - 07:50 by Zenxia »

Ian @ un4seen

  • Administrator
  • Posts: 23980
I can't assign to cc21 due all midi uses standard cc#7 to initial attenuation.

There can be more than 1 modulator with the initialAttenuation destination, ie. a CC21 to initialAttenuation modulator won't affect the standard CC7 modulator.

The CC21-24 modulators were added for another BASSMIDI user that needed more control in their apps where they are also creating the soundfont, so they can use CC21-24 in both the app's code and soundfont. Other users might find them useful for their apps too, but I guess they're unlikely to be very useful in general public soundfonts.

In serious, what solution you says that is better way for measure cc#7 to attenuation, I measured this on my soundblaster and bassmidi send all work to trash.

Is that with the standard/default CC7 modulator? If so, please provide a MIDI file and soundfont to reproduce the problem with. Make sure the MIDI file only contains the events required to produce the problem (no other events to confuse matters).

Try to kill notes at least after 20 ms, can be delayed or add 10ms linear slope release after noteoff.

Sorry but there are no plans for delaying events in BASSMIDI. That sort of thing can be done by the app, ie. send the event to BASSMIDI later.

Zenxia

  • Posts: 138

The CC21-24 modulators were added for another BASSMIDI user that needed more control in their apps where they are also creating the soundfont, so they can use CC21-24 in both the app's code and soundfont. Other users might find them useful for their apps too, but I guess they're unlikely to be very useful in general public soundfonts.


Yep, doesn't userful, my guide is sb modulators due bassmidi follow this.


Quote
Is that with the standard/default CC7 modulator? If so, please provide a MIDI file and soundfont to reproduce the problem with. Make sure the MIDI file only contains the events required to produce the problem (no other events to confuse matters).

not, im get only volume difference due missing CC#7 to attenuation modulator, see the differences between two.

Quote
Sorry but there are no plans for delaying events in BASSMIDI. That sort of thing can be done by the app, ie. send the event to BASSMIDI later.

I'm not asking app side due anyway fails. I'm asking this because any minimal lactency difference send noteoff delayed ignoring overlapping.
Please fix this. This is important. Fix overlapping. I tried only kill last note on as add 35% improvement but cause problem in some game midis/ringtones.

Ian @ un4seen

  • Administrator
  • Posts: 23980
If you believe you have found a bug in BASSMIDI then please provide test file(s) to reproduce it with. I can't investigate things with only recordings of unknown files from unknown software. If you don't want to share the files publicly, you can email/PM them to me.

Zenxia

  • Posts: 138
If you believe you have found a bug in BASSMIDI then please provide test file(s) to reproduce it with. I can't investigate things with only recordings of unknown files from unknown software. If you don't want to share the files publicly, you can email/PM them to me.


The only bug is overlapping, for compesate any lactency on the noteoff events, is better noteoff at least 10ms after received noteoff message instead immediately noteoff. And if you want optimize bassmidi for blackmidi ignore this feature.

Also i tried use dynamic range compressor and seems better. For mixing on any external (like audacity) is better this.

The software that i tested this feature is Omnimidi, but newers version have bad problems.

As sequencer Midiplayer x64 lastest version libraries.

Is hard to build a custom library for test? Try to add at least for 10 seg and fix noteoff overlapping issues.

But if the notes were intended to be released later then surely the MIDI file's author would have delayed the note off events? I don't think it is a good idea to override what the MIDI data says to do, and certainly not by default.

If you want, it is possible to change the time of the note off events. You would use BASS_MIDI_StreamGetEvents to get all of the events, then increase the "tick" values of the MIDI_EVENT_NOTE events that have velocity=0, and then pass the modified event array to BASS_MIDI_StreamCreateEvents. For example, something like this:

Code: [Select]
float ppqn;
BASS_ChannelGetAttribute(midi1, BASS_ATTRIB_MIDI_PPQN, &ppqn); // get PPQN value
int eventc = BASS_MIDI_StreamGetEvents(midi1, -1, 0, NULL); // get number of events
BASS_MIDI_EVENT *events = new BASS_MIDI_EVENT[eventc + 1]; // allocate event array
BASS_MIDI_StreamGetEvents(midi1, -1, 0, events); // get the events
// look for and delay note off events
for (int a = 0; a < eventc; a++) {
   if (events[a].event == MIDI_EVENT_NOTE && !HIBYTE(events[a].param)) // found a note off
      events[a].tick += 4; // delay by 4 ticks
}
// add end event
events[eventc].event = MIDI_EVENT_END;
events[eventc].tick = BASS_ChannelGetLength(midi1, BASS_POS_MIDI_TICK);
midi2 = BASS_MIDI_StreamCreateEvents(events, (int)ppqn, 0, 0); // create a new stream from the events
delete[] events; // free the event array
BASS_ChannelPlay(midi2, 0); // start playing

One thing to note is that the event array must be in chronological order when passed to BASS_MIDI_StreamGetEvents, so you may need to reorder (sort by tick) the events after delaying the note offs.