View Single Post
Old 04-28-2012, 08:43 PM   #51
Banned
Human being with feelings
 
Banned's Avatar
 
Join Date: Mar 2008
Location: Unwired (probably in the proximity of Amsterdam)
Posts: 4,868
Default

Quote:
Originally Posted by Banned View Post
[...] I could prepare a more extensive demonstration, I guess [...]
Ok, here's a little demonstration project (8kb .zip) for people to play with:



The mapping of OSC<-->MIDI CC# needs a bit of explanation.

Every track uses the MIDI CC# number which corresponds to the track number. Up to a 100 tracks are supported with the default setting of 100. So:
- track 1 uses CC# 1;
- track 2 uses CC# 2;
- .... and so on, until:
- track 100 uses CC# 100.

(I guess you can change the default in the OSC config file to 120 if you need a tiny bit more - at some point we run out of CC# numbers on one MIDI port x 16 channels, and would have to use multiple MIDI ports, or switch to a different mapping scheme.)

I didn't want to include only the sends, and leave out track volume and pan settings, which also can be controlled with a relatively small number of parameters. So you get those as a bonus.

I have used the CC# numbers most people are probably already familiar with for volume (7) and pan (10), for stereo width / right pan (depending on pan mode), I have used the one for balance (8).

However, and this is the important part to understand: in this case, they are not used as CC# numbers, but as MIDI channels. I have only used these numbers to make it easy to remember what function they control, not to confuse you. And since I guess most people have a much bigger number of tracks than track sends in their typical projects, while we have only 16 MIDI channels and 127 CC#s, it seemed to make sense to swap them around. Once you get this, it is not hard to figure out what MIDI channel and CC# is mapped to a particular mixer parameter.

So, for a couple of examples:
- to control the volume of track 1, you'd use MIDI CC# 1 on MIDI channel 7;
- to control the panning of track 2, you'd use CC# 2 on MIDI channel 10; and so on.
- to control the stereo width of track 3 (set to 'stereo pan' mode), you'd use CC# 3 on MIDI channel 8 (while using CC# 3 on MIDI channel 10 for the panning);
- to control the right panning of track 4 (set to 'dual pan' mode), you'd use CC# 4 on MIDI channel 8 (while using CC# 4 on MIDI channel 10 for the left panning);
- ... and so on.

Then I used MIDI channels 1 to 6 to control the volume of sends 1-6 for each individual track (i.e. the MIDI channel corresponds to the send number), and MIDI channels 11 to 16 for the panning of sends 1-6 (making it easy to remember: simply prefix a 1 before the send number) to control the panning of sends 1-6 for each individual track. So:
- to control the volume of send 1 on track 1, you'd use MIDI CC# 1 on MIDI channel 1;
- to control the volume of send 3 on track 5, you'd use MIDI CC# 5 on MIDI channel 3;
- to control the panning of send 2 on track 4, you'd use MIDI CC# 4 on MIDI channel 12;
- (NB: there are no dual / stereo pan modes available for the sends/receives in REAPER - yet; feel free to put up a FR and get my +1 vote on it ).

Taken together, using most of the MIDI CC#s on all the other 15 MIDI channels (on a single I/O port), we now have a mapping for MIDI<-->OSC conversion that maps 100 tracks x (6 x send level + 6 x pan) + volume + pan + pan2 = 1500 mapped MIDI CC#s to 1500 REAPER mixer parameters . MIDI channel 9 is still completely free to do other stuff on the same port, and you can freely use notes and such on all 16 MIDI channels, so you still have room left to control switch buttons for solo / mute / record arm / monitor and such.

The REAPER/OSC side of things is easy to set up: I have used the same UDP ports that REAPER uses as defaults for its OSC control surface support (8000/9000 - if you need to modify the port numbers, it's easy enough to find them in the Pd patch and change them), and you can use REAPER's default OSC configuration, but I have also included a 'lean and mean' configuration file in the package that ensures that only the necessary data for this example patch is sent out from REAPER to Pd. Since it is quite short and may be illustrative for those interested, I quoted it below as well (EDIT: updated with a table showing the mapping in the comments).

(I also left a few hooks for adding support for receives in the Pd patch; you'll need to decrease the number of sends and so on... Have fun. )

Let me know if you have trouble installing it or getting it to work, and I'm interested to hear how you think it compares to other possible workarounds.

Quote:
Originally Posted by OSC-MIDI-conversion-example.ReaperOSC
Code:
# [OSC-MIDI-conversion]
# OSC pattern config file for Pure data example patch;
# illustrating OSC<-->MIDI conversion for track volume + (dual) pan, 
# and volume + pan for track sends 1 through 6:
# 
#   Function:    MIDI Channel:   Track: 1 |   2  |  …  |  100
# ----------------------------------------------------------------
# Track Send 1 Volume    1  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 2 Volume    2  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 3 Volume    3  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 4 Volume    4  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 5 Volume    5  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 6 Volume    6  MIDI CC#:   1  |  2  |  …  |  100   
# Track Volume           7  MIDI CC#:   1  |  2  |  …  |  100   
# Track Pan(2)           8  MIDI CC#:   1  |  2  |  …  |  100   
# --- (NOT MAPPED) ---   9  MIDI CC#:   1  |  2  |  …  |  100   
# Track Pan             10  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 1 Pan      11  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 2 Pan      12  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 3 Pan      13  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 4 Pan      14  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 5 Pan      15  MIDI CC#:   1  |  2  |  …  |  100   
# Track Send 6 Pan      16  MIDI CC#:   1  |  2  |  …  |  100   
# ----------------------------------------------------------------

DEVICE_TRACK_COUNT 100
DEVICE_SEND_COUNT 6
# Uncomment if you want to add support for track receive volume + pan:
# DEVICE_RECEIVE_COUNT 6

# ----------------------------------------------------------------

REAPER_TRACK_FOLLOWS REAPER
DEVICE_TRACK_FOLLOWS DEVICE
DEVICE_TRACK_BANK_FOLLOWS MIXER

# ----------------------------------------------------------------

TRACK_VOLUME n/track/@/volume 
TRACK_PAN n/track/@/pan 
TRACK_PAN2 n/track/@/pan2 

TRACK_SEND_VOLUME n/track/@/send/@/volume
TRACK_SEND_PAN n/track/@/send/@/pan

# Uncomment if you want to add support for track receive volume + pan:
# TRACK_RECV_VOLUME s/track/@/recv/@/volume/str
# TRACK_RECV_PAN n/track/@/recv/@/pan
PS: note to ToneE: check inside the Pd patch, I needed much less than 1500 cables there!
__________________
˙lɐd 'ʎɐʍ ƃuoɹʍ ǝɥʇ ǝɔıʌǝp ʇɐɥʇ ƃuıploɥ ǝɹ,noʎ

Last edited by Banned; 04-29-2012 at 01:37 AM.
Banned is offline   Reply With Quote