Old 08-27-2018, 08:26 AM   #1
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default Set track's midi port via script?

Is this possible? I have not been able to track anything down for this.

Do JSFX have access to data on the source port of the midi they receive on input? If not, maybe I could trigger the port selection by linking an action to a parameter change in the JSFX.

I'd like to write a midi input effect that can save settings to translate between mpe and non-mpe midi controllers and vsti's.

I'd like to be able to select a preset depending on whether or not the controller is sending out MPE and whether or not the VST is set up to recieve it. Since I use a touchscreen live, I can't use the built-in menu for this, it's much too small.

The ability to get a list the port names would be useful as well.... but I don't see that anywhere either.

Alternatively, I could write a VST3 to do it, but I'm having a hard time finding info on how multiple midi ports are dealt with in that scenario.
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-27-2018, 10:31 PM   #2
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

well, I did run into

ext_midi_bus

in the jsfx documentation. Does anyone know of a js effect that provides an example of using this?

For now, I can't get midi busses to work at all, never mind scripting them :/
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-28-2018, 07:35 AM   #3
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

okay, studying the busses more, and I've discovered that the busses can be piped directly to a vst, using the i/o menu in the fx chain window.... so maybe they don't ever need to go to a track per se at all???

if I can put a JSFX on the track, and control its midi in buss, I'm in business.

I'll go try that.
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-28-2018, 08:03 AM   #4
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

aaak, so confusing!

so I don't get the menu on JS effects? Or on midi only effects? It's there sometimes, and not others, and I can't figure out why.

still seeing nothing coming from any buss ever. why am I only seeing a MIDI button with no pin menu? The pin menu is where I select the midi buss in, shouldn't a midi effect have the midi buss in submenu??

I've tried insert effects and regular effects on the receiving channel...
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-28-2018, 08:24 AM   #5
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

here's a pic of what I'm doing. Note that I have tried every input setting for the 'MIDI INPUTS' track. As I said, MIDI all gets everything in on buss1. Nothing ever gets in on any other buss.

I've modified the midi logger js as shown, and put it on the input fx buss.

I'm trying to upload a screenshot, but can't get it below 64k and still read anything!! How do people do this???
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-28-2018, 08:31 AM   #6
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

okay, squeezed it into a screenshot.

can anybody tell me what I'm doing wrong here? I'd like to eventually put a vsti on each receiving track (such as this), but I want to be able to have a midi processing jsfx in line before each vst...

So my desired flow is:
Track for each midi interface->send to different midi busses->choose buss to receive on per track->jsfx for midi processing-->vsti

Is this possible?

I'd eventually like to select busses, choose midi processing jsfx presets, and load vstis via a lua script with a gui on my touchscreen.

Thanks.
Attached Images
File Type: png midiBussesInReaper.png (54.3 KB, 85 views)
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<

Last edited by woodslanding; 08-28-2018 at 08:37 AM.
woodslanding is offline   Reply With Quote
Old 08-28-2018, 09:32 AM   #7
LugNut
Human being with feelings
 
Join Date: Jun 2013
Location: So Florida
Posts: 888
Default

Hi,
I too would like to know the whole skinny on midi busses in reaper. reaper user DarkStar was doing something with them in the past,maybe pm him?
I do know that midi busses were introduced to be used with reason in rewire. I got excited...then I look at the many midi jsfx, and cannot access the busses.
I'm rooting for ya:-)
LugNut is online now   Reply With Quote
Old 08-28-2018, 10:59 AM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 2,338
Default

You can set track input from reascript, for example by channel and MIDI device name:

Code:
function SetMidiInput(chan, dev_name)
  local tr = reaper.GetSelectedTrack(0,0)
  if not tr then return end
  for i = 0, 64 do
    local retval, nameout = reaper.GetMIDIInputName( i, '' )
    if nameout:lower():match(dev_name:lower()) then dev_id = i end
  end
  if not dev_id then return end
  val = 4096+ chan + ( dev_id << 5  )
  reaper.SetMediaTrackInfo_Value( tr, 'I_RECINPUT',val)
end


SetMidiInput( 2, 'touchosc' )
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 08-28-2018, 03:12 PM   #9
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

Wow cool, thanks for that info... I'll study this code!

Is it possible to get a list of device names? That would be necessary to create an interface for this. That's the ideal approach--a set of buttons in my Lua gui to select the device.

But the workaround you mentioned would also be fine. It's just not working for me.

Edit: Nevermind. Just looked closer at the code, and I see where you are getting device names. Great, thanks!!!! I so did not see this in the docs.

Edit: this line is hard to p****:
val = 4096 + chan + ( dev_id << 5 )
what's going on there??? you are definitely a better hacker than me, if you figured that out
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<

Last edited by woodslanding; 08-28-2018 at 03:19 PM.
woodslanding is offline   Reply With Quote
Old 08-28-2018, 03:52 PM   #10
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

thinking about this a little more.... I actually really like the idea of bringing each device in on a track, and then choosing between these tracks as a midi source. That way, if I change a device, I don't break a bunch of presets that were looking for a device that is not available anymore. I can change one device for a similar one, and maintain backwards compatibility with old presets.

So I guess I'm hoping I can get the midi busses to work somehow.

That said, I suppose I can come up with some kind of wrapper for devices that works this way. I'll think about that.
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 08-29-2018, 08:28 AM   #11
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

I think this will work great... I can make a little text file:

piano = Babyface Midi Port
roli = Seaboard Block
organ = ADVANCE61
etc.

and then present the left side items on the list to the user (me), and convert them to the text on the right for the script to use. then I can just edit the text file if my setup changes.

But I still need to be able to get other particular data to each track, which seems like it requires the midi busses to work. Specifically, I have one sustain pedal, and one expression pedal, and would like them to be able to address all channels, even when the input port is different.

Is it in fact possible to get data to a track via midi bus? This seems to be possible from reading the manual, but I have not been able to get it to work.

I wish I could just put a JSFX midi in the first slot of the inputFX of a channel, set the channel to ALL MIDI, and have the JSFX know which port an event comes from. I just want to double-check that this is not possible, as it would be the most elegant solution.
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<
woodslanding is offline   Reply With Quote
Old 03-09-2019, 11:01 AM   #12
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 303
Default

So I figured out the user error that was keeping me from getting midi into my tracks via buss.

So now I have the question:

Is there a way to record this midi on the track??? It seems like midi from a send does not get recorded, even when the track is record enabled. Is there a workaround for this?

DOH! Question answered by darkstar in a similar thread -- set the track to record OUTPUT instead of INPUT.
__________________
e moon
http://ericmoonmusic.com
>>{ Very Stable Genius }<<

Last edited by woodslanding; 03-09-2019 at 11:08 AM.
woodslanding 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:01 PM.


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