Zum Inhalt springen
Alea64 MIDI Controller mit Teensy

ALEA64

    Schach ist ja an sich schon ein aufregendes Spiel, aber wie bekommt man es auf das nächste Level? Mit Sound!

    Wir benötigen Ihre Zustimmung um den Inhalt von YouTube laden zu können.

    Mit dem Klick auf das Video werden durch den mit uns gemeinsam Verantwortlichen Youtube [Google Ireland Limited, Irland] das Video abgespielt, auf Ihrem Endgerät Skripte geladen, Cookies gespeichert und personenbezogene Daten erfasst. Damit kann Google Aktivitäten im Internet verfolgen und Werbung zielgruppengerecht ausspielen. Es erfolgt eine Datenübermittlung in die USA, diese verfügt über keinen EU-konformen Datenschutz. Weitere Informationen finden Sie hier.

    Jmx0O2RpdiBjbGFzcz0mcXVvdDtudi1pZnJhbWUtZW1iZWQmcXVvdDsmZ3Q7Jmx0O2lmcmFtZSB0aXRsZT0mcXVvdDtBbGVhNjQgLSBtYWtlIG11c2ljIGJ5IGNoYW5jZSB3aGlsZSBwbGF5aW5nIGNoZXNzJnF1b3Q7IHdpZHRoPSZxdW90OzEyMDAmcXVvdDsgaGVpZ2h0PSZxdW90OzY3NSZxdW90OyBzcmM9JnF1b3Q7aHR0cHM6Ly93d3cueW91dHViZS5jb20vZW1iZWQvbEQydW1YQ1h3TjQ/ZmVhdHVyZT1vZW1iZWQmcXVvdDsgZnJhbWVib3JkZXI9JnF1b3Q7MCZxdW90OyBhbGxvdz0mcXVvdDthY2NlbGVyb21ldGVyOyBhdXRvcGxheTsgY2xpcGJvYXJkLXdyaXRlOyBlbmNyeXB0ZWQtbWVkaWE7IGd5cm9zY29wZTsgcGljdHVyZS1pbi1waWN0dXJlJnF1b3Q7IGFsbG93ZnVsbHNjcmVlbiZndDsmbHQ7L2lmcmFtZSZndDsmbHQ7L2RpdiZndDs=

    ALEA64 ist ein MIDI-Controller, das die Spielfeldmitte in einen Klangteppich verwandelt. Dazu werden die Schachfiguren mit Magneten und die Schachfelder mit Magnetschaltern ausgestattet. Setzt man nun eine Figur auf eines der »heißen« Felder, wird ein MIDI-Signal an die Software der Wahl geschickt, die wiederum ein Soundloop triggert. Besonders eignet sich Ableton Live für diese Anwendung.

    Bauteile

    Schaltplan

    Schaltplan Alea64 MIDI-Controller Teensy

    Wenn man das gesamte Schachbrett mit Sensoren ausstatten will, lässt sich das übrigens mit den 74HC4051-Chips realisieren. Auf der Teensy-MIDI-Website findet sich eine Anleitung dazu.


    Sieh dir jetzt meinen neuen Arduino-Videokurs an: Jetzt ansehen!


    Code

    #include <Bounce2.h>  // Bounce library makes button change detection easy
    const int channel = 1;
    const int controls[] = {51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74};
    
    Bounce button0 = Bounce(0, 5);  // 5 = 5 ms debounce Zeit
    Bounce button1 = Bounce(1, 5);  
    Bounce button2 = Bounce(2, 5);  
    Bounce button3 = Bounce(3, 5);  
    Bounce button4 = Bounce(4, 5);  
    Bounce button5 = Bounce(5, 5);  
    Bounce button6 = Bounce(6, 5);  
    Bounce button7 = Bounce(7, 5);  
    Bounce button8 = Bounce(8, 5);  
    Bounce button9 = Bounce(9, 5);  
    Bounce button10 = Bounce(10, 5);
    Bounce button11 = Bounce(11, 5);
    Bounce button12 = Bounce(12, 5);
    Bounce button13 = Bounce(13, 5);
    Bounce button14 = Bounce(14, 5);
    Bounce button15 = Bounce(15, 5);
    Bounce button16 = Bounce(16, 5);
    Bounce button17 = Bounce(17, 5);
    Bounce button18 = Bounce(18, 5);
    Bounce button19 = Bounce(19, 5);
    Bounce button20 = Bounce(20, 5);
    Bounce button21 = Bounce(21, 5);
    Bounce button22 = Bounce(22, 5);
    Bounce button23 = Bounce(23, 5);
    
    
    void setup() {
      for (int i=0; i<24; i++){
        pinMode(i, INPUT_PULLUP);
      }
    }
    
    void loop() {
      button0.update();  
      button1.update();
      button2.update();
      button3.update();
      button4.update();
      button5.update();
      button6.update();
      button7.update();
      button8.update();
      button9.update();
      button10.update();
      button11.update();
      button12.update();
      button13.update();
      button14.update();
      button15.update();
      button16.update();
      button17.update();
      button18.update();
      button19.update();
      button20.update();
      button21.update();
      button22.update();
      button23.update();
      
      
      // Schicke ein Steuersignal, wenn der Button gedrückt wird
      if (button0.fallingEdge()) {
        usbMIDI.sendControlChange(controls[0], 127, channel);
      }
      if (button1.fallingEdge()) {
        usbMIDI.sendControlChange(controls[1], 127, channel);
      }
      if (button2.fallingEdge()) {
        usbMIDI.sendControlChange(controls[2], 127, channel);
      }
      if (button3.fallingEdge()) {
        usbMIDI.sendControlChange(controls[3], 127, channel);
      }
      if (button4.fallingEdge()) {
        usbMIDI.sendControlChange(controls[4], 127, channel);
      }
      if (button5.fallingEdge()) {
        usbMIDI.sendControlChange(controls[5], 127, channel);
      }
      if (button6.fallingEdge()) {
        usbMIDI.sendControlChange(controls[6], 127, channel);
      }
      if (button7.fallingEdge()) {
        usbMIDI.sendControlChange(controls[7], 127, channel);
      }
      if (button8.fallingEdge()) {
        usbMIDI.sendControlChange(controls[8], 127, channel);
      }
      if (button9.fallingEdge()) {
        usbMIDI.sendControlChange(controls[9], 127, channel);
      }
      if (button10.fallingEdge()) {
        usbMIDI.sendControlChange(controls[10], 127, channel);
      }
      if (button11.fallingEdge()) {
        usbMIDI.sendControlChange(controls[11], 127, channel);
      }
      if (button12.fallingEdge()) {
        usbMIDI.sendControlChange(controls[12], 127, channel);
      }
      if (button13.fallingEdge()) {
        usbMIDI.sendControlChange(controls[13], 127, channel);
      }
      if (button14.fallingEdge()) {
        usbMIDI.sendControlChange(controls[14], 127, channel);
      }
      if (button15.fallingEdge()) {
        usbMIDI.sendControlChange(controls[15], 127, channel);
      }
      if (button16.fallingEdge()) {
        usbMIDI.sendControlChange(controls[16], 127, channel);
      }
      if (button17.fallingEdge()) {
        usbMIDI.sendControlChange(controls[17], 127, channel);
      }
      if (button18.fallingEdge()) {
        usbMIDI.sendControlChange(controls[18], 127, channel);
      }
      if (button19.fallingEdge()) {
        usbMIDI.sendControlChange(controls[19], 127, channel);
      }
      if (button20.fallingEdge()) {
        usbMIDI.sendControlChange(controls[20], 127, channel);
      }  
      if (button21.fallingEdge()) {
        usbMIDI.sendControlChange(controls[21], 127, channel);
      }
      if (button22.fallingEdge()) {
        usbMIDI.sendControlChange(controls[22], 127, channel);
      }
      if (button23.fallingEdge()) {
        usbMIDI.sendControlChange(controls[23], 127, channel);
      }
    
     
      // Schicke ein Steuersignal, wenn der Button nicht mehr gedrückt wird
      if (button0.risingEdge()) {
        usbMIDI.sendControlChange(controls[0], 0, channel);
      }
      if (button1.risingEdge()) {
        usbMIDI.sendControlChange(controls[1], 0, channel);
      }
      if (button2.risingEdge()) {
        usbMIDI.sendControlChange(controls[2], 0, channel);
      }
      if (button3.risingEdge()) {
        usbMIDI.sendControlChange(controls[3], 0, channel);
      }
      if (button4.risingEdge()) {
        usbMIDI.sendControlChange(controls[4], 0, channel);
      }
      if (button5.risingEdge()) {
        usbMIDI.sendControlChange(controls[5], 0, channel);
      }
      if (button6.risingEdge()) {
        usbMIDI.sendControlChange(controls[6], 0, channel);
      }
      if (button7.risingEdge()) {
        usbMIDI.sendControlChange(controls[7], 0, channel);
      }
      if (button8.risingEdge()) {
        usbMIDI.sendControlChange(controls[8], 0, channel);
      }
      if (button9.risingEdge()) {
        usbMIDI.sendControlChange(controls[9], 0, channel);
      }
      if (button10.risingEdge()) {
        usbMIDI.sendControlChange(controls[10], 0, channel);
      }
      if (button11.risingEdge()) {
        usbMIDI.sendControlChange(controls[11], 0, channel);
      }
      if (button12.risingEdge()) {
        usbMIDI.sendControlChange(controls[12], 0, channel);
      }
      if (button13.risingEdge()) {
        usbMIDI.sendControlChange(controls[13], 0, channel);
      }
      if (button14.risingEdge()) {
        usbMIDI.sendControlChange(controls[14], 0, channel);
      }
      if (button15.risingEdge()) {
        usbMIDI.sendControlChange(controls[15], 0, channel);
      }
      if (button16.risingEdge()) {
        usbMIDI.sendControlChange(controls[16], 0, channel);
      }
      if (button17.risingEdge()) {
        usbMIDI.sendControlChange(controls[17], 0, channel);
      }
      if (button18.risingEdge()) {
        usbMIDI.sendControlChange(controls[18], 0, channel);
      }
      if (button19.risingEdge()) {
        usbMIDI.sendControlChange(controls[19], 0, channel);
      }
      if (button20.risingEdge()) {
        usbMIDI.sendControlChange(controls[20], 0, channel);
      }  
      if (button21.risingEdge()) {
        usbMIDI.sendControlChange(controls[21], 0, channel);
      }
      if (button22.risingEdge()) {
        usbMIDI.sendControlChange(controls[22], 0, channel);
      }
      if (button23.risingEdge()) {
        usbMIDI.sendControlChange(controls[23], 0, channel);
      }
    
      // MIDI Controllers should discard incoming MIDI messages.
      while (usbMIDI.read()) {
      }
    }

    Dieses Projekt ist von Johann-Jost Dierks entwickelt worden, der es StartHardware freundlicherweise zur Verfügung gestellt hat. 

    Hier geht es zur Projektwebsite.


    Wenn dir das Projekt gefallen hat und du von weiteren interessanten Projekten inspiriert werden willst, sieh dir doch mal mein neues E-Book »Arduino Projekte Volume 1« an!

    • Die beliebtesten Arduino-Projekte von StartHardware
    • Inklusive Schaltplan, Beschreibung und Code
    • Arduino-Schnellstart-Kapitel
    • Kompakter Programmierkurs


    Schreibe einen Kommentar

    Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

     

    Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.