Code Monkey home page Code Monkey logo

mobile-fpga-bluetooth-midi's Introduction

mobile-fpga-bluetooth-midi

This is an interactive MIDI demo using Bluetooth (BLE-MIDI), a mobile app (iOS + SwiftUI), an ESP32 (running MicroPython) and an FPGA (implementing a Verilog design).

The FPGA board used in this demo is the ULX3S which contains the ESP32 and FPGA. The FPGA is used to implement a multichannel ADPCM decoder/mixer, which outputs both analog and digital audio from the 3.5mm headphone jack. There is additional logic to control the ADPCM core over Bluetooth using an SPI interface provided by the ESP32. There is also an integrated tracker that automatically plays a song while sending corresponding MIDI messages for display on the mobile app.

The ESP32 implements a BLE peripheral which sends and receives messages using a custom iOS app. This mobile app provides a piano-like interface for the user to send MIDI messages for playback using the FPGA, while also displaying notes which were triggered by the FPGA itself.

Demo GIF Demo GIF 2

Prerequisites

FPGA and ESP32 (Server)

Mobile app (Client)

  • Xcode 12.0.0 or newer
  • iPhone / iPad running iOS14 or newer

The client provides a basic interface to a BLE-MIDI peripheral such as the one implemented by the ESP32 software in this project. It doesn't implement the full BLE-MIDI spec, but other MIDI software with Bluetooth connectivity can be used instead.

Usage

Submodules

An FPGA project containing the ADPCM core is in a submodule and must be pulled first.

git submodule update --init

Flashing FPGA bitstream

The rtl/ics-adpcm/demo directory contains the sources to build the FPGA bitstream. This includes a UART passthrough for the ESP32 for console interaction.

The Makefile must be configured according to the size of the ECP5. Default is 85F.

cd rtl/ics-adpcm/demo
make ulx3s_prog

ESP32 configuration

It's assumed that MicroPython has already been flashed to the ESP32 as mentioned above.

The files in the esp32/ directory need to be copied to the ESP32. The included main.py file is automatically run by MicroPython on startup. If this isn't wanted, it can be renamed and manually started with an import statement in the REPL. When the ESP32 program starts, it should print regular status updates.

  • webrepl can be used to copy files to upload files remotely.
  • rshell can be used to upload files over the console.

The ESP32 variant used on the test board is WROOM, which has limited RAM but had no apparent issues running the software.

Mobile app

Once the FPGA has been configured and the ESP32 is running, the included app in the iOS/ directory can connect to the ESP32 by tapping the "Scan" button.

Controls

After connecting with Bluetooth, both the mobile app and the buttons on the FPGA can be used to control playback of individual notes.

Details on how to control the ADPCM demo project from the FPGA can be found here.

mobile-fpga-bluetooth-midi's People

Contributors

dan-rodrigues avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emard chaostong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.