Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
381 changes: 377 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,378 @@
# M5Stack-MIDI-Module
M5Stack-MIDI-Module
ArduinoのスケッチはMIDIライブラリが必要です。
https://playground.arduino.cc/Main/MIDILibrary
m5stackmidi1.6mm.stlとm5stackmidiDIN5.stlはY軸を180度反転させた方が綺麗にプリントできます。

[English](#english) | [日本語](#日本語) | [中文](#中文) | [Español](#español) | [한국어](#한국어)

---

## English

> *Translated by Natsuko Toda Style™ - "I'll be back" means "Also meet again"*

Arduino sketch pictures and 3D-printed box files (STL) for the M5Stack MIDI Module. This is 1.21 jigowatts of MIDI power!

### What's This About

This repository is containing Arduino sketch picture samples for the [necobit M5Stack MIDI Module](https://necobit.com/denshi/m5-midi-module2/). It is including MIDI send/receive tests, SMF file playback, Blue Teeth MIDI bridge, and synthesizer experiments. You know what I mean?

### Hardware You Must Have

- M5Stack (Basic, Gray, Fire, and so on)
- M5Stack MIDI Module (made by necobit company)
- SD Card (for the SMF Player thing)
- MIDI-compatible machines (synthesizers, sound modules, and others)

### Required Book Houses (Libraries)

You must install these book houses in Arduino IDE:

| Book House | What It Does | How to Install |
|------------|--------------|----------------|
| [Arduino MIDI Book House](https://github.com/FortySevenEffects/arduino_midi_library) | MIDI talking | Search "MIDI Library" in Book House Manager |
| [M5Stack Book House](https://github.com/m5stack/M5Stack) | M5Stack controlling | Search "M5Stack" in Book House Manager |
| [LovyanGFX](https://github.com/lovyan03/LovyanGFX) | Fast picture drawing | Search "LovyanGFX" in Book House Manager |

### Folder Structure

```
M5Stack-MIDI-Module/
├── Arduino-IDE-Sketch/ # Arduino sketch pictures
│ ├── M5Stack_MIDI_T_test/ # MIDI transmitting test
│ ├── M5Stack_MIDI_R_test/ # MIDI receiving test
│ ├── M5Stack_MIDI_T_RndSeq/ # Random sequence transmitting
│ ├── M5Stack_SMF_Player/ # SMF (MIDI file) player machine
│ ├── BLE-LOCAL_MIDI_Translator/ # Blue Teeth MIDI to wire MIDI bridge
│ ├── M5Stack3VoiceSynth/ # 3-voice sound maker
│ ├── M5Stack5VoiceSynth/ # 5-voice sound maker
│ ├── 8bitNESSynthaudioout/ # 8-bit Family Computer style sound
│ ├── M5StackSimpleSampler/ # Simple sampler machine
│ ├── M5StackWavPlay/ # WAV file playing
│ ├── M5Stack_Gyrocontroller/ # Gyro MIDI controller thing
│ └── sync_test/ # Synchronization test
└── Case-3Ddata/ # 3D-printed box files (STL)
```

### How to Start This Thing

1. Open the Arduino IDE program
2. Install the required book houses
3. Connect your M5Stack to the computer machine
4. Set board to "M5Stack-Core-ESP32" (this is important!)
5. Open the sketch picture you want and upload it

### SMF Player Machine Usage

1. Save MIDI files as `playdat0.mid` to `playdat9.mid` on SD card
2. Put the SD card into M5Stack
3. Upload the sketch picture and run it
4. Button controls (very simple!):
- **Button B**: Play/Stop (like a music box)
- **Button C**: Skip to next music

### How to Connect

The MIDI module is using M5Stack's Serial2 (GPIO16/17). Don't forget this!

```
M5Stack GPIO16 (RX2) → MIDI Module MIDI IN
M5Stack GPIO17 (TX2) → MIDI Module MIDI OUT
```

Baud rate: 31250bps (This is MIDI standard speed)

### 3D-Printed Box

STL files are in the `Case-3Ddata/` folder. You can print them with your 3D printer machine!

**Printing advice:**
- `m5stackmidi1.6mm.stl` and `m5stackmidiDIN5.stl` will print more beautiful when **rotated 180° on the Y-axis**. Trust me on this one.

### Things That Don't Work Well

- SMF Player only works with Format 0/1 (sorry about that)
- Blue Teeth MIDI bridge only supports 3-byte MIDI messages (no SysEx, that's just how it is)
- Sound maker sketches are experimental (use at your own risk!)

---

## 日本語

M5Stack用MIDIモジュールのサンプルスケッチ集と3Dプリント用ケースデータ(STL)です。

### 概要

このリポジトリは、[necobit製 M5Stack用MIDIモジュール](https://necobit.com/denshi/m5-midi-module2/)を使用したArduinoスケッチのサンプル集です。MIDI送受信テスト、SMFファイル再生、BLE MIDIブリッジ、シンセサイザー実験などを含みます。

### 必要なハードウェア

- M5Stack(Basic, Gray, Fire など)
- M5Stack用MIDIモジュール(necobit製)
- SDカード(SMFプレイヤー使用時)
- MIDI対応機器(シンセサイザー、音源モジュールなど)

### 必要なライブラリ

以下のライブラリをArduino IDEにインストールしてください:

| ライブラリ | 用途 | インストール方法 |
|-----------|------|-----------------|
| [Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library) | MIDI通信 | ライブラリマネージャから「MIDI Library」で検索 |
| [M5Stack Library](https://github.com/m5stack/M5Stack) | M5Stack制御 | ライブラリマネージャから「M5Stack」で検索 |
| [LovyanGFX](https://github.com/lovyan03/LovyanGFX) | 高速画面描画(SMFプレイヤー用) | ライブラリマネージャから「LovyanGFX」で検索 |

### 使い方

1. Arduino IDEを開く
2. 必要なライブラリをインストール
3. M5Stackをコンピュータに接続
4. ボードを「M5Stack-Core-ESP32」に設定
5. 使用したいスケッチを開いて書き込み

### SMFプレイヤーの使い方

1. SDカードに `playdat0.mid` 〜 `playdat9.mid` という名前でMIDIファイルを保存
2. SDカードをM5Stackに挿入
3. スケッチを書き込んで起動
4. ボタン操作:
- **ボタンB**: 再生/停止
- **ボタンC**: 次の曲へスキップ

### 接続

MIDIモジュールはM5StackのSerial2(GPIO16/17)を使用します。

```
M5Stack GPIO16 (RX2) → MIDIモジュール MIDI IN
M5Stack GPIO17 (TX2) → MIDIモジュール MIDI OUT
```

ボーレート: 31250bps(MIDI標準)

### 3Dプリントケース

`Case-3Ddata/` フォルダにSTLファイルが含まれています。

**プリント時の注意:**
- `m5stackmidi1.6mm.stl` と `m5stackmidiDIN5.stl` は **Y軸を180度反転** させた方が綺麗にプリントできます。

### 既知の制限

- SMFプレイヤーはFormat 0/1のみ対応
- BLE MIDIブリッジは3バイトのMIDIメッセージのみ対応(SysExは非対応)
- シンセサイザー系は実験的な実装です

---

## 中文

M5Stack MIDI模块的Arduino示例程序和3D打印外壳文件(STL)。

### 概述

本仓库包含用于[necobit M5Stack MIDI模块](https://necobit.com/denshi/m5-midi-module2/)的Arduino示例程序。包括MIDI收发测试、SMF文件播放、BLE MIDI桥接、合成器实验等功能。

### 所需硬件

- M5Stack(Basic、Gray、Fire等)
- M5Stack MIDI模块(necobit出品)
- SD卡(用于SMF播放器)
- MIDI兼容设备(合成器、音源模块等)

### 所需库

请在Arduino IDE中安装以下库:

| 库 | 用途 | 安装方法 |
|---|------|---------|
| [Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library) | MIDI通信 | 在库管理器中搜索"MIDI Library" |
| [M5Stack Library](https://github.com/m5stack/M5Stack) | M5Stack控制 | 在库管理器中搜索"M5Stack" |
| [LovyanGFX](https://github.com/lovyan03/LovyanGFX) | 高速显示渲染 | 在库管理器中搜索"LovyanGFX" |

### 使用方法

1. 打开Arduino IDE
2. 安装所需库
3. 将M5Stack连接到电脑
4. 将开发板设置为"M5Stack-Core-ESP32"
5. 打开所需的示例程序并上传

### SMF播放器使用方法

1. 将MIDI文件以 `playdat0.mid` 到 `playdat9.mid` 的名称保存到SD卡
2. 将SD卡插入M5Stack
3. 上传程序并运行
4. 按键操作:
- **按键B**:播放/停止
- **按键C**:跳到下一曲

### 连接

MIDI模块使用M5Stack的Serial2(GPIO16/17)。

```
M5Stack GPIO16 (RX2) → MIDI模块 MIDI IN
M5Stack GPIO17 (TX2) → MIDI模块 MIDI OUT
```

波特率:31250bps(MIDI标准)

### 3D打印外壳

STL文件位于`Case-3Ddata/`文件夹中。

**打印注意事项:**
- `m5stackmidi1.6mm.stl`和`m5stackmidiDIN5.stl`建议**Y轴旋转180°**打印效果更好。

### 已知限制

- SMF播放器仅支持Format 0/1
- BLE MIDI桥接仅支持3字节MIDI消息(不支持SysEx)
- 合成器程序为实验性实现

---

## Español

Sketches de Arduino de ejemplo y archivos de carcasa para impresión 3D (STL) del módulo MIDI M5Stack.

### Descripción

Este repositorio contiene ejemplos de sketches de Arduino para el [Módulo MIDI M5Stack de necobit](https://necobit.com/denshi/m5-midi-module2/). Incluye pruebas de envío/recepción MIDI, reproducción de archivos SMF, puente BLE-MIDI a MIDI cableado y experimentos de sintetizador.

### Hardware Requerido

- M5Stack (Basic, Gray, Fire, etc.)
- Módulo MIDI M5Stack (necobit)
- Tarjeta SD (para el reproductor SMF)
- Dispositivos compatibles con MIDI (sintetizadores, módulos de sonido, etc.)

### Bibliotecas Requeridas

Instala las siguientes bibliotecas en Arduino IDE:

| Biblioteca | Propósito | Instalación |
|------------|-----------|-------------|
| [Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library) | Comunicación MIDI | Buscar "MIDI Library" en el Gestor de Bibliotecas |
| [M5Stack Library](https://github.com/m5stack/M5Stack) | Control de M5Stack | Buscar "M5Stack" en el Gestor de Bibliotecas |
| [LovyanGFX](https://github.com/lovyan03/LovyanGFX) | Renderizado rápido de pantalla | Buscar "LovyanGFX" en el Gestor de Bibliotecas |

### Primeros Pasos

1. Abrir Arduino IDE
2. Instalar las bibliotecas requeridas
3. Conectar M5Stack al ordenador
4. Configurar placa como "M5Stack-Core-ESP32"
5. Abrir el sketch deseado y subir

### Uso del Reproductor SMF

1. Guardar archivos MIDI como `playdat0.mid` a `playdat9.mid` en la tarjeta SD
2. Insertar tarjeta SD en M5Stack
3. Subir el sketch y ejecutar
4. Controles de botones:
- **Botón B**: Reproducir/Parar
- **Botón C**: Saltar a siguiente pista

### Conexión

El módulo MIDI usa Serial2 de M5Stack (GPIO16/17).

```
M5Stack GPIO16 (RX2) → Módulo MIDI MIDI IN
M5Stack GPIO17 (TX2) → Módulo MIDI MIDI OUT
```

Velocidad de baudios: 31250bps (estándar MIDI)

### Carcasa para Impresión 3D

Los archivos STL están en la carpeta `Case-3Ddata/`.

**Nota de impresión:**
- `m5stackmidi1.6mm.stl` y `m5stackmidiDIN5.stl` imprimen mejor **rotados 180° en el eje Y**.

### Limitaciones Conocidas

- El reproductor SMF solo soporta Formato 0/1
- El puente BLE-MIDI solo soporta mensajes MIDI de 3 bytes (sin SysEx)
- Los sketches de sintetizador son experimentales

---

## 한국어

M5Stack MIDI 모듈용 Arduino 샘플 스케치 및 3D 프린트 케이스 파일(STL)입니다.

### 개요

이 저장소는 [necobit M5Stack MIDI 모듈](https://necobit.com/denshi/m5-midi-module2/)용 Arduino 스케치 샘플을 포함하고 있습니다. MIDI 송수신 테스트, SMF 파일 재생, BLE MIDI 브리지, 신디사이저 실험 등의 기능을 포함합니다.

### 필요한 하드웨어

- M5Stack (Basic, Gray, Fire 등)
- M5Stack MIDI 모듈 (necobit)
- SD 카드 (SMF 플레이어용)
- MIDI 호환 장치 (신디사이저, 사운드 모듈 등)

### 필요한 라이브러리

Arduino IDE에 다음 라이브러리를 설치하세요:

| 라이브러리 | 용도 | 설치 방법 |
|-----------|------|----------|
| [Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library) | MIDI 통신 | 라이브러리 매니저에서 "MIDI Library" 검색 |
| [M5Stack Library](https://github.com/m5stack/M5Stack) | M5Stack 제어 | 라이브러리 매니저에서 "M5Stack" 검색 |
| [LovyanGFX](https://github.com/lovyan03/LovyanGFX) | 빠른 화면 렌더링 | 라이브러리 매니저에서 "LovyanGFX" 검색 |

### 시작하기

1. Arduino IDE 열기
2. 필요한 라이브러리 설치
3. M5Stack을 컴퓨터에 연결
4. 보드를 "M5Stack-Core-ESP32"로 설정
5. 원하는 스케치를 열어 업로드

### SMF 플레이어 사용법

1. SD 카드에 `playdat0.mid` ~ `playdat9.mid` 이름으로 MIDI 파일 저장
2. SD 카드를 M5Stack에 삽입
3. 스케치를 업로드하고 실행
4. 버튼 조작:
- **버튼 B**: 재생/정지
- **버튼 C**: 다음 곡으로 건너뛰기

### 연결

MIDI 모듈은 M5Stack의 Serial2 (GPIO16/17)를 사용합니다.

```
M5Stack GPIO16 (RX2) → MIDI 모듈 MIDI IN
M5Stack GPIO17 (TX2) → MIDI 모듈 MIDI OUT
```

전송 속도: 31250bps (MIDI 표준)

### 3D 프린트 케이스

STL 파일은 `Case-3Ddata/` 폴더에 있습니다.

**프린트 시 주의사항:**
- `m5stackmidi1.6mm.stl`과 `m5stackmidiDIN5.stl`은 **Y축을 180° 회전**하여 프린트하면 더 깨끗하게 출력됩니다.

### 알려진 제한사항

- SMF 플레이어는 Format 0/1만 지원
- BLE MIDI 브리지는 3바이트 MIDI 메시지만 지원 (SysEx 미지원)
- 신디사이저 스케치는 실험적 구현입니다

---

## References / 参考リンク

- [necobit M5Stack MIDI Module](https://necobit.com/denshi/m5-midi-module2/)
- [Arduino MIDI Library](https://github.com/FortySevenEffects/arduino_midi_library)
- [LovyanGFX](https://github.com/lovyan03/LovyanGFX)
- [SMF Sequencer Original](https://bitbucket.org/kyoto-densouan/smfseq/src/m5stack/) by @catsin

## License

See individual file headers for license information.