Cov txheej txheem:

Basic Arduino MIDI Controller: 5 Kauj Ruam
Basic Arduino MIDI Controller: 5 Kauj Ruam

Video: Basic Arduino MIDI Controller: 5 Kauj Ruam

Video: Basic Arduino MIDI Controller: 5 Kauj Ruam
Video: The 5 BEST ARDUINOS for Building a MIDI CONTROLLER 2024, Hlis ntuj nqeg
Anonim
Basic Arduino MIDI maub los
Basic Arduino MIDI maub los

Qhia:

Kuv yog tus tshiab los ua haujlwm nrog Arduino tab sis kuv vam tias yuav nthuav kuv qhov kev paub los ntawm kev qhia lwm tus thiab tau txais kev tawm tswv yim. Nov yog qhov yooj yim heev MIDI maub los nrog 4 khawm thiab lub zog ntsuas. Tus txheej txheem rau txoj haujlwm no zoo li qhov no:

1. Tsim tawm lub khob cij

2. Upload Daim Duab Sketch mus rau Arduino

3. To taub Hairless MIDI thiab sab hauv MIDI loop (loopbe1)

4. qhia koj qhov MIDI mus rau DAW (Ableton)

Khoom siv

1 x Arduino Mega 2560

1 x Mov Board

1 x USB Cable

1 x Potentiometer

4 x Tact Nyem khawm

4 x 120Ohm resistors

14 x jumper cables rau lub thawv ntawv

Kauj Ruam 1: Txhim Kho Lub Breadboard

Txhim Kho Lub Breadboard
Txhim Kho Lub Breadboard
Txhim Kho Lub Breadboard
Txhim Kho Lub Breadboard

Txuas koj lub khob cij kom tag nrho cov khoom sib dhos ua duab 1 saum toj no. Txhua lub pob yuav tsum zoo ib yam li daim duab 2. Khawm nkag tau yog 2, 3, 4 thiab 5 ntawm Arduino thiab tus pin nruab nrab ntawm lub hwj chim tau txuas nrog ANALOG input A0.

Kauj Ruam 2: Upload Sketch

Rub tawm daim Sketch
Rub tawm daim Sketch

Luam thiab paste cov cai hauv qab no rau hauv Arduino IDE. Xaiv lub rooj tsav xwm raug hauv qab "cov cuab yeej" thiab xa cov duab kos mus rau Arduino.

byte noteON = 144; // nco rau ntawm commandbyte nco; // cia rau tam sim no ua si nco int khawmPin1 = 2; int buttonPin2 = 3; int buttonPin3 = 4; int buttonPin4 = 5; int potPin = A0; boolean currentState = LOW; // stroage rau lub xeev khawm tam sim no boolean lastState = LOW; // cia rau khawm kawg lub xeev tsis muaj teeb tsa teeb tsa () {pinMode (buttonPin1, INPUT); pinMode (buttonPin2, INPUT); pinMode (buttonPin3, INPUT); pinMode (buttonPin4, INPUT); // lub sijhawm no peb yuav teeb tus pin li INPUT Serial.begin (9600); // initialize Serial connection} void loop () {int PotVal = analogRead (potPin); byte nrawm = daim ntawv qhia (PotVal, 0, 1023, 0, 127); currentState = digitalRead (buttonPin1); if (currentState == HIGH && lastState == LOW) {MIDImessage (noteON, 60, velocity); // tig ceeb toom 60 rau nrog 127 nrawm nrawm (200); // daim ntawv nyoos ntawm khawm debouncing} lwm tus yog (currentState == LOW && lastState == HIGH) {MIDImessage (noteON, 60, 0); // tig ceeb toom 60 tawm qeeb (2); // daim ntawv nyoos ntawm khawm debouncing} lastState = currentState; currentState = digitalRead (buttonPin2); yog (currentState == HIGH && lastState == LOW) {// yog tias khawm tau nyuam qhuav nias MIDImessage (noteON, 61, tshaj tawm); // tig ceeb toom 60 rau nrog 127 nrawm nrawm (200); // daim ntawv nyoos ntawm lub pob debouncing} lwm tus yog (currentState == LOW && lastState == HIGH) {MIDImessage (noteON, 60, 0); // tig ceeb toom 60 tawm qeeb (2); // daim ntawv nyoos ntawm khawm debouncing} lastState = currentState; currentState = digitalRead (buttonPin3); yog (currentState == HIGH && lastState == LOW) {// yog tias khawm tau nyuam qhuav nias MIDImessage (noteON, 62, tshaj tawm); // tig ceeb toom 60 rau nrog 127 nrawm nrawm (200); // daim ntawv nyoos ntawm lub pob debouncing} lwm tus yog (currentState == LOW && lastState == HIGH) {MIDImessage (noteON, 60, 0); // tig ceeb toom 60 tawm qeeb (2); // daim ntawv nyoos ntawm khawm debouncing} lastState = currentState; currentState = digitalRead (buttonPin4); yog (currentState == HIGH && lastState == LOW) {// yog tias khawm tau nyuam qhuav nias MIDImessage (noteON, 63, tshaj tawm); // tig ceeb toom 60 rau nrog 127 nrawm nrawm (200); // daim ntawv nyoos ntawm lub pob debouncing} lwm tus yog (currentState == LOW && lastState == HIGH) {MIDImessage (noteON, 60, 0); // tig ceeb toom 60 tawm qeeb (2); // daim ntawv nyoos ntawm khawm debouncing} lastState = currentState; } // xa MIDI lus tsis muaj dab tsi MIDImessage (byte hais kom ua, byte data1, byte data2) {Serial.write (hais kom ua); Serial.write (data1); Serial.write (data2); }

Kuv tseem tshiab heev los sau cov cai feem ntau….. cov uas muaj kev paub me ntsis ntxiv tuaj yeem tuaj yeem ntxuav qhov no…

Kauj Ruam 3: Nkag Siab Hairless MIDI thiab Internal MIDI Loops

Nkag siab Hairless MIDI thiab Internal MIDI Loops
Nkag siab Hairless MIDI thiab Internal MIDI Loops
Nkag siab Hairless MIDI thiab Internal MIDI Loops
Nkag siab Hairless MIDI thiab Internal MIDI Loops
Nkag siab Hairless MIDI thiab Internal MIDI Loops
Nkag siab Hairless MIDI thiab Internal MIDI Loops

Arduino xav tau los ntawm tus choj txuas ib yam li Hairless MIDI tom qab ntawd dhau los ntawm lub voj MIDI sab hauv xws li loopbe1 (lossis IAC npav rau Mac).

Nco tseg: koj tsis tuaj yeem xa cov duab kos mus rau Arduino thaum nws txuas nrog lub plua plav MIDI txuas txuas.

Xaiv koj Arduino hauv Hairless MIDI qhov chaw nres nkoj txuas thiab loopbe1 lossis IAC Bus hauv MIDI tawm.

Nco tseg: nco ntsoov tias hais tsis tau lus thaum siv loopbe1.

Kauj Ruam 4: Txuas nrog Koj DAW

Txuas nrog Koj DAW
Txuas nrog Koj DAW

Yog tias koj tau txais lub teeb liab rau Hairless MIDI app thaum koj nias lub pob ntawm lub khob cij (lub teeb yuav ci) koj yuav tsum tuaj yeem xa cov ntaub ntawv MIDI mus rau DAW. Kuv siv Ableton tab sis ib qho DAW yuav tsum ua haujlwm. Nco ntsoov tias koj sab hauv MIDI lub voj (loopbe1) tau qhib rau hauv koj li kev nyiam DAW (hauv Ableton koj xav kom "taug qab" kom qhib tau). Tom ntej no, xaiv ib qho ntawm koj li MIDI taug qab nkag mus rau MIDI lub voj (loopbe1) raws li qhia hauv daim duab saum toj no.

Kauj ruam 5: Ua si

Image
Image

Cov nyees khawm yuav tam sim no ua haujlwm zoo li lwm yam MIDI maub los! Lub hwj chim yuav hloov qhov nrawm ntawm cov ntawv xa mus rau DAW. Daim vis dis aus (tsaus ntuj heev…) qhia pom lub suab piano zoo heev hauv kev ua!

Pom zoo: