Bassmidi: Sysex tuning support

Started by Karl Eick,

Karl Eick

Hello all,
From what I can see, Bassmidi doesn't support changing the tuning via Sysex messages. I would love this feature because it would make playing microtonal Midis much easier, and I wouldn't need to use Timidity because it's old and does not work on ARM.
Thanks in advance!

Ian @ un4seen

BASSMIDI does include support for the standard "MIDI Tuning Scale/Octave Extensions" sysex, as described here:

    https://midi.org/midi-tuning-updated-specification

The equivalent Yamaha XG and Roland GS sysex are also supported.

Karl Eick

Oh, that's interesting! You see, I'm using Cool Soft Virtual Midi Synth, which uses the bass libraries, and it does not respond to sysex files correctly, like you can create with sevish.com/scaleworkshop. In Timidity, they operate with no problems. So, it's an issue with Virtual Midi Synth then?

Ian @ un4seen

That webpage is generating "Bulk Tuning Dump" sysex, which has tuning for every key. BASSMIDI doesn't currently support that but rather the "Scale/Octave Tuning" sysex, which has tuning adjustment for 12 keys applied to every octave. Will the latter work for your purposes or do you absolutely need the former?

Karl Eick

Ah, that explains it! The former would be better, because to my knowledge, for achieving things like 17 TET, that's the only way that would work.

Ian @ un4seen

OK. I'll check next week if support for the "Bulk Tuning Dump" sysex can be added, and hopefully come back with an update for you to try.

Ian @ un4seen

Do you have any MIDI files that use the "Bulk Tuning Dump" sysex? If so, please upload (or link) them for reference. They can be uploaded here:

    ftp://ftp.un4seen.com/incoming/

I'm mostly interested in seeing what tuning program numbers are used. The spec states that 128 is the maximum, but also that fewer may be supported. I don't suppose there's usually any need for more than 1? It might not be possible to support 128 in BASSMIDI due to its 32-bit event parameter size limit - a tuning program number, a key number and a frequency will need to be squeezed into that.

Karl Eick

I'm sorry, how do I upload something there? Any credentials needed? I don't seem to be able to do it through the browser, and I don't know how I can access the server properly using clients like WinSCP or something. Is a Dropbox link fine as well? That would be much easier for me. OTherwise, I would appreciate some help for uploading. I'm blind and use a screen reader. Thank you.

Ian @ un4seen

I don't think any browsers still support FTP links these days, but you can open it in File Explorer and then copy'n'paste the files into it. A publicly accessible Dropbox link will be fine too.

Karl Eick

Oh, didn't know it was that simple! Well, I tried to copy paste it, and it worked the first time, but when I updated the folder with f5, the file was gone, and copying it again threw an access denied error. But since it worked the first time, can you see it? If not, I'll post a dropbox link.

Ian @ un4seen

Your file was received, thanks. Uploaded files aren't publicly visible/accessible, so that's why you couldn't see the file after refreshing.

As I suspected, the file is only using/modifying the default tuning program 0, so perhaps BASSMIDI doesn't need to support any other tuning programs. That would simplify things. Do you have any more such files? If so, please upload them too, to check whether they're also only using tuning program 0.

Karl Eick

That's great! And actually, that's all I need! Unless you want to see other tunings, if it makes a significant difference. This one was 22 tone equal temperament, I could show you a different one, like 17 or 19. Essentially, what I did, is just creating a sysex file with scaleworkshop, and then adding that track to the midi file, which timidity can process correctly. I guess, it's using the same system all the time, just different values for the tuning. And you can select the preset index, but I never bothered to mess with that.

Karl Eick

Ok, better safe than sorry, I uploaded two more files you can look at.

Ian @ un4seen

Thanks. Here now is a BASSMIDI update for you to try:

    www.un4seen.com/stuff/bassmidi.zip

It adds support for the "BULK TUNING DUMP" (08 01) and "SINGLE NOTE TUNING CHANGE" (08 02) sysex with tuning program 0 (other programs are ignored), which will apply to all channels except drum channels (they have their own key tuning options). Changes should take immediate effect, ie. on notes that are already playing. The tuning is reset to default by a system reset sysex.

Your test files still sound a bit strange to me, but perhaps that's how they're meant to be? Let me know whether they sound OK to you.

Karl Eick

#15
Thanks so much for such a quick update! The tuning is now applied correctly. However,  the current Bulk Tuning Dump implementation always retunes the original sample assigned to the MIDI note number itself.
This causes unnecessarily large pitch shifts in many tunings such as 17-TET.
It would sound much more natural if BASSMIDI selected the sample whose original pitch is already closest to the target frequency, and only applied the remaining fine detuning afterwards.
In other words, the tuning should influence sample selection as well, not only the final playback pitch.

Ian @ un4seen

Yeah, that is likely to sound better, but complicates applying changes to any already playing notes. I'll look into it and hopefully come back with another update for you to try next week.

Karl Eick

Thank you so much! I really appreciate your efforts to make this work. Looking forward to the new version!

Ian @ un4seen

Here's another update for you to try:

    www.un4seen.com/stuff/bassmidi.zip

Let me know how it goes. One thing I'm unsure about is how this key tuning should interact with the master tuning and channel tuning and octave tuning, so please let me know if you see any issues with that stuff. Currently, the coarse tuning values are added to the note, and the key tuning is applied to the result of that, and then the finetune values are added.

Karl Eick

#19
Yes, this result is already much better. However, it's still not quite the same as I used to hear from timidity. Maybe the Key mapping needs to be made to find the closest key, and only do the fine tuning after that. I mean, this is kind of what happens here, but with some, I still don't hear the same result as in Timidity in terms of sample selection.