DISTRHO / Nekobi

DISTRHO Nekobi
GNU General Public License v2.0
48 stars 12 forks source link

Microtonal tuning support #6

Open SeanArchibald opened 6 years ago

SeanArchibald commented 6 years ago

I understand many people think Nekobi is feature complete already. For me there is just one more thing that I'd love to do with Nekobi - play microtonal music on it.

amsynth has a nice implementation of the Scala tuning format (.scl/.kbm file pair) that could be reused here. Support for Scala tunings would mean that Nekobi could be used in the creation of any non-Western music such as maqam (Arabic, Turkish, Iranian music etc.), Indian raga and even non-traditional tunings such as microtonal equal temperaments and regular temperaments.

Scala tuning file spec: http://www.huygens-fokker.org/scala/scl_format.html Examples of Scala files: http://www.huygens-fokker.org/scala/downloads.html (bottom of page, 'Scale Archive', contains thousands of example files)

Not sure if Nekobi is still being developed but I hope somebody finds this request. :)

falkTX commented 6 years ago

a PR is welcome :)

wan-may commented 1 year ago

I'm going to do this!

Before I get cracking, I want to ask about this library: https://github.com/ODDSound/MTS-ESP. It seems to provide a way to delegate tuning management to a different plugin, meaning there's no need to change the UI or to make Nekobi stateful. This also seems to support a bunch of different tuning formats.

There's a couple drawbacks that I can see. If they're dealbreakers then I can still go ahead with this other library: https://github.com/surge-synthesizer/tuning-library

Can I have some input on the following caveats?

wan-may commented 1 year ago

Oh, and as another note, I'm just going to change the fundamental frequency according to the loaded tuning. I'll be making no attempts to change the harmonics or the vcf to match.

gordonjcp commented 1 year ago

I'm currently working on a fork of Nekobi - yes, a fork of a project that's a fork of my project, but I like the way that DPF works and I want to "fix" Nekobee with the benefit of roughly 17 years of hindsight. Anyway, I'm so sorry about the state of my code!

What you could do is expose "CV" pitch as a control port - feed the plugin a value from 1 to 5 representing volts - and use that instead of the MIDI note input. That way you can make a microtonal-to-"CV" plugin that you'd just connect to it? Maybe?

The filter tuning is not affected by the oscillator pitch, there's no note tracking as per the original design of the 303, which is what Nekobee was (incredibly loosely) based on.

wan-may commented 1 year ago

Hey, glad you're revisiting it! This code seems fine (only took me like an hour to fix the tuning knob?) so I can't wait to see how you improve on it!

I'm not a fan of your suggestion, because:

Having typed out that last bit, I realise that MTS-ESP would be bad UX for that same reason. I'll go with the surge thing. More specifically, that means: use the standard DPF file picker and State API for letting the user load kbm/scl, use the surge library to parse kbm/scl, then use that info to alter the pitch inside the synthesis code.

Good to hear that no pitch tracking is desired, that makes things much easier.