Old 07-25-2018, 06:12 PM   #1
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default Reaper MIDI Feedback

DO NOT USE MOTORIZED FADERS FOR NOW!!! See the README.md file for more info.

First off, yes, I am aware of ReaLearn and Geoff Waddington's CSI extension, but I use Linux and did not see Linux builds for either when I started. Plus, this is a more straight forward solution to the specific problem w/o extra features (or needing extra plugins like ReaLearn uses). Also, they do not seem to be open source, so no way for me to contribute. By doing it myself, I get exactly what I want, ASAP, and everybody else gets to see/use the code for their own application/education (and Python FTW)! That being said, I do recommend you look at the others first.

About:
This script basically does what it says on the tin. It looks at your FX MIDI mapping and returns the FX parameter's value back to the MIDI controller, so it can update it's faders/LEDs/etc. to correspond with the selected track/plugin (depending on what is selected and how you have the mapping options set, i.e. "Enable only when..." under param -> Learn). It should (and has in my tests so far) eliminate the need for "Soft takeover" by keeping physical CCs in sync w/ FX parameters they are mapped to.

This was developed in/for Linux, but should (in theory) work on other platforms. It will just only support JS and VST without minor modification. It has also only been tested on a Behringer BCR2000 using Python 2.7, however it should work with any controller in any version of Python 2.7 and later...in theory....

This is my first ReaScript and I'm also completely new to programming for MIDI devices, so constructive criticism is appreciated!

Download:
https://bitbucket.org/experimentfail...ck/src/master/

There is quite a bit more information in the README.md file. Also, I enabled the Issue Tracker in BitBucket, so please use that or post here with questions or to report bugs.

I will edit this post as I progress. You may want to subscribe to the thread as well, as I will try to reply to it when I push updates.

p.s. there is no official name of this script/project...just midi_feedback I guess. I only added Reaper to the git repo so it was clear what it was for.

UPDATE 8/02/18: I'm considering this in "alpha" state now. It seems all basic functionality is working in my limited tests (in other words, it updates MY controller as expected, respecting "Enable only when..." options in param -> Learn, as best as I understand/have tested them).

UPDATE 8/22/18: I'll delete this little entry when I get back to it, but just in case anyone is paying attention, I'm taking a break from this while I deal with a minor transitional period at my day job. And anyway, right now, the script possess the minimal functionality needed to be useful to me, so not much I can do until I really start to use it in practice. Cheers.

Last edited by experimentfailed; 08-22-2018 at 04:03 PM.
experimentfailed is offline   Reply With Quote
Old 07-26-2018, 11:44 AM   #2
Tiggerdyret
Human being with feelings
 
Join Date: Jan 2016
Posts: 166
Default

Great, do you plan on adding more features down the line?
Tiggerdyret is online now   Reply With Quote
Old 07-26-2018, 01:25 PM   #3
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Well, I have a couple things that I want to achieve in my own workflow, but not 100% sure how to approach them yet. For example, one thing I really want is a "channel strip mode", so I can control multiple parameters from multiple plugins on a track at once from my BCR2000.

The holy grail, though, would be to let my script also handle the MIDI input from the controller, so I can do way more advanced stuff like button combinations (as in: hold a button while pressing another for alternative function). I just don't know if that will be possible or not...I know how to read MIDI input in Python but it will take some experimenting to see if I can do it in an actual ReaScript. If it can be done, though, it would pretty much be the last word on control surface integration
experimentfailed is offline   Reply With Quote
Old 07-26-2018, 09:27 PM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,739
Default

A Reaper extension supporting any Surface in a definable way / Workflow is being worked on -> https://forum.cockos.com/showthread.php?t=183143

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 07-27-2018 at 05:27 AM.
mschnell is online now   Reply With Quote
Old 07-27-2018, 03:10 AM   #5
Tiggerdyret
Human being with feelings
 
Join Date: Jan 2016
Posts: 166
Default

Quote:
Originally Posted by experimentfailed View Post
Well, I have a couple things that I want to achieve in my own workflow, but not 100% sure how to approach them yet. For example, one thing I really want is a "channel strip mode", so I can control multiple parameters from multiple plugins on a track at once from my BCR2000.

The holy grail, though, would be to let my script also handle the MIDI input from the controller, so I can do way more advanced stuff like button combinations (as in: hold a button while pressing another for alternative function). I just don't know if that will be possible or not...I know how to read MIDI input in Python but it will take some experimenting to see if I can do it in an actual ReaScript. If it can be done, though, it would pretty much be the last word on control surface integration
Yeah, that's what I want to do too. I made this post in the Realearn thread:
Quote:
Originally Posted by Tiggerdyret View Post
I also had a cool idea of a feature for "grouped plugin focus", which means instead of having either "track selected" or "fx in focus", you categorize different groups and control what fx are handled together by different groups. So if one fx from the group is in focus you are controlling all the plugins in that group at the same time. Whenever I click on one of the effects in a particular group all of the fxs are made active.
Tiggerdyret is online now   Reply With Quote
Old 07-27-2018, 06:13 AM   #6
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Tiggerdyret - Interesting idea. Sounds a bit more fleshed out than mine. I hadn't considered the option of switching from channel strip to single-FX mode sorta thing.

I just started working on the basics to get any of this working last night, which is basically to make it start respecting those settings (the only when track/FX selected settings). Hopefully will have something working in the next couple of days (it's Friday \o/).

Thanks!


Quote:
Originally Posted by mschnell View Post
A Reaper extension supporting any Surface in a definable way / Workflow is being worked on -> https://forum.cockos.com/showthread.php?t=183143

-Michael
I"m aware of that project too, but didn't see a Linux build. That's usually the story of my life. Plus, I'm a programmer, his project does not seem to be open source (and I prefer Python anyway, not to mention only know a little C/C++ atm), and I want to get my hands dirty.

Last edited by experimentfailed; 07-27-2018 at 07:26 AM.
experimentfailed is offline   Reply With Quote
Old 07-27-2018, 08:25 AM   #7
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,739
Default

Quote:
Originally Posted by experimentfailed View Post
didn't see a Linux build. That's usually the story of my life.
Of course it would be nice if Geoff would provide a Linux built, once he's out of Alpha.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 07-29-2018, 12:29 PM   #8
Tiggerdyret
Human being with feelings
 
Join Date: Jan 2016
Posts: 166
Default

Quote:
Originally Posted by experimentfailed View Post
Tiggerdyret - Interesting idea. Sounds a bit more fleshed out than mine. I hadn't considered the option of switching from channel strip to single-FX mode sorta thing.
Yeah, would also be cool for switching between channels strips style configs, instrument configurations or any other fx chain you could think of; like adding a gain knob to a saturation plugin that doesn't have one or making a tape style delay with 3 different plugins all controlled without having to click the mouse more than once.
Tiggerdyret is online now   Reply With Quote
Old 08-02-2018, 06:28 PM   #9
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

@all- I think I have achieved the most basic desired behavior, at least for my BCR2000...So far, it seems to be good enough to be useful/powerful, even if I can't get my bigger dreams accomplished.

Quote:
Originally Posted by Tiggerdyret View Post
Yeah, would also be cool for switching between channels strips style configs, instrument configurations or any other fx chain you could think of; like adding a gain knob to a saturation plugin that doesn't have one or making a tape style delay with 3 different plugins all controlled without having to click the mouse more than once.
I'm not sure I follow... Either way, my most promising thought process right now for channel strips (given what is feasible for my time/experience), will be to have the user define/save a "master" FX chain file they set up in REAPER, that will be their ALTERNATE "Channel Strip Mode" mappings for each plugin. I'm just not sure yet if any of my ideas will be feasible, but at least it looks like I've accomplished my most basic goals for this script

Last edited by experimentfailed; 08-03-2018 at 02:39 PM.
experimentfailed is offline   Reply With Quote
Old 08-03-2018, 03:43 PM   #10
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,060
Default

Thanks for sharing this.

I wanted to give it a try (also BCR2000 user here) but on running the script I get this error:



This is with the latest script version from your repo (downloaded a few minutes ago), Win 8.1 x64, Python 3.3.

Any idea ?
nofish is offline   Reply With Quote
Old 08-04-2018, 09:47 AM   #11
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 438
Default

Quote:
Originally Posted by nofish View Post
Python 3.3.
xrange is a Python2ism, so I'm guessing the script doesn't support Python 3.
tack is offline   Reply With Quote
Old 08-04-2018, 11:35 AM   #12
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,060
Default

Quote:
Originally Posted by tack View Post
xrange is a Python2ism, so I'm guessing the script doesn't support Python 3.
Yep, trying with Python 2.7 did the trick, thanks.

My BCR output is listed second in Reaper's MIDI output list but I had to use
Code:
midiOutDev = 18
to get feedback going, so maybe it's offset by one compared to in Linux.

But other than that, seems to work nicely so far.
The approach that no extra plugin is needed for feedback and instead just doing the mapping natively in Reaper and being done with it I really like.

Will do more testing and report back if I find something worth mentioning.

Thanks again.

Last edited by nofish; 08-04-2018 at 11:43 AM.
nofish is offline   Reply With Quote
Old 08-04-2018, 04:52 PM   #13
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Quote:
Originally Posted by nofish View Post
Yep, trying with Python 2.7 did the trick, thanks.

My BCR output is listed second in Reaper's MIDI output list but I had to use
Code:
midiOutDev = 18
to get feedback going, so maybe it's offset by one compared to in Linux.

But other than that, seems to work nicely so far.
The approach that no extra plugin is needed for feedback and instead just doing the mapping natively in Reaper and being done with it I really like.

Will do more testing and report back if I find something worth mentioning.

Thanks again.
Sorry for the version confusion! I've just pushed an update replacing xrange w/ range - not sure why I did that. Old habit I guess.

I also made a note of your output device findings in the instructions. The API documentation says hardware outputs start at 16, so I assumed that's for all platforms but I guess not...

Glad you got it going and that it seems to be working out
experimentfailed is offline   Reply With Quote
Old 08-05-2018, 07:58 AM   #14
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,060
Default

Quote:
Originally Posted by experimentfailed View Post
Sorry for the version confusion! I've just pushed an update replacing xrange w/ range - not sure why I did that. Old habit I guess.
Thanks.
There are still other occurences in there it seems.

https://bitbucket.org/experimentfail...feedback.py-39
nofish is offline   Reply With Quote
Old 08-05-2018, 01:05 PM   #15
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Quote:
Originally Posted by nofish View Post
Thanks.
There are still other occurences in there it seems.

https://bitbucket.org/experimentfail...feedback.py-39
lolfail...thanks! Fixed and pushed again...I need to get Python 3 working in my environment (it's fine on my system but REAPER wasn't having it).

Also updated experimental, trying to reduce flickering of the BCR2000. I would say give it a try, but it only seems to slightly reduce the problem. My original idea isn't working, which was to store the values in a list, and check if they have changed each frame, before updating that CC. It worked on a more simplified version and eliminated the problem, so I'll keep muddling through until I figure out wtf is wrong with my logic.
experimentfailed is offline   Reply With Quote
Old 08-05-2018, 02:01 PM   #16
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,060
Default

Thanks again.
I can confirm it's now working with Python 3.3 here.

About the flickering you mention, I rarely observed it so far but occassionally I do.
Seems to be certain conditions necessary that it manifests, not sure.
E.g. I got it when learning ReaComp's 'Attack' parameter, but only when I move ReaComp's GUI slider, when I move the learned rotary on the BCR the flickering stops.
Most other ReaComp's params seem fine here.

Anyway, no showstopper I'd think.
nofish is offline   Reply With Quote
Old 08-05-2018, 03:45 PM   #17
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Quote:
Originally Posted by nofish View Post
Thanks again.
I can confirm it's now working with Python 3.3 here.

About the flickering you mention, I rarely observed it so far but occassionally I do.
Seems to be certain conditions necessary that it manifests, not sure.
E.g. I got it when learning ReaComp's 'Attack' parameter, but only when I move ReaComp's GUI slider, when I move the learned rotary on the BCR the flickering stops.
Most other ReaComp's params seem fine here.

Anyway, no showstopper I'd think.
Maybe it's just something with my device. I will check to see if there's ever been any firmware updates for it. But yea, it certainly isn't going to stop me from using it

I also notice parameter movements aren't too smooth sometimes. I was hoping maybe that was related to the flickering, but now I'm not sure. I haven't tried 14 bit mode yet, either. It may be down to that. It's just a huge PITA b/c I'm using 3 presets on the BCR and have to change every single encoder one by one on each preset....ugh.
experimentfailed is offline   Reply With Quote
Old 08-05-2018, 05:04 PM   #18
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Just added bcr_lightsOut mode to experimental (basically takes advantage of the "minus" LED display modes of the BCR, like 1d-, such that unmapped encoders can now have their lights turned off, while those with a value of 0 but mapped, will be illuminated properly...it literally just changes values of 0 to 1). See page 16 and 17 of the BCR/BCF manual for more info about the LED display modes. Also fixed a bug in both versions (my reset function was doing channels 0-15 instead of 1-16 lol).
experimentfailed is offline   Reply With Quote
Old 08-06-2018, 10:29 AM   #19
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Pushed another update for experimental, which should now support multiple devices (untested). I've also moved the configuration into an external file (also for experimental). I'll be rolling these changes to the main script after I test everything properly (hopefully tonight)!

EDIT: Pushed again...I'm opting out of external configs (at least for now). I was running into path issues that will probably only get worse for people on other platforms. It'd just be too much to manage.

Last edited by experimentfailed; 08-06-2018 at 03:47 PM.
experimentfailed is offline   Reply With Quote
Old 08-06-2018, 06:58 PM   #20
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

DO NOT USE MOTORIZED FADERS FOR NOW!

I did a thought experiment and realized that situations could exist where this script could lead to early servo burn out (aka hardware failure).

I have a BCF2000 I planned on eventually testing with, but I will be delaying that until I figure out for sure how to reduce the update frequency to what I intend (which is only when parameter values change or the physical control is manipulated).
experimentfailed is offline   Reply With Quote
Old 08-09-2018, 08:29 AM   #21
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 8,060
Default

I'm still following development.

Regarding your remark in the README about track chunk truncation, if I understand correctly, it may be due to Reaper's (current*) ~4 MB GetTrackStateChunk() size limitation ?

https://forum.cockos.com/showthread.php?t=193686

That thread also contains a workaround for it.

* alternatively, good news is that in the current pre-release cycle that size limitation seems to be removed, so you may use the native function without problems in future (didn't test myself though).

https://forum.cockos.com/showthread.php?t=209812

(Sorry if I misunderstood your comment and it's not about that...)

Last edited by nofish; 08-09-2018 at 08:34 AM.
nofish is offline   Reply With Quote
Old 08-09-2018, 12:00 PM   #22
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Yes, for the track chunk truncation, I am indeed referring to the 4mb size limit, which will cause tracks with loads of items/FX/etc to not be fully read by the script.

I think I ran across that link in my travels (with the workaround). I haven't gotten around to building/installing the SWS/S&M extension yet for Linux, and looks like the workaround requires it, so I'll try to get that going (I need it anyway).

It's hard for me to imagine track chunks even getting to 4mb, though, but I just don't know. So my plan right now is to just wait and see, as myself (and hopefully others) use it, we'll just kinda find out the hard way together whether it's a big problem or just something annoying for rare situations not worth the extra effort to fix.

Thanks!!

EDIT: oh also thanks for pointing out the changelog!! I didn't see that one, so problem may already be solved before it matters anyway
experimentfailed is offline   Reply With Quote
Old 08-09-2018, 07:26 PM   #23
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

I went ahead and graduated experimental to latest. It seemed to work well enough for me, and assuming my logic is correct, everything should work as expected. We're still in alpha, tho, so bugs are a given. Now I'm hashing out a program change feature, while it's fresh in my mind. It's something I'll need for my workflow. I want my BCR to change to preset 2 (and I'm merely assuming the BCR corresponds program changes to preset changes).

EDIT: program change was a wash - BCR does not support changing presets in this way (or any other that I can see, other than the dedicated buttons on the device itself).

Last edited by experimentfailed; 08-13-2018 at 12:34 PM.
experimentfailed is offline   Reply With Quote
Old 08-10-2018, 06:05 PM   #24
experimentfailed
Human being with feelings
 
Join Date: Jan 2012
Location: USA/Michigan
Posts: 85
Default

Found some obvious oversights in logic which lead to some minor optimizations. Decided for w/e reason it was worth a push. Maybe just so the code base makes me look less like a moron lol
experimentfailed 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 01:26 AM.


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