Old 01-04-2015, 11:58 AM   #1
zerofab
Human being with feelings
 
Join Date: Jan 2015
Posts: 3
Default apply velocity curve to MIDI keyboard

Hi guys

I've got a CP33 keyboard with limited velocity range output. A plugin I found using the forum search already remedies that problem. However, now the problem is that I would need to add this plugin as an input FX to every single MIDI track, which does not seem very efficient to me. Also if I want to change the velocity curve in the future, I would need to do this on every track individually...

Do you guys have any ideas on how to best go about this situation?

(Is there maybe a way to create an auxilliary channel where I apply the MIDI transformations and then take the output of that channel as the MIDI input for all my other channels?)

All the best
Zerofab
zerofab is offline   Reply With Quote
Old 01-05-2015, 05:12 PM   #2
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Kalispell
Posts: 14,759
Default

Quote:
Originally Posted by zerofab View Post
Hi guys

I've got a CP33 keyboard with limited velocity range output. A plugin I found using the forum search already remedies that problem. However, now the problem is that I would need to add this plugin as an input FX to every single MIDI track, which does not seem very efficient to me. Also if I want to change the velocity curve in the future, I would need to do this on every track individually...

Do you guys have any ideas on how to best go about this situation?

(Is there maybe a way to create an auxilliary channel where I apply the MIDI transformations and then take the output of that channel as the MIDI input for all my other channels?)
Hi Zerofab, and welcome to the forum.

What plugin are you talking about that remedies the problem?

When you say your keyboard has a limited velocity range, what exactly do you mean, is it only putting out a few velocity levels?
Tod is offline   Reply With Quote
Old 01-06-2015, 04:05 AM   #3
zerofab
Human being with feelings
 
Join Date: Jan 2015
Posts: 3
Default

Hi Tod

Thank you, glad to be here

The plugin that solved the limited velocity range problem can be found in this thread, it's called "velocity range tool" (I've also attached it to my post now):

http://forum.cockos.com/showthread.p...+midi+keyboard

What I mean by limited is that it only outputs velocities from 30 - 100 when I play my softest / hardest instead of the full range of 1-127. This limitation meant that when I played f.i. a piano VST with my MIDI keyboard it just didn't sound / feel "right". This problem has been solved by using the velocity range tool described above that seems to act like a type of "expander", extrapolating the limited dynamic range from my keyboard (i.e. 30-100) onto the full dynamic range (1-127).

The pitfall of using this plugin is that it needs to be on every single MIDI track in Reaper, which really is not practical at all for a number of reasons (i.e. what happens if I switch keyboard, tedious to implement in existing projects, etc...)

Any ideas?
zerofab is offline   Reply With Quote
Old 01-06-2015, 08:41 AM   #4
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default

Scale velocity *outside* of REAPER using some MIDI processing tool. OSCII-bot would work fine for this, for just one example.
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ
Banned is offline   Reply With Quote
Old 01-06-2015, 09:12 AM   #5
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,681
Default

Quote:
Originally Posted by zerofab View Post
The pitfall of using this plugin is that it needs to be on every single MIDI track in Reaper, which really is not practical at all for a number of reasons (i.e. what happens if I switch keyboard, tedious to implement in existing projects, etc...)

Any ideas?
Just thinking out loud (a bit of faff, but):
-- set your keyboard to, say, channel 16.
-- create a track with the plug-in on it and set to Record (Monitoring only) from channel 16
-- RecArm that track,
-- Send that track to other tracks (possibly changing the MIDI channel in the Sends to 01, 02 etc)

-- set those other tracks to Record the Output
-- set those tracks' Record Input to a channel other than 16
-- RecArm the track on which you want to record.


So the incoming MIDI goes to the first track and to the other RecArmed track.
On the first track, the note velocities are modified by the FX and Sent to the other tracks.

The other RecArmed track directly receives the MIDI from the keyboard, but ignores that as the Record Input for the track is not channel 16. The track also receives the MIDI from the first track. That MIDI can be recorded or sent to a synth or both.

Here is an example:



Once you have got it set up, save all the tracks as a Track Tempalte for next time.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 01-06-2015, 10:12 AM   #6
zerofab
Human being with feelings
 
Join Date: Jan 2015
Posts: 3
Default

Hi guys

I went with the solution of Banned, downloaded MidiPipe and ported the reaper JS plugin to Applescript (OSA script). Then I disabled the MIDI keyboard output and enabled the MidiPipe output in Reaper MIDI preferences. Tracks are set to record MIDI from all devices / channels and everything works like a charm now )

Many thanks to both of you, Banned and DarkStar, for your help!

All the best
zerofab

PS: Here's the applescript I used within MidiPipe (e.g "Applescript Trigger"); a ported version of the Reaper JS plugin that I have found on this forum:

Code:
on runme(message)

-- parameters
set channel to 1
set inputVelocityMin to 30
set inputVelocityMax to 90
set outputVelocityMin to 10
set outputVelocityMax to 127

-- init
set midiCommand to item 1 of message
set midiNote to item 2 of message
set midiVelocity to item 3 of message
set midiNewVelocity to 0
set inputVelocityRange to (inputVelocityMax - inputVelocityMin)
set outputVelocityRange to (outputVelocityMax - outputVelocityMin)

-- only apply to NoteOn command on specified channel
if midiCommand = (143 + channel) and midiVelocity > 0 then

	-- calculate new velocity based on parameters
	set midiNewVelocity to round(((((midiVelocity - inputVelocityMin) * outputVelocityRange) / inputVelocityRange) + outputVelocityMin) + 0.5)

	-- limit size to allowed velocity range
	if midiNewVelocity ≥ 0 then 
	
		set midiNewVelocity to midiNewVelocity
	
	else
	
		set midiNewVelocity to 0
	
	end if
	
	if midiNewVelocity ≤ 127 then 
	
		set midiNewVelocity to midiNewVelocity
	
	else
	
		set midiNewVelocity to 127
	
	end if

	-- set new velocity to correctly deliver message
	set midiVelocity to midiNewVelocity

end if

-- deliver message
return {midiCommand, midiNote, midiVelocity}

end runme
zerofab is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.