Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
baloe opened this issue Dec 29, 2022 · 1 comment
Open

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

baloe opened this issue Dec 29, 2022 · 1 comment

Comments

@baloe
Copy link

baloe commented Dec 29, 2022

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)

@bazmonk
Copy link

bazmonk commented Jan 14, 2023

delay(100) is only a tenth of a second. Try making those longer, like a few thousand (which would be a few seconds).

How are you powering the Trigger?

Are you sure Tx on the Arduino isn't pin 1? On every Arduino I've seen, 0 is Serial1 Rx, and pin 1 is Tx (the one you want to connect to the Trigger's Rx).

I use Triggers in a project and much prefer talking to it via Serial instead of MIDI (even though, funnily enough, I'm using it in a MIDI instrument). I can absolutely give you an example of that, if you're willing to go that route (same wiring, just a more direct way of talking to the Trigger). Otherwise the rest looks good.

(I'm not associated with this project, just chiming in)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants