User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Selecting note number based on CC »
Welcome, Guest. Please Login or Register.
May 7th, 2025, 6:24pm


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Mapping Questions
(Moderator: Jamie OConnell)
   Selecting note number based on CC
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Selecting note number based on CC  (Read 2054 times)
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Selecting note number based on CC
« on: Mar 21st, 2005, 4:52pm »
Quote Quote Modify Modify

Is it possible (other than through scripting) to change the note number of an event based on the value of a continuous controller? I'm hoping to do this so I can play hi-hat sounds sampled at different open positions in Reason based on the position of my hi-hat foot pedal. I don't see a way to do this through mapping, so I just wanted to make sure I'm not missing something before I start learning how to do it through scripting.
IP Logged
Peter L Jones
Expert
*****




Hit it

   
WWW

Gender: male
Posts: 978
Re: Selecting note number based on CC
« Reply #1 on: Mar 21st, 2005, 7:23pm »
Quote Quote Modify Modify

My gut instinct is "no"...  But wait...
 
#1 Translate the CC value into a Program Change and route back into MIDI OX.
 
#2 Then use a Patch Map to switch in a different translation data map, with the incoming note number mapped to different values for hihat.
 
Untried... let me know if it works - I might use it! Smiley
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
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #2 on: Mar 21st, 2005, 8:43pm »
Quote Quote Modify Modify

Thanks for the suggestion. I'll try this out, hopefully in the next few days.
 
After my original post, I saw a few other related posts where the discussion ultimately led to the need to store note events so that the incoming note off event could also be mapped to the appropriate note based on the controller value at the time of the note on. However, I think it could be done without storing history, as follows.
 
When the note on arrives at the input, check the value of the controller, then do two things.
 
1) Send note on with new note # based on controller value
2) Send a note off with the new note #, delayed by a few ms
 
The note off event for the original note on at the input could then be ignored since a new note off would be generated.
 
This should work given that Reason's NN-XT sampler just needs a quick note on/off to trigger the drum sound - it doesn't need a sustained note. The question is whether or not MIDI-OX will do this (generate two events based on one event and a controller value) without scripting. I haven't found a way to do this, but I'll try the program change suggestion.
IP Logged
Peter L Jones
Expert
*****




Hit it

   
WWW

Gender: male
Posts: 978
Re: Selecting note number based on CC
« Reply #3 on: Mar 22nd, 2005, 12:49pm »
Quote Quote Modify Modify

on Mar 21st, 2005, 8:43pm, mbone12368 wrote:
When the note on arrives at the input, check the value of the controller,
Where are you planning on storing the value from the last MIDI CC event?
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
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #4 on: Mar 22nd, 2005, 4:17pm »
Quote Quote Modify Modify

I have just a basic understanding of midi at the moment, so maybe I'm missing something. I'm thinking the only time you need the CC value is when the note on arrives. At that time, both a new note on (with a new note #) and a note off (with the same new note #) are generated, but the new note off is delayed, and the original note off is ignored. There's no need to store the CC value, as long as the new note # is stored. So, technically, this scheme does require storage for delaying the note off, but MIDI-OX already does that.
 
The point I'm trying to make here is that implementing a multi-note open hi-hat sound is theoretically possible without storing an event history, beyond what MIDI-OX already does for delaying events. This is in response to other hi-hat controller related posts where Jamie and possibly others stated that this would require storing event history. I'm just suggesting that this may be simpler to implement in MIDI-OX than originally thought.
 
It would be really cool if MIDI-OX had the ability to generate two events (note on and delayed note off) based on a combination of a note on event and a CC value sampled at the time the note on arrived. I don't believe this is possible at the moment (unless the suggestion in the post above from Peter L Jones works) without scripting.
IP Logged
Peter L Jones
Expert
*****




Hit it

   
WWW

Gender: male
Posts: 978
Re: Selecting note number based on CC
« Reply #5 on: Mar 23rd, 2005, 6:29am »
Quote Quote Modify Modify

on Mar 22nd, 2005, 4:17pm, mbone12368 wrote:
I'm thinking the only time you need the CC value is when the note on arrives.

Yes but the only time you have access to the CC value is when the CC message arrives.  Unless you store it.  All events are completely discrete.
 
(Unlike in analogue hardware, you can't just sample the current value of something when you need it.  In digital hardware, of course, the values are all stored in memories.)
« Last Edit: Mar 23rd, 2005, 6:31am 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
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #6 on: Mar 23rd, 2005, 9:14am »
Quote Quote Modify Modify

I think I'm starting to understand what you're saying. Do you mean that the CC value may not arrive at the same time as the note on event? If so, you'd have to continually store the CC values, say in a one event FIFO, and grab the latest stored value when the note on arrives. Is this correct?
IP Logged
Peter L Jones
Expert
*****




Hit it

   
WWW

Gender: male
Posts: 978
Re: Selecting note number based on CC
« Reply #7 on: Mar 23rd, 2005, 12:41pm »
Quote Quote Modify Modify

Yes but...  A FIFO's not a good idea...  What if you get two notes with no CC between?  You've read the only value in the FIFO already, so there's nothing there for subsequent notes.  If you don't intend to remove the value, then it's not a FIFO, it's just a memory store, written to on receipt of a CC message and read on receipt of a Note message.
 
My alternative approach above immediately turns the CC into a Program Change (no memory needed), then immediately acts on the Program Change (to replace the current translation map).  The different translation maps would each immediately translate a (Closed or Open) HiHat note into some other note - different for each map - that you could assign to the various opennesses.
 
I'm doing something similar to change the channel number on my MIDI keyboard using my FCB1010.  Each button (in one of the banks) tells MIDI OX to load a map that translates the channel number on MIDI messages to a fixed value, with a different map loaded by each button and a different fixed channel number in each map.  The FCB1010 sends Program Changes, though, so I don't need the first step - hence I can't say it will work Cheesy.
 
___________
 
Of course, if you're using a sampler that understands MIDI CCs, you can probably adapt the multisample map to get the effect you're after using the CC directly.
« Last Edit: Mar 23rd, 2005, 12:47pm 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
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #8 on: Mar 23rd, 2005, 7:34pm »
Quote Quote Modify Modify

Thanks for all your help. I'm sure it's obvious that I have some learning to do about midi. I'm going to try your suggestion soon - I'm still trying to make time for it. I'll let you know if it works.
 
I'm trying to do this so I can use my drum set with the Reason Drum Kits refill using the NN-XT sampler. I wish it had the ability to map samples based on CC. That would make things simpler. Maybe there's a way to do it in Reason, but I haven't been able to figure it out. It doesn't mention anything about it in the manual. I'll try the Propellerhead forums and see if there's a way. If not, I'll certainly request this feature in a future version of Reason's NN-XT.
 
Good luck with your keyboard project!
IP Logged
mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #9 on: Apr 6th, 2005, 4:04pm »
Quote Quote Modify Modify

I finally got around to trying to convert control changes to program changes. It works, except for one mysterious thing, which I'll get to in a moment. I had to do this using two instances of MIDI-OX. The first takes the external input and converts the control change events to program change events based on different ranges of the current controller value, then delays note off events by 3ms, and sends the output to Midi Yoke 2. The second instance of MIDI-OX takes the output from Midi Yoke 2 and sends it to Midi Yoke 1. A patch map switches between open 1, open 2, and open 3 hi-hat sounds based on the program changes generated by the first instance. Each map converts the open hi-hat note number to either open 1, open 2, or open 3 note number. The map for open 3 is loaded at startup. Otherwise, the note number conversion wouldn't start until the pedal controller is first moved to load a map file.
 
This seems to be working as expected, but here's the strange part. The first instance of MIDI-OX shows a 3ms delay on note off events (actually note on with velocity 0) when comparing the output to the input. However, when the same note shows up on the input of the second instance, the note off is delayed by an additional 3ms, for a total delay of 6ms. The output monitor of the second instance shows the same timestamps as the input, thus also showing a 6ms delay. I don't think this is hurting performance at all, but I can't figure out why it's happening.
 
To get back to my original application, this isn't really the end of what I'm trying to do, but it's a big start. The DM Pro drum module sends several note numbers for the hi-hat. It sends open and closed notes as well as pedal down and pedal up notes. There is a threshold that determines the boundary between open and closed, and the control value starts at 0 when up, and goes to 127 when fully depressed. When the controller value is below the threshold (pedal not pressed down very far) an open hi-hat note number is sent when the hi-hat is struck. When the pedal is pressed down further and it passes the threshold, a pedal down note is sent, and when the hi-hat is struck, a closed hi-hat note number is sent. As the pedal is lifted past the threshold again, a pedal up note is generated and when the hi-hat is struck, the open hi-hat note is generated again.
 
The problem I have is that the threshold doesn't quite work the way it's supposed to for sending midi to other devices even though it seems to work fine for the DM Pro's internal sound generator. On the way down, the threshold seems to be around 100-120, but it varies wildly. On the way back up, it switches back to the open note around 55-80 on the controller value. So the threshold is not the same going down as coming back up, and there's not much range in the open part of the controller for switching among three different open sounds. Changing the threshold and other settings on the DM Pro doesn't seem to make things better. What I could do is capture both the open and closed note numbers in MIDI-OX and decide whether it should be closed, open 1, open 2, or open 3 based on the controller value. The problem comes when I try to create the pedal down and pedal up events. I would need to store the previous controller value to know when the pedal crossed the threshold in either direction to generate the proper note number. Also, the DM Pro calculates the velocity of the pedal down/up based on the velocity of the pedal. This would also require storage of at least one past controller value to calculate velocity. So, in order to carry this further, it looks like I'll have to use scripting.
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: Selecting note number based on CC
« Reply #10 on: Apr 8th, 2005, 2:23pm »
Quote Quote Modify Modify

Quote:
This seems to be working as expected, but here's the strange part. The first instance of MIDI-OX shows a 3ms delay on note off events (actually note on with velocity 0) when comparing the output to the input. However, when the same note shows up on the input of the second instance, the note off is delayed by an additional 3ms, for a total delay of 6ms. The output monitor of the second instance shows the same timestamps as the input, thus also showing a 6ms delay. I don't think this is hurting performance at all, but I can't figure out why it's happening.

 
MIDI-OX Data Mapping allows specification of a delay for any event.  Ensure you don't have this enabled.  MIDI TimeStamps are relative to the last time MIDI Reset was called on the Input device driver (typically only done right after an Open call), but different instances will usually have different startup points in time.
 
IP Logged

--Jamie
Music is its own reward.

mbone12368
New Member
*



MIDI-OX Rules!

   


Posts: 9
Re: Selecting note number based on CC
« Reply #11 on: Apr 12th, 2005, 8:19pm »
Quote Quote Modify Modify

I realize there's a difference in absolute timestamps between the two instances. But just looking at the difference between the note on and corresponding note off I also noticed that another few ms delay is being added to note off events in the second instance. There is no delay defined in the mapping of the second instance. There is only a delay set for note off events in the first instance, so this is puzzling.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.