Torben,
I am trying sending Midi out, but i don’t know my Midi device number.
I get a “not open” error
How can i check?
MidiOut ( 1, 144, 74, 127 ) ;
Torben,
I am trying sending Midi out, but i don’t know my Midi device number.
I get a “not open” error
How can i check?
MidiOut ( 1, 144, 74, 127 ) ;
Run the following script:
begin
MidiOutListDevices;
end.
Then watch the output in the system log.
Ah, it says Device 2.
After changing the script i still get the error:
3-10-2014 23:05:10 Error Runtime error “MIDI device 2 is not open” in background script D:\mAirList\Scripts\midi.mls, handling message: PLAYERCONTROL_START 398B17822BEF018F 00 00000000 00000000 ?
I can write via midiox to the device and also it does remote commands, weird that it won’t accept input.
I use this script found on the forum
[code]procedure OnPlayerStart(PlaylistIndex: integer; PlayerIndex: integer);
begin
if PlayerIndex = 0 then
MidiOut ( 02, 144, 74, 127 ) ;
end;
procedure OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer; Duration: TTimeValue);
begin
if PlayerIndex = 0 then
MidiOut ( 02, 144, 74, 00 ) ; // hier noch die Werte für den Stop-Befehl anpassen!
end;
begin
end.[/code]
You must open the device before you can use it. Add the following procedure to your script:
procedure OnLoad;
begin
MidiOutOpen(2);
end;
That did the trick 
I want to know if it is possible to send Sysex data like: f0 00 01 40 20 00 00 48 65 6c 6c 6f f7
Just writing a simple HELLO to the device’s LCD
MidiOutSysEx(2, #$f0+#$00+#$01+#$40+#$20+#$00+#$00+#$48+#$65+#$6c+#$6c+#$6f+#$f7);
Or if the text is ASCII anyway, you can also write:
MidiOutSysEx(2, #$f0+#$00+#$01+#$40+#$20+#$00+#$00+'Hello'+#$f7);
Tried that but nothing is being displayed.
I test the script via “Open - Run Script”
Am I forgetting something here?
[code]
procedure OnLoad;
begin
MidiOutOpen(2);
MidiOutSysEx(2, #$f0+#$00+#$01+#$40+#$20+#$00+#$00+#$48+#$65+#$6c+#$6c+#$6f+#$f7);
end;
begin
end. [/code]
Well, this rather looks like a Notification Script (now called Background Script in v5). The kind of script where you use the predefined functions (OnLoad, OnPlayerStart, …), and mAirList calls them automatically when those things happen.
But scripts run from the Open menu must be “ordinary scripts” (or “action scripts”) that have the code between the begin/end lines…
begin
MidiOutOpen(2);
MidiOutSysEx(2, #$f0+#$00+#$01+#$40+#$20+#$00+#$00+#$48+#$65+#$6c+#$6c+#$6f+#$f7);
end.
Strange, still nothing happens.
Normal Midi output/input is working fine.
Havent’t tested it in a while… Perhaps you can use a tool like MIDI-OX to check if the commands are really sent?
Then i need some help on the right setup of midi-ox.
As i only can monitor midi from device to pc.
When sending the sysEx from midi-ox it works.
Regards,
Ferry