qiemem / eurorack

Firmware customization for Mutable Instruments' Eurorack Modules.
93 stars 16 forks source link

Feature request: reset for clocked LFOs #43

Closed eethann closed 2 months ago

eethann commented 2 years ago

Especially when dividing the clock for LFO sync, having a reset would be extremely useful. This would mean that sync gates were used only for determining tempo, but would be independent of the phase of the LFO.

One option for this would be to choose whether cv in is used for LFO speed or for reset gate.

I have hoped I might be able to try this as a pr, but opening as an issue as a way to get it out into the world more quickly.

eethann commented 2 years ago

One first question: is there a way to get the CV input value independent of the slider value? I see the cv_slider method appears to return the summed amount.

If they can't be separated, perhaps there is some form of quadrature option that could work here. E.g. the first LFO is gated, but a gated "Sync'd LFO" to the right of a gated LFO would inherit the timing and waveform from the Gated LFO, with the pot used to specify division/multiplication and the CV used for reset.

qiemem commented 2 years ago

Hey, sorry for the delayed reply. First, check out this related discussion on the MI forum: https://forum.mutable-instruments.net/t/stages-proposed-harmonic-lfos-mode/18948

I think doing a enhanced sequencer-style segment group type might be the way to go here, especially if this needs to cover clocked LFOs. This sounds pretty similar to your sync'd LFO idea as well. I'm currently having a private conversation with bgFMI about what that might look like. But open to other ideas.

One first question: is there a way to get the CV input value independent of the slider value? I see the cv_slider method appears to return the summed amount.

In the stock firmware, the CV and slider are read in together and are inseparable. I modified it so that they could be manipulated before being read in (for attenuation and quantization). I also added local_parameters_ struct that contains the separated values for "local" segments... that is segments that only appear on that the Stages module doing the processing. They also might only be available, essentially, for single segments, not segment groups, but I can't remember. Regardless, that should be good enough for your purposes.

That said, it would be unfortunate for reset-capabilities to be mutually exclusive with CV control over clocking, which is why, I think, I favor the segment group approach. Also, how would that functionality be enabled for a segment?

qiemem commented 2 years ago

Oh wait, I'm being silly. Obviously groups are defined by gates so the the extended-sequencer-esque approach doesn't work.

eethann commented 2 years ago

Thanks for linking to that thread. I don't think I'd always want to devote all the segments of Stages to this, so my personal first choice wouldn't be the Harmonic LFO approach (though I do think it's a wonderfully simple and intuitive option).

As for functionality, I think the idea is that the phase of a resetable clocked LFO is set to 0 whenever a trigger comes in the appropriate input (either CV or gate in, I suppose).

As for how a user might designate a segment as a resetable, I don't have a clear answer but I do have a few ideas that could work:

Anyway, just some thoughts. I suppose I'm curious if any of those seem like they might be workable (and useable). I do like the linking via button hold idea, but it would be a totally new UI paradigm.

qiemem commented 2 months ago

Added in ce452df42e0c523a333ef5ba8f81d2b2ad242e99