Skip to content

Simple example for how to MIDI-control via an Arduino #25

Description

@baloe

I would like to simply play a note in MIDI mode.

I have done the following:

  • I have unpacked the MellotronDemo.zip onto the SD card
  • I have verified that a sound is played after pressing the test button
  • I have hooked up:
    • Arduino TX (0) with Wavetrigger RX
    • Arduino GND with Wavetrigger GND

I have been playing around with a few arduino sketches, like the one below, but none of them ever produced a sound.
Could anyone give me a hint on how to get this to work?

#include <MIDI.h>

// Create and bind the MIDI interface to the default hardware Serial port
//MIDI_CREATE_INSTANCE(HardwareSerial, Serial, MIDISerial);
MIDI_CREATE_DEFAULT_INSTANCE();

void setup()
{ 
    MIDI.begin();
}

void loop()
{
    for (int note = 0; note < 100; note++) {
      MIDI.sendNoteOn(note, 127, 1);
      delay(100);
      MIDI.sendNoteOff(note , 0, 1);
      delay(100);
    }
}

(I am also asking in the Midi library discussion group: FortySevenEffects/arduino_midi_library#313)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions