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
Timing issues?
Timing issues?
- Attachments
-
- Bernulli Gate.voltagepreset
- (18.27 KiB) Downloaded 687 times
Re: Timing issues?
Hey, I have all those modules! I'll take a look. Is this what you are trying to do?
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?)
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.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.
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?)
Re: Timing issues?
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.
- honki-bobo
- Posts: 315
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Timing issues?
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.
Best regards,
Martin
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.
Best regards,
Martin
Re: Timing issues?
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)?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.
- honki-bobo
- Posts: 315
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Timing issues?
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?
Re: Timing issues?
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?
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?
- honki-bobo
- Posts: 315
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Timing issues?
Ok, it took me a while to figure this out, but I think I've got it.
The short answers are
The long answers
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).
The short answers are
The "acoustical" result (kick and snare changing randomly) is what you would expect to hear, but actually kick and snare are switched.
Yes.
The long answers
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:
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).
- honki-bobo
- Posts: 315
- Joined: Sat Nov 09, 2019 1:18 pm
Re: Timing issues?
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).
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.
When the Sample and Hold value goes below the threshold, it is the other way around.
So, as you can see, kick and snare are still altering randomly, but they are actually switched and 2 samples early.
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).
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.
When the Sample and Hold value goes below the threshold, it is the other way around.
So, as you can see, kick and snare are still altering randomly, but they are actually switched and 2 samples early.
Yes, it is. You can think of it as a gate signal with a gate time of 1 sample.