Monophonic Pad Array / Radio button switch array with note-off

Discuss Lemur and share techniques.
Post Reply
Endorfinity
Newbie
Posts: 13
Joined: 26 Feb 2025 17:15
Location: Moskva

Monophonic Pad Array / Radio button switch array with note-off

Post by Endorfinity »

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.

Image
Attachments
test.jzml
(19.66 KiB) Downloaded 24 times
midikinetics
Regular
Posts: 58
Joined: 15 May 2015 17:46
Contact:

Re: Monophonic Pad Array / Radio button switch array with note-off

Post by midikinetics »

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 `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:

Code: Select all

x = fill(x, 0, sizeof(x));
Phil999
Regular
Posts: 944
Joined: 11 Jan 2012 01:53

Re: Monophonic Pad Array / Radio button switch array with note-off

Post by Phil999 »

midikinetics wrote: 12 Apr 2025 16:07 Also you can clear all the `x` states for a button in one line like this:

Code: Select all

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.

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.
Formant+Eurorack, PPG wave 2.2, Korg MS-20, etc., EWI 4000s, QuNeo, etc., Mixbus32c, u-he, MadronaLabs, Samplemodeling, NI, etc., iPad2/4/Pro
Endorfinity
Newbie
Posts: 13
Joined: 26 Feb 2025 17:15
Location: Moskva

Re: Monophonic Pad Array / Radio button switch array with note-off

Post by Endorfinity »

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.

Image

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...
midikinetics wrote: 12 Apr 2025 16:07 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.
nope, I need momentary behavior, i.e if I move my finger off the pad, it should turn off.
midikinetics wrote: 12 Apr 2025 16:07 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.
that example was for testing purposes only
in practice any button should work as a reset button, if pressed when there's pad already pressed in a row
midikinetics wrote: 12 Apr 2025 16:07 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.
If I set trigger condition this way, it means I can have more than one pad in a row activated which is not allowed.
Phil999 wrote: 12 Apr 2025 22:41 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.
See above. The Pad grid should work as a keyboard, albeit monophonic.

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.
Attachments
omnichord.jzml
(3.06 KiB) Downloaded 16 times
midikinetics
Regular
Posts: 58
Joined: 15 May 2015 17:46
Contact:

Re: Monophonic Pad Array / Radio button switch array with note-off

Post by midikinetics »

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 `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.
Attachments
RadioPads.jzml
(5.22 KiB) Downloaded 9 times
Post Reply