Old 03-26-2020, 07:42 AM   #1
domportera
Human being with feelings
 
Join Date: Mar 2020
Posts: 13
Question OSC CC Pitch Bend

Iím trying to make an application that communicates via OSC to Reaper. Basically, Iím trying to make a pitch bend wheel app where I control midi with my normal controller, but use OSC to control the pitch bend via an Android app. I will share this with you all if I get this working! I'd even port it to iPhone but I won't be able to test it there.

Iíve successfully done OSC control with MIDI note messages, but Iím having trouble trying to control CC. Reaper gets my messages but it doesn't respond to them. Iíve tried every combination of OSC string I could come up with based on the default Reaper OSC format, but I might be missing something or formatting improperly.

Any tips on the proper message I should be sending? Is this at all possible?
domportera is offline   Reply With Quote
Old 03-26-2020, 10:37 AM   #2
pljones
Human being with feelings
 
pljones's Avatar
 
Join Date: Aug 2007
Location: London, UK
Posts: 711
Default

Be clear that Pitch Bend and Continuous Controller are two different MIDI messages. (Just like Note On and Continuous Controller are different.)

Default.ReaperOSC contains lines that handle the useful types of MIDI message.

So, for MIDI CC, you should have:
# for CCs, if two, first wildcard is channel (0-15). MIDI CC number is required (as decimal integer only!)
VKB_MIDI_CC i/vkb_midi/@/cc/@ f/vkb_midi/@/cc/@ i/vkb_midi/cc/@ f/vkb_midi/cc/@

That would match either of these for CC1=32 (first explicitly on channel 0):
/vkb_midi/0/cc/1 32
/vkb_midi/cc/1 32

And for Pitch Bend
# pitch can take channel as wildcard, or value only
VKB_MIDI_PITCH i/vkb_midi/@/pitch f/vkb_midi/@/pitch i/vkb_midi/pitch f/vkb_midi/pitch

That would match either of these (first explicitly on channel 0):
/vkb_midi/0/pitch 300
/vkb_midi/pitch 300

I have a horrible feeling that "300" is taken and turned into a two MIDI data byte pair, i.e. the literal "on the wire" value. That makes life annoyingly difficult. Basically, you've a 14 bit value with a range of 0 to 16383, where 0 or 1 is the maximum pitch bend down and 16383 the maximum up, with 8191 or 8192 being "in the middle" (zero bend). Then you have to think "Ah, I'm working from -1200 to +1200, so I divide 16384 by 2400 and multiply by the adjustment I want plus 1200. Simple!"

I'm assuming all the VKB messages map (roughly) to StuffMIDIMessage...

Are these not present / not working? Do you have a track with the MIDI In routed correctly?
__________________
Quote:
Originally Posted by Tony Williams
...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.

Last edited by pljones; 03-26-2020 at 10:46 AM.
pljones is offline   Reply With Quote
Old 03-26-2020, 12:06 PM   #3
domportera
Human being with feelings
 
Join Date: Mar 2020
Posts: 13
Default

Yes that was it!! I thought it was CC because I couldn't get the pitch command to work either, good to know now.

My issues were mostly that I was using a / at the end of the address most of the time I was testing, and when I wasn't I assumed it was an 7 bit integer, so i was mapping 0-127 which was basically imperceptible. But now that I have the proper size mapped to my slider it works perfectly!

Thanks so much for your thorough help! It will help me beyond just this problem as well.

I will update this thread when I have a proper build ready for use by others
domportera is offline   Reply With Quote
Old 03-26-2020, 02:49 PM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 9,012
Default

Quote:
Originally Posted by domportera View Post
I’m trying to make an application that communicates via OSC to Reaper.
You could use OSIIBot to convert OSC to Midi and LoopMidi to allow fo connecting the Midi device interfaces of Reaper and OSCIIBot.

(I do this to do something like synchronizing an OSC aware Mixer with Reaper.)

-Michael

Last edited by mschnell; 03-26-2020 at 11:09 PM.
mschnell is offline   Reply With Quote
Old 03-26-2020, 07:48 PM   #5
domportera
Human being with feelings
 
Join Date: Mar 2020
Posts: 13
Exclamation Progress so far

Thanks for the tip, I'll check it out!

Here's the android app so far - https://appsenjoy.com/download/b49dc...433392d33.html

Obviously requires both Reaper and your phone to be on the same network.

Github:
https://github.com/domportera/OSC-Mod-Wheels

Super simple app, but it adds lots of value to my midi keyboard
domportera is offline   Reply With Quote
Old 03-26-2020, 10:41 PM   #6
Fergler
Human being with feelings
 
Fergler's Avatar
 
Join Date: Jan 2014
Posts: 4,196
Default

Does it present a better latency than using rc.reaper.fm to control an instance or ReaControlMIDI?
__________________
Check out my hip-hop, funk-rock band Theatre Crisp
Fergler is offline   Reply With Quote
Old 03-27-2020, 08:05 AM   #7
domportera
Human being with feelings
 
Join Date: Mar 2020
Posts: 13
Default

Quote:
Originally Posted by Fergler View Post
Does it present a better latency than using rc.reaper.fm to control an instance or ReaControlMIDI?
Couldn't tell you honestly 🤷 Latency is basically whatever your local network takes for a UDP packet.

The app has been updated to have 6 different controls that can be used simultaneously - Pitch, mod wheel, channel pressure, expression, foot pedal, and volume. Pitch behaves as a wheel that re-centers itself, while the rest is treated like a fader. I'll put out a new build later but I want to address a couple of nitpicky things first.

Last edited by domportera; 03-27-2020 at 09:33 AM.
domportera 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 02:15 AM.


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