Flip flop module for Toggle-able modulation target
in progress
Jon Diercks
Most modulation targets that are on/off in behavior will turn on when the modulating source goes above 50% and off when source goes back below 50%. I’d like a way for such targets to behave as toggles instead, so that the target will go on when source is >50%, but won’t go off again until the source has gone back under 50% and then hits >50% again. This would allow for things like routing signals differently on odd vs. even note-on events.
This could be accomplished by just adding a new mod target to the Macro Button module, similar to the existing “Macro” target, but maybe name it “Macro Toggle”, then any other mod target that I want to be toggle-able could just be chained from a Macro Button.
Nikolozi
in progress
Ready for testing in build 438
Jon Diercks
Nikolozi - quick initial test successful! See attached.
I cranked up the Smooth parameter which gives it a nice crossfade … which of course will be even more useful when we get long slew :-)
Thanks much for adding this useful feature!
Nikolozi
Jon Diercks Nice, works with Poly signals also.
Jon Diercks
Nikolozi - interesting, hadn’t even thought about that because I’m usually playing mono leads from windsynth. The concept of flip-flop in poly is actually a little brain-bending if I think about it too hard, but I guess it makes sense, just like everything else in poly, the signal chain has to behave as if there is a separate path for each poly voice. Cool.
The use case that actually started me down this flip-flop road in the first place comes from one of the physical modeling example recipes I found where they’re using flip-flop to alternate sending successive notes through two identical resonators, so that legato phrases will behave more like the legato of an actual acoustic wind instrument, and less like a typical synth legato. If I get it working I’ll be sure to post an example.
Nikolozi
Jon Diercks Initially, I was thinking that each poly voice would have its own flip-flop state, i.e when a voice got reused, it would toggle the state assigned to that voice. But then I started thinking about your original requirement, and I realised that every new note-on simply flip-flops the last state, regardless of which voice it was.
Nikolozi
Interesting idea, I'll think about it.
Jon Diercks
Nikolozi - I guess this is actually a pretty well-defined thing in the modular world, usually referred to as a flip-flop, or a 1-bit sample & hold. I was trying to find a way to build it using the Multiply/Add module in labs, based on multiplying by -1, but haven’t cracked it yet.
Nikolozi
Jon Diercks. I don't think it's possible atm in any way. If I understand the problem correctly, you want a digital pulse signal to be converted to a step-up or step-down signal. It will be converted to a step-up if previously it was converted to a step-down and vice versa. That would require the modulator/converter to have memory of the previous state. So, I think it will require a new module. And maybe Flip-Flop is an appropriate module name for that :)
Jon Diercks
Nikolozi I like it!
Nikolozi
Jon Diercks thinking about it some more, maybe rather than being a modulation signal converter, it can just be triggered using MIDI notes. When it receives a MIDI note-on the it will flip up the modulation signal to 100%, when it receives another note-on, it will flip down to 0% and so on. I think that would address your needs, yeah?
Nikolozi
And actually, rather than a whole new module, MIDI Source is a perfect home for the feature. MIDI Source already offers things like "Random on Note-On" and "Note-On/Off Gate", and this will be something like "Flip-Flop on Note-On ".
Jon Diercks
Nikolozi, sure that would work. I can think of other use cases like triggering flip flop from an LFO or beat pulse, but those could be implemented by first modulating a Note Event module, which in turn triggers a flip flop via midi source.
Jon Diercks
A dedicated module would probably be more intuitive for the Eurorack crowd.
Jon Diercks
Plus it would be nice to have a clear visual indicator of the current flip flop state.
Nikolozi
Jon Diercks :
> Plus it would be nice to have a clear visual indicator of the current flip flop state.
You will have a clear indication of the flop flop state, the MIDI Source's graph shows the latest value.
Nikolozi
Jon Diercks:
> A dedicated module would probably be more intuitive for the Eurorack crowd.
Separate module where it converts MIDI notes to modulation, or do you mean have a dial so you can do mod-to-mod signal conversion?
Nikolozi
Jon Diercks:
> sure that would work. I can think of other use cases like triggering flip flop from an LFO or beat pulse, but those could be implemented by first modulating a Note Event module, which in turn triggers a flip flop via midi source.
Doing it in MIDI Source means the module becomes even more flexible, and also means I can do it sooner. A new module usually takes a bit more time to think about various details etc.
(Just realised that my answers didn't appear the ones I was answering, so I copy pasted your comments for clarity)
Update:
But to be fair, I can see pros/cons of both approaches, so maybe I'll let these ideas brew for a bit longer and not rush implementing it.Jon Diercks
Nikolozi, sounds fine, and you're right there are some advantages to doing it as an expansion of the existing midi source module.
Nikolozi
Jon Diercks and another thing, that occurred to me, should velocity be ignored? I guess it should be, doesn't have much meaning here. Like if velocity is 102, does that mean modulation should jump up to 80% (=102/127) and then maybe down to 20%?
Jon Diercks
Nikolozi hmm could be useful, but I'd want the option to ignore it.
Nikolozi
Jon Diercks yeah, I was just thinking out loud, don't think it's useful at all. So velocity probably should be ignored.
Jon Diercks
Nikolozi if for some reason I did want something like that I could probably wire up a separate midi source module instance for the velocity component and then combine that modulation with the flip flop via Multiply/Add. Yeah default for flip flop should be to toggle on every note-on, regardless of velocity.
Jon Diercks
One other possible wrinkle... I can imagine some scenarios where I would want a way to force the flip flop to a specific state, regardless of the current state. For example, if the flip flop was being used to control whether Strummer is going upward or downward, and the strumming pattern is partially random, might want to ensure that the first strum of each bar is always the same direction. In a hardware module I guess that would probably be done with a dedicated CV/gate input for resetting the cycle. Not sure what would make sense in the midi source module.
Jon Diercks
Nikolozi
Jon Diercks having a general way to reset state in a module would probably be great. At the moment, the LFO module, for example, has Trigger modes to reset. And it uses MIDI note-on events. I've thought about having another signal type like Gate, for things like this, but haven't been able to come up with anything useful yet, that just doesn't add more confusion with little benefit. Maybe there's a way to do it. Something to think about, I guess.
Re screen recording, can you explain how it works?
Jon Diercks
Nikolozi - for state reset, I would suggest that any modules that need it could just have a new "Reset" mod target added, which triggers when any >50% mod signal is sent to it.
My cobbled-together flip-flop works by using the Strummer module to track flip-flop state. On each new note-on from the keyboard, the Chord module sends a two-note chord to the strummer, which is set to 2 steps, one up and one down, thereby alternating between last-note-high and last-note-low on output. Then the Key Track MIDI Source module is set to modulate the Macro Button, which in turn modulates two Macro sliders +100%/-100%, just to demonstrate a possible use case that flips between two signal paths.
I'm not in a rush to actually use this, but it was bugging me that I couldn't figure out a way to do it. A dedicated flip-flop option in the MIDI Source module would be much better, of course.