Lets start with basics. What will we need to take as input, and what should we be outputting?
I want to take a modular approach, these will need to be reusable.
I want to keep things flexible so they can be used with other devices if possible.
Input:
– Device: The device we are controlling
– Channel: The midi channel we are listening and sending on
– Control: The midi note/cc on the channel we are listening and sending on
Output:
– Result: A bool value output of the button state
– Output: This will pass the midi data down to an execute operator
Trigger Button

Show Tixl Graph Code
[{"Id":"97b66dfb-e856-4318-8f84-1c4ef175fa2d"/*Object*/,"Inputs":[],"Children":[{"Id":"359b2194-14bf-4696-8aab-d79d4d150a00"/*MidiInput*/,"SymbolId":"59a0458e-2f3a-4856-96cd-32936f783cc5","InputValues":[{"Id":"044168eb-791c-405f-867f-3d5702924165"/*EventType*/,"Type":"System.Int32","Value":1},{"Id":"23c34f4c-4ba3-4834-8d51-3e3909751f84"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"6c15e743-9a70-47e7-a0a4-75636817e441"/*PrintLogMessages*/,"Type":"System.Boolean","Value":true},{"Id":"7c681ee6-d071-4284-8585-1c3e03a089ea"/*TeachTrigger*/,"Type":"System.Boolean","Value":false},{"Id":"9b0d32de-c53c-4df6-8b29-5e68a5a9c5f9"/*Channel*/,"Type":"System.Int32","Value":1},{"Id":"ca3ce08d-6a19-4ad5-9435-08b050753311"/*Damping*/,"Type":"System.Single","Value":0.0},{"Id":"df81b7b3-f39e-4e5d-8b97-f29dd576a76d"/*Control*/,"Type":"System.Int32","Value":52}],"Outputs":[]},{"Id":"ea300002-4544-44ba-a20a-fb9a9c94c74f"/*MidiOutput*/,"SymbolId":"f9f4281b-92ee-430d-a930-6b588a5cb9a9","InputValues":[{"Id":"0fff2ce2-defa-442c-a089-4b12e7d71620"/*NoteOrController*/,"Type":"System.Int32","Value":52},{"Id":"a10e3f7b-d132-49ca-9f6d-726d5e699443"/*Velocity127*/,"Type":"System.Int32","Value":64},{"Id":"a7e1eac2-5602-4c40-8519-19ca53763c76"/*ChannelNumber*/,"Type":"System.Int32","Value":1},{"Id":"adea6968-35ef-436a-bc2d-d9433b623df6"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"ec4d83b6-78eb-4cac-826b-cafb0be3f604"/*SendMode*/,"Type":"System.Int32","Value":0}],"Outputs":[]}],"Connections":[{"SourceParentOrChildId":"359b2194-14bf-4696-8aab-d79d4d150a00","SourceSlotId":"4bf74648-207f-4275-83ba-09e1c048c33b","TargetParentOrChildId":"ea300002-4544-44ba-a20a-fb9a9c94c74f","TargetSlotId":"9efa1be1-f102-4457-a69b-2aef59f6b845"}]},{"Id":"97b66dfb-e856-4318-8f84-1c4ef175fa2d"/*Object*/,"Description":"","InputUis":[],"SymbolChildUis":[{"ChildId":"359b2194-14bf-4696-8aab-d79d4d150a00"/*MidiInput*/,"Position":{"X":0.0,"Y":0.0}},{"ChildId":"ea300002-4544-44ba-a20a-fb9a9c94c74f"/*MidiOutput*/,"Position":{"X":225.38617,"Y":227.86115}}],"OutputUis":[]}]Functionality:
When the button is pressed, it sends a single positive pulse to the result, and to the midi channel and cc/note number of the Apc40.
Explanation:
The midi input’s WasHit is connected directly to the midi output. This allows the pulse from WasHit to also light the button.
WasHit is passed as a bool as Result
Toggle Button

Show Tixl Graph Code
[{"Id":"aa73d8dd-c0bb-43f0-b9d5-802b70eea692"/*Object*/,"Inputs":[],"Children":[{"Id":"671c34cb-5336-47e7-a51f-6973a5931e1c"/*CountInt*/,"SymbolId":"0e1d5f4b-3ba0-4e71-aa26-7308b6df214d","InputValues":[{"Id":"11f9cdb5-84fc-4413-8ca7-77e12047f521"/*DefaultValue*/,"Type":"System.Int32","Value":1},{"Id":"2ff3d674-90d7-4c8f-8551-aad9992540db"/*Modulo*/,"Type":"System.Int32","Value":2}],"Outputs":[]},{"Id":"7fdbb6b5-3508-4260-9a70-5e8cacb5a2d6"/*IsIntEven*/,"SymbolId":"9a34f503-709b-42e0-a25f-bc74573afa6b","InputValues":[{"Id":"6b3e1e47-5a42-4954-9d4a-bf2cdb466400"/*Invert*/,"Type":"System.Boolean","Value":false}],"Outputs":[]},{"Id":"8761811e-e25f-45a6-84e3-9873ed424263"/*MidiInput*/,"SymbolId":"59a0458e-2f3a-4856-96cd-32936f783cc5","InputValues":[{"Id":"044168eb-791c-405f-867f-3d5702924165"/*EventType*/,"Type":"System.Int32","Value":1},{"Id":"23c34f4c-4ba3-4834-8d51-3e3909751f84"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"6c15e743-9a70-47e7-a0a4-75636817e441"/*PrintLogMessages*/,"Type":"System.Boolean","Value":true},{"Id":"7c681ee6-d071-4284-8585-1c3e03a089ea"/*TeachTrigger*/,"Type":"System.Boolean","Value":false},{"Id":"9b0d32de-c53c-4df6-8b29-5e68a5a9c5f9"/*Channel*/,"Type":"System.Int32","Value":2},{"Id":"ca3ce08d-6a19-4ad5-9435-08b050753311"/*Damping*/,"Type":"System.Single","Value":0.0},{"Id":"df81b7b3-f39e-4e5d-8b97-f29dd576a76d"/*Control*/,"Type":"System.Int32","Value":53}],"Outputs":[]},{"Id":"d5646d15-3e0c-431a-b3ad-987b84651711"/*MidiOutput*/,"SymbolId":"f9f4281b-92ee-430d-a930-6b588a5cb9a9","InputValues":[{"Id":"0fff2ce2-defa-442c-a089-4b12e7d71620"/*NoteOrController*/,"Type":"System.Int32","Value":53},{"Id":"a10e3f7b-d132-49ca-9f6d-726d5e699443"/*Velocity127*/,"Type":"System.Int32","Value":3},{"Id":"a7e1eac2-5602-4c40-8519-19ca53763c76"/*ChannelNumber*/,"Type":"System.Int32","Value":2},{"Id":"adea6968-35ef-436a-bc2d-d9433b623df6"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"ec4d83b6-78eb-4cac-826b-cafb0be3f604"/*SendMode*/,"Type":"System.Int32","Value":1}],"Outputs":[]}],"Connections":[{"SourceParentOrChildId":"8761811e-e25f-45a6-84e3-9873ed424263","SourceSlotId":"4bf74648-207f-4275-83ba-09e1c048c33b","TargetParentOrChildId":"671c34cb-5336-47e7-a51f-6973a5931e1c","TargetSlotId":"bfd95809-61d2-49eb-85d4-ff9e36b2d158"},{"SourceParentOrChildId":"671c34cb-5336-47e7-a51f-6973a5931e1c","SourceSlotId":"2e172f90-3995-4b16-af33-9957be07323b","TargetParentOrChildId":"7fdbb6b5-3508-4260-9a70-5e8cacb5a2d6","TargetSlotId":"c5703990-1062-4512-b016-74ae1cce538a"},{"SourceParentOrChildId":"7fdbb6b5-3508-4260-9a70-5e8cacb5a2d6","SourceSlotId":"b69bc0ba-010d-4268-93f4-d5f682af00d5","TargetParentOrChildId":"d5646d15-3e0c-431a-b3ad-987b84651711","TargetSlotId":"9efa1be1-f102-4457-a69b-2aef59f6b845"}]},{"Id":"aa73d8dd-c0bb-43f0-b9d5-802b70eea692"/*Object*/,"Description":"","InputUis":[],"SymbolChildUis":[{"ChildId":"671c34cb-5336-47e7-a51f-6973a5931e1c"/*CountInt*/,"Position":{"X":162.6813,"Y":136.13843}},{"ChildId":"7fdbb6b5-3508-4260-9a70-5e8cacb5a2d6"/*IsIntEven*/,"Position":{"X":162.6813,"Y":171.13843}},{"ChildId":"8761811e-e25f-45a6-84e3-9873ed424263"/*MidiInput*/,"Position":{"X":0.0,"Y":0.0}},{"ChildId":"d5646d15-3e0c-431a-b3ad-987b84651711"/*MidiOutput*/,"Position":{"X":338.83704,"Y":24.298645}}],"OutputUis":[]}]Functionality:
When the button is pressed, it toggles between the on/off states of the button and outputs as the result, and to the midi channel and cc/note number of the Apc40.
Explanation:
From midi input, count every time WasHit is triggered.
If the counter is even, we send a positive to the midi output and result
We need to set the Default Value on CountInt to 1, since we are checking IfIntEven, it should start in an off/false/odd state
We can also set the Modulo on CountInt to 2, so we are not counting massive numbers, this will allow the counter to flipflop between 0 and 1.
Hold Button

Show Tixl Graph Code
[{"Id":"6f480d0e-a1d4-4b53-991c-c523fbbaea1a"/*Object*/,"Inputs":[],"Children":[{"Id":"02a85404-e7ed-4b94-a712-64929d0414a4"/*IsIntEven*/,"SymbolId":"9a34f503-709b-42e0-a25f-bc74573afa6b","InputValues":[],"Outputs":[]},{"Id":"2bade3bb-3145-42cf-87ed-947772a6dfc4"/*Not*/,"SymbolId":"51648ecd-05ee-40b3-b562-8518ada70918","InputValues":[],"Outputs":[]},{"Id":"a2029f04-3ad3-4481-be47-a097ebc968a3"/*FloatToInt*/,"SymbolId":"06b4728e-852c-491a-a89d-647f7e0b5415","InputValues":[],"Outputs":[]},{"Id":"a70bb0d2-ed3f-4b3a-9718-16f2478e6dab"/*MidiInput*/,"SymbolId":"59a0458e-2f3a-4856-96cd-32936f783cc5","InputValues":[{"Id":"044168eb-791c-405f-867f-3d5702924165"/*EventType*/,"Type":"System.Int32","Value":1},{"Id":"23c34f4c-4ba3-4834-8d51-3e3909751f84"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"6c15e743-9a70-47e7-a0a4-75636817e441"/*PrintLogMessages*/,"Type":"System.Boolean","Value":true},{"Id":"7c681ee6-d071-4284-8585-1c3e03a089ea"/*TeachTrigger*/,"Type":"System.Boolean","Value":false},{"Id":"9b0d32de-c53c-4df6-8b29-5e68a5a9c5f9"/*Channel*/,"Type":"System.Int32","Value":1},{"Id":"ca3ce08d-6a19-4ad5-9435-08b050753311"/*Damping*/,"Type":"System.Single","Value":0.0},{"Id":"df81b7b3-f39e-4e5d-8b97-f29dd576a76d"/*Control*/,"Type":"System.Int32","Value":52}],"Outputs":[]},{"Id":"cf044df8-1d69-44d3-8b0a-ac0151d110a8"/*MidiOutput*/,"SymbolId":"f9f4281b-92ee-430d-a930-6b588a5cb9a9","InputValues":[{"Id":"0fff2ce2-defa-442c-a089-4b12e7d71620"/*NoteOrController*/,"Type":"System.Int32","Value":52},{"Id":"a10e3f7b-d132-49ca-9f6d-726d5e699443"/*Velocity127*/,"Type":"System.Int32","Value":64},{"Id":"a7e1eac2-5602-4c40-8519-19ca53763c76"/*ChannelNumber*/,"Type":"System.Int32","Value":1},{"Id":"adea6968-35ef-436a-bc2d-d9433b623df6"/*Device*/,"Type":"System.String","Value":"Akai APC40"},{"Id":"ec4d83b6-78eb-4cac-826b-cafb0be3f604"/*SendMode*/,"Type":"System.Int32","Value":1}],"Outputs":[]}],"Connections":[{"SourceParentOrChildId":"a2029f04-3ad3-4481-be47-a097ebc968a3","SourceSlotId":"1eb7c5c4-0982-43f4-b14d-524571e3cdda","TargetParentOrChildId":"02a85404-e7ed-4b94-a712-64929d0414a4","TargetSlotId":"c5703990-1062-4512-b016-74ae1cce538a"},{"SourceParentOrChildId":"02a85404-e7ed-4b94-a712-64929d0414a4","SourceSlotId":"b69bc0ba-010d-4268-93f4-d5f682af00d5","TargetParentOrChildId":"2bade3bb-3145-42cf-87ed-947772a6dfc4","TargetSlotId":"e5322b67-9c56-4afe-a398-79294858acc0"},{"SourceParentOrChildId":"a70bb0d2-ed3f-4b3a-9718-16f2478e6dab","SourceSlotId":"01706780-d25b-4c30-a741-8b7b81e04d82","TargetParentOrChildId":"a2029f04-3ad3-4481-be47-a097ebc968a3","TargetSlotId":"af866a6c-1ab0-43c0-9e8a-5d25c300e128"},{"SourceParentOrChildId":"2bade3bb-3145-42cf-87ed-947772a6dfc4","SourceSlotId":"0274f62a-b3a2-49e3-a486-043ee71f366b","TargetParentOrChildId":"cf044df8-1d69-44d3-8b0a-ac0151d110a8","TargetSlotId":"9efa1be1-f102-4457-a69b-2aef59f6b845"}]},{"Id":"6f480d0e-a1d4-4b53-991c-c523fbbaea1a"/*Object*/,"Description":"","InputUis":[],"SymbolChildUis":[{"ChildId":"02a85404-e7ed-4b94-a712-64929d0414a4"/*IsIntEven*/,"Position":{"X":157.531,"Y":36.03125}},{"ChildId":"2bade3bb-3145-42cf-87ed-947772a6dfc4"/*Not*/,"Position":{"X":157.531,"Y":71.03125}},{"ChildId":"a2029f04-3ad3-4481-be47-a097ebc968a3"/*FloatToInt*/,"Position":{"X":157.531,"Y":1.03125}},{"ChildId":"a70bb0d2-ed3f-4b3a-9718-16f2478e6dab"/*MidiInput*/,"Position":{"X":0.0,"Y":0.0}},{"ChildId":"cf044df8-1d69-44d3-8b0a-ac0151d110a8"/*MidiOutput*/,"Position":{"X":157.531,"Y":106.03125}}],"OutputUis":[]}]Functionality:
When the button is pressed, it continuously sends a positive as the result, and to the midi channel and cc/note number of the Apc40.
Explanation:
From midi input, convert the float to an int using FloatToInt
Convert int to a bool using IsIntEven
Since the ON state of the float is 1, this is an ODD number, we need to invert the bool using NOT.
What might we need to extend?
- Define the Color of OFF states
- Define the Color of ON states
