General
Monophonic Pad Array / Radio button switch array with note-off
Started by Endorfinity on .
Sign in or create an account to join the conversation.
Hi gang.
I'm trying to build a note controller which has multirow array of note pads.
Notes in a row should cancel each other and this is where I've stumbled.
I've made a test rig with the simplest script:
pressing pad[0] cancels any other pressed pads in a row (i'd like to extent this script to any other pad later)
but instead of momentary behaviour, pad[0] acts like a toggle switch. trying this on iPad is even worse - if I press any other pad with pad[0] they turn off, but when I toggle pad[0] off any other pads that were previously shut will turn on again as if iPad thinks that I'm still touching those.
Looks like I'm entering some infinite loop, yet I can't find a solution to exit it.
Any help will be much appreciated.
Test rig attached.
[img]https://i.imgur.com/BBZPQEf.png[/img]
I'm trying to build a note controller which has multirow array of note pads.
Notes in a row should cancel each other and this is where I've stumbled.
I've made a test rig with the simplest script:
pressing pad[0] cancels any other pressed pads in a row (i'd like to extent this script to any other pad later)
but instead of momentary behaviour, pad[0] acts like a toggle switch. trying this on iPad is even worse - if I press any other pad with pad[0] they turn off, but when I toggle pad[0] off any other pads that were previously shut will turn on again as if iPad thinks that I'm still touching those.
Looks like I'm entering some infinite loop, yet I can't find a solution to exit it.
Any help will be much appreciated.
Test rig attached.
[img]https://i.imgur.com/BBZPQEf.png[/img]
If these are supposed to be toggles, have you considered using the Switches widget set to Radio mode instead of the Pads? The Switches widget has this functionality baked in.
If the reset button truly has a different function than the rest of the buttons I would highly recommend making it a separate button. This will simplify the math and make the project easier to reason about.
To address the issue, have you tried setting the evaluation condition for the
Also you can clear all the
If the reset button truly has a different function than the rest of the buttons I would highly recommend making it a separate button. This will simplify the math and make the project easier to reason about.
To address the issue, have you tried setting the evaluation condition for the
cut() script to be on x falling instead of rising? The buttons would reset when you lift your finger off the button. Also you can clear all the
x states for a button in one line like this:x = fill(x, 0, sizeof(x));that’s a good tip. Although quite obvious. I did try x=0, which obviously does not work for an array. Then used more complicated means which work. Reminds me that I’m still a beginner. And that I forgot many things I used to know ten years ago.midikinetics wrote: Also you can clear all thexstates for a button in one line like this:
x = fill(x, 0, sizeof(x));
To the actual question, I also thought that a Switches object with radio mode should be the first idea. But I haven’t downloaded the template to understand the issue in detail.
Hi fellas, thanks for chiming in, I really appreciate that!
Ok, what I'm really trying to do is to make an iPad approximation of the Suzuki Omnichord.
I have 3 rows of pad array: top row - for major chords, middle - for minor, bottom - for dominant 7th + combination with up to three buttons in a row, take a look at the manual.
[img]https://i.imgur.com/OZAhwMO.png[/img]
I may do the chord logic elsewhere outside Lemur (e.g. Plogue Bidule), but for now I'd like to set up two things in my pad array:
1. pads in one row should cancel each other, i.e. if i press second pad in a row, this should turn the first pad off, essentally making a row monophonic.
2. pads in one column should not cancel each other, allowing combos of pads to make a different chords.
I am already having problems at the first step, so there goes...
in practice any button should work as a reset button, if pressed when there's pad already pressed in a row
Maybe my idea is incompatible with the way the Pad array works, and I need to think some workarounds.
Yet, having one Pad array would be neat.
Ok, what I'm really trying to do is to make an iPad approximation of the Suzuki Omnichord.
I have 3 rows of pad array: top row - for major chords, middle - for minor, bottom - for dominant 7th + combination with up to three buttons in a row, take a look at the manual.
[img]https://i.imgur.com/OZAhwMO.png[/img]
I may do the chord logic elsewhere outside Lemur (e.g. Plogue Bidule), but for now I'd like to set up two things in my pad array:
1. pads in one row should cancel each other, i.e. if i press second pad in a row, this should turn the first pad off, essentally making a row monophonic.
2. pads in one column should not cancel each other, allowing combos of pads to make a different chords.
I am already having problems at the first step, so there goes...
nope, I need momentary behavior, i.e if I move my finger off the pad, it should turn off.midikinetics wrote: If these are supposed to be toggles, have you considered using the Switches widget set to Radio mode instead of the Pads? The Switches widget has this functionality baked in.
that example was for testing purposes onlymidikinetics wrote: If the reset button truly has a different function than the rest of the buttons I would highly recommend making it a separate button. This will simplify the math and make the project easier to reason about.
in practice any button should work as a reset button, if pressed when there's pad already pressed in a row
If I set trigger condition this way, it means I can have more than one pad in a row activated which is not allowed.midikinetics wrote: To address the issue, have you tried setting the evaluation condition for thecut()script to be onxfalling instead of rising? The buttons would reset when you lift your finger off the button.
See above. The Pad grid should work as a keyboard, albeit monophonic.Phil999 wrote: To the actual question, I also thought that a Switches object with radio mode should be the first idea. But I haven’t downloaded the template to understand the issue in detail.
Maybe my idea is incompatible with the way the Pad array works, and I need to think some workarounds.
Yet, having one Pad array would be neat.
Ah I see. Yeah, the Pads widget isn't really set up for this kind of behavior. However you can achieve a similar thing by "faking" it using different colors. Instead of using
In this example, when
This would mean in your chord generation logic you need to use
You absolutely could do the chord generation logic easily in Lemur. Just create 3 of these and listen for changes to any of the
x, save a `selectedIndex' property, and then change the colors of the pads based on the index. In this example, when
selectedIndex is -1, this represent no selection. When the pad is pressed, you update the selectedIndex and refresh the buttons. When the same index was pressed that was previously selected, set selectedIndex back to -1. This would mean in your chord generation logic you need to use
selectedIndex to determine the root note, not x, and check for -1 as the sentinel value meaning "no selection". You absolutely could do the chord generation logic easily in Lemur. Just create 3 of these and listen for changes to any of the
selectedIndex properties and check which ones are -1. Then based on that generate the appropriate chord quality. Or you could even put these all in a container and keep an array of selectedIndices and aggregate them together. That's probably what I would do.