Author |
Topic: Map CC to Midi Note Velocity (Read 2792 times) |
|
LarrySeyer
New Member


MIDI-OX Rules!
Gender: 
Posts: 4
|
 |
Map CC to Midi Note Velocity
« on: Dec 4th, 2005, 9:26pm » |
Quote Modify
|
I'm trying to put some 'life' into some MIDI scores that I'm working on. All of the MIDI notes are set to velocity 100... (it is a limitation of the notation program that was used and the fact that the person who entered the data simply chose the default value for each of the notes that she entered into the engraver) As most of you already know, sending this data to any sample library results in a very bland and boring computer sounding type of orchestral output. What I would like to do is to map my CC #1 mod wheel to control the velocity of the notes being played. In other words, I want to keep the NOTE on/off information... the timing, but NOT the velocty of the notes... I want to be able to use the MOD wheel to control the velocity of the notes played. Doing this will allow me to 'breath' some life into these lifeless scores. So far, I have not be able to figure out how to do this... Does anyone have a clue as to how this can be done? Thanks! Best to you! Larry Seyer www.larryseyer.com
|
|
IP Logged |
www.larryseyer.com www.electriclarryland.com (Podcast) www.larryseyer.com/wordpress (blog)
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Map CC to Midi Note Velocity
« Reply #1 on: Dec 5th, 2005, 3:13am » |
Quote Modify
|
You could do this using MIDI-OX, but not by using the normal mapping feature. You can't change the value of one message (Note On) by using a message that arrived at a different time (Modulation). You might try experimenting with the Expression controller, but that will change the overall volume of all notes playing. You can use MIDI-OX's scripting capabilities to do what you requested. I wrote a simple script in JavaScript to give it a try. Here's the code for the entire script: // 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 == 0x0B0 && dat1 == 0x01) // Mod Wheel { // A new Modulation value for this channel has arrived: // remember it, and eat the controller modVal[ chan ] = dat2; } else if (status == 0x090 && dat2 > 0x00) { // A Note On has a velocity > 0 if (modVal[ chan ] > 0) // Only map for non 0 modulation { velo = modVal[ chan ]; } else { velo = dat2; } mox.OutputMidiMsg( -1, stat, dat1, velo ); } else // other message = just output { mox.OutputMidiMsg( -1, stat, dat1, dat2 ); } } I also placed it online in case anyone wants to download: ModVelo.js
|
« Last Edit: Dec 5th, 2005, 3:17am by Jamie OConnell » |
IP Logged |
--Jamie Music is its own reward.
|
|
|
LarrySeyer
New Member


MIDI-OX Rules!
Gender: 
Posts: 4
|
 |
Re: Map CC to Midi Note Velocity
« Reply #2 on: Dec 5th, 2005, 3:27am » |
Quote Modify
|
Wow, thanks! I can't wait to try this! Best to you! Larry Seyer
|
|
IP Logged |
www.larryseyer.com www.electriclarryland.com (Podcast) www.larryseyer.com/wordpress (blog)
|
|
|
LarrySeyer
New Member


MIDI-OX Rules!
Gender: 
Posts: 4
|
 |
Re: Map CC to Midi Note Velocity
« Reply #3 on: Dec 5th, 2005, 1:01pm » |
Quote Modify
|
OK, I got the .JS to load.. ( I simply clicked on the .JS and it ran ). Simple enough. However, instead of controlling the velocity of the notes, it seems to be controlling the timing of them? Is this even possible? For whatever reason, the velocities are not being affected by this script... but the timing is. When I move the mod wheel up and down, I can delay/advance the timing of the notes sent, but not the velocity. Any ideas? Thanks! Best to you! Larry Seyer PS Here is my gear: Nuendo 2.2 AMD Dual Opteron with 4 gigs of RAM RAID 10 typical controller, typical keyboard, typical trackball Emagic Unitor 8 GigaStudio 3.1 on seperate computer via port 8 on Unitor (Intel P4 3.2)
|
« Last Edit: Dec 5th, 2005, 1:20pm by LarrySeyer » |
IP Logged |
www.larryseyer.com www.electriclarryland.com (Podcast) www.larryseyer.com/wordpress (blog)
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Map CC to Midi Note Velocity
« Reply #4 on: Dec 5th, 2005, 2:06pm » |
Quote Modify
|
I didn't see any timing differences at all in my experiments. If there are it would be related to some lagging of Windows Script Host operation. To verify that the script worked, here is what I did... 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). Launched MIDIBar (Actions | Play MIDI...), and set its Output to MIDI Yoke 1. I then loaded a fairly dense MIDI file and pressed Play. As the file played (the timing of it was fine), I wiggled the mod controller wheel on the Keyboard. It definitely affected the velocity level of the Notes being played on channel 1. To confirm I looked at the MIDI-OX Output (default) monitor and saw that the velocities were being adjusted, and were different from the Input monitor. I am wondering how my experiment differed from yours? The MIDI must be streaming exclusively through MIDI-OX to have any permanent effect on the velocities. Are you playing these constant velocity files out of your notation package or Nuendo, through MIDI Yoke to MIDI-OX? Is it then being output from MIDI-OX to the GigaStudio computer?
|
|
IP Logged |
--Jamie Music is its own reward.
|
|
|
LarrySeyer
New Member


MIDI-OX Rules!
Gender: 
Posts: 4
|
 |
Re: Map CC to Midi Note Velocity
« Reply #5 on: Dec 5th, 2005, 4:48pm » |
Quote Modify
|
It works!!!! I was confused on how to wire it up... This is great! ok... I'm giving you guys money. (hope you take PayPal) Best to you! Larry Seyer
|
|
IP Logged |
www.larryseyer.com www.electriclarryland.com (Podcast) www.larryseyer.com/wordpress (blog)
|
|
|
|