I’m still blown away by what can be done just within the confines of the digital domain. It’ll probably take the rest of my life to understand why I’d ever need an analog version . Resurrecting old hardware sounds awesome, but since I’ve never really lived that life (I’m addicted to screens, what can I say) I can only really imagine the potential implications from afar.
Even after doing stuff with ChucK and Csound, I haven’t really needed to bust out even the cheapo FPGA I got a few months (probably closer to a year now?) back, wrestle with drivers, proprietary IDEs and other shit just to realize that there are no cool prefabs to mess with, and I’m probably not going to get very far with naked DSP on a chip.
The ease of use has really made me into a lazy sack of shit, that’s for sure
@Koldunya I’m putting this here because it’s probably more nerdy than the usual folks in Hardware Thread want to read. Hopefully @KvlT’s okay with it, if not I’ll make my own thread (with hookers and blackjack).
I’ve honestly slept on the ESP32. Looking at the specs on the cheap ones, it’s sooo much more powerful than 99% of the Arduinos for same or less money. I’ve ordered a handful to see what I can do with them. I have a couple of Sonoff wifi outlets that use them and they’ve been rock solid.
I also got some (12 actually, because Amazon) CD74HC4067 multiplexers - that’s 16 analog in for three analog GPIO, so I think I could conceivably hook up three of them if I’m reading the data sheet right. 48 inputs seems like more than I need (and honestly would start getting expensive just in knobs/buttons/sliders), but the plan right now is to do 16 and then maybe 32, mostly to see where the considerably higher clock speed of the ESP caps out on reading. Assuming pots over encoders, it seems like a super simple solution for a basic MIDI controller. I’ve also considered adding an encoder knob to change MIDI channel and maybe a small screen that outputs the MIDI value? I’m not sold on the needing either of those things but might be a fun learning project.
Related to your idea of encoders, the other thing I’m looking at is the TCA9584A, an 8 channel I2C expander. If each encoder takes two data pins (ignoring the push button, at least for now), that’s 4 per chip. They’re 7-bit addressable so you can have 8 per I2C bus without a bunch of software shenanagins, but even on a $6 ESP-WROOM-32 that’s 2 buses x 8 chips x 4 encoders/chip = 64 total.
I’m interested in where polling breaks down and you have to go to interrupts (which apparently the TCA9584A will do). Even as speedy as those ESP32s are I think trying to read that many things each cycle, especially on the slower I2C bus and with the context switching of the expanders, my guess is you hit the limit for direct polling before you run out of encoders. I did see a thing today where someone got an 18x speedup on an Arduino by doing register reads vs the Arduino digitalRead. Maybe going bare metal will provide enough benefit to poll all of them.
Hey thanks I didn’t even know this was a thing lol.
ESP32s are just crazy performance for the price it seems.
There’s a company that makes an ESP32-P4 board with an I3C bus called the Firebeetle but that’s the first I’ve even heard of it. Iirc I2C has an “ultrafast” mode but yeah I don’t know enough about encoders tbh. I suppose I could open my LCXL3 and see if I can spot the MCU lol
haha the dark corner of idmf where we (mostly KvlT and I so far) check out weird software and hardware and find the hard way to do things. He’s got a bunch of cool Arduino experiments and some crazy SonicPi scripting things, I’ve got some Max patches, lots of “hey I saw this thing it might be cool” type of posts. More the merrier, we get excited about this stuff.
I think that’s right, I just meant if you wanted to send MIDI over ESP-Now to like a DAW or software you’d need the other one hooked up to PC. Seems reasonable for as cheap as they are, and probably a good solution for a simple or one-off controller. I don’t know how hard it’d be to pass that MIDI to another piece of hardware like an Axoloti or synth.
I’ve only seen ‘normal’ at 100kbps and fast at 400kbps, but apparently there is also Fast-plus, High Speed and Ultra-Fast, topping out at 5Mbps. These don’t seem to be as widely supported, requiring specific hardware to handle the faster voltage rise/fall times. That expander I looked at apparently only supports normal and fast. It’s literally just an IC and some resistors, I wonder if the faster modes are more common in MCUs where you’re using a main MCU to talk to other ones. I don’t even know if the I2C bus speed is a factor.
The potential problem, as I see it, is you have however many encoders hooked up. Every cycle the cpu has to go to each of them in some order, possibly through an expander, and check the status of two legs. So there’s outbound time, maybe a small delay while the expander switching happens, and return time. Then is has to compare what it gets back to the last status and potentially act on it (turned x amount in y direction) and send a MIDI message.
That whole process has to break down at some scale, I just don’t know what the bottleneck would be or if any of it even matters. If it’s CPU speed, bus speed, if the expanders play a part or not, if you can do double duty with two buses or not… just a bunch of specifics I don’t know. I’m fairly certain if you had, say, three encoders you’d be fine. I’m guessing 64 would have serious timing issues. I’m interested in where it falls apart and you have to move to interrupts.
I’m going to try and prove to myself the analog route is as easy as I think and then I’m going to jump into testing some of the encoder stuff.
but why tho? A wireless MIDI controller? That’s actually an interesting idea depending on the latency…
I’ve determined that encoders are just black magic and pots are way easier lol. And sending MIDI CCs you have 0 and 127 at either end anyway.
I counted the controls I’m using for my Axoloti Core Horrorscape Machine and it’s 96 knobs LOL, 8 faders because those stay the same across the 4 pages (24 knobs x 4), and 64 buttons.
I am not shelling out money for, or wiring, that many things let alone trying to figure out how to connect it all.
However, figuring out how to do 4 “pages” of controls is in the cards, I think.
I grabbed your axo patch and loaded it up to play around. I get an error when I try to go Live: region 'SRAM' overflowed by 1744 bytes which I think just means it’s out of memory (I’ve never actually maxed it out before). I seem to remember you said you were tight or over on memory when you were working on it. Any suggestions?
Same thing, still over by 1744 bytes. I just deleted the reverb and delay and it loads fine (nothing specific about those, just trying to bring the size down and it was easy to route). So either I have less RAM than you (different board revision maybe?) or there’s something funky happening. I don’t have an SD-card in it, though I can’t imagine that’d make a difference. I may poke at it some this weekend, but the core of the seems to be working fine. I’ll just run it through an external reverb/delay to get the jist.
Appreciate you checking, though. I haven’t done much besides turn it on but it seems really cool.
EDIT I assume your Axoloti board has the latest firmware? If it’s different from the one mine has maybe that’s why you’re running out of space sooner? I’m just spitballing here, I saw someone mentioned about an AxOwl firmware how much space various things take up
Owl patches can be made with PD, Max Gen, C++, FAUST, some other stuff I can’t remember. Might be interesting… I have four of the damned boards lol, though one is MIA.
Everything I’m running is the ‘latest’ from the Axoloti github. That’s 1.0.12.2 of the software, and it looks like 1.0.0.1 of the firmware according to the console output when I connect. Strangely, the Axoloti software sees the board just fine but the Ksoloti software (which as I understand it is supposed to be backwards-compatible) doesn’t. I even tried flashing the board to Ksoloti’s legacy firmware and the software still didn’t see it.
It’s an interesting problem but one I’m more curious than fussed about. Everything seems to work fine on all my patches and yours if I remove the delay and/or reverb. I’m not sure if I’m missing any major functionality not using Ksoloti software but I guess if it ain’t broke, don’t fix it?
I used the Ksoloti software in Legacy mode for mine, and firmware 1.0.0.1, what a weird issue hehe.
I finally just finished my Adafruit “HELLA Untztrument” and have discovered the LEDs are on or off, no PWM/dimming. Oof, oh well. I did finish it lol. Fuck Adafruit for using f’ing flathead screws, and the acrylic enclosure is a miserable disaster to line everything up just so and tbh it’s still not quite right
I feel your pain. All my MIDI controller test stuff is “out for delivery”, but it’s about 50/50 whether I get a Sunday delivery since I’m way out in the boonies and they shove me to Monday unless my neighbors are getting deliveries too. Ah well, I guess it beats not getting it at all.
And it ends up I fucked up anyway – grabbed the first and cheapest ESP32 boards on Amazon (ESP-WROOM-32), but after doing more research and prelim coding found out they don’t support USB-OTG, which is basically what enables HID, ie enables it to be used as a standalone MIDI host. Analogous to having to use all the Hairless MIDI extra program crap with the ATMega 328s whereas the 32u4s work out of the box. It looks like the S2 and S3 boards will work and are only about $1.50/ea more. Return and reorder, I guess.
It’s off on mine. I’m really convinced this is a mismatch between using the old Axoloti github stuff vs the Ksoloti, probably the toolchain/compiler like he mentioned. I think it’s basically the same code but improvements in both the src and the compiler options have made it a tad bit smaller in the intervening years. I may look at getting things running with the Ksoloti packages, though I’m not seeing a ton of info on how to do it so it’ll take some playing around.
I think I finally understand now XD. You’re using the Axoloti patcher from:
and I’m using the Ksoloti patcher in Legacy/Axoloti Mode. I think?
Got my pots, and exploring the GPIO of the Axoloti Core it looks like the dude made a 15 knob control system because that’s all the analog IO you get on the board. A handful of those can also be digital IO. Analog pins are PA0-PA7, PB0 and PB1, PC0-PC4, and those are labeled on the model’s lid piece. The Analog input module only has those as options. Digitals are PA0-PA7, PB0-PB1 and PB6-PB9, and PC0-C4, so if I use all the analog IO I have 5 digital-only pins to use. Looks like PB8 is also SDA and PB9 is SCL for an I2C bus. There’s a module for using them with 128x64 OLEDs, and I have one that even has the SS1106 but mine is SPI. Bummer XD. I can config an SPI interface but that uses up pins PA4-PA7 oh and mine is 5V and not 3.3V, at least
I definitely have a lot better of an idea of what I’m working with on the board, now. Other than this mystery 7 pin header with no labels. (the schematic labels it as an SPI interface, and it might be for the USB port but not 100% on that). Thankfully Ksoloti has a backup of the old Axoloti forums, maybe I can find something (I can’t, the search doesn’t work. oof). I might even be able to disable the JTAG/debug port(s) and gain back some GPIO by the looks of it (I’d have to modify the patcher object to use the pins, but that should be easy… allegedly)
OOF. Good to know, I had a 3 pack of 38 pin ESP32s with USB C on my wishlist but they aren’t S2 or better. Bluetooth HID is possible on the WROOM32 but… yeah. I found a three pack of S3 dev boards for $20
I’m also realizing that adding GPIO controls is going to eat into sram space and so I’ll probably have to kill off one of the sound engines if I want a fully stand-alone box
BUT, this doesn’t have to be the Horrorscape Engine. It can also just be a generic box for any number of things, too.
So I removed the long-delay from the patch and added a stereo tape delay with more controls and the sram size VASTLY DECREASED lol. I’m talking 244863 down to 365712 o.O admittedly this tape delay is kinda boring and barely seems to do anythjing. The “CC Spike” buttons don’t do anything to the sound, before it made all kinds of delightful glitches. Both modules are a patch within a patch sort of thing. Weird.
You might be able to keep the del/rev if you delete the MIDI Monitor device that’s near them. Turns out it’s for logging data only and hogs a lot of space in sram. It says to not use it in a live patch lol. Don’t blame me, I didn’t put it there >_>
EDIT apparently the “labels” also take up a lot of space, I was told. I don’t know the SRAM use yet on the Horrorscape Machine, but the axp file is down to 37KB from 54KB lol. I added the long-delay back after changing its delay time from TWENTY ONE SECONDS down to 5.x seconds, and now I have the more fun delay back lol
this guy has a tutorial and example code for running 64 pots off an Arduino Nano (TL;DR - he’s using 16 pin muxes x 4).
related to live-coding, I’m reminded that I discovered Strudel.cc and then… didn’t really go anywhere with it. I think making a “cyber deck” for it would be kinda cool but at the same time I’d want to do more than shove a Raspberry Pi into a toolbox
I watched that a couple nights ago. Definitely answered that question for me. It was about what I figured - you could probably do even more if you had the inputs for it. Analog is cheap, comparatively. Digital encoders is where I start to wonder about the limit.
This thing is the bee’s knees for building a MIDI controller. Handles all the MIDI over USB (also includes a great table in the docs as to which boards will do what) and abstracts a lot of the setup and config. The docs are really educational.
I still want to do some bare metal implementation, both as a learning experience and A/B comparison with things like that library, but it makes bootstrapping a home rolled controller stupid easy.
I stripped every last vestige of Axoloti/Ksoloti from my system (saved the patches, obviously), rebuilt drivers, installed Ksoloti 1.0.whatever, set it to Legacy and it recognized my board after a firmware flash. Your patch loaded right up into Live mode without a problem. Huzzah! No clue what was wrong to begin with, but sometimes starting over is the play.
Sounds like you’re making serious progress with the MIDI controls and tightening up the patch. I’d read the same thing about labels and started to mess with it before just deciding to kill the delay. Of course now I don’t have to, so I may look at dropping the delay time down like you suggested.
My mis-ordered ESPs showed up, beat all to shit. Boards stuck in foam, in a static bag, all three in a plastic bag, then in a soft mailer. Looks like plenty of people between there and here stuffed them in bags and boxes and dropped heavy things on them – the pins on one board were pressed through both its individual bag and the larger bag and bent like staples. Oh well, I was going to return them anyway.
I ended up ordering basically what you linked. There’s a ton of options and they all seem to be the same (N16R8), a knock-off chip on a knock-off board with a slightly different layout from official and zero docs. Luckily the interwebs have cottoned to the differences and you can find the altered pinouts online. I think it’ll do what I need it to, excited to give it a try for $6/ea.
when I get home I’m planning to upload it again to the folder. I just wanted to run it on hardware first
oof about the boards. my pots were thrown into a bag and half of the pins were bent, too XD
I’m pretty sure you can purpose each core of an ESP32 to do a different task, and one of them handles wifi/bluetooth exclusively if you use them.
EDIT speaking of those pots, they are labeled 1M instead of 10K which is kind of fine, since on that vid the guy used 100k to draw less amperes so 10k wasn’t an amazing choice anyway I suppose; Ohm’s Law bitches lol