Logical comparator in Reason
Anybody help me with create simply logic equation IF A = B THEN 1 ELSE 0 in Reason (stock or RE)?
DVC-1 haven't "equal", TRUTH works with equation ">0" or raise value.
DVC-1 haven't "equal", TRUTH works with equation ">0" or raise value.
What are you trying to accomplish? CV A == CV B can be difficult because you might consider two CV values equal but the precision of the math doesn't. i.e 0.77171 != 0.77172
Note CV do not require deep precision, I think.
I need compare two note CV values and return 1 if equal it.
I need compare two note CV values and return 1 if equal it.
Reason devices take CV and quantize it to 128 steps to get a MIDI note value. For instance the entire range from 0.0 to 0.0078125 would be 'equal' to C-2. I can't think of an easy way, even with my own devices, to trigger on two CVs being in the same note range.
- Timmy Crowne
- Competition Winner
- Posts: 357
- Joined: 06 Apr 2017
- Location: California, United States
For an equal value check, you could:
Route CV(a) and CV(b) into a Thor’s CV inputs 1 and 2.
Hold a MIDI note for the Thor so that its gate is held open. (You can sequence the note and play the song for this to trigger.)
Use the mod matrix to send CV input 1(a) to Filter 1 Audio Input with an amount of 100, and CV input 2(b) to the same destination with an amount of -100 to essentially subtract (b) from (a).
Set the Shaper module to rectify, with full drive. This will ensure that if there is any difference between (a) and (b), the Shaper will return a positive value.
Use the mod matrix to route the shaper output to Global Env Gate Trig and Set Global Env Sustain level to maximum.
Turn Rotary 1 to 127 and route it to CV Out1. Also route Global Env to CV Out1, with an amount of -100. This means that your function will default to false unless (a) and (b) are equal.
***MAKE SURE THE THOR’S AUDIO OUTPUTS ARE DISCONNECTED! Sending DC signal to your audio outputs is something I don’t think you want. ***
Sent from my iPhone using Tapatalk
Route CV(a) and CV(b) into a Thor’s CV inputs 1 and 2.
Hold a MIDI note for the Thor so that its gate is held open. (You can sequence the note and play the song for this to trigger.)
Use the mod matrix to send CV input 1(a) to Filter 1 Audio Input with an amount of 100, and CV input 2(b) to the same destination with an amount of -100 to essentially subtract (b) from (a).
Set the Shaper module to rectify, with full drive. This will ensure that if there is any difference between (a) and (b), the Shaper will return a positive value.
Use the mod matrix to route the shaper output to Global Env Gate Trig and Set Global Env Sustain level to maximum.
Turn Rotary 1 to 127 and route it to CV Out1. Also route Global Env to CV Out1, with an amount of -100. This means that your function will default to false unless (a) and (b) are equal.
***MAKE SURE THE THOR’S AUDIO OUTPUTS ARE DISCONNECTED! Sending DC signal to your audio outputs is something I don’t think you want. ***
Sent from my iPhone using Tapatalk
Thank you, Timmy, but I can't take comparator with that patch (I can have error somewhere).
Super clever solution - Thor to the rescue once again!Timmy Crowne wrote: ↑18 Sep 2018For an equal value check, you could:
Route CV(a) and CV(b) into a Thor’s CV inputs 1 and 2.
Hold a MIDI note for the Thor so that its gate is held open. (You can sequence the note and play the song for this to trigger.)
Use the mod matrix to send CV input 1(a) to Filter 1 Audio Input with an amount of 100, and CV input 2(b) to the same destination with an amount of -100 to essentially subtract (b) from (a).
Set the Shaper module to rectify, with full drive. This will ensure that if there is any difference between (a) and (b), the Shaper will return a positive value.
Use the mod matrix to route the shaper output to Global Env Gate Trig and Set Global Env Sustain level to maximum.
Turn Rotary 1 to 127 and route it to CV Out1. Also route Global Env to CV Out1, with an amount of -100. This means that your function will default to false unless (a) and (b) are equal.
Don't forget to turn the "Gate Trig" on the Global Env OFF, or the note you use to trigger the voice section will also trigger the Global Env, defeating the purpose. Also, set Global Env release to zero.
Selig Audio, LLC
- Timmy Crowne
- Competition Winner
- Posts: 357
- Joined: 06 Apr 2017
- Location: California, United States
Maybe my explanation was unclear. I've attached a test file here:
You'll see that when Synth A and Synth B both play the same note (G3), the Equal Value Checker returns true, and triggers a cymbal sample on the Kong. Hope this is what you're looking for!
What @rcbuse says is true though, if the MIDI note values are even slightly off, this won't work.
EDIT: Good catch, Selig. I forgot that I always start with a completely zeroed-out Thor!
You should be fine if you are driving it with a sequencer like matrix or RPG. But say if you wanted to test note equality for two free running LFOs, you are going to have some issues.Timmy Crowne wrote: ↑18 Sep 2018
What @rcbuse says is true though, if the MIDI note values are even slightly off, this won't work.
Just to be clear, what cases will a Note CV device generate a non integer Note CV value?Timmy Crowne wrote: ↑18 Sep 2018What @rcbuse says is true though, if the MIDI note values are even slightly off, this won't work.
I can't think of any, so I'm curious what I might be missing.
Of course, if you're talking about generic CV values, they are floating point, not integer.
Selig Audio, LLC
Well, there isn't any such thing as an integer CV value, CV is always floating point, typically -1.0 to +1.0 (but can be larger)selig wrote: ↑18 Sep 2018Just to be clear, what cases will a Note CV device generate a non integer Note CV value?Timmy Crowne wrote: ↑18 Sep 2018What @rcbuse says is true though, if the MIDI note values are even slightly off, this won't work.
I can't think of any, so I'm curious what I might be missing.
Of course, if you're talking about generic CV values, they are floating point, not integer.
It only becomes a MIDI value when a device multiplies incoming CV by 127 and converts to an integer.
Something like the matrix would take an integer note value and divide to by 127 to get the CV value.
Like C-3 = MIDI 60 = 60.0/127.0 = 0.4724409449 CV
Like C#-3 = MIDI 61 = 61.0/127.0 = 0.4803149606 CV
But all the values inbetween 0.4724409449 and 0.4803149606 would also be valid once converted back
A synth would also take 0.48000000 * 127.0 = 60.96 = 60 = C-3
- Timmy Crowne
- Competition Winner
- Posts: 357
- Joined: 06 Apr 2017
- Location: California, United States
I’ve never programmed an RE, but I would imagine it’s possible a developer could code a device’s tuning with round-off such that note values are functionally accurate, but not precise to the floating point. Theoretically, the device would behave as expected in Reason’s environment, but its Note CV output wouldn’t necessarily match other devices perfectly for the same pitch class. Perhaps there are safeguards in the API that prevent this.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
Well, there is a standard formula that all devices conform to for MIDI > CV > MIDI conversions. However, if you are in the realm of CV, you can do things like, say, with Janitor, you could add 0.0315 CV to a signal and transpose all notes up 4 semitones, but if you compare those values to other values, they will be the same "notes" according to the conversions, but not the same value.Timmy Crowne wrote: ↑18 Sep 2018I’ve never programmed an RE, but I would imagine it’s possible a developer could code a device’s tuning with round-off such that note values are functionally accurate, but not precise to the floating point. Theoretically, the device would behave as expected in Reason’s environment, but its Note CV output wouldn’t necessarily match other devices perfectly for the same pitch class. Perhaps there are safeguards in the API that prevent this.
Sent from my iPhone using Tapatalk
- Timmy Crowne
- Competition Winner
- Posts: 357
- Joined: 06 Apr 2017
- Location: California, United States
Ah I see. So a CV signal could be given a slight offset but still convert to the “proper” MIDI note. Perhaps a Neptune could be placed inline to quantize both CV signals prior to checking for equivalency.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
In what case would a value of 0.48 be output from a CV device to represent C3? Isn't every CV Note value for C3 the same float value? Or are you suggesting some devices don't use the same formula to derive the Note CV value?rcbuse wrote: ↑18 Sep 2018Well, there isn't any such thing as an integer CV value, CV is always floating point, typically -1.0 to +1.0 (but can be larger)
It only becomes a MIDI value when a device multiplies incoming CV by 127 and converts to an integer.
Something like the matrix would take an integer note value and divide to by 127 to get the CV value.
Like C-3 = MIDI 60 = 60.0/127.0 = 0.4724409449 CV
Like C#-3 = MIDI 61 = 61.0/127.0 = 0.4803149606 CV
But all the values inbetween 0.4724409449 and 0.4803149606 would also be valid once converted back
A synth would also take 0.48000000 * 127.0 = 60.96 = 60 = C-3
And if the above is true, how can a comparator fail to see two "C3" values as being equal, whether integer or float?
I thought that was the question here, whether a comparator can distinguish between two C3 values and see them as being the same. My question was based on that line of reasoning, so maybe I should rephrase: in what case would two C3 CV Note values NOT be seen as the same by a "compare" function?
Selig Audio, LLC
Well, say you are getting freaky with CV and using a LFO to drive note values. Or if you are using PSQ which doesn't use note values it just outputs 0.0 to 100.0. Or you are using something like Janitor to add a little CV to transpose notes from a matrix or RPG.
Got it!
Selig Audio, LLC
Great and unexpected solution, Timmy!Timmy Crowne wrote: ↑18 Sep 2018
You'll see that when Synth A and Synth B both play the same note (G3), the Equal Value Checker returns true, and triggers a cymbal sample on the Kong. Hope this is what you're looking for!
Lot of thanks!
But... Im so dumb for fix one problem.
After key (equal) note that device trigger any next note before off.
After key (equal) note that device trigger any next note before off.
- Attachments
-
- drumroll (under construction)_v2.zip
- (10.08 KiB) Downloaded 40 times
- Timmy Crowne
- Competition Winner
- Posts: 357
- Joined: 06 Apr 2017
- Location: California, United States
This is an ingenious patch! Wow. I think I see the issues you're having with it:
The most recently "rolled" note is being triggered on any next different note’s onset.
(Substitute Seq Gate for Global Env in Thor 1 Mod 13; Set Global Env's delay to 0.1ms and full sustain, zero out other env parameters.)
In SELECTED mode, the currently rolled note is undesirably held over when a different note is played legato.
(Activate MIDI Trigger Button in Comparathor to ensure current values are being passed into the Shaper.)
A note's "rolled" sequence begins simultaneously with its manual drum trigger, resulting in build up of multiple samples and phasing.
(Add two Note Echo's to Thor 1 and Comparathor as a variable timing lookaheads, creating a natural flam effect when the roll starts.)
Here's the version with the changes I made:
Superb. Thank you for your help!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 14 guests