MidiOutOpen Error 7 [SOLVED]

Hi, English follows German - just saw that this is in the English section of the discussion board :wink:

jetzt habe ich den Behringer CMD MM-1 so weit zum Laufen bekommen, daß er mein Voicetracking-Setup gut unterstützt. Jetzt wollte ich mich mal daran machen, die etwas erweiterten Funktionen des Controllers in Verbindung mit mAirlist auszuschöpfen (ein ziemlich ambitioniertes Unterfangen für mich, da ich seit bestimmt 20 Jahren kein Pascal mehr angefaßt habe, mit MIDI sowieso nur mal sehr oberflächlich rumgespielt habe und auch in der Welt der Controller ziemlich neu bin ;-))

Sei’s drum - mit Hilfe des Forums habe ich schonmal die ersten Hürden umschifft und meine MIDI Device Nummer herausgefunden - siehe Auszug aus dem Log:

2014-11-16 00:35:51 Information Main() called. 2014-11-16 00:35:51 Information initController called. 2014-11-16 00:35:51 Information Device 0: Microsoft GS Wavetable Synth 2014-11-16 00:35:51 Information Device 1: UltraLite mk3 2014-11-16 00:35:51 Information Device 2: CMD MM-1

Der Behringer taucht auf, entsprechende habe ich das in meinem Script auch eingetragen:

[code]const

mAirlistDevice = 2; // <— Edit your controller’s device number from mAairlist Log

function initController(werte:integer):boolean;

begin
systemlog(‘initController called.’);
MidiOutListDevices; // List available MIDI Devices
midioutopen(mAirlistDevice); // Open MIDI Device

end;

begin
systemlog(‘Main() called.’);
initController(58);
end.[/code]

Lasse ich die midioutopen Zeile weg, beschwert er sich weiter unten (ich versuche, einen Wert in das “VU-Meter” des MM-1 zu setzen, das habe ich mit MIDI-OX schon hinbekommen) zu Recht, daß das MIDI Device nicht geöffnet wurde. Nehme ich die Zeile, die vermeintliche Lösung, aber rein, dann bekomme ich eine Fehlermeldung “Error 7” (siehe Anhang) - kann jemand daraus erkennen, was ich falsch mache und mir einen Tipp zur Korrektur geben? Braucht Ihr mehr Infos? Ich bin mit meinem Latein grad mal wieder am Ende… :slight_smile:

  • gibt es irgendwo eine Referenz für die API? Ist das ein Wrapper für die Windows-MididOutOpen-Funktion? Ich konnte jedenfalls auch bei der Suche nach “Error 7” nichts finden, was ich auf meine Situation hätte übertragen können :-/

Danke schonmal im Voraus,

English text:

I managed to setup the Behringer CMD MM-1 so I can use it well in my voice tracking setup. No I wanted to dive into the advanced features of the controller in conjunction with mAirlist (a rather ambitious enterprise for my as I didn’t touch Pascal in 20 years, used MIDI only very superficially until now and as I am completely new to the world of controllers ;-))

Be it, as it may - with the help of this discussion board I managed to dodge the first obstacles and find out my MIDI device’s ID - see the following log excerpt:

2014-11-16 00:35:51 Information Main() called. 2014-11-16 00:35:51 Information initController called. 2014-11-16 00:35:51 Information Device 0: Microsoft GS Wavetable Synth 2014-11-16 00:35:51 Information Device 1: UltraLite mk3 2014-11-16 00:35:51 Information Device 2: CMD MM-1

The Behringer shows up, and I put the findings in my script accordingly:

[code]const

mAirlistDevice = 2; // <— Edit your controller’s device number from mAairlist Log

function initController(werte:integer):boolean;

begin
systemlog(‘initController called.’);
MidiOutListDevices; // List available MIDI Devices
midioutopen(mAirlistDevice); // Open MIDI Device

end;

begin
systemlog(‘Main() called.’);
initController(58);
end.[/code]

If I comment out the midioutopen line mAirlist correctly complains a few steps below that device isn’t open (I’m trying to set a value to the “VU mters” of the MM-1, I managed to do this using MIDI-OX before). If I use the line, however, I get an error message “Error 7” (see attachment) - can anybody see where I’m failing here and give me a hint to solve this? Do you need more information? I just hit rock bottom trying to find the solution on my own… :slight_smile:

  • is there anywhere a reference for the API? Is ist a wrapper for the Windows-MididOutOpen-Function? I’ve been searching for “Error 7” on the net but couldn’t find anything that seemed related to my situation :-/

Thanks in advance,

LG & best regards,

McCavity


Screenshot201411160106.png

Error 7 = MMSYSERR_NOMEM = “The system is unable to allocate or lock memory.”

http://msdn.microsoft.com/en-us/library/windows/desktop/dd798476(v=vs.85).aspx

Not sure why this happens (I assume you are NOT out of RAM). But perhaps a good starting point for another Google search.

No, I think 6GB RAM should suffice - but the hint on “or lock” might be the key point: when I started voice tracking this morning I noticed that mAirlist wouldn’t answer to MIDI commands anymore. I restartet mAirlist to no avail, only after I closed MIDI-OX (which had been running all the time) mAirlist responded to the control commands from the MM-1 again. This together with your information leads me to believe that MIDI-OX might have been locking the devices’s memory so mAirlist couldn’t access it while MIDI-OX was running. I’ll verify this hypothesis later and post an update.

In the meantime thanks for the hint,

EDIT: I just checked and the hint (and my deduction from that) seem correct: after I closed MIDI-OX the script finished correctly. I can now open and close the device. However, I still seem to not have the correct settings to send to the MIDI device: no error shows up, but also the LEDs I tried to switch on don’t light. That’s why I wanted MIDI-OX to run parallelly, so I can check what actually happens on the MIDI bus.

Is there anyone of the MIDI-experienced who can help me find a setup where I can see the MIDI messages passed between the device and mAirlist?

EDIT#2: I think I found the reason why the LEDs wouldn’t light up: seems to be a simple copy-paste-and-forget error (I do feel ashamed ;-)) albeit I can’t confirm it yet (I’ll have to check this afternoon): I used Thomas Kloppholz’ Behringer CMD LC-1 script as a basis for my own and did adapt the mAirlist device number, however i failed to check the MIDI channel settings, too. After recalculating the values I found out that the LC-1 from Thomas’ script appears to be using channel 8 while my MM-1 uses channel 5 - d’oh! :slight_smile: So I think if this check succeeds I can continue with my scripting efforts :smiley:

EDIT#3: yes, that solved it. My script now has a simple testroutine that lights a few of the VU LEDs and sets all the buttons that support it to “blink”. It can also reset the states to default values. Now I cna start thinking about the logic :wink: Setting status to [SOLVED]

best regards,

McCavity