Closed andre2007 closed 3 years ago
I'll post my little program up here later but the core of it is fairly simple:
MidiInput mi = MidiInput("hw:4,0"); // string dfevice name on Linux, on Windows it just always uses the default device which probably just works anyway, it does on my computer, so i never implemented device switching
// so im not supposed to call a midi out function from inside the callback...
mi.record((ts, status, data1, data2) {
// time stamp, midi status, data1 data 2 make up the midi message
});
Of course doing stuff with the messages gets trickier but even this minimal thing should give you something to writeln to prove it works with your hardware too.
Fantastic, thanks a lot!
This is my very much work-in-progress program:
shoud be able to compile with dmd -i midi.d
with the arsd directory in the search path.
Run it as midi.exe program.mid
to play one (I included one midi you can try) or midi.exe record
with a midi device plugged in to see it respond to your key presses on the midi hardware.
Tons of bugs, I wanted to go back and work on it more after the blog but have just been too busy with other things.
Fantastic, thank you so much!
lemme know if you get it all working.
I started the midi app as single dub package and it was working fine. The app already looks really great! Thank you so much.
In a "this week in D" article I saw you work on a midi keyboard teaching program. By chance I was looking into the midi module from you to see whether i can use to use it with my e-piano. From your article I understand I can use it for midi input from a physical device (usb cable). Do you have by chance some sample coding to get started?