Introduction: Arduino-based MIDI Controller
A MIDI controller is useful for producing music, as well as life performance.
Make your own MIDI Controller with cheap materials!
The following instruction is partially in Chinese.
Main Feature:
可彈奏鋼琴上一個八度的音(包含黑鍵)
透過按鍵,切換音域至高8度
透過可變電阻作為旋鈕,控制效果器參數
Reference:
Step 1: Hardware Required
•Arduino UNO R3
•適當大小的麵包版
•公對公杜邦線 至少14條 :從Arduino板接上12個觸控模塊、1個開關、1個可變電阻,在麵包版上的接線,使用小跳線較優。
•TTP223 觸控按鍵模塊 (D2A4) 至少12個:觸摸時輸出高電位,反之輸出低電位。
•小跳線:越多越好,功能同杜邦線。
•無斷開關
•10k可變電阻
Step 2: Hardware Connection
1. 可變電阻及按鈕:將兩者如電路圖所示的接上arduino及麵包板。可變電阻接pin A0,按鈕接pin A1 (因為digital pin 2-13都接上觸控模塊了)。
2. 觸控按鍵模塊:如圖所示,按照模組上的標示將三個接腳分別接上5V、GND及arduino腳位,並照圖上排成類似鋼琴鍵的樣子。訊號腳由左至右分別接到pin 2~13,下排的線路可自製短單芯線接至上排線路。
3. 都接上後即大功告成!
Step 3: About MIDI
MIDI,為Musical Instrument Digital Interface的縮寫,是工業標準的電子通訊協定。概念如同樂譜,記錄音高、節拍、力度等資訊,而非音訊,所以檔案比.mp3小很多。MIDI可讓電腦的音源演奏我們寫的音樂,猶如把樂譜拿給樂師演奏。
MIDI資料格式有3 bytes,分別是Status byte, Data byte 1, Data byte 2,請參閱https://www.midi.org/specifications/item/table-1-s...。
Note table: http://www.blog.finetanks.com/?p=90
例如:經由Channel 1,發出C4音 (中央C),力度100,此3 bytes為(144, 60, 100)。
baud rate設為19200,而非一般Serial monitor的9600。
Step 4: Code
Download the source code: https://drive.google.com/open?id=0BxJZTZDiPRQhUWF5...
Revised from https://raw.githubusercontent.com/langsound/Digita...
The pitch is not confined to the range of C4, C#4, D4,..., B4. You can adjust the range by editing the code.
Step 5: Arduino to MIDI
Download Hairless MIDI:http://projectgus.github.io/hairless-midiserial/
Download loopMIDI: http://www.tobias-erichsen.de/software/loopmidi.ht...
Follow the instruction on those websites.
Turn off the serial monitor before connecting Arduino to Hairless MIDI!
Step 6: MIDI to Music
Any DAW works.
We demonstrated using FL studio 12.
Set "loopMIDI port" as MIDI input.
Step 7: Try to Play Your Hand-made MIDI Instrument
Step 8: Life Performance
The potentiometer was linked to master volume.
Step 9: Advanced Life Performance
The potentiometer can be linked to anything. In this clip, it was linked to the cutoff frequency of low pass filter.