Alterating between two values , not random

Official support for: loomer.co.uk
Post Reply New Topic
RELATED
PRODUCTS

Post

I need something that alternates between two given values , but not random and that can be triggered by metro .
See red box , needs to open close gate at regular intervals .
One possible way it to use metro + data delay to trigger two data modules consecutively
Is there another way ?
Image
Eyeball exchanging
Soul calibrating ..frequencies

Post

Image

If I understand what you're asking for: you could use a latch with feedback driving a NOT gate, which will complement the boolean every time the metronome is called. You'll need to set the default value on the latch first to either true or false, depending on what value you want to be emitted initially.

Here, I cast the boolean to an integer (so, 0 or 1), and then use that to read either "first" or "second" from the literal array. But you could use the boolean to control a 2 to 1 switch instead.

... But, if you want to just output an event at some tick, and then another one at n ticks later, I think [delay] is the way to go.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

Cheers ,
It would be great if we had a simple module that does just that , a simple counter +select module (compares input against argument )
When you think of it , most of these modules in max are pretty high level , so we need to create them from scratch in architect .
Eyeball exchanging
Soul calibrating ..frequencies

Post

I can certainly add a macro to the library to do such a thing. Thanks for the suggestion.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

I recreated your example and used ['0', '1'] , the printout reads 0 and 1 but these values can not be used to control a switch , it's not recognized as an integer
Or any other number , 60, 67 to control the pitch
Image

Edit again needles confusion , the right output of the get element can not be used as an integer to control things ( we need to tap of the integer output ) , yet both show the exact same printed message in the console

Image
Image
Image
Last edited by gentleclockdivider on Tue Aug 18, 2020 3:21 pm, edited 1 time in total.
Eyeball exchanging
Soul calibrating ..frequencies

Post

That's because you're sending strings of "0" and "1". Any non-empty string is considered truthy when coerced to boolean. You need to send numbers. Replace the get element collection with [0, 1], i.e., without the quotes.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post

The console does not show these are strings
Eyeball exchanging
Soul calibrating ..frequencies

Post

If you want to show a type, use a [get data type] module which will emit the type of the event received.
Architect, the modular MIDI toolkit, beta now available for macOS, Windows, and Linux.

Post Reply

Return to “Loomer”