|
Post by duddex on Oct 3, 2022 9:21:48 GMT
Last week rodney (Earcandles) posted a link to a ESP32-BLE-MIDI library on discord. I used this library to create a ESP32-BLEMIDI2CV module. The module receives MIDI data via Bluetooth which is converted into control voltage and gate information which can be used in the AEModular system. You can find my code on github ( github.com/duddex/ESP32-BLEMIDI2CV). I made a short video to show you how it works: The library from Maxime ANDRÉ ( github.com/max22-/ESP32-BLE-MIDI) was easy to use and I mainly reused one of the examples from that library (Dump-Messages.ino). There are 2 x 8 bits DAC channels on the ESP32 to convert digital signals into analog voltage signal outputs. These are the DAC channels: DAC1 (GPIO25), DAC2 (GPIO26). This code receives MIDI data an converts the information into control voltage. Note on and note off information is sent to PIN32. Note information, velocity information and modwheel information is converted to CV and sent to PIN25 and PIN26. At the moment the ESP32-BLEMIDI2CV code supports two modes: Mode 1: * Note on/Note off is sent to PIN32 (Note on: HIGH, Note off, LOW) * Note information is converted to control voltage and sent to PIN25 * Velocity information is converted to control voltage and sent to PIN26 Mode 2: * Note on/Note off is sent to PIN32 (Note on: HIGH, Note off, LOW) * Note information is converted to control voltage and sent to PIN25 * Modwheel information is converted to control voltage and sent to PIN26 The potentiometer is connected to PIN34 to switch between two modes. Turn the potentiometer to the left for mode1. Turn it to the right for mode2. I connected PIN25 to CV1 in of the 2OSC/d module. PIN26 is connected to CV1 of the MS20 filter. PIN32 is connected to GT1 of the 2ENV module. The latency is quite low it is very responsive. In the video I use an iPhone as a MIDI controller. But it also worked with an Android phone using MIDI BLE Connect. Pitch bend is not yet implemented. This should be straightforward to do. I just didn't have the time yet.
|
|
|
Post by duddex on Oct 3, 2022 9:22:21 GMT
Some questions for you:
Do you have any other ideas for "modes" which I could implement? One idea I have, is to send more trigger information (for example for drums).
And as you can see in the video I used Moog synthesizer Apps as MIDI controller. Can you recommend any "dedicated" MIDI controller or sequencer apps for iOS or Android?
|
|
|
Post by rodney on Oct 3, 2022 16:19:01 GMT
Fantastic! I vaguely remember trying a iOS sequencer called Phaedra that seemed nice. I will check again as I am messing with iPad music a bit more lately.
|
|
|
Post by slowscape on Oct 3, 2022 16:33:22 GMT
Yesssss! I've been waiting for anyone to make a midi module, mostly to buy, but this one seems easy because the dac is built in, and I have an extra esp32 laying around!
So from the sounds of it, I can get two CV channels and probably as many gates as there are digital pins?
|
|
|
Post by duddex on Oct 4, 2022 5:21:09 GMT
Exactly. ESP32 has two 8-bit DAC (digital to analog converter) channels, connected to GPIO25 (Channel 1) and GPIO26 (Channel 2). I have to admit that I haven't figured out yet, how many digital pins are available. This probably also depends on the model of the ESP32 board.
|
|
|
Post by duddex on Oct 4, 2022 5:23:29 GMT
I found an old (> 10 years) article about the Phaedra app. It seems that this app is not available in the app store anymore. It looks quite interesting. Something like this would be great. I keep on searching and let you know if I found something
|
|
|
Post by duddex on Oct 16, 2022 9:20:09 GMT
The module also works with Windows First add the ESP32 as a Bluetooth device You need loopMidi and Midiberry. Set the loopMidi port as input and the ESP32 as output Here I use Propellerhead Reason to send MIDI notes via the loopMidi port to my AEmodular system
|
|
|
Post by dizzeesatchel on Oct 16, 2022 15:43:29 GMT
Interested in this...although the choice of different ESP32 boards is a little baffling and the ones i've seen want to be powered by USB or battery rather than through the pins, which gets in the way of making one in a module format
Assume that as with most microcontrollers the output is limited to max 3.3v? And we could use a standard op-amp arrangement to increase this?
|
|
|
Post by pt3r on Oct 16, 2022 20:22:43 GMT
you can use Bi-directional logic level converter scaling which whereby you can go back forth between 3.3 and 5v or do a mosfet scaling which can also work bidirectionally.
|
|
|
Post by duddex on Oct 17, 2022 6:38:10 GMT
You are right - having only an output range up to 3.3v is a bit of a disadvantage. But the advantage of using the ESP32 without additional amps etc is, that you only need the ESP32. For now, I can live with this limitation
I want to take a close look at the MCP4728. This is a 12-Bit Voltage Output DAC with four buffered outputs. Together with the two DACs on the ESP32 that would give me 6 channels. But then of course I have an additional component and not the ESP32 standalone anymore
|
|
|
Post by duddex on Oct 17, 2022 6:41:19 GMT
For power supply (5V) I plan to use a cable like this and get the power from the AEModular
|
|
|
Post by MikMo on Oct 17, 2022 10:03:00 GMT
Robert chose not to have bluetooth in the TBD module, because of excessive current draw. Would that not be the same with an ESP32 module with bluetooth enabled ?
Currentdraw should probablly be meassured or estimated before mounting such a device in an AE rack, or otherwise powewring it from the AE 5V.
|
|
|
Post by dizzeesatchel on Oct 17, 2022 10:03:42 GMT
Yeah i'm interested in picking this up and running with it, adding a bolt-on DAC for extra CV channels. Regarding power: one of the more promising boards i looked at - i think the Adafruit Feather? - mentioned in the specs that it was possible to power by sending 5v and GND to the USB and GND pins respectively on the board. They don't recommend it but that seems to be because it opens the possibility of back-powering anything you connected to the USB socket while it's being bus powered. I wouldn't be wanting to do that anyway though, sooooo ....... edit: although MikMo raises a good point about the current draw! edit 2: ah actually it was wi-fi which was dropped from the TBD, maybe Bluetooth / Bluetooth LE is still an option
|
|
|
Post by duddex on Oct 18, 2022 18:48:50 GMT
That's a good point. I didn't think about current draw at all. I am not a electric or electronic expert. One of my colleagues at work is more experienced. I will ask him to help me measuring
|
|
|
Post by dizzeesatchel on Oct 19, 2022 9:53:05 GMT
Thinking of trying this out with the TinyS3It's super small (potentially fits in 1u), low power, can officially power it with 5v to the pins, has bluetooth LE, I2C and enough GPIO. No onboard DAC but could pair it with that quad 12-bit DAC. From what i can figure out the current draw should be about in line with TW modules using similar microcontrollers, eg TBD uses an ESP32 and draws 80ma, Cirrus draws 90ma I think.
|
|
|
Post by rodney on Oct 22, 2022 18:09:38 GMT
Thinking of trying this out with the TinyS3It's super small (potentially fits in 1u), low power, can officially power it with 5v to the pins, has bluetooth LE, I2C and enough GPIO. No onboard DAC but could pair it with that quad 12-bit DAC. From what i can figure out the current draw should be about in line with TW modules using similar microcontrollers, eg TBD uses an ESP32 and draws 80ma, Cirrus draws 90ma I think. I think the ESP32-S3 can also act as a USB device (older ESP32 cannot), including as host, so it might be able to accept USB MIDI as well as Bluetooth.
|
|
|
Post by dizzeesatchel on Oct 23, 2022 16:58:25 GMT
Up & running, after some faffing about how to connect and upload to an ESP32 board (i'm used to Pi Pico, which seems less mysterious somehow). I actually went to bed last night thinking i might have bricked it within a couple hours of opening the package, but perseverance paid off.
duddex 's code won't work directly, i imagine because it refers to an onboard DAC, which this particular board doesn't have. So next step is to figure out how to interface with the Quad DAC and retool the code a little to match. But the dump-messages example from the library works fine, and i managed to connect to it from another computer and successfully send midi messages from Orca
And yeah both these boards are tiiiiiiiny (the ESP32 gets pretty warm though, which makes me worry about power consumption a bit)
|
|
|
Post by rodney on Oct 23, 2022 23:28:15 GMT
Robert chose not to have bluetooth in the TBD module, because of excessive current draw. Would that not be the same with an ESP32 module with bluetooth enabled ? Current draw should probably be measured or estimated before mounting such a device in an AE rack, or otherwise powewring it from the AE 5V. It's possible that the two more recent generation ESP32s have more efficient WiFi and Bluetooth, but I'm just speculating here.
The trouble with their products is that it can take a while for English documentation to catch up with the Chinese docs.
The ESP8266 was mostly documented by impatient users with meters and scopes.
|
|
|
Post by rodney on Oct 24, 2022 1:39:00 GMT
a brief comparison between the current models of ESP32
|
|
|
Post by dizzeesatchel on Oct 25, 2022 20:55:18 GMT
Just gates so far, but working fine with no real noticeable latency. My use case would probably be sequencing rather than performing (hello Orca) so a tiny bit of latency wouldn't be the end of the world, but all good so far. Easy to connect to iPad, sending some clock divisions from miRack. Next up, seeing how that DAC performs I've underclocked the board a bit, hopefully will help with power draw. Also both these little boards run off 5v, so I don't think we need to worry about adding op-amps, but need to do the measurements to make sure.
|
|
|
Post by duddex on Oct 26, 2022 6:39:44 GMT
Yes. This library looks very interesting. I will take a look at the examples
|
|
|
Post by dizzeesatchel on Nov 2, 2022 14:05:16 GMT
Getting somewhere slowly and learning how to code for Arduino as I go
I'm just using one gate and one CV output here, but they're all connected. I don't think my way of assigning CV values to different outputs is the best (things go wrong when notes happen simultaneously, although gates seem to work fine?) so still need to look into that. Anyway it's nice to see it being powered from the rack without noticeable issues. I measured the current draw and it hovers around 100ma which is only a little more than Cirrus, but still, will try to reduce that.
This works great from iPad but the tempo isn't nearly as tight when sending midi from my laptop - but at this point i'm pretty sure that's a Linux thing. Need to solve it though because my ideal use case is sending sequences from Orca. Ordered a DIY module from TW so hopefully most bugs will be ironed out by the time that arrives
I looked at USB midi as well, but it seems to be poorly supported on this particular board. Planning to keep my version pretty dedicated to one purpose and not have any controls or other modes - just a sleek, mysterious black panel Although i was overly pleased with myself for using the onboard neopixel as a connected/disconnected indicator....
(oh yeah, and here i'm just using my old favourite the MS20 filter for sine waves. Gates are triggering an envelope from o_C)
|
|
|
Post by rodney on Nov 11, 2022 11:09:01 GMT
That is so cool! I have an old iPad3 so it would be great to have it revived as a sequencer (If there is anything out there that still runs on it!)
|
|
|
Post by dizzeesatchel on Nov 13, 2022 0:17:49 GMT
I'm getting a ton of noise when using the headphone out on the POWER module - i'm guessing that circuit is just super prone to interference or something? I wonder what it would be like with the proper HPAMP module (i don't have it unfortunately...). The one in the POWER module does seem a bit like a bonus feature which is a tad bit noisy at the best of times tbh.
When i use the standard line out there's no audible noise whatsoever, so that's good at least. But it's going to be annoying if i ever want to use that headphone out and this midi thing is connected to the bus. I guess one solution would be to build in an on/off switch which just disconnects that single module when not in use? I have my DIY kit now so quite keen to get solderin'
|
|