surge-synthesizer / shortcircuit-xt

Will be a sampler when its done!
GNU General Public License v3.0
246 stars 27 forks source link

The modulator "misc" (phasor and random) panel #1278

Open baconpaul opened 1 week ago

baconpaul commented 1 week ago

Screenshot 2024-09-07 at 8 14 53 AM

Here's the panel

Here's how I would do it

Step one: include the data

Step two: make the screen

Step three: make it work in the engine. This will be a non-compatible break with prior patches and that's OK.

so go stare at that. I think the mistake I made is that everyone gets the same transport phasor set. So I propose something roughly akin to

  1. Replace that code with a sort of 'single clock phasor' which has int beatPhasor, float subBeatPhasor
  2. Add something like `engine::configPhasorValue(beatPhasor, subBeatPhasor, PhasorConfig) which does the equivalent of updateTransportPhasor. (This has the side effect of doing that modf per zone so we may want to, once this is done, open an issue to cache phasors by config for performance reasons)
  3. Add a PhasorProcessor (different than the storage) which calls that and presents the value. Make one a member on voice and bind that value to the voice mod matrix. Similarly make that a member on group and bind it to the group matrix, removing the old phasor bindings. You'll probably need more notes here but luckily I refactored all the phasors to be shared in modulation_shared/TransportPhasorBase
  4. code, test, ask on discord at this point basically.
Andreya-Autumn commented 1 week ago

Tackling this now. Just to be sure @baconpaul, the "make it stream" example I'm meant to follow is the SC_STREAMDEF macro in modulation_traits, no?

Andreya-Autumn commented 1 week ago

...and if so. How exactly should I deal with the enums? I see there's a STREAM_ENUM macro but it's not clear to me how that interacts with the stream def one.

baconpaul commented 1 week ago

Yes And for stream enum it’s thee parts By the enum in the header define a to string pair - there’s a macro for that just look at play mode or lfo curve shape or what not In the cpp implement it Then define it streamable in the json

this seems a lot but it stops us being sensitive to streaming breaks from enum reordering

Andreya-Autumn commented 1 week ago

Ah right ok! It's coming back slowly sorry. Haven't been outside of processors much... 😅 Will take another dig at it tomorrow.