Old 03-19-2020, 08:55 AM   #1
simonluca
Human being with feelings
 
Join Date: Oct 2007
Posts: 144
Default Hardware Controller to OSC

Hello everyone,
so, in the 7th Corona lockdown day I decided to resuscitate my BCR2000 to use it as controller for plugins, softsynths, hardware synths and hardware outboards.

Since BCR has infinite rotary encoders, my goal is have parameter feedback (Reaper -> BCR) and in my understanding OSCII is the best way to achieve this.
Another Idea is to take advantage of he 14bit setting possibilities of the BCR to gain more accuracy in controlling some parameters. I thought to achieve this by "converting" 14Bit midi to OSC messages.

My problem is that the documentation is very poor, provided examples are not commented and I'm not a programmer, so I'm having a lot of troubles. Even how to define the outboard controller is not clear to me (BCR is listed in reaper as "BEHRINGER - BCR2000 - Port 1"; should I put quotation marks? Should I rename it to delete spaces in the name?).

There was a user called "Banned" (or was he banned for real?) who actually did something very similar but all his contributes are offline now and he is not active anymore since 5 years.
I'm a Max-Msp user and I write some Javascript code (always in the MaxMsp realm), so i have some sort of programming background, at least logic-side. MIDI world is kind of blurry to me but I can study it.

Anyone in the willing of helping me out? Maybe someone downloaded Mr "Banned" scripts before they got lost. Maybe someone did something similar for his/her own controller.

Thank you and stay healthy!
__________________
www.sluca.net
simonluca is offline   Reply With Quote
Old 03-19-2020, 03:40 PM   #2
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

@input in MIDI "BEHR" should work. The code matches on a substring of the device name. If this does not work look at the Midi device as it is named at the Windows or OSX level and match that. There's a detailed analysis of the matching at https://forum.cockos.com/showthread.php?t=221903

"Banned" was a friendly forum user with that clever name: he just went away one day.

See his code for the Peavey StudioMix here with some 14bit code in it
https://forum.cockos.com/showpost.ph...&postcount=284
There is other guidance in this thread

See also the Akai MidiMix script at https://forum.cockos.com/showthread.php?p=1638321

There are also short example scripts included with OSCII-Bot

Good luck

Last edited by goldenarpharazon; 03-19-2020 at 04:17 PM.
goldenarpharazon is offline   Reply With Quote
Old 03-19-2020, 05:47 PM   #3
simonluca
Human being with feelings
 
Join Date: Oct 2007
Posts: 144
Default

Thank you very much for the links.
I opened both Banned and your code and *wow*, hundreds of lines.
I'm sure they do much more than I need. Or at least I hope otherwise I'm ... well you know.



Have a nice day and thank you again.

SL
__________________
www.sluca.net
simonluca is offline   Reply With Quote
Old 03-20-2020, 02:57 AM   #4
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

What you are aiming for should work.

See also all the advice in this thread where someone was working with the Behringer.
https://forum.cockos.com/showthread.php?t=186477
goldenarpharazon is offline   Reply With Quote
Old 03-23-2020, 03:41 AM   #5
simonluca
Human being with feelings
 
Join Date: Oct 2007
Posts: 144
Default

Quote:
Originally Posted by goldenarpharazon View Post
What you are aiming for should work.

See also all the advice in this thread where someone was working with the Behringer.
https://forum.cockos.com/showthread.php?t=186477
Thank you very much, I already saw that thread. Unfortunately I still can't OSCII let recognize the Device. I tried everything, BEHR, BCR2000, BCR 2000 and every other combination with or without quotation marks. I looked how OSX calls it, I used that name, I tried to rename the device. No luck.

So, well, If I can't even do something very basic as open the device after dozen of attempts, I probably should give up. It's a pity, but I'd like to invest my Coronatime in something with an - even very little - outcome.

By the way, thank you very much for your help, it's much appreciated.

Have a nice day.

SL
__________________
www.sluca.net
simonluca is offline   Reply With Quote
Old 03-23-2020, 08:14 AM   #6
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

To encourage: this connection should be simple.

Use a Midi Monitor programme to connect up with the BCR2000 and see incoming Midi as buttons are pressed etc.
This will give you confidence in the Midi device name/port name and the BCR2000.
Also tell on the forum which OS you are working on and what drivers you have intalled and then others who have that OS can also help with confidence.
If using OSX this may help: https://feelyoursound.com/setup-midi-os-x/ since it is the port name that should be matched not the device name.
If still not working, include a screen print of how the OS lists the ports / devices?
goldenarpharazon is offline   Reply With Quote
Old 03-23-2020, 09:51 AM   #7
simonluca
Human being with feelings
 
Join Date: Oct 2007
Posts: 144
Default

Quote:
Originally Posted by goldenarpharazon View Post
To encourage: this connection should be simple.

Use a Midi Monitor programme to connect up with the BCR2000 and see incoming Midi as buttons are pressed etc.
This will give you confidence in the Midi device name/port name and the BCR2000.
Also tell on the forum which OS you are working on and what drivers you have intalled and then others who have that OS can also help with confidence.
If using OSX this may help: https://feelyoursound.com/setup-midi-os-x/ since it is the port name that should be matched not the device name.
If still not working, include a screen print of how the OS lists the ports / devices?
Ha, I like your optimism! Thank you!
Well, the BCR it's listed as "BCR2000", very simple.
Maybe I'm simply doing something completely wrong. What I did:
1) I changed the @input and @output lines to "BCR2000".
2) I copied the txt to the OSCII search folder
3) I hit "Reload scripts"

the outcome is:

Listening on '*:9000'
Warning: tried to open device matching 'BCR2000'(0) but failed, will retry
Warning: tried to open device matching 'BCR2000'(0) but failed, will retry
1 inputs, 1 outputs, 2 bidirectional

Total: 1 scripts, 1 inputs 1 outputs 2 bidirectional

This is the script.

// generic REAPER<-->alphatrack OSC, for REAPER's Default.ReaperOSC
// Only a basic volume fader works now, needs a lot more work

@input osc_in OSC "*:9000"
@output osc_out OSC "localhost:8000"

@output midi_out MIDI "BCR2000"
@input midi_in MIDI "BCR2000"

@init

track_index = 1;

track_voltab = 1024;

@timer

@oscmsg

function set_vol_fader(vol) (
vol *= 16383;
msg1=0xe0;
msg2=vol&127;
msg3=vol/128;
midisend(midi_out);
);

oscmatch("/track/%d/*") ? (
// fmt0 will have the affected track index


oscmatch("/track/%d/select") ? (
oscparm(0,0)>0 ? (
track_index=fmt0;
set_vol_fader(track_voltab[fmt0]);
);
) : oscmatch("/track/%d/volume") ? (
track_voltab[fmt0] = oscparm(0,0);
fmt0 == track_index ? set_vol_fader(track_voltab[fmt0]);
);
);


@midimsg

msg1 == 0xe0 ? (
vol = (msg2 + msg3*128) / 16383;
track_voltab[track_index] = vol;
fmt0 = track_index;
oscsend(osc_out,"/track/%d/volume", vol);
set_vol_fader(vol);
);


Am I missing something?
__________________
www.sluca.net
simonluca is offline   Reply With Quote
Old 03-23-2020, 05:06 PM   #8
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

Guessing this question is on MacOS then given what was said in post #1 and the advice of "jnobody" try the matching string "Port 1".
goldenarpharazon 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 12:39 PM.


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