[ANSWERED] Logic gates and tabulated "iff" statements
-
OK,
This one is going to be a bit long winded, but I think it's important for people to know what I did in order for them to help me create more refined patches in the future.
I was recently playing around with a midi controller with an 8x8 grid of buttons equipped with 3 coloured lights (an AKAI APCmini to be precise) my idea was to use part of this grid to represent all of the scenes in a given patch with the current scene highlighted in green and all of the others in yellow. I also wanted these buttons to jump to the relevant scene when pressed.for the experiment I created 48 scenes with nothing but a single user actor in them.
I managed to succeed in getting the functionality using a relatively brute force method which made me think that there must be an easier way
the method I ended up with consisted of:
a current scene number actor hooked up to 48 different selectors.
each selector had 48 inputs; 47 of which were defined as "5" (the velocity that triggers a yellow light command) and 1 was defined as "1"(the velocity that defines a green light command) obviously each of those 48 selectors had the "1" in a different place.
Then each of those selectors was hooked up to a different "send note" actor each configured to the relevant port, channel, and pitch for their respective buttons.
then those "send note" actors had to be hooked up to enter scene triggers.
and that's just the lights. I then had to attach 48 note on watchers to 48 individual jump actors.
I was a long process but now I have a user actor that does the job.
However, it occurred to me after I'd finished this laborious task that I was going a very long way around to a relatively simple logic operation.
I wanted to say to a whole array "if and only if your designated number is generated, send the command '1'. If not send the command '5' "
Is there a cleaner way to use an "iff" logic statement in Isadora than what I ended up doing?
Thanks.
-
This should work for a file with up to 127 Scenes. 127-scene-midi-jump.izz
With more complex logic you could involve the pitch and some logic to handle a file with more than 127 Scenes.
Best wishes,
Woland
-
That's a nice idea for the jumps, although the way the numbering of the buttons is mapped on my particular controller I still have to put in a table actor to map the key input to the desired scene. but that's still 96 actors reduced down to 5 so I call that a win (even if I have to manually make the table work properly)
any thoughts on the "note send" element with the many many lights that require new information in each scene?
-
I think a user actor I made the other day may be helpful to you. It uses some simple Javascript to create a multi toggle.
By default it has 10 outputs. (the JS can support 99) Given the default 10, if a integer between 1 and 10 is input, that matching numeric output will be ON, and all others will be OFF, giving you a nice toggle. If the Input value is Zero, all outputs are OFF, if the Input is greater than the number of toggles (10 by default) all outputs are ON.dx-js-multi-toggle.iua3
Using this as the center of the logic, and then creating a user actor that bundles note data as JSON, and bundling this together into a master JSON data structure, it should be pretty easy to select only the JSON data associated to the ON value from the big bundle of JOSN data. Then parse that JSON into the individual values.
If I followed what you wanted to do, I think that gets you a pretty clean implementation. -
Thanks, that might be exactly what I'm looking for.
-
@thatmattrogers said:
any thoughts on the "note send" element with the many many lights that require new information in each scene?
I don't understand the MIDI mapping for this device entirely, but if I think that you should be able to adapt this to send all the midi messages you need. (One needs to be told that it's green, and all the rest need to be told that they're yellow, yes?)
-
@thatmattrogers said:
I still have to put in a table actor to map the key input to the desired scene.
If you order your scenes sequentially according to the buttons, then you can just use a calculator instead of a table to handle whatever offset you need.
E.g. if you need buttons with values 9-63 to trigger scenes 1-55, you can do this:
If you need the offset to go the other way, just switch the calculator to add.
e.g. if you need buttons with values 0-47 to trigger scenes 1-48, you can do this: