Loopy Pro: Create music, your way.

What is Loopy Pro?Loopy Pro is a powerful, flexible, and intuitive live looper, sampler, clip launcher and DAW for iPhone and iPad. At its core, it allows you to record and layer sounds in real-time to create complex musical arrangements. But it doesn’t stop there—Loopy Pro offers advanced tools to customize your workflow, build dynamic performance setups, and create a seamless connection between instruments, effects, and external gear.

Use it for live looping, sequencing, arranging, mixing, and much more. Whether you're a live performer, a producer, or just experimenting with sound, Loopy Pro helps you take control of your creative process.

Download on the App Store

Loopy Pro is your all-in-one musical toolkit. Try it for free today.

diy esp32 ble controller questions

anybody have any experience with building an esp32 controller?
i am kind of lost. i have made it connect and looks like a ble midi controller in Aum and is sending a signal. but when i check it on a midi monitor app. it is not midi notes or cc information. it’s just a bunch of data like bytes and other random info. it’s very odd.
if anybody can help, or has some very basic code that works, i’d love to see it and compare what i’m doing wrong. thanks

Comments

  • edited October 17

    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

  • @rheslip said:
    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

    oh awesome ! thanks so much.

  • @rheslip said:
    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

    cool ipad to esp32? sounds interesting. where you controlling lights? or controlling other synths?

  • @rheslip said:
    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

    do you have a link to you github stuff?

  • wimwim
    edited October 17

    Post your code? Midi monitor output?

    Hint: if you place three back-ticks ( ` ) in a row on a line by themselves before and after the code, it’ll keep its formatting.

  • Yes @eross, a screenshot of your MIDI monitor output would help.

  • @rs2000 said:
    Yes @eross, a screenshot of your MIDI monitor output would help.

  • edited October 17

    include <NimBLEDevice.h>

    define MIDI_SERVICE_UUID "03B80E5A-EDE8-4B33-A751-6CE34EC4C700"

    define MIDI_CHAR_UUID "7772E5DB-3868-4112-A1A9-F2669D106BF3"

    const int BUTTON_PIN = 13; // Button pin
    bool deviceConnected = false;
    NimBLECharacteristic* midiChar;

    class MyServerCallbacks : public NimBLEServerCallbacks {
    void onConnect(NimBLEServer* pServer) override {
    Serial.println("Device connected!");
    deviceConnected = true;
    }

    void onDisconnect(NimBLEServer* pServer) override {
        Serial.println("Device disconnected!");
        deviceConnected = false;
        NimBLEDevice::startAdvertising();  // Restart advertising
        Serial.println("Advertising restarted");
    }
    

    };

    void sendMidiNoteOn() {
    uint8_t midiPacket[] = { 0x90, 60, 127 }; // Note On message (channel 1, note 60, velocity 127)
    Serial.println("Attempting to send Note On...");
    if (midiChar) {
    midiChar->notify(midiPacket, sizeof(midiPacket));
    Serial.println("Note On sent.");
    } else {
    Serial.println("MIDI Characteristic is not initialized.");
    }
    }

    void sendMidiNoteOff() {
    uint8_t midiPacket[] = { 0x80, 60, 0 }; // Note Off message (channel 1, note 60, velocity 0)
    Serial.println("Attempting to send Note Off...");
    if (midiChar) {
    midiChar->notify(midiPacket, sizeof(midiPacket));
    Serial.println("Note Off sent.");
    } else {
    Serial.println("MIDI Characteristic is not initialized.");
    }
    }

    void setup() {
    Serial.begin(115200); // Initialize Serial Monitor
    while (!Serial) { }

    NimBLEDevice::init("ESP32 BLE MIDI Controller"); // Device name
    NimBLEServer* pServer = NimBLEDevice::createServer();
    pServer->setCallbacks(new MyServerCallbacks());
    
    NimBLEService* pService = pServer->createService(MIDI_SERVICE_UUID);
    midiChar = pService->createCharacteristic(MIDI_CHAR_UUID, NIMBLE_PROPERTY::NOTIFY | NIMBLE_PROPERTY::WRITE_NR);
    pService->start();
    
    NimBLEAdvertising* pAdvertising = NimBLEDevice::getAdvertising();
    pAdvertising->addServiceUUID(MIDI_SERVICE_UUID);
    pAdvertising->setMinPreferred(0x30); // Set preferred connection intervals
    pAdvertising->setMaxPreferred(0x60);
    NimBLEDevice::startAdvertising();
    
    Serial.println("BLE MIDI Controller Initialized and Advertising");
    pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input
    

    }

    void loop() {
    static bool lastButtonState = LOW;
    bool currentButtonState = digitalRead(BUTTON_PIN) == LOW; // Read button state

    // Check for button state change
    if (currentButtonState != lastButtonState) {
        delay(50); // Simple debounce delay
        lastButtonState = currentButtonState; // Update last button state
        if (currentButtonState) {
            Serial.println("Button pressed.");
            if (deviceConnected) {
                sendMidiNoteOn(); // Send Note On when button pressed
            }
        } else {
            Serial.println("Button released.");
            if (deviceConnected) {
                sendMidiNoteOff(); // Send Note Off when button released
            }
        }
    }
    

    }

  • Oh @eross, are you sure you're sending your MIDI data at the correct clock rate?

  • @rs2000 said:
    Oh @eross, are you sure you're sending your MIDI data at the correct clock rate?

    i’m not sure. ive just kind of pieced together code. what clock rate should it be at?
    i may try using a different library maybe it’s just a compatability issue

  • @eross said:

    @rheslip said:
    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

    do you have a link to you github stuff?

    @eross said:

    @rheslip said:
    There is an older project called Pedalino that has a lot of useful code in it.

    https://github.com/alf45tar/Pedalino

    Not sure if it still works with the newer SDK but I found it very useful to get my own BLE projects working.

    My stuff is on github/rheslip but I was doing midi from the iPad to the ESP32.

    do you have a link to you github stuff?

    https://github.com/rheslip?tab=repositories

    I designed a Eurorack module called Motivation Radio based on the ESP32. The BLE code on GitHub takes MIDi from the iPad and converts it to CV for the rack. I think it does other stuff too - been a long time since I used it.

  • Hi @eross . Your screenshot shows 0x3C in a 2-byte message. Now, the Note On message is 3 bytes, and 0x3C = 60, so it looks like the receiver is not seeing the first byte.

  • i switched ble libraries , and all is working perfectly now. thanks guys for the help

  • @eross said:
    i switched ble libraries , and all is working perfectly now. thanks guys for the help

    Which one works for you now?

  • include <Arduino.h>

    include <BLEMidi.h>

    these are the two that work. i had to delete a few other libraries because they had the same file names within libraries, and confusion arduino ide.
    working good now

  • @eross Which library is BLEMidi.h from?
    Thanks!

  • @rs2000 said:
    @eross Which library is BLEMidi.h from?
    Thanks!


    here are all the libraries. i think the esp32ble is where that file is from

  • Nice. A few years back I made a whole esp32 based midi controller only to find out there was no BLE midi libraries for it. I ended up switching to a different board, I should be able to make use of that unused board now.

  • Thank you @eross. I have a few ESP32 boards here, waiting for a better time :)

  • @wim said:
    Nice. A few years back I made a whole esp32 based midi controller only to find out there was no BLE midi libraries for it. I ended up switching to a different board, I should be able to make use of that unused board now.

    Yeah. That's the reason I picked up the Raspberry Pi for one of my projects a few years back, before the pandemic. Maybe this also explains why there have been so many new MIDI controllers coming out in the past few years.

    Something like the M-Wave chocolate pedal, and the wireless Bluetooth keyboards and mixers I've been seeing lately would have been more expensive than they are priced nowadays.

    Super thankful for competition. But it does make it harder to stand out. I'm perfectly happy with my Novation Launchkey Mini mk3 because they actually created an application that works really well with it, and sounds great (Ampify Groovebox)

  • @seonnthaproducer said:

    @wim said:
    Nice. A few years back I made a whole esp32 based midi controller only to find out there was no BLE midi libraries for it. I ended up switching to a different board, I should be able to make use of that unused board now.

    Yeah. That's the reason I picked up the Raspberry Pi for one of my projects a few years back, before the pandemic. Maybe this also explains why there have been so many new MIDI controllers coming out in the past few years.

    Something like the M-Wave chocolate pedal, and the wireless Bluetooth keyboards and mixers I've been seeing lately would have been more expensive than they are priced nowadays.

    Super thankful for competition. But it does make it harder to stand out. I'm perfectly happy with my Novation Launchkey Mini mk3 because they actually created an application that works really well with it, and sounds great (Ampify Groovebox)

    how do you like the raspberry pi. ?

  • edited October 20

    @eross said:

    @seonnthaproducer said:

    @wim said:
    Nice. A few years back I made a whole esp32 based midi controller only to find out there was no BLE midi libraries for it. I ended up switching to a different board, I should be able to make use of that unused board now.

    Yeah. That's the reason I picked up the Raspberry Pi for one of my projects a few years back, before the pandemic. Maybe this also explains why there have been so many new MIDI controllers coming out in the past few years.

    Something like the M-Wave chocolate pedal, and the wireless Bluetooth keyboards and mixers I've been seeing lately would have been more expensive than they are priced nowadays.

    Super thankful for competition. But it does make it harder to stand out. I'm perfectly happy with my Novation Launchkey Mini mk3 because they actually created an application that works really well with it, and sounds great (Ampify Groovebox)

    how do you like the raspberry pi. ?

    It’s really great. I have the 4th generation of it.
    But it’s a different experience from iOS. You’re definitely better getting a laptop than a Raspberry pi for advanced configurations, but for lightweight applications, it’s solid.

    I do see the ultimate combination as a powerful Windows laptop + iPad. But that’s a talk for another day.

  • wimwim
    edited October 22

    I don't use my Raspberry Pi 4 (4gb) for music, but I do use it for a lot.

    • Running a PiHole Ad Blocker for the household.
    • Serving a collection of old music recordings from the 1890's though 1950's that my dad put together in his later years: https://oldmusic.freeddns.org.
    • Serving a huge collection of old time radio recordings my dad also put together: https://otr.warehouse13.freeddns.org.
    • Serving a non-public collection of my own CD's that were sitting unused in a box in my garage.
    • Ripping all those CDs for archiving purposes and for the above server.
    • Hosting some private web pages and a wiki for my own use
    • Running a database server backend for the wiki
    • A reverse proxy for https and added security for the exposed web services
    • A home DLNA server for my old DVDs, also ripped on the Pi
    • A Samba file server for sharing files among devices at home.
    • A client that updates my Dynamic DNS entries if our internet connection is interrupted.
    • All but the last two are in nicely portable Docker containers.

    All without the thing even breaking a sweat. It's currently running through normalizing the old time radio collection without any degradation in the above services.

    I also have a Raspberry Pi Zero W that can serve as a BLE midi bridge to connect USB MIDI devices via Bluetooth to the iPad. Another can serve as an Octoprint server for my 3d printer. I don't use either of those though.

    As for music, I find Arduinos to work better. Pi's don't do super great where it comes to the need for accurate timing. I've been tempted to make a Zynthian box, but haven't really felt like buying a DAC for the Raspberry Pi. It'd be a fun project, but I doubt I'd end up using it much.

    I'm off of making controllers for now though. With all the quality low-cost controllers available right now, it's really not cost effective to make my own.

  • Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

  • @wim said:
    Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

    Wait… there’s a rasp…oala? Koalaspi? Man this seems such a great way to waste a weekend. I have all the parts already. Even a arduino for the controller part. Thanks for bringing it to my attention, can’t believe I never heard of it before

  • that sounds pretty interesting koala on raspberry pi.

  • @pedro said:

    @wim said:
    Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

    Wait… there’s a rasp…oala? Koalaspi? Man this seems such a great way to waste a weekend. I have all the parts already. Even a arduino for the controller part. Thanks for bringing it to my attention, can’t believe I never heard of it before

    It's recent, and unpublicized except for on the discord channel as far as I know. I fired it up real quick on a Virtual Box Linux VM. It seemed to work, but the fan on my MacBook started to go crazy, so I figured running it in the VM wasn't a real great idea.

  • @wim said:

    @pedro said:

    @wim said:
    Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

    Wait… there’s a rasp…oala? Koalaspi? Man this seems such a great way to waste a weekend. I have all the parts already. Even a arduino for the controller part. Thanks for bringing it to my attention, can’t believe I never heard of it before

    It's recent, and unpublicized except for on the discord channel as far as I know. I fired it up real quick on a Virtual Box Linux VM. It seemed to work, but the fan on my MacBook started to go crazy, so I figured running it in the VM wasn't a real great idea.

    Intel code running on M1/M2 maybe?

  • @rs2000 said:

    @wim said:

    @pedro said:

    @wim said:
    Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

    Wait… there’s a rasp…oala? Koalaspi? Man this seems such a great way to waste a weekend. I have all the parts already. Even a arduino for the controller part. Thanks for bringing it to my attention, can’t believe I never heard of it before

    It's recent, and unpublicized except for on the discord channel as far as I know. I fired it up real quick on a Virtual Box Linux VM. It seemed to work, but the fan on my MacBook started to go crazy, so I figured running it in the VM wasn't a real great idea.

    Intel code running on M1/M2 maybe?

    Nope. It’s an Intel Mac.
    But there’s a lot going on there. It’s a virtual intel box running Linux on MacOS machine, and trying to hijack/use the audio system. It’s not surprising.

    Koala standalone works great directly on MacOS (Intel and Apple Silicon). Trying it on VirtualBox was just for fun.

  • @wim said:

    @rs2000 said:

    @wim said:

    @pedro said:

    @wim said:
    Huh. Koala Sampler on Linux / Raspberry Pi ...

    https://www.elf-audio.com/koala/linux.php

    Wait… there’s a rasp…oala? Koalaspi? Man this seems such a great way to waste a weekend. I have all the parts already. Even a arduino for the controller part. Thanks for bringing it to my attention, can’t believe I never heard of it before

    It's recent, and unpublicized except for on the discord channel as far as I know. I fired it up real quick on a Virtual Box Linux VM. It seemed to work, but the fan on my MacBook started to go crazy, so I figured running it in the VM wasn't a real great idea.

    Intel code running on M1/M2 maybe?

    Nope. It’s an Intel Mac.
    But there’s a lot going on there. It’s a virtual intel box running Linux on MacOS machine, and trying to hijack/use the audio system. It’s not surprising.

    Koala standalone works great directly on MacOS (Intel and Apple Silicon). Trying it on VirtualBox was just for fun.

    Interesting, thanks.
    I've mainly used VMware Workstation (Win) and Fusion (Mac) in the past and apart from spending some time to find the best audio drivers for USB audio interfaces and let the VM talk to USB directly, things went quite well here.

Sign In or Register to comment.