Author |
Topic: Bug or compatibility problem? (Read 1747 times) |
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Bug or compatibility problem?
« on: Jan 4th, 2006, 9:36am » |
Quote Modify
|
Hi, there is a problem with the xxx_MidiInput() function. The status parameter is always 22 and the channel parameter 250. No matter what the input is. Therefore I can't output the same Midi data using OutputMidiMsg(). This is the event function from my script, which outputs no midi at all: function On_MidiInput(timestamp, status, chan, dat1, dat2) { WScript.Echo("status: "+status+" chan: "+chan); mox.OutputMidiMsg(-1, status+chan, dat1, dat2); } Hope someone can help... wunderfitz
|
« Last Edit: Jan 4th, 2006, 9:36am by wunderfitz » |
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Bug or compatibility problem?
« Reply #1 on: Jan 4th, 2006, 11:26am » |
Quote Modify
|
The XXX_MidiInput function call is different from how you are using it. This may be due to some early documentation not being updated. The correct calling sequence is: function On_MidiInput(timestamp, port, status, dat1, dat2) { . . . } timestamp: time in milliseconds since port was opened port: port number that the event arrived on status: the MIDI Status (4 high bits) + Channel (0 - 15) dat1: depends on MIDI Status Message dat2: depends on MIDI Status Message See MOXScript.rtf in the MIDI-OX application folder for more info.
|
|
IP Logged |
--Jamie Music is its own reward.
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #2 on: Jan 4th, 2006, 1:47pm » |
Quote Modify
|
Thank you for the quick answer Yeah, that is the case. The function description is different in the help file and the MOXScript.rtf file. But this is not the problem, as the two variables were just confused. This function: function On_MidiInput(ts, port, stat, dat1, dat2) { WScript.Echo("stat: "+stat+"\nport: "+port); mox.OutputMidiMsg(-1, stat, dat1, dat2); } produces this output: And those values are always the same. Stat = 250 and port = 22. No matter what the input is.
|
|
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Bug or compatibility problem?
« Reply #3 on: Jan 4th, 2006, 2:52pm » |
Quote Modify
|
Strange. What OS are you running on? I wonder whether launching a modal message box in the middle of a COM connection point sink interrupt is skewing the result? In general, you should try for as little delay as possible and maximum efficiency inside the XXX_MidiInput() call. What is the result when you run the included Breath2NRPN.js script? Any message other than Breath controller (CC:02) is just sent to the output with that one.
|
« Last Edit: Jan 4th, 2006, 2:53pm by Jamie OConnell » |
IP Logged |
--Jamie Music is its own reward.
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #4 on: Jan 4th, 2006, 4:05pm » |
Quote Modify
|
I'm running Windows XP, SP2. I've only added the messagebox when I saw that there was no Midi out. Removing the box doesn't change anything. None of the demoscripts work. Seems to be the same problem everywhere. But I don't think that it is a general problem with my system, because routing and translating Midi data in MidiOx (using the built in tools) works fine. And I suppose that they are based on the script too?
|
|
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Bug or compatibility problem?
« Reply #5 on: Jan 4th, 2006, 5:06pm » |
Quote Modify
|
Internal routing and mapping use a different code path and are not involved in the COM interface code at all. When you say that 'none of the demoscripts work', can I assume you mean that the MIDI input function does not appear to work, although the scripts seem to run without error? In particular, when you run the MOXScriptDemo.vbs script do you get 9 message box dialogs displayed? 1) WSH version 2) MIDI-OX version 3) Enumeration of available Input devices 4) Enumeration of available Output devices 5) Open Input devices 6) Open Output devices 7) Divert MIDI Input? 8) Press OK to end MIDI Loop ... Normally this is where input is routed to output - until OK is pressed 9) End Demo - Shutdown? If so, the scripting itself appears to be working and the answer must be somewhere in the actual COM code. How many actual MIDI devices are listed in MIDI-OX Options | MIDI Devices... Inputs and Outputs? How many of each are opened? Are these counts and devices the same as the ones enumerated in the script dialogs?
|
« Last Edit: Jan 4th, 2006, 5:06pm by Jamie OConnell » |
IP Logged |
--Jamie Music is its own reward.
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #6 on: Jan 4th, 2006, 5:47pm » |
Quote Modify
|
Yes, the scripting is working. I am also getting all the 9 dialog boxes. It's just the Midi input part that doesn't seem to work. Also, when I use a constant instead of the paramter given by the function for outputting Midi data, there is no error: mox.OutputMidiMsg(-1, 0xB0, dat1, dat2); So it must be the Midi input routine that doesn't work. I have ~25 Midi in and out ports in MidiOx, and all are listed by the script. I open one in and one out port only: Midi input through an Emagic MT4, output to MidiYoke port 8. And the script correctly lists these two as open ports. Also, both ports I use here work prefectly when using MidiOx without a script. I'll post again tomorrow, bedtime over here
|
|
IP Logged |
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #7 on: Jan 4th, 2006, 5:56pm » |
Quote Modify
|
Just thought of something, maybe this helps: I also used the XXX_SysExInput() function in the same script. This one works without problems. The input data is as expected. However SysEx output doesn't seem to work (not sure about this! Gotta try output again). I will also try another Midi interface to check if it isn't a MT4 issue.
|
« Last Edit: Jan 4th, 2006, 5:57pm by wunderfitz » |
IP Logged |
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #8 on: Jan 5th, 2006, 10:09am » |
Quote Modify
|
Ok, I made some tests again: I opened other MIDI ports instead of those from the MT4, as well as other outputs than the MIDI Yoke. And still the same problem. So it's not related to the interface. I also tried the SysEx sink and SysEx output. Both work perfectly, I managed to convert some specific SysEx data and output some other SysEx data.
|
|
IP Logged |
|
|
|
wunderfitz
New Member

 MIDI-OX Rules!
Posts: 7
|
 |
Re: Bug or compatibility problem?
« Reply #9 on: Jan 30th, 2006, 10:37am » |
Quote Modify
|
Any ideas yet?
|
|
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Bug or compatibility problem?
« Reply #10 on: Feb 4th, 2006, 10:10pm » |
Quote Modify
|
Sorry it doesn't work for you. It seems to be working for everybody else (so far).
|
|
IP Logged |
--Jamie Music is its own reward.
|
|
|
|