| .. | ||
| .github/workflows | ||
| docs | ||
| midi-storage | ||
| src | ||
| .gitignore | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
arduino-music-box
It's Node.js + Arduino project to play any midi file.
使用node.js把指定的midi文件转为频率和时间,然后串口发送给arduino播放。
Prerequisites
- You need to provide the following environment variables to make it works (the easiest way is to create
.envfile in the project root folder)
SERIAL_PORT=<NAME_OF_SERIAL_PORT>
BOUD_RATE=<BOUD_RATE>
MIDI_STORAGE_FOLDER=<MIDI_STORAGE_FOLDER>
- Electronics:
- Arduino Uno
- Piezo buzzer
- Wires (optional)
- Circuit scheme
How to run
To run the project you have to:
- Upload sketch file from
src/arduino/play.inoto your Arduino Uno using Arduino IDE or whatever you use for arduino development - Keep Arduino Uno connected to your computer
- Run in the terminal:
npm install
node src/node/index.js
By default it will start playing files from midi-storage (you can change it in the index.js)