zezic / ZZC

VCV Rack plugin pack
https://zzc.github.io/free
Other
33 stars 4 forks source link

(Maybe) Issue with phase in Div #66

Closed RemiCollin closed 4 years ago

RemiCollin commented 4 years ago

First of all, I'm discovering the phase sync mechanism, and I think it's a very clever idea !

I'm trying to use it with div, but I'm confused at how it works, shouldn't it sync automatically to the phase period ? Here's what I have on scope :

Screen Shot 2019-11-22 at 09 20 34

Shouldn't the Div automatically line up to the clock by phase position ?

zezic commented 4 years ago

The Div does not have an auto-sync function yet. It only resets when explicitly triggered by RESET input:

Screenshot at 2019-11-22 14-02-44

But even after synchronization it will go off-phase if someone change its ratio by CV or knob without syncing that change to the master clock or Div output.

However, the Divᵉ (expander version) can sync its ratio switches to the flips of incoming or its own phase (it depends on current ratio).

Nothing stops me from adding the same sync functionality to the Div module by including it as a menu option. Should I add it to the 1.1.1 version as well?

RemiCollin commented 4 years ago

Ok so this is the intended behaviour, the phase output is only used to carry tempo information.. I wasn't sure. I thought at first it was carrying both tempo/position suppressing the need of using reset, which seemed more intuitive to me (and probably what the Sync button does on div expander ?), and also opening beautiful possibilities, like generating off beat clocks by just shifting the phase 180° :)

zezic commented 4 years ago

Phase output is used to carry both tempo and position information, but position is not absolute. What's about Divider and Div modules - they are applying their ratio immediately so it's natural for them not to sync. They both trying to output continuous phase without abrupt hops.

It's possible to add an auto-sync feature to Divider as well as to Div, but it would be better to keep it for the next release (1.1.2).

By the way, what's about shifting the phase - the FN-3 module can be used for this by adjusting its SHIFT knob or CV when its in TRI mode and PWM knob is at its maximum.

RemiCollin commented 4 years ago

What do you mean by "position is not absolute" ? Shouldn't we consider the phase value as "which position are we at in the beat" ?

Sorry for so much questions, but I'd like to implement phase inputs in my sequencers, and would like to make sure I really understand how it works :)

Le ven. 22 nov. 2019 à 13:05, Sergey Ukolov notifications@github.com a écrit :

Phase output is used to carry both tempo and position information, but position is not absolute. What's about Divider and Div modules - they are applying their ratio immediately so it's natural for them not to sync. They both trying to output continuous phase without abrupt hops.

It's possible to add an auto-sync feature to Divider as well as to Div, but it would be better to keep it for the next release (1.1.2).

By the way, what's about shifting the phase - the FN-3 module can be used for this by adjusting its SHIFT knob or CV when its in TRI mode and PWM knob is at its maximum.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/zezic/ZZC/issues/66?email_source=notifications&email_token=ACJFG4GAMCAFTQ6DYBCJ4PDQU7DKBA5CNFSM4JQNLYWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE5OHNA#issuecomment-557507508, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJFG4CBUKFRDP272GX46J3QU7DKBANCNFSM4JQNLYWA .

zezic commented 4 years ago

Yes, you can consider the phase value as an indicator of the inter-beat position, but what I wanted to say is that's not a mandatory.

The Divider module works by measuring a difference between current phase input and its previous value. For example, let's imagine a simplified 2:1 Divider. Let's say, it receives a 0.7 value from the clock when previous value was a 0.5. So, the difference between them is 0.2. Then, because of the ratio of 2:1 we should divide it by that ratio: 0.2 / (2:1) = 0.1. After that divider is ready to increase its phase by 0.1 and become ready for the next cycle. That's about the Divider.

What's about the sequencer - it's up to you how to take the phase since there is still no standard in VCV for such thing and it's almost not compatible with the real hardware (where pulse-based clock is pretty stable). You can take it as an absolute information about the inter-beat position or you can take it as an absolute point on a whole pattern. You can implement both modes and add something else.

Actually I've implemented Divider module before getting familiar with the phasor and complex amplitude terms and its implementation may be different from the classical phase scalers which probably can be found in such environments like Cycling '74 Max, Pure Data or Bitwig's Grid. By the way, you can get Bitwig for free and discover all the phase-related modules available in its Grid environment, maybe you will get some ideas!

Please, feel free to write your thoughts. And, again, what's about the auto-sync mode for the Divider and Div - I will add them at the next (1.1.2) release of ZZC.

RemiCollin commented 4 years ago

Thanks a lot for the detailed explanation & suggestions ! I'll definitely look into Bitwig grid system, been on my todo list for a while...

About the auto sync, I still have the feeling, regarding user experience, that I'd expect phase output to sync by default, but at the same time it would be a breaking change and for consistency it's probably best to implement it later the same way you did for the expander.

Le ven. 22 nov. 2019 à 14:36, Sergey Ukolov notifications@github.com a écrit :

Yes, you can consider the phase value as an indicator of the inter-beat position, but what I wanted to say is that's not a mandatory.

The Divider module works by measuring a difference between current phase input and its previous value. For example, let's imagine a simplified 2:1 Divider. Let's say, it receives a 0.7 value from the clock when previous value was a 0.5. So, the difference between them is 0.2. Then, because of the ratio of 2:1 we should divide it by that ratio: 0.2 / (2:1) = 0.1. After that divider is ready to increase its phase by 0.1 and become ready for the next cycle. That's about the Divider.

What's about the sequencer - it's up to you how to take the phase since there is still no standard in VCV for such thing and it's not compatible with the real hardware as well as pulse-based clock. You can take it as an absolute information about the inter-beat position or you can take it as an absolute point on a whole pattern. You can implement both modes and add something else.

Actually I've implemented Divider module before getting familiar with the phasor and complex amplitude terms and its implementation may be different from the classical phase scalers which probably can be found in such environments like Cycling '74 Max, Pure Data or Bitwig's Grid. By the way, you can get Bitwig for free and discover all the phase-related modules available in its Grid environment, maybe you will get some ideas!

Please, feel free to write your thoughts. And, again, what's about the auto-sync mode for the Divider and Div - I will add them at the next (1.1.2) release of ZZC.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/zezic/ZZC/issues/66?email_source=notifications&email_token=ACJFG4DKSWOIDQA6HVP2TZLQU7N6PA5CNFSM4JQNLYWKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE5UZMY#issuecomment-557534387, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJFG4BQ4XDTMK6C6YRGPLLQU7N6PANCNFSM4JQNLYWA .

zezic commented 4 years ago

It can be added in the next way to not break any existing patches:

  1. If user loads a patch with Dividers in Divs and they have the old sets of settings (where auto-sync is not mentioned) they will work as they worked before (without auto-sync).
  2. If user adds a fresh new instance of Divider or Div it spawns with auto-sync enabled by default.

Also, an option to set the default behavior can be added, so, all is good, there is no problem.