plugdata-team / plugdata

Pure Data as a plugin, with a new GUI
https://plugdata.org
GNU General Public License v3.0
1.38k stars 60 forks source link

Feature: MTS master/client (microtuning) #1354

Open unclewayback opened 7 months ago

unclewayback commented 7 months ago

It would be super cool (or even super cooler) if plugdata was able to act as an MTS master!

This would enable the very flexible way that puredata treats pitch/frequency to be extended to other MTS compatible clients/plugins.

There is already a MAX package that allows max-for-live devices to act as MTS-ESP clients, but the real boon would be the ability to act as master. Surge XT recently implemented something like this, with a clap plugin that can be loaded per-track in (for example) bitwig (I'm having some issues with this recognising other clients at the moment, but in principle it is exciting).

Maybe it would make most sense as an Else external, I don't know.

Further details are here: https://oddsound.com/devs.php

dromer commented 7 months ago

One problem is that the libMTS library is proprietary and needs additional installation steps.

Also, how would you use this tuning information in the first place?

unclewayback commented 7 months ago

Oh, I didn't realize there were proprietary elements, that's a shame considering it seems to be being widely adopted.

Yes I saw some issues, on page 3 of the oddsound thread on kvr, regarding a vst plugin of theirs automatically installing the library? There was some conversation about this being a problem or not. ( https://www.kvraudio.com/forum/viewtopic.php?t=563023&start=30 )

The clients just go by a tuning table, I thought, so I figured in use it might be similar to [mtof] - except it would be dynamically updatable across all instances (perhaps with an option to not listen/load other tables) ?

I guess was hoping for a kind of 'master tuning object', which could be dynamically retuned and would output those frequencies to all objects it was connected to - something that wouldn't be too hard inside pure data itself, but I thought it would be nice if a patch using such an object, on being loaded into a DAW through plugdata, could somehow act as an 'MTS master', thus retune other compatible plugins in said DAW...

I thought this could be interesting because it seems to be being talked about as a new standard, kind of thing, and the dynamic aspects give it certain advantages over .scl/.kbm alone. (Also I think it can integrate with the unfortunately under used MIDI tuning standard, to retune hardware dynamically via sysex messages?).

I guess it would be simple enough to hack something together using netsend/receive and having a master patch with a bunch of receivers, which I will probably do for the mean time, but if anyone can see advantages to integrating with the MTS stuff consider it a feature request... I might look at it myself one day but I only really know pd atm.

dromer commented 7 months ago

Oh I think the features that MTS brings are definitely interesting. It's just a shame that it's not a liberally licensed piece of infrastructure.

unclewayback commented 7 months ago

Certainly. From what I can see though, the Zero Clause BSD / 0BSD licence doesn't look in any way restrictive?

dromer commented 7 months ago

That is the bindings, but not the library. This is a proprietary binary blob -> https://github.com/ODDSound/MTS-ESP/tree/main/libMTS

(this blob also restricts it to only 3 specific operating systems and architectures)

unclewayback commented 7 months ago

Thanks, I'm reading about binary blobs.

timothyschoen commented 6 months ago

Unfortunately the licensing issues and OS/arch limitations make it a poor fit for plugdata :(

Enkerli commented 1 month ago

Just to be clear… Bacon Paul’s implementation is unencumbered MIT License. And Surge XT can act as a source for MTS-ESP. So, architectural issues might not affect plugins which use the same architectures as Surge.

Also, Andreya Ek Frisk from the Surge Synth Team clarified the situation in a blog comment.

Hello! I appreciate the conversation here.

I would like to chime in and correct what I perceive to be a misunderstanding: MTS-ESP is absolutely an open standard by every meaningful definition. Any dev, whether they make commercial or free software in open or closed source, can:

Design and build an MTS-ESP Master*. Instructions found here: https://github.com/ODDSound...

...if they were already making software which calculates frequencies based on received MIDI notes, make that software be a client of MTS-ESP. Instructions here: https://github.com/ODDSound...

*(As an aside "Master" being an unfortunate wording is a valid critique of MTS-ESP, but that's beside the point here).

There is a third part to the MTS-ESP spec. Which is a small dynamic library file which holds the tuning information in memory to pass between Masters and Clients.ODDsound distributes a closed-source version of this binary, which has led some open-source devs to be concerned that MTS-ESP may be incompatible with certain open source licences. This is obviously irrelevant in Ableton's case since they don't use such licences, but I wanted to address it as it's the only argument against MTS-ESP being an open standard that I've come across. And my perception of it is that it's unfounded because:

1, if users optionally loading a closed-source binary to access a totally optional feature constitutes a GPL violation, Ardour (a GPL3 DAW) should not be allowed to load Diva (a closed-source synth plugin). That is not how the GPL is usually interpreted, and no one seems to think that should change. 2, there is an open-source version of the library, found here: https://github.com/baconpau...

So, MTS-ESP is an open standard.

It is also free to use. Perhaps the reason you say it isn't is that when it was first release, the only implementation of a "Master" plugin that existed for a time was ODDsounds own. It is indeed payware, and has every right to be, it's great software and the folks who made it need to make rent. But today there are several other options. I will continue in another post though.

DemandDystopia commented 1 month ago

To add onto what Enkerli said I'd also quote baconpauls simple-mts-main

First it documents 2 methods of using the propietary binaries and then mentions:

Finally, if you want to use an open source implementation of this dll, you can build or contribute to this open source version: https://github.com/baconpaul/mts-dylib-reference. Note the open source version does not support IPC so will not work in 'sandboxed' environments like some Bitwig configurations. If you would like to contribute an IPC implementation, go ahead!

The way I read it this should completely replace the need for the propietary binaries and every step from Master - Middleware - Client can be implemented using 0BSD or MIT licensed code respectively.

The issue of Oddsounds library only supporting a limited amount of architectures seems solved by this as well, based on my understanding of seeing someone run mts-dylib on a Rasberry Pi in the surge discord (just search mts-dylib on there and you'll find it).

If the lack of IPC is an issue for plugdata, 6months ago there was a PR adding it, and baconpaul wanted to make some tweaks and add it that week, possibly forgot about it. So simply requesting an update on that might lead to it being solved in a timely manner.

So unless I'm not seeing something the 2 very valid reasons this request was closed don't apply using mts-dylib instead of Oddsounds libary - so I'd ask to consider the re-opening the issue.

dromer commented 1 month ago

The problem was not with the spec not being open (it certainly is), but having to distribute a proprietary binary (and mentioned limitations).

This MIT licensed replacement by Paul certainly sounds promising (had not seen it before, the "dylib" name is a bit misleading I suppose). I've poked him about the IPC implementation as that could certainly be a prerequisite for plugdata indeed (not exactly sure though).

There is of course still the big issue of how we would even use this library? I'd imagine some sort of mtof-mts external that converts notes into microtuned frequencies .. or something.

How do you see the practical use in Pd in this regard?

DemandDystopia commented 1 month ago

For allowing plugdata to be an mts-esp client oddsounds max package could be a solid inspiration, but basically just consists of an mtof, ftom & mtof~.

For use as a master, which is where things would be especially interesting, I'd assume this could be done with a mts-master external or so, that at minimum is an object to send the re-tunings as a master.

Ideally this should probably play nice with the microtonal externals else provides, like scala etc.

Oddsounds master plugins also can display how many clients are connected right now, so having support for this in that external would probably be nice to have too.