Presenting: ZynTeensy!

I wanted controllers for my self-hacked Zynthian which were fully midi-implemented, and I built said controls on the Teensy platform. I have made the sketch available on github for anyone who wants to do the same for any reason. The README file is not done yet, but the sketch is already there and the GPIO-savvy will understand what’s going on, it’s ultimately quite a simple sketch, depending:

The sketch is designed based on the current testing branch, and is ready for V5 from the controls standpoint - there’s no RGB leds just yet, and unlikely I’ll go that much effort, from here on I’ll rely on the official hardware for the official UI, though I’ve got some zynthian-based devices of my own planned.

For switches (up to the 20 required for v5) you only need to provide the pin numbers to the array in the indexed order of the CUIA binds currently present on the testing branch. Which is to say, assigned to Note 90 and up, so index 0 = 90, index 1 = 91, etc. Tip of the hat to the devs for implementing those actions all in a row like that.

The encoders are a moving target at the moment, because testing does not assign them by default, so anyone implementing this code today will need to assign each encoder’s up and down actions manually. There is a 9-key run of free notes starting at E1, and I mapped them down/up starting from there. Hopefully future updates don’t mess with that in any way.

If the user does this same implementation, my code will work as is. If Zynthian is planning to use those keys for something else by default, this will become more difficult - at the very least, an array of note assignments would have to be maintained and implemented in the code by the person setting this up. Hopefully they either use those control notes the same way I did, or at least leave them free by default.

The good news is that if this rigorous sequentiality is maintained in assigning CUIA actions, the setup() and loop() functions can be completely ignored, just setup your CUIA right, assign your pins in the correct order, make sure it’s set as a MIDI device, and go. It is unlikely, as I said, that this code will be updated to handle the LEDs for V5, but in all other respects it should work fine for V5 layouts as long as the indexing is maintained.

I am toying with the idea of trying to make this smarter - talk to the Zynth with OSC, find out which notes are assigned to the required actions, and send notes intelligently - but it will largely depend on how much I need to hack on the zynthian end of things, it’s still a big scary codebase, but I’m getting more used to big codebases as I go…

6 Likes

Just seeing how far I can get with this onto a MKRZero but I’m beginning to believe it will be a little bit involved getting USBMidi to play ball.

Indeed, even removing the usbMIDI calls only gets you so far…

But interesting to see the way code crosses architectures…

The controller ended up on the Teensy because I have a huge collection of Arduinos of various sorts, but none with the 32U4, so as it turned out that Teensy was the only controller I had at hand that did native USB midi. I’d recommend ordering a 4, they cheap, and 600mhz, you can cram a microdexed in there too if you want :>

You can apparently kludge the other ones into midi but it’s more involved and I don’t quite understand it, from what I can tell you have to run something on the computer to translate. I almost pivoted over to OSC at one point but elected to complete it as was, because I saw the path to finishing it clearly, once Joe let us know about the upgrade to CUIA in testing.

3 Likes

You should use at least a Teensy-3.6 (for stable) or a Teensy-4.1 (for dev or the next stable). Teensy-4.0 should work but is not supported.

BTW: MicroDexed should run your Zyn code additionally without any problems for the sound engine :grinning:

1 Like

I’m trying for a generic control code base cos that seems beneficial.
I’ve still got to mod my qwerty version to deal with multiple modifiers, cos my C is largely cut and paste based.

I would probably envisage doing an OSC, qwerty and MIDI version if just to test the different CUIA approaches. a couple of GPIO pins might suffice to select the mode without involving two way comms.

1 Like

I’m looking forward to the 4.1 based MicroDexed.
Just wondering, is MicroMDAPiano dead?

No, MDAEPiano is integrated into MicroDexed :grinning:

Also a Drum-ROMpler…

You can test this by checking out the dev-branch. Currently all is working, but storing a performance has bugs.

1 Like

Ah, good to know. I was just wondering since the website still shows them as two different projects.

Looking forward to it, thank you :slight_smile:

1 Like

auto-magically ?

I would be happy if you would like to join in with your Zynthian-Remote-Control as your own page in our MDT project.

However to make it fully usable it would need some touch screen elements with added controls since we only have 2 physical encoders.

Ok so it’s running under keyboard control…

The code is horrible. Done using the Arduino IDE and the complications brought about throu’ the device loosing tty connection as soon s the Keyboard components are activated, thereby requiring full dev system reboot to edit…

The zynth has turned off the xwindow keyboard repeat which interacts very unpleasnatly with qwert CUIA, so make sure to test for long presses…

The actions chart is as below… Some of us didn’t realise All notes off was a Long snapshot press!!

1 Like

You could also implement arbitrary custom switches within your FrankensTeeinsy which can be configured within Zynthian to trigger any CUIA.

1 Like

Holmes! Look!! It’s alive!!!

1 Like

We have, of course, walked this path before…

zynthian_big_red_button

1 Like

Heehee at one point during the process I forgot to setup the keybinds in the zynth, and when I went to twiddle a knob it sent a big flood of note on messages, like I told it to, and chaos ensued. :>