Gadzira yako wega MIDI controller neArduino

midi

Kana iwe uri mudiwa wemimhanzi kana zvakananga muimbi kana muimbi ane hunyanzvi, zvirokwazvo mumba mako makaunganidza muunganidzwa wakakura wezviridzwa zvemimhanzi. Kuti uite izvi zvese musanganiswa zvakakwana, zviri nani kuwana MIDI controller. Nehurombo, idzi mhando dzezvinhu kazhinji dzinodhura, saka zvinonetsa kuti munhu asina zviwanikwa zvakawandisa kuti awane zvese zvavanogona kupa.

Kuti unzwisise zviri nani zviri mutungamiriri weMIDI, akuudze kuti izwi MIDI rinobva Musical Instrument Dhijitari, ndiko kuti, rudzi rwemutongi runogadzira zvigadzirwa zvemagetsi zvemagetsi zvinogona kutaurirana. Kana iwe uine keyboard yemagetsi pamba, semuenzaniso, zvinopfuura zvingangoita kuti iine MIDI interface. Usati waenderera kumberi mberi, kunyangwe paine chokwadi chekuti pane zvimwe zvigadzirwa zvehunyanzvi izvo zvinogona kutungamira kuti munhu atende neimwe nzira, zvinofanirwa kuve pachena kuti MIDI haisi odhiyo.

Gadzira yako wega MIDI controller neiyi yakapusa dzidziso

Kana tangojekesa nezve izvi, zvichave zviri nyore kwazvo kwauri kuti unzwisise kuti MIDI ingori yakapusa kuraira kwakaiswa kunokwanisa kutsigira kusvika gumi nematanhatu yakazvimirira migero, zvinoreva kuti panogona kuve nemichina inosvika gumi neshanu yakasiyana inotaurirana yakazvimiririra. Aya majaira anofanirwa kuve akabatanidzwa kuburikidza ne16-pini DIN tambo, iyo iri tambo ine mapini mashanu mukati mekobatanidza. Sekuwedzera, zvakajairika kushandisa USB pachinzvimbo che5-pini DIN, kana tikashandisa USB tinofanirwa kugadzira USB-MIDI interface.

Pasina imwezve ado, ini ndinokusiya iwe neiyo link kwaunogona kuwana iyo Tutorial nhanho nhanho ine yakawanda ye mifananidzo inotsanangura kwatingaite zviito zvese zvinodiwa kuti tigadzire yedu yega MIDI controller.

Nyaya inoenderana:
Ungachinja sei zita rekushandisa rePi uye password pane yedu Raspberry Pi

Nzira yekugadzira yako wega MIDI controller neArduino

midi chinongedzo

Vazhinji vanhu vanhu vanoda, nezvikonzero zvakasiyana ivo pachavo nehunyanzvi, kushandisa a zvizere tsika MIDI controller Nekuti pamwe uye semuenzaniso, pane imwe nguva muhupenyu hwako seartist, kutenga isingadhuri MIDI controller ingangotadza kuzadzisa zvaunotarisira kana zvaunoda nepo, kana nguva yacho yasvika, kusarudza yehunyanzvi vhezheni inogona kunyanyisa mune zvese zvemari zviwanikwa. Iwe kudiwa, pamwe nenhamba huru yezvinhu zvavanogona kupa.

Nekuda kweizvi, nhasi ndinoda kukuratidza zvese zvaunoda kuti ugone kugadzira yako MIDI controller, zvichiratidza zvese zvese zvaunoda pakuvakwa kwayo uye nekukupa iyo software iyo yauchazoda kuisa. Semashoko, pabasa iri kushandiswa kweArduino bhodhi kwakakosha, mutungamiriri ane simba rakaringana kuita iri basa.

Nyaya inoenderana:
Maitiro ekugadzira robhoti: 3 dzakasiyana sarudzo

Chii chinonzi MIDI controller?

midi

Chaizvoizvo, MIDI inodzora inoitisa, zvakanyanya kutaura, yekubatanidza akasiyana mimhanzi zvigadzirwa kune mumwe nemumwe. Mazhinji zviridzwa zvinosanganisira MIDI interface, kunyangwe izvi zvichifanira kuve zvakajeka sezvo paine vashandisi vazhinji vanowanzovhiringidzika, MIDI harisi faira reodhiyo, asi seti yakapusa yemirairo iyo chiridzwa chinogona kugamuchira. kana marongero enzwi.

Mukati meMIDI kune mhando mbiri dzakasiyanaKune rimwe divi isu tinayo iyo inonzi Shanduko Kudzora uko iine controller nhamba uye kukosha pakati pe0 ne127. Nekuda kweizvi, mameseji anogona kupihwa uko kwakasiyana paramende senge vhoriyamu kana toni inogona kuchinjwa. Zvishandiso zvakasiyana zvinogamuchira MIDI zvinofanirwa kuunza dhairekitori nazvo zvichitsanangura kuti ndezvipi mameseji uye mameseji akaiswa nekusarongeka uye kuti ungachinje sei.

Panzvimbo yechipiri isu tine Chirongwa Chekuchinja, akateedzana meseji ayo zvakare ari nyore kupfuura ayo anoumba Shanduko Kudzora. Aya marudzi emeseji anoshandiswa kushandura preset kana chigamba chechigadzirwa. Senge muKuchinja Kudzora, pamwe chete nechiridzwa chako mugadziri anofanirwa kusanganisira bhuku rinoratidza kuti ndezvipi zvekutanga zvichishandurwa neimwe meseji.

Zvikamu Zvinodiwa Kuvaka Yako Yakagadzirwa Homemade MIDI Controller

Midi yekubatanidza schematic

Kuti ukwanise kuvaka yako wega MIDI controller iwe unozoda akateedzana zvidimbu mukuwedzera kune, sezvatatotaura, Arduino bhodhi. Usati waenderera mberi, ingokuudza kuti pamwe, mune ramangwana nekuti iwe unoda kuwedzera chirongwa, iwe unoda zvimwe zvinhu, kunyangwe panguva ino uine zvidimbu zvishoma unenge uine zvakawanda.

Tichada yechikadzi 5-pole DIN tambo, 2 220 ohm resistors, 2 nguva pfupi switch, 2 10k ohm resistors, waya dzekubatanidza, redunhu bhodhi, MIDI tambo uye MIDI chishandiso kana USB interface. Uine zvidimbu izvi chete zvaunogona kutanga, uchitevera tsoka dzangu, kuti uite yako MIDI controller.

Matanho ekutanga

Arduino midi kuronga

Ndisati ndatanga ndinokusiira pikicha uko iwe paunogona kuona pini dzeyako MIDI tambo, nenzira iyi tinogona kunyatsoziva iwo mapini uye kunyanya panofanira kusunganidzwa yega yega. Zvakawanda kutaura, zvese zvaunofanirwa kuita panguva ino kubatanidza pini 5 yetambo kune 220 ohm resistor uye kubva ipapo kuenda kuArduino Transmit 1, pini 4 kusvika 220 ohm resistor uye kubva ipapo kuenda kune 5V socket yeArduino uchiri pini 2 inofanirwa kuve yakabatana neiyo Ground kubatana kweako mutongi.

Kana danho iri rangoitwa, iwe hauna dhairekitori iri mupikicha iri pazasi pemitsara iyi, inguva yekubatanidza mabhatani. Pfungwa iri muchikamu ichi ndeyekuzadzisa, uchishandisa iyo digitalRead pini (inokwanisa kuona kana magetsi anosvika pairi achichinja) kukwanisa kushandisa transistor kuti iite, nemuchina webhatani. Kune izvi isu tinongofanirwa kushandisa bhatani kuitira kuti, iro reruboshwe rwayo isu tibatanidze kune 5V, iro kurudyi kune 220 ohm kuramba uye kubva ipapo kuenda pasi apo, zvakare, isu tinobatanidzawo kurudyi kupini 6 Bhatani repiri raizoiswa nenzira imwecheteyo kunyangwe, sezvaungaona mumufananidzo, pachinzvimbo chepini 6 tinoisanganisa na7.

Software yekushandisa kumba midi controller

Kana tangopedza neese Hardware, inguva yekubatanidza chimbo chedu uye kuyedza. Izvo zvisati zvaitika tinofanirwa kuve ne USB-MIDI interface uye ne MIDI tambo kubatanidza bhodhi, iri kutumira data, nekombuta yedu. Kuti tiite izvi, isu takasarudza raibhurari ye MIDI v4.2 yakagadzirwa nevakomana kubva kuForty Seven Effects yatinofanira kunge takaisa pane yedu Arduino uye yakaverengerwa muchirongwa.

Panyaya yekombuta, isu tinoda chirongwa chinokwanisa kutarisa rese data reMIDI rinosvika pariri kubva kuArduino. Kune izvi isu tine mikana yakasiyana senge MIDI Monitor (OS X), MIDI-OX (Windows) kana Kmidimon (Linux)

Kuti tiite bvunzo diki isu tinongofanirwa kubatanidza iyo Arduino kune komputa yedu uye nekuita inotevera kodhi:

#include
#include
#include
#include
#include

MIDI_CREATE_INSTANCE(HardwareSerial,Serial, midiOut); // crear objeto de salida MIDI llamado midiOut

void setup() {
Serial.begin(31250); // configuracion de serial para MIDI
}

void loop() {
midiOut.sendControlChange(56,127,1); // envío de señal MIDI CC -- 56 = nota, 127 = velocidad, 1 = canal
delay(1000); // retraso
midiOut.sendProgramChange(12,1); // envío de una señal MIDI PC -- 12 = valor, 1 = canal
delay(1000); // retraso de 1 segundo
}

Kana zvese zvikafamba mushe, unogona kuenda kubhatani bvunzo, kana bvunzo iyi isina kukushandira iwe unofanirwa kuona kuti kubatana kwese kwakaringana, dunhu rakangofanana neiri dhayagiramu rapfuura, dunhu yakabatana neUSB-MIDI interface ine tambo ye MIDI, tambo dze MIDI port dzakabatana zvakanaka, tambo ye MIDI yakabatana nekuisa kweiyo USB-MIDI interface, iyo Arduino bhodhi yakanyatso kubatana kune yemagetsi network uye ine simba rakaringana ...

Kuedza kuti mabhatani anoshanda nemazvo

Usati waenderera mberi kudyisa chirongwa chedu nemabasa matsva uye kodhi yatinogona kurasikirwa nayo, zvakakodzera kumira kwechinguva uye edza kuti mabhatani anoshanda nemazvo. Kwavari tinofanirwa kurodha kodhi inotevera:

const int boton1 = 6; // asignacion del boton a una variable
const int boton2 = 7; // asignacion del boton a una variable

void setup() {
Serial.begin(9600); // configuracion del serial
pinMode(boton1,INPUT); // configuracion del boton1 como entrada
pinMode(boton2,INPUT); // configuracion del boton2 como entrada
}

void loop() {

if(digitalRead(boton1) == HIGH) { // prueba de estado del boton1
delay(10); // retraso
if(digitalRead(boton1) == HIGH) { // prueba de estado de nuevo
Serial.println("Boton 1 funciona correctamente!"); // log
delay(250);
}
}

if(digitalRead(boton2) == HIGH) { // prueba de boton 2
delay(10); // retraso
if(digitalRead(boton2) == HIGH) { // prueba de estado de nuevo
Serial.println("Boton 2 funciona correctamente!"); // log
delay(250);
}
}

}

Iyi kodhi inongofanirwa kuverengerwa nekuitwa kuitira kuti, iine tambo yeUSB yakabatana, chirongwa ichi chinotiudza kana paine mabhatani akatsikirirwa.

Isu tinogadzira yedu yakagadzirirwa yakagadzirirwa MIDI controller

Kana tangoita bvunzo idzi, inguva yekuunganidza yedu yega MIDI controller yeiyo, iwe uchafanirwa kunyora iyi inotevera kodhi:

#include
#include
#include
#include
#include

const int boton1 = 6; // asignamos boton a la variable
const int boton2 = 7; // asignamos boton a la variable

MIDI_CREATE_INSTANCE(HardwareSerial,Serial, midiOut); // create a MIDI object called midiOut

void setup() {
pinMode(boton1,INPUT); // configuracion del boton1 como una entrada
pinMode(boton2,INPUT); // configuracion del boton2 como una entrada
Serial.begin(31250); // configuracion MIDI de salida
}

void loop() {
if(digitalRead(buttonOne) == HIGH) { // comprobacion de estado
delay(10); // retraso
if(digitalRead(buttonOne) == HIGH) { // comprobacion de estado de nuevo
midiOut.sendControlChange(56,127,1); // envío un MIDI CC -- 56 = nota, 127 = velocidad, 1 = canal
delay(250);
}
}

if(digitalRead(buttonTwo) == HIGH) { // comprobacion de estado
delay(10); // retraso
if(digitalRead(buttonTwo) == HIGH) { // nueva comprobacion de estado
midiOut.sendControlChange(42,127,1); // envío un MIDI CC -- 42 = nota, 127 = velocidad, 1 = canal
delay(250);
}
}
}

Sechidimbu, ndikuudze kuti haugone kushandisa iyo Serial.println () yekuraira ne MIDI kuburitsa nguva ino, kana iwe uchida kuratidza imwe mhando yemeseji pakombuta, ingochinja:

midiOut.sendControlChange(42,127,1);

by:

midiOut.sendControlChange(value, channel);

uko kukosha uye chiteshi zvinofanirwa kuve nehunhu hunodiwa hwaunoda kuratidza.

Kushanda muenzaniso:


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Makomendi gumi, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa. Raida minda anozivikanwa ne *

*

*

  1. Inotarisira iyo data: Miguel Ángel Gatón
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   Alfred akadaro

    Arduino inokupa iwe yakawanda mikana yekuita mapurojekiti wega https://www.juguetronica.com/arduino . Chimwe chezvinhu zvakanakisa ndechekuti iwe unogona kutanga usina kuve nyanzvi uye kuenderera mberi nekudzidza, nekudaro uchikurudzira iwe kuti uve-wega-unodzidziswa.

  2.   Danel Roman akadaro

    Thanks.

    Ndiri kuyedza kuita ino yakanakisa dzidziso ... asi iyo #includes haina kukwana….

    Iwe ungandiudza here kuti ndeapi anodikanwa?

    Ndinokutendai zvikuru.

  3.   Uell akadaro

    Hi!
    Ndinoda kugadzira yemagetsi dhiramu module nekutsiva mabhatani ane jack zvinongedzo kune iyo piezoelectric chiratidzo chinosvika.
    Zvingave zvichikwanisika kuzviita here?

  4.   Eduardo Valenzuela akadaro

    Ndokumbirawo kana muchikwanisa kupa zvinosanganisira kodhi iyi, ndiri kufarira chirongwa ichi.