Standardize SC synth engine commands #844
Comments
|
Agreed - standardizing synth engine commands would be good. Not only for voice / polyphonic engines but other use cases, ie. "triggerable engines" like
I guess
IMO lua-side engine metadata (supplying engine commands, polls, etc without having to load an engine) would help here. also for |
|
Definitely like the idea of scripts requiring an engine type rather than specific engines. Briefly looking at I'm not immediately seeing the advantage in handling voice allocation on the script side - with the aim being to decouple as much as possible doesn't it make sense for things like polyphony and voice stealing logic to stay in the engine where the author knows the performance limitations and character they're after?
|
The A more traditional sampler engine may need something else, agreed, unless it is based on mapping samples to midi ranges and the matron (lua) -> crone (sc) is based on noteOn's with midinotes rather than frequencies. Early on I considered taking a MIDI sound module approach to norns engine commands, meaning
Good point. I'm still not sure what's best. Both approaches may be applicable depending on use case - this could be two different engines types. What I find a bit peculiar is the inclusion of
You're right. My bad. The |
Yes exactly, it does seem a little redundant but it allows the script to trigger a note of any arbitrary We could consider the MIDI sound module approach, I think it would make typical use cases simpler but be less inviting of more experimental ones? |
absolutely |
|
not sure if it matches 100% with this topic, but @catfact pointed out if we're going to do some changes to the engines it would be good to unify them as best we could. This in response to some review comments about inconsistencies we currently have monome/dust#171 (review) |
|
Also, for parameters of (synth) engines would it be useful to look at what other projects (or maybe only projects that build on top of SuperCollider?) are doing? Or do we want to stay close to what SuperCollider offers? For example: Sonic Pi has quiet a list of things one can pass to a synth, I believe most of it is documented here https://sonic-pi.net/tutorial.html#section-2 |
|
i appreciate the desire for common paradigms to be standardized by convention (e.g. polysynth with ADSR amp envelope.) but i also really want to be really careful about adding proscriptive structure around what sound engines should look like, polyphonic or not |
|
woops didn't mean to close |
|
agreed that it'd be nice to have a class of engines that could be interchangeable, but this should not apply to all engines. thank you for the thoughts everyone! |
|
This issue came to my attention during my FM7 engine project. I could imagine some kind of facility that defines symbols for all known parameters for a polyphonic synthesizer, then a utility that does some kind of collection method to exclude those not implemented by an engine. For example, my FM7 synth doesn't have a filter (and probably won't in the future) so an \lpf, \bpf, etc symbol will never map to a param method. |
|
supercollider gives us the OOP tools to enforce this architecturally. so something like:
seems useful for the usual reasons:
issue remains, for me, where exactly to draw the line as far as abstraction. (e.g. no way one realtime "timbre" param is always gonna be enough.) i guess i don't have any strong opinions on this, except for a feeling that limitations will always become onerous at some point, so start by implementing the minimum (note on, note off, stop all notes) and keep things generic when possible (e.g. array of args, since even "note number" or "hz" is kinda insufficient) if this seems like a good approach then maybe a good exercise would be converting extant poly engines to use a really minimal version of something like this, identifying commonalities and exceptions as they arise |
hm, yeah, i was thinking in terms of required interface methods.
returns
returns so, not so much that lua can check, but we explcitly tell lua the whole command/poll interface of the engine at load time, so |
|
Is it possible to move this to the norns repo? |
|
Created a little demo that can look for these standard API methods here. It currently looks for |
|
I added an extra variation of noteOn to the top post that I've been using for sample playback engines (Timber). |
|
what's the best way forward with this? just publish a specification for the docs? i can certainly update my (pretty boring) engine, and we could encourage migration of those engines that would be valid. |
|
Getting an (optional) standard in the docs and applied to the current SC engines sounds like a great first step to me. Then we can discuss further about having a lua class per engine to allow easier checking of an engine's capabilities? |
I think it'd be great to standardize the SC engine interfaces as much as possible for engines which are synths/voices. This would be a simple first step towards making engines interchangeable between scripts.
Here's a proposal to get the conversation started, it's based on some comments @catfact posted on lines a while back and my own testing.
engine.noteOn(id, freq, vel)Start a note, the engine starts a synth as it sees fit.
idwould typically be a MIDI note number but could be any unique integer to refer to this note in future.engine.noteOn(id, freq, vel, sampleId)I've also been using this extended variation in Timber for sample playback that lets you specify a sample.
engine.noteOff(id)engine.noteOffAll()Stop a note by
idor stop all notes.engine.noteKill(id)engine.noteKillAll()Stop notes immediately, ignoring their usual envelopes, typically freeing the synth.
Useful in a sequencer script when notes have long release times for example.
engine.pitchBend(id, ratio)engine.pitchBendAll(ratio)Bend a note by ratio or bend them all.
engine.pressure(id, pressure)engine.pressureAll(pressure)These correlate to key pressure and channel pressure (after touch) in the MIDI spec.
engine.timbre(id, timbre)engine.timbreAll(timbre)Correlate to MPE spec.
I have an example implementation of this on a branch, SC and lua script here:
https://gist.github.com/markwheeler/b88b4f7b0f2870567b55cbc36abbd5ea
https://gist.github.com/markwheeler/fbf0d7e62ce15e1d7110bc7e58f4022f
Thoughts:
The text was updated successfully, but these errors were encountered: