Timing issues?

For discussion of the Voltage Modular synthesis ecosystem.
Post Reply
jasonmads
Posts: 5
Joined: Tue Sep 08, 2020 11:36 pm

Timing issues?

Post by jasonmads »

This is my attempt at a Bernoulli Gate, using only CA modules.
when button 1 is pressed the gate out of the Threshold switches, both drums trigger.
I set up a debug S&H when both were triggered but I couldn't get it to capture.
Adding a gate to trigger (button 2) seems to fix things, shouldn't button 1 work also?

Thanks for any insight,
Jason
vm1.jpg
vm1.jpg (970.71 KiB) Viewed 4372 times
Attachments
Bernulli Gate.voltagepreset
(18.27 KiB) Downloaded 687 times
Steve W
Posts: 826
Joined: Thu Jul 16, 2020 5:55 pm

Re: Timing issues?

Post by Steve W »

Hey, I have all those modules! I'll take a look. Is this what you are trying to do?
A Bernoulli gate takes a logic signal (trigger or gate) as an input, and routes it to either of its two outputs according to a random coin toss.
I also have CA's Random Task Module https://docs.cherryaudio.com/cherry-audio/random-task and M*4's Dice Roller https://store.cherryaudio.com/modules/dice-roller.

How important to your intended application are the buttons and the sample and hold (and any other modules you have in your preset)?

Just tested your preset. Button 2 seems to work as you stated (assuming the above definition is correct). Press button 2 and one of the two sounds happens (random either/or).

If you put Andew Mccauley's Gate Trigger in Cabinet 1 and hook it up to button 1 like you have in Cabinet 2 with button 2, that also seems to work.

If I am right, are you asking what the Gate Trigger Module does and why do you need it for your application? (Or, maybe you are looking for a CA module only solution?)

Bernouli Mod 001a.png
Bernouli Mod 001a.png (290.84 KiB) Viewed 4360 times
Steve W
Posts: 826
Joined: Thu Jul 16, 2020 5:55 pm

Re: Timing issues?

Post by Steve W »

First, thanks for posting your patch. I have been having some fun with it and so I thought I'd share some findings.
  • I tried using a midi keyboard instead of the P.Moon button and got misfires and doubles. Tried both trigger and gate.
    Maybe the P.Moon button eliminates a bouncing effect?
  • Hooking up a P.Moon button to CA's Micro Burst gets up to 32 triggers. Really shows off the either-or logic.
User avatar
honki-bobo
Posts: 315
Joined: Sat Nov 09, 2019 1:18 pm

Re: Timing issues?

Post by honki-bobo »

Hi Jason,

there are actually timing issues happening. The output of the Threshold module is 1 sample late, so the outputs of the Boolean Logic module will basically flip 1 sample after you've pressed the button. Delaying the signal from the button to the inputs of the Boolean Logic module will solve this. That is why the Gate-Trg module works.

If you are interested, I have a module designed specifically for this purpose: the Sample Delay. You can delay a signal by 1 to 9999 samples and resolve timing issues even in complex patches. There even is a polyphonic version, or a bundle containing both.

One more optimization suggestion to your patch: assuming you want a new random value every time you push the button, you can get rid of the LFO module. The Sample And Hold as a built-in random value generator that is automatically active when no connection to the input jack is present.
Bernoulli Gate.png
Bernoulli Gate.png (261.43 KiB) Viewed 4341 times
Best regards,
Martin
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
Steve W
Posts: 826
Joined: Thu Jul 16, 2020 5:55 pm

Re: Timing issues?

Post by Steve W »

honki-bobo wrote: Sun May 23, 2021 1:50 pm there are actually timing issues happening. The output of the Threshold module is 1 sample late, so the outputs of the Boolean Logic module will basically flip 1 sample after you've pressed the button. Delaying the signal from the button to the inputs of the Boolean Logic module will solve this. That is why the Gate-Trg module works.

If you are interested, I have a module designed specifically for this purpose: the Sample Delay.
Thanks for the explanation, Martin. I have some of your modules, but not that one. So, let me ask, will the Sample Delay Module also get rid of the issue when the either-or circuit/logic is triggered via midi (such as from a usb keyboard)?
User avatar
honki-bobo
Posts: 315
Joined: Sat Nov 09, 2019 1:18 pm

Re: Timing issues?

Post by honki-bobo »

Steve W wrote: Sun May 23, 2021 5:25 pm So, let me ask, will the Sample Delay Module also get rid of the issue when the either-or circuit/logic is triggered via midi (such as from a usb keyboard)?
I have tried to reproduce this, but I couldn't. I have used the patch you can see in my last post and simply used the Trigger output from the IO panel instead of the button and it worked just the same, with my Maschine Mikro and also with my e-piano. Maybe you had the same timing issue when you tried your keyboard?
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
jasonmads
Posts: 5
Joined: Tue Sep 08, 2020 11:36 pm

Re: Timing issues?

Post by jasonmads »

Thanks for the replies.

Hey Martin, yea that "obvious" box in plain sight "WHITE NOISE GEN" on the S&H just never clicked. Thanks for pointing it out! I'm still scratching my head wondering how I kept missing the message every time I put random into it.

So my intention with this patch was to make a Bernoulli Gate using only CA modules. Now I understanding the timing issues are happening at a single sample level explains why my debug section wasn't showing things. But now I'm not sure why it is "working" with the GATE-TRG, the trigger should arrive at the BOOL before the Threshold signal. Is a trigger a single sample in length?
User avatar
honki-bobo
Posts: 315
Joined: Sat Nov 09, 2019 1:18 pm

Re: Timing issues?

Post by honki-bobo »

Ok, it took me a while to figure this out, but I think I've got it.

The short answers are
jasonmads wrote: Fri May 28, 2021 5:06 pm But now I'm not sure why it is "working" with the GATE-TRG, the trigger should arrive at the BOOL before the Threshold signal.
The "acoustical" result (kick and snare changing randomly) is what you would expect to hear, but actually kick and snare are switched.
jasonmads wrote: Fri May 28, 2021 5:06 pm Is a trigger a single sample in length?
Yes.


The long answers
jasonmads wrote: Fri May 28, 2021 5:06 pm But now I'm not sure why it is "working" with the GATE-TRG, the trigger should arrive at the BOOL before the Threshold signal.
I don't own Andrew's GATE-TRG module, so I will use my own gate-trigger-converter. It won't make much of a difference, I suppose. I have recorded signals at different points in the patch to check what's going on timing-wise. This is the patch I've made:
patch.png
patch.png (934.9 KiB) Viewed 4206 times
timing issue.voltagepreset
(16.33 KiB) Downloaded 623 times

The upper cabinet is basically your patch, except for the gate-trigger-converter. The lower cabinet uses the Sample Delay module to compensate for the delay.

In this image you see the recorded audio files from the first, second and last VM Recorder in the lower cabinet showing the difference between the direct trigger signal and the delayed trigger signal. The output of the Sample and Hold module was greater than 0, so the Over Out on the Threshold module goes high.

The past samples between the direct trigger and the Sample Delay output is marked. I was not able to confirm this, yet, but it seems that every module introduces a 1 sample delay anyways, plus 1 sample delay from the Sample Delay makes the 2 samples that are marked in the image.

As you can see in the audio file in the middle, the trigger signal does not coincide with the gate signal (Direct trigger + Over Out). When the trigger signal gets delayed it coincides with the gate signal (Sample Delay trigger + Over Out). Consequently the Boolean Logic module won't output anything, because trigger and gate are not high at the same time (Bool output @ direct trigger + Over Out). This only happens when the trigger is delayed (Bool output @ Sample Delay trigger + Over Out).
Over Out - low 2 high.png
Over Out - low 2 high.png (110.72 KiB) Viewed 4206 times
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
User avatar
honki-bobo
Posts: 315
Joined: Sat Nov 09, 2019 1:18 pm

Re: Timing issues?

Post by honki-bobo »

This image shows the same VM Recorder files, but the output of the Sample and Hold module was less than 0, so the Over Out on the Threshold module goes low.

In the audio file in the middle you see the the trigger and the gate signal overlap (Direct trigger + Over Out). As a result the Boolean Logic module will output high (Bool output @ direct trigger + Over Out). The delayed trigger signal behaves as expected. The trigger coincides with the first sample of the closed gate (Sample Delay trigger + Over Out) and the Boolean Logic module outputs low (Bool output @ Sample Delay trigger + Over Out).
Over Out - high 2 low.png
Over Out - high 2 low.png (109.57 KiB) Viewed 4206 times

Here you can see the outputs of the Boolean Logic module in comparison. In this image the Sample and Hold module outputs a value greater than 0, so the Over Out goes high and the Under Out goes low. One would expect the Boolean Logic module to output High for the Over Out + Trigger connection, but instead the Under Out connection goes high. Again the Sample Delay module compensates for that.
Direct and with Sample Delay - low 2 high.png
Direct and with Sample Delay - low 2 high.png (115.31 KiB) Viewed 4206 times

When the Sample and Hold value goes below the threshold, it is the other way around.
Direct and with Sample Delay - high 2 low.png
Direct and with Sample Delay - high 2 low.png (114.91 KiB) Viewed 4206 times

So, as you can see, kick and snare are still altering randomly, but they are actually switched and 2 samples early.

jasonmads wrote: Fri May 28, 2021 5:06 pm Is a trigger a single sample in length?
Yes, it is. You can think of it as a gate signal with a gate time of 1 sample.
Image
Monkey Business Audio
Modules - Music - Twitter - YouTube
Post Reply

Return to “Voltage Modular”