Benutzer-Werkzeuge

Webseiten-Werkzeuge


projekte:usb-midi-controller

Dies ist eine alte Version des Dokuments!


USB-MIDI-Controller

  • ATmega32u4 (Arduino Leonardo) as host device
    • Uses LUFA to send MIDI messages to the computer over the USB
    • Uses I2C to talk to one or more clients
  • Some ATtiny as client device
    • ADC to read the controller value from a potentiometer or similar
    • Uses the USI as I2C to communicate with the master
  • Clients are daisy-chainable, see Communication

Communication

  • The host device acts as a slave and has address 1, all clients are I2C masters
  • Initialization
    1. When a client powers on, it repeatedly (until it receives an answer) sends a message to the host, consisting of
      • A request code
      • The number nc of controls it needs allocated to itself
    2. The host then allocates a continuous block of nc controls for the device and responds with
      • The response code corresponding to the request
      • The 7-bit address of the first control
    3. The device then enables the next device, either by pulling its RESET line high or enabling VCC
  • Control changes: When one control of a client has changed, it constructs the corresponding MIDI packet: B0 XX YY, where XX stands for the control number and VV the new 7-bit value of the control
    • On collision, the device waits between 100 and 1000 microseconds and tries again

A preliminary command table, with each length including the command byte

Request Length Response Length Description
0x01 2 0x02 3 Initialization
0xB0 3 None 0 Control change

Wiring

  • Common wires include
    • GND
    • SDA
    • SCL
  • Each device uses one pin to trigger a FET that connects its VCC to the VCC of the next client. Alternatively, it may connect to the RESET pin of the next client.
  • This uses four wires. A nice and simple method of connecting these would be to use 3.5mm TRRS connectors, like those commonly used for smartphone earphones that include a microphone.
projekte/usb-midi-controller.1417478125.txt.bz2 · Zuletzt geändert: 2014-12-02 00:00 (Externe Bearbeitung)