MTS-ESP Support

Now that there’s a library to support pretty much any tuning system, it’d be great to support it.

A number of tools already do. The list expanded quickly.

I think of it as something close to Ableton Link, only for tuning. It syncs up everything you play with the same tuning.
SPi could respond to that or even serve as the reference.
In terms of interaction, it’d be as seamless as it is for existing tools which support it. If you have some MTS-ESP reference in your system, plugins supporting MTS-ESP will retune dynamically. In terms of SPi serving as reference, it could be a matter of loading .tun or .scl files. Or simply respond to use_tuning What would be most excellent, there, is the how easy it’d be to switch tunings programmatically. That could work really well for hermode tuning.

And that’d make the coding of anything other than 12TET way simpler, when it comes to external tools.
Yes, I realize we can switch tuning easily within SPi. What this would allow is communication with other things.

Just a thought. Maybe the effort to implement that wouldn’t be worth it.

It certainly looks interesting.

My main two concerns are that the MTS-ESP master doesn’t appear to be open source (perhaps I missed something?) and that I don’t really use exotic tunings, so wouldn’t likely be the best person to implement such functionality well.

The library is BSD Zero:

And, if I understand correctly, it does allow devs to create “Master” plugins.

As for someone likely to use and implement it, I sense that there’s enough interest in microtuning, around here. For instance, from a post @Hussein, @binarysweets based Challenge #6 on microtuning.

(Met @blipson, @philAwesomeTech, @hitsware, @emlyn, and @amiika.)

Also, some microtonal music @gregeporter here:

And @aoimatsu here:

No idea if any of these coders is able or willing to try something with MTS-ESP. Sounds somewhat likely.

(In the meantime, I’ll probably focus on existing implementations, including the VCV one. In the DAW world, I’ve been using Entonal Studio, which is proprietary and quite useful.)

I saw that the client was BSD Zero, but I couldn’t find the license of the “master”. Also, I wasn’t sure about whether the client could work without the master involved.

Your comparison with Link makes sense, but Link is fully open source and doesn’t need any other components to work correctly. It’s totally fine by itself in non-network mode. Of course, if you do connect it to other Link nodes, then you can start sharing BPM, but that’s not required.

I like the sound of something that can provide a huge range of scales for use. However, I’m not so keen on something that needs external software to work. This is especially important when you start considering Sonic Pi code as notation that can survive generations. It needs to be self-contained.

It feels like you could get a long way towards this by importing the various tuning files and making the accessible with use_tuning.

Although, I’ve definitely not looked into this in any great detail so could totally be missing something.

I don’t really understand MTS-ESP yet, but in the meantime you can also use “pitch bend tuning” with external software or hardware synths.

I recently got hardware synth with ability to custom the pitch bend range to ±1 semitones (Can do up to ±64 semitones which is fun for all kinds of things). Anyway, ±1 semitone range is all you need to do quite accurate alternate tunings (maybe not all tuning but good enough for me). I’v played around with this idea and came up with this bit of code to send pitch_bend from sonic pi to the external synths:

define :microtonal_midi do |note_value, port="*", channel="*", semitones=1|
  if note_value.kind_of?(Float) and note_value.modulo(1)!=0.0
    start_value = note_value > note_value.round ? note_value : note_value.round
    end_value = note_value > note_value.round ? note_value.round : note_value
    bend_diff = midi_to_hz(start_value) / midi_to_hz(end_value)
    bend_target = 1200 * Math.log2(bend_diff)
    midi_bend_value = 8192 + (8191 * (bend_target/(100*semitones))).to_i
    midi_pitch_bend delta_midi: midi_bend_value, port: port, channel: channel
  midi note_value, port: port, channel: channel

s = scale :g, :ferahfeza

s.notes.each do |n|
  microtonal_midi n, "microsoft_gs_wavetable_synth_0", 1 # ms gs for example only
  sleep 0.25 # In some cases should also set pitch_bend back to normal after the sleep  

Also added this to Ziffers as well as custom scales from earlier experiments:

# Ziffers "between the notes" syntax
zplay "{0 0.22 3 2.45 3}", port: "microsoft_gs_wavetable_synth_0", channel: 1 

# With the custom scale hack
zplay "[: q 0 4 2 5 :] q 6 4 2 1", scale: [2,1,1.25,3], port: "microsoft_gs_wavetable_synth_0", channel: 1
1 Like

It’s a protocol to communicate tuning information, including reference pitch and keyboard mapping.
“All my synths are using 31EDO, B♭ at 60Hz is the reference, keys are laid out in this way with these intervals within the tuning system”. And, then, when you switch to 7-limit Just Intonation with C at 260 Hz as reference pitch and all keys restricted to a diatonic scale, all your synths are still in sync (in tune with one another).

So, if we have SPi as “Master” (and it really does sound like code to add the protocol is BSD Zero), sending that use_tuning message would also work with a VST I use in my DAW as well as the complete patch I have in VCV Rack.