Trying to build a toggle device (feedback wanted)

Official support for: mutools.com
KVRian
666 posts since 27 Nov, 2011

Post Mon Feb 08, 2021 12:22 am

I am trying to send and receive events to/from a MIDI controller, and want to build a toggle mechanism within MuLab. The controller sends ON vel=127 when pressing a button, and OFF vel=0 when releasing the button. So in my easy mode vision of this, I am trying to fire new events based on receiving ON vel=127 twice. In a hard mode vision, I am trying to fire different events based on receiving the ON vel=127 / OFF vel=0 sequence.

In the real world, this means that when I toggle a button on, a sequence will begin playing and a light on my controller will turn on. When I toggle the button off, the sequence will stop and the controller light will turn off. I want one sequence per button, with the ability to toggle multiple buttons simultaneously.

Here is a project file with my efforts (each one described below):
mux toggle test.MuProject.zip
Note: in the project modular area, I have a MIDI out for my controller (Midi Fighter 64) and each of the toggle racks routes its event out to the midi out.

Easy mode

The first time I receive ON vel=127, I want to do two things:

1. Send a MIDI ON with a fixed velocity to the MUX output
2. Send a MIDI ON with a fixed velocity to another module in the MUX

The second time I receive ON vel=127, I want to do two things:

1. Send a MIDI ON with a different fixed velocity to the MUX output
2. Send a MIDI OFF with a fixed velocity to another module in the MUX

What I've tried so far

Note modification

This was my first approach. The idea here is that I'd use a note dispatch to switch between Note Modifiers to set the velocity to either MAX or MIN. This doesn't quite work - because the Note Off is bypassed, and so the controller light turns off when I release the button. So the first time I press the button, it's lit while held, but turns off as soon as I release it. The second time I press the button, it doesn't light at all (because the dispatcher is sending this event to the MIN modifier which sets velocity to 0). I think it also doesn't work with multiple buttons, but I didn't get that far.

Sequences

So far this is the one that works. I have a note filter, and a midi sequence for each note. The midi sequence sends out to the midi controller, and also triggers an audio sequence.

The main shortcoming of this one is that I have to create a note filter, midi sequence, and target (audio sequence) for each of the 128 buttons on my controller. I figure I will have to create a target for each one - but if I can cut down on having to create the note filter and midi sequence for each one as well, that would be super helpful (I especially don't want to clutter up the sequence list in the browser with all these util sequences).

Transposed sequence

I was really hoping this one would work. The idea here is that there’s a single transposed sequence, and it sends to note filters which play the audio sequences. But, it doesn’t work, because the MIDI sequence can only play one at a time. Send two notes simultaneously to the midi sequence does not play the sequence twice, once for each transposed note.

I suppose this would need to be a "polyphonic sequence" to support this approach.

Bonus layering

This isn’t really what I’m going for, but figured I’d try it out as a somewhat similar concept. Instead of each button being responsible for a single audio sequence, where I layer the sounds by playing multiple buttons, I have each button sending to one or more audio sequences.

Looking for feedback / guidance

The first thing is, when I toggle a button off, there’s frequently a little popping noise - it seems that the note off is sent immediately, as opposed to being synced to the beat (even if the sequence is set to sync to the beat). Also it seems like there is no little fade out when the audio sequence stops. This is most apparent when stopping the kick drum loop on C2. If I don’t stop it exactly right, there’s a pop. So, is there any solution for that?

Then the big thing: is my Sequences approach the way to go about this? It is working for me and I can push on with it. I just want to check in here first to see if there’s a more efficient way, before I spend time creating all of the MIDI sequences for each note.
You do not have the required permissions to view the files attached to this post.

KVRian

Topic Starter

666 posts since 27 Nov, 2011

Post Tue Feb 09, 2021 11:39 am

Well I am pleased to say that the latch behavior on the Note Event Pad does exactly what I want! This project demonstrates it, the "Toggle (latch)" rack:
mux toggle test.MuProject.zip
You do not have the required permissions to view the files attached to this post.

KVRAF
10925 posts since 24 Jun, 2008 from Europe

Post Tue Feb 09, 2021 12:38 pm

:tu:

Return to “MUTOOLS”