Author |
Topic: convert allnoteoff to noteoff,problem (Read 1630 times) |
|
bbsqbbsq
New Member

 MIDI-OX Rules!
Posts: 5
|
 |
convert allnoteoff to noteoff,problem
« on: Aug 15th, 2006, 10:33pm » |
Quote Modify
|
sorry for my english first. i have an Electronic Organ,when i stroke one key.computer receive 4 message. ----------- C0 00 00 Program Change 0 Unused Channel 1 B0 7B 00 Control Change All Note Off0 Channel 1 90 43 48 Note On G3 (sol3) Velocity: 72 Channel 1 B1 7B 00 Control Change All Note Off0 Channel 1 ---------- therefor,i can't stroke 2 and more key simultaneously.when i stroke the second key ,computer receive a "all note off" message befor "note on",this cause the first stroked key note off. i use the miniox to transform the control message 123(all note off) to (note off).then i can stroke many keys simultaneously,but they do not note off.i think the noteoff doesn't get the same channel or value with note on. how can i make the (note off) get the same value with(note on). help me ,plz....
|
|
IP Logged |
|
|
|
bbsqbbsq
New Member

 MIDI-OX Rules!
Posts: 5
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #1 on: Aug 16th, 2006, 6:52am » |
Quote Modify
|
the problem had been solved. just change some codes sticked on the article below http://www.midiox.com/cgi-bin/yabb/YaBB.pl?board=Mapping;action=display; num=1133749566 ------------------------------------------- // ModVelo.js - JavaScript example // Copyright (c) 2005 by Jamie O'Connell // // This script is an example of doing JScript with MIDI-OX // It converts any arriving Note On velocity to most recent Modulation Wheel value var mox; var modVal = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); // initialize 16 element array // Create object mox = WScript.CreateObject("Midiox.MoxScript.1", "On_"); mox.DivertMidiInput = 1; mox.FireMidiInput = 1; WScript.Echo( "Press OK to end MIDI translate Loop" ); mox.FireMidiInput = 0; mox.DivertMidiInput = 0; // Clean up mox = null; modVal = null; // Exit Point //------------------------------------------ function On_MidiInput( ts, port, stat, dat1, dat2) { // We convert all Note On messages var status; var chan; var velo; status = stat & 0xF0; chan = stat & 0x0F; if (status == 0x090 && dat2 > 0x00) // A Note On has arrived { // A new Note ON value for this channel has arrived: remember it, and eat the controller modVal[ chan ] = dat1; } if (status == 0x080 && dat2 > 0x00) // A Note off has a velocity > 0 { if (modVal[ chan ] > 0) // Only map for non 0 modulation { velo = modVal[ chan ]; } else { velo = dat1; } mox.OutputMidiMsg( -1, stat, velo, dat2 ); } else // other message = just output { mox.OutputMidiMsg( -1, stat, dat1, dat2 ); } }
|
« Last Edit: Aug 16th, 2006, 6:52am by bbsqbbsq » |
IP Logged |
|
|
|
Peter L Jones
Expert
    

Hit it
Gender: 
Posts: 978
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #2 on: Aug 16th, 2006, 4:36pm » |
Quote Modify
|
Ah, good, you found a solution!
|
|
IP Logged |
"...Playing fast around the drums is one thing. But to play with people for others, to listen to, that's something else. That's a whole other world." -- Tony Williams
|
|
|
XtrmFajita
New Member


MIDI-OX Rules!
Gender: 
Posts: 2
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #3 on: Dec 27th, 2006, 9:49pm » |
Quote Modify
|
My friend's keyboard has the exact same MIDI implementation as pasted above. Whenever a single key is pressed and released, he gets the same 4 messages as bbsqbbsq. We've tried using the script that bbsqbbsq pasted but it doesn't seem to have much effect for us. From what I understand we need a script to watch for NoteOn, and store the "Note value" so that when the corresponding AllNotesOff comes through, the script can use the same "Note value" as NoteOn but with velocity set to 0 (effectively changing the MIDI implementation to a standard one). As far as I can tell, the keyboard uses the Channel number to link NoteOn events with the corresponding AllNotesOff event. Where do I start? Surely someone has already done this?
|
|
IP Logged |
|
|
|
Peter L Jones
Expert
    

Hit it
Gender: 
Posts: 978
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #4 on: Dec 28th, 2006, 1:10pm » |
Quote Modify
|
Did you see this part of the referenced thread? on Dec 5th, 2005, 2:06pm, Jamie OConnell wrote:...I connected my MIDI controller as Input to MIDI-OX. I connected MIDI Yoke 1 as Input to MIDI-OX. I connected an external MIDI Module (MU100R) as Output from MIDI-OX. I routed both Inputs to the Output. Then I shut down MIDI-OX. I launched MIDI-OX via the script (double-click).... |
|
|
« Last Edit: Dec 28th, 2006, 1:10pm by Peter L Jones » |
IP Logged |
"...Playing fast around the drums is one thing. But to play with people for others, to listen to, that's something else. That's a whole other world." -- Tony Williams
|
|
|
XtrmFajita
New Member


MIDI-OX Rules!
Gender: 
Posts: 2
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #5 on: Dec 28th, 2006, 7:27pm » |
Quote Modify
|
Thanks for your prompt reply Peter, but fortunately we already got it working last night. I tracked it down to a greaterthan sign that should have been an == in the edited script that was pasted above by bbsqbbsq The line Code: if (status == 0x080 && dat2 > 0x00) // A Note off has a velocity > 0 |
| should read Code: if (status == 0x080 && dat2 == 0x00) // A Note off has a velocity > 0 |
| This small change, combined with a filter set up to convert all Ctrl messages to NoteOff messages was all we needed. For the routing setup we just used the Edirol MIDI interface as MidiOx input and connected the MidiOx Event Port to MidiYokeNT1 and set Reason to listen for MIDI on MidiYokeNT1. Seemed to work fine. Is this correct though Peter? I hope that all makes sense, if anyone has any questions feel free to post them here and I'll try to be more clear.
|
|
IP Logged |
|
|
|
Peter L Jones
Expert
    

Hit it
Gender: 
Posts: 978
|
 |
Re: convert allnoteoff to noteoff,problem
« Reply #6 on: Dec 29th, 2006, 3:23pm » |
Quote Modify
|
Quote:For the routing setup we just used the Edirol MIDI interface as MidiOx input and connected the MidiOx Event Port to MidiYokeNT1 and set Reason to listen for MIDI on MidiYokeNT1. Seemed to work fine. Is this correct though Peter? |
| "If it works, it works!" is a good approach . But yes, it sounds sensible. Thanks for posting about the fix-up.
|
|
IP Logged |
"...Playing fast around the drums is one thing. But to play with people for others, to listen to, that's something else. That's a whole other world." -- Tony Williams
|
|
|
|