Hey, I’m new to Zynthian, and am interested in adding some midi controller support for the Akai APC mini mk2 (and next MPD 218 if I can figure this one out). I had seen support for the APC Key25, and thought that this wouldn’t be much of a stretch.
I’ve follwed the instructions on the wiki, found the APC Key25 driver, copied that, tweaked it with the correct button assignments, updated the __init__.py, and deleted the python cache file. I restarted both the zynthian process, as well as rebooting the hardware, but it doesn’t seem to be picking up my changes.
I did run into issues (mostly lack of time) trying to remote debug and see if I could figure out if my changes were being loaded. The wiki talks about a .vscode/launch.json file, but I could find neither the directory, nor file on my Zynthian.
My changes are visible here, and should be pretty straightforward.
Any help or pointers would be appreciated. Thanks!
I have at least partially figured it out. The device is lighting up and the mode switching is working.
For debug, I used the web ui, that gave me enough info to figure out that I hadn’t mapped a couple of important buttons, Record and Play. This controller doesn’t have those, so I just set them outside the range, and that did it.
Still more work to do, but the latest commit in my repo makes this thing do something.
Hi @ejf! A warm welcome to the community and kudos for jumping in with such a hefty first development.
VSCode is not installed nor configured by default on zynthian. If you run vscode from another computer, connected via ssh to zynthian then vscode server is installed on the zynthian but the launch.json file is not created automatically. You can manually create it in /zynthian/zynthian-ui/.vscode/ and then it will be available to use for debug from vscode over ssh for the main UI.
It is great that you are making progress with this and there may be others who will benefit. It would be even better if, when you and/or @oscaracena have time - the code were to be abstracted so that it can be extended to support multiple devices. The work that @oscaracena did with integrating the APC Key25 is excellent and it would be great if we had a superset of functionality that could be mapped to subsests within multiple controllers.
Having different codebase for each controller is bloated and requires increased support effort, e.g. if a bug is found in one then it may need patching in all. If there were one class with all/most of the functionality then subclasses for each hardware device we could more rapidly add more devices.
You have most recently been through the fun/pain of figuring out what changes are required (maybe minor because of the similarity of the devices) so may be in a good position to start this abstraction.
I’ll take a pass at abstracting and combining the two files. Python is not my native language, so it might be rough comparitively. The only key differences are the button addresses and device name. The APC mini also does not have Play or Record buttons, so I mapped those to values that I think were outside the range (but that may actually have introduced a bug).
On the VSCode issue, it did not automatically create the .vscode/ directory, so knowing that I can just create it where it needs to be and drop in that launch file is helpful. Thanks @riban ! Overall, the wiki was amazing. I haven’t seen one that detailed in a while, and it really sped things up for me and made this very approachable for someone not familliar with the project.
And of course, thank you to @oscaracena for the awesome work on the keys versions of these things, all I needed to do was a bunch of copy/paste on your work.
It all depends on someone making the driver for it. I was just researching random stuff about color-schemes on the Zynthian when i stumbled upon the MINI. It is very tempting to order one, and maybe it would be a sort of entry into the business of ctrl-drivers and contribution to the community.
I think i understand a little bit about what Riban and Oscaracena discusses in this thread about some sort of higher ground for ctrl-drivers that some specific controller can utilize. But i think with my limited knowledge and poor stamina in these matters, i would need the easiest approach to making a controller driver.
@Riban@oscaracena is it more or less correct to assume that if i buy the Akai APC Mini, and start of with some sort of copying from the Akai APC Key25 driver, and giving that i would persevere and become a sufficient ctrl-driver programmer, it would be possible to get something not to far from @oscaracena’s sequencer part of the Key25 functionality, and the mixer working for normal channel mixing?
I (am learning to) use the Akai APC Key25 on my TravelZynthian. But at home i use a Studiologic SL73 and my homebreewed Zynthian. I can really see the Akai APC Mini fitting very well into that. Of course there are no knobs, but i guess that one could use the faders to adjust specific parameters for specific steps / specific instruments.
@ejf How did it go with your attempt at a driver? Could i have a look at what you all ready made?
What I would do if I had the mini, is to further abstract the apc key25 mk2 driver. Defining pads and knobs mapping which can be overwritten when subclassed. Same for rows and columns.
The midi messages to set the colours are identical.
For the faders I would use the methods defined in the apc key25 (first gen) driver, since these are absolute.
Then there is the ninth fader with which you’ll want to control the main outs.
And I think you can query this device on the actual fader positions, which can be nice to do stuff with.
And soft Keys that have no function yet. The documentation is vague about how exactly drum and notes mode are handled (the device? In ableton live?).
If you have no experience in Python yet simply copying and tweaking may be easier than subclassing.
Thanks for the feedback @niels
I di very much agree, and the copy/tweak method is the way to go for me. I’ve done some work in php/mysql/html over a long period (booking database and webpage for a mounytain-guide company) - and i remember how coding from the ground slowly crept into my copy/tweak style. But i must admit i do not think i ever started coding on a blank page without copying first
I will order, and we will see how it goes. I have the Wiki and the community in place. The uncertain factor is definitely myself
We change things quite a bit on zynbleton which may require significant changes to device drivers. I am looking at that now so they’re is a (rather small) chance I might have time to look at abstraction. No promises but it would be a very useful bit of work. (@jofemodo has me under strict instructions to avoid scope creep… .)
Zynbleton is coming! Nice timing with christmas coming up soon. Last year it was the Tascam US16x08 . I’m never bored riding the Z-train…
I like that the future is to some degree uncertain. Otherwise it would be quite boring/predictable. It will be a thrill to see what comes out of the workload you people are putting down.
I and I think others, too will appreciate it very much if you can make a APC mini mk2 driver happen. I think it fits perfectly to the zynthian with the pads and faders
Maybe in this case a little scope creep is to be allowed
The Mini has arrived, but spare time is limited for the next days, maybe even two weeks as i’m of to Denmark to visit my mom. Should i bring the mini with me and try fumbling with the driver while there, or should i wait and see if Zynbleton is on Vangelis in a fortnight or so. Hard choices in life. Maybe i’ll just do both.
DISCLAIMER: No one should have high hopes about me making a driver that can work on a level similar to @oscaracena ‘s beautiful Akai APC key25 driver. Or maybe not work at all. Don’t go shopping based on my (lack of) abilities !