VCVRack / AudibleInstruments

VCV Rack plugin based on Mutable Instruments Eurorack modules
https://vcvrack.com/AudibleInstruments.html
Other
387 stars 84 forks source link

Implementation of Stages #67

Closed Rcomian closed 5 years ago

Rcomian commented 5 years ago

Finishing off the implementation of Stages.

Supports all the grouping options, outputs per segment, sample rate change stability, loop modes.

Add loop sections in a group by using "AB Loop" in the context menu, this lets you add a second loop item, not mapping the hardware behaviour.

Does not support: chaining multiple modules into one larger virtual module.

Rcomian commented 5 years ago

Adding these pull requests as a placeholder to talk about anything more that's needed. History is a little ugly, happy to clean it up or just squash it.

AndrewBelt commented 5 years ago

I'm going to merge this, but one change I'd like to see is kSampleRate added as a class variable of SegmentGenerator instead of a global.

I'm also not sure why you have 6 SineOscillators (which is too simple to be its own class) instead of just a phase that's incremented once per Stages step.

I don't understand what "AB Loop" is. I can't find it in the manual. It also doesn't uncheck when I select it a second time. Can we remove it?

Corrected code style.

Everything else works great.

Rcomian commented 5 years ago

Sample Rate

sample_rate_ has been made a member variable of the segment_generator, with an explicit SetSampleRate function call to set it.

Sine Oscillators

Sine oscillators have been removed, since all lights need to be in sync, a single phase variable makes more sense.

AB Loop

AB Loop mode has been removed. This was to simulate holding 2 type buttons simultaneously.

In the hardware, holding a single type button only ever puts a single segment into loop mode. If another segment in the group was already looping, its looping status gets removed.

To have 2 segments in loop mode you need to hold both type buttons simultaneously, something we can't do with a mouse-based UI.

Having 2 segments in loop mode is an essential feature as it creates a loop section within the group, providing a whole new range of behaviours. This loop area is indicated by the 2 segments flashing in a ping-pong pattern.

The AB loop idea was to put the module into a mode where you could hold a second button and get 2 modules into loop mode in a group. Outside of AB Loop mode, pressing a second button would stop looping the previous segment, behaving as the hardware behaves. It was a bit confusing and not brilliantly implemented.

The mode has been removed, we can now just hold a second button and it will make a loop section in the group - the lights will ping-pong as they do in hardware. If you put a 3rd segment in the group into loop mode then the other two will stop looping, leaving a single looping segment.

Although it's not quite the same as the hardware, it's probably better than the AB Loop mode. It's actually the first way I implemented it before trying to emulate hardware behaviour more closely.

Rcomian commented 5 years ago

Reading this back, I think it would make a lot more sense to iterate over groups first and then the segments in each group.

What I'm doing now is iterating over all the segments and then trying to back-work which group I'm in. It's a lot of non-obvious state that could get removed.

AndrewBelt commented 5 years ago

Looks great, thanks!

Funk-Burasuta commented 5 years ago

Maybe I'm saying this out of place but, would right-clicking a button and a contextual menu saying "Start AB Loop Here" (and the end-point being the same but to end it) do the job? I'm no programming expert and I have no idea how many man-hours it would take, so I just leave it as a suggestion