Author Topic: problems and suggestions with bassmidi sfz support  (Read 173 times)

raygrote

  • Posts: 27
Hi,
Wasn't sure if this was the right place to post these things, but I'm pretty sure it is, as I've tested the things I am mentioning both with the Bassmidi VST plug-in from Falcosoft, and XM Play's midi input plug-in revision 15A. I'll list the things I'm addressing in order from most to least important to me.
1. When making an SFZ that references .wav samples, things seem to work just fine. But with Flac samples, the transpose and tune opcodes don't seem to work. Haven't tried with other formats like wavpack, but this is a major setback for me.
2. Things like loop_mode=loop_sustain don't seem to work, but in soundfonts this behavior is possible so I think this was simply overlooked. While I don't have many things that use it, it is quite handy to have if you want to add release effects to something. What I think loop_mode=loop_sustain does, is play a sample, repeating between the loop start and loop end as it does with loop_continuous. But when a note off is received, it will play the rest of the sample past loop end. Can't remember if it finishes the loop first or not though I suspect it does. I need to test this more with the soundfont format so that I know what to expect with SFZ support. Regardless it doesn't seem to be working at all at present, it treats it as loop_continuous, which I think is default.
3. There seems to be no way to allow mod wheel (CC1) to control anything. In Bassmidi's sound font support, cC1 controls a pitch LFO, but I don't think even that is possible with the SFZ support. In other SFZ players you can link an LFO depth to a midi CC manually but since Basmidi doesn't support this behavior so far as I can tell, I'm not sure how I would do this.
4. If you importa an SFZ that is encoded in UTF8, some opcodes are not recognized (I discovered this by accident.) Not sure if this is documented anywhere, but the Falcosoft VST doesn't mention it and that was the first thing I tested SFZ support in. If this is widely known information, I'll consider it my mistake without hesitation, but it took me a few hours to figure out what was going on with an sFZ that in certain spots just would not do what it was supposed to do.

5. Not sure if all of the supported SFZ opcodes are mapped to soundfont parameters or if some of them are SFZ-specific. I do know the ranges of some of them can be taken to extremes outside the capabilities of a soundfont, which I find really cool. In any case, I've made a short list of all the SFZ opcodes I find myself using a lot with SForzanod and which are pretty standard when looking at SFZ opcode references.
While groups and regions work fine, globals don't seem to be supported, unless I am doing something wrong. I find myself using globals to share settings among several groups, such as an amp envelope or something.
delay=num, sets the region to wait a certain amount of time before it plays (not the same as ampeg_delay).
bend_up=num, bend_down=num, specifies pitch bend range in cents. You can do this with rpn messages, but if an sFZ has it, I think it would be convenient for that range to be used over the default, until an rpn is received.
trigger=(attack/release are the two I use, there are others but the two I specified are most important to me). Attack means a region will play on note on as normal, release means the region will play on a note-off.
If trigger=release is supported, rt_decay=num is useful to allow the release region to decay so that if you're using a decaying instrument, the release can play at a suitable volume depending on how long you hold the note. Num is measured in dB/sec. So, if you use rt_decay=10, and you hold a note for 2.5 seconds, the release sample will play -25dB quieter than it otherwise would.
fil_keytrack=num (same as pitch_keytrack but moves the filter cutoff instead). I'm pretty sure this is centered around C4 by default though fil_keycenter=num can change that.

That about wraps it up. If you're still with me, thanks for reading!

Ian @ un4seen

  • Administrator
  • Posts: 20595
Re: problems and suggestions with bassmidi sfz support
« Reply #1 on: 9 Jan '18 - 13:52 »
1. When making an SFZ that references .wav samples, things seem to work just fine. But with Flac samples, the transpose and tune opcodes don't seem to work. Haven't tried with other formats like wavpack, but this is a major setback for me.

Oops. Here's an update to fix that:

   www.un4seen.com/stuff/bassmidi.zip

2. Things like loop_mode=loop_sustain don't seem to work, but in soundfonts this behavior is possible so I think this was simply overlooked. While I don't have many things that use it, it is quite handy to have if you want to add release effects to something. What I think loop_mode=loop_sustain does, is play a sample, repeating between the loop start and loop end as it does with loop_continuous. But when a note off is received, it will play the rest of the sample past loop end. Can't remember if it finishes the loop first or not though I suspect it does. I need to test this more with the soundfont format so that I know what to expect with SFZ support. Regardless it doesn't seem to be working at all at present, it treats it as loop_continuous, which I think is default.

"loop_mode=loop_sustain" should be supported. I just did a quick test to check, and it seemed to be working. Can you provide an example SFZ+WAV to reproduce the problem with?

3. There seems to be no way to allow mod wheel (CC1) to control anything. In Bassmidi's sound font support, cC1 controls a pitch LFO, but I don't think even that is possible with the SFZ support. In other SFZ players you can link an LFO depth to a midi CC manually but since Basmidi doesn't support this behavior so far as I can tell, I'm not sure how I would do this.

CC1 can be manually set (via the MIDI_EVENT_MOD_FILTER/PITCH/VIBRATO/VOLUME events) to affect filter cutoff, pitch, vibrato depth, and volume.

4. If you importa an SFZ that is encoded in UTF8, some opcodes are not recognized (I discovered this by accident.) Not sure if this is documented anywhere, but the Falcosoft VST doesn't mention it and that was the first thing I tested SFZ support in. If this is widely known information, I'll consider it my mistake without hesitation, but it took me a few hours to figure out what was going on with an sFZ that in certain spots just would not do what it was supposed to do.

I think the only thing that UTF-8 would really affect is the sample filenames. UTF-8 filenames are supported by BASSMIDI on other platforms, but not on Windows currently. The update above should add support for UTF-8 filenames. Let me know if you still have UTF-8 issues with it.

5. Not sure if all of the supported SFZ opcodes are mapped to soundfont parameters or if some of them are SFZ-specific. I do know the ranges of some of them can be taken to extremes outside the capabilities of a soundfont, which I find really cool. In any case, I've made a short list of all the SFZ opcodes I find myself using a lot with SForzanod and which are pretty standard when looking at SFZ opcode references.
While groups and regions work fine, globals don't seem to be supported, unless I am doing something wrong. I find myself using globals to share settings among several groups, such as an amp envelope or something.
delay=num, sets the region to wait a certain amount of time before it plays (not the same as ampeg_delay).
bend_up=num, bend_down=num, specifies pitch bend range in cents. You can do this with rpn messages, but if an sFZ has it, I think it would be convenient for that range to be used over the default, until an rpn is received.
trigger=(attack/release are the two I use, there are others but the two I specified are most important to me). Attack means a region will play on note on as normal, release means the region will play on a note-off.
If trigger=release is supported, rt_decay=num is useful to allow the release region to decay so that if you're using a decaying instrument, the release can play at a suitable volume depending on how long you hold the note. Num is measured in dB/sec. So, if you use rt_decay=10, and you hold a note for 2.5 seconds, the release sample will play -25dB quieter than it otherwise would.
fil_keytrack=num (same as pitch_keytrack but moves the filter cutoff instead). I'm pretty sure this is centered around C4 by default though fil_keycenter=num can change that.

I will look into these. If you can provide any examples of the opcodes in use, that would be helpful for testing.

raygrote

  • Posts: 27
Re: problems and suggestions with bassmidi sfz support
« Reply #2 on: 10 Jan '18 - 12:13 »
Hi Ian, thanks for the reply and the update! I'll try it soon and get back to you.
I think I have an sfz that's in UTF8 where the looping didn't work properly because there was a strange character in the loop_mode opcodes that wasn't visible in Notepad, but in a hex editor I found it. I'll double check that and send it to you to look at. How should I upload things?

I'll have a look at what you said about the mod wheel stuff and see what I come up with. Also an example of some of the opcodes I mentioned can be found in the Salamander Grand Piano. That at least uses trigger=release and rt_decay. It's been a while since I looked at it so there may be more, but I know it has those two.

Ian @ un4seen

  • Administrator
  • Posts: 20595
Re: problems and suggestions with bassmidi sfz support
« Reply #3 on: 10 Jan '18 - 17:05 »
I think I have an sfz that's in UTF8 where the looping didn't work properly because there was a strange character in the loop_mode opcodes that wasn't visible in Notepad, but in a hex editor I found it. I'll double check that and send it to you to look at. How should I upload things?

Oh, that sounds like a bad/corrupt SFZ file then. It probably wouldn't work properly with any software. You can upload the files via FTP here:

   ftp.un4seen.com/incoming/