Old 05-18-2020, 10:39 AM   #1
preachers
Human being with feelings
 
preachers's Avatar
 
Join Date: Feb 2010
Location: Jilin
Posts: 190
Default Help me scripting a JS which only receive certain MIDI Program

I have a idea to use Reaper as an ultimate GM softsynth, the whole thing has been described here: https://forum.cockos.com/showthread.php?t=236440

The plugin should be inserted as the first one in track FXChain with a whole GM program list in it. By selecting certain program, the track would only respond to the specific program. In other word, it responds to MIDI PROGRAM rather than MIDI CHANNEL. It's better with multi-select/de-select function.

Any help would be appreciated!

Last edited by preachers; 05-18-2020 at 11:39 AM.
preachers is offline   Reply With Quote
Old 05-18-2020, 09:16 PM   #2
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 943
Default

I suspect that your idea would not work if you have multiple instruments playing in the same passage and you are only relying on the program change messages to separate them. In order for it to work, the MIDI file would have to provide a program change message immediately before every note-on message and again immediately before every note-off message. I doubt that this is done. I think usually program change is used in combination with channels. You would play a whole passage with one program on one channel before switching to another on the same channel. The channels are used like tracks to separate the program changes.

Maybe it would be possible to have a master JSFX which would attach the program changes to each note-on/off?
__________________
ReaRack JSFX Modular Synth - Mostly harmless: https://stash.reaper.fm/v/28403/ReaR...dularSynth.zip
The Wasters of Time: https://soundcloud.com/thewastersoftime
Time Waster is offline   Reply With Quote
Old 05-19-2020, 08:30 AM   #3
preachers
Human being with feelings
 
preachers's Avatar
 
Join Date: Feb 2010
Location: Jilin
Posts: 190
Default

Quote:
Originally Posted by Time Waster View Post
I suspect that your idea would not work if you have multiple instruments playing in the same passage and you are only relying on the program change messages to separate them.
I think I should explain my use case a bit more specific. By configuring Reaper as a GM softsynth, I can do at least these two things:

1,Composing music using an external application Guitar Pro, Sibelius for example, they focus on notation/tablature more than Reaper but doesn't have their own sound source.

2,When playing dos games using Dosbox, I can use it to improve the whole sound quality.

The point that I don't use channel to separate MIDI signals is that they will NEVER play different instruments at the same channel same time. If that happen, it's wrong with the MIDI file itself but not my setup. Neither my composed MIDI file or those MIDI signal coming from Dos games will have that problem. The reason I want multi-select program in one track is that I don't want to setup the whole 128 tracks by myself but for those important ones like guitar, and set all other programs to a softsynth like Yamaha S-YXG50.
preachers is offline   Reply With Quote
Old 05-19-2020, 09:49 AM   #4
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 4,857
Default

Yeah this thing needs to block all midi messages until it sees its own designated PC (and preferably a set of several possible PCs, like all the pianos in the GM standard, or all the guitars, or...).

When it does see that PC, it then passes any events that are on the same channel as the PC was.

I suppose it should then watch for PCs on that channel which do not fit its list and when it gets one go back to “block and watch” mode.

The “easy” way to do it might be to have .txt definition files that would have the list of PCs that it should watch for, though I guess we could go through the GM definition and figure it out and hard code it as a drop down.

Edit - but as I understand it, we’d like to be able to either include or exclude those channels. Either pass or block the channel that sees the PC.

Edit 2 - oh but now what happens if there’s two guitars in the song!?! Now we need the various instances to communicate via gmem or global namespace... but actually I think this might be an area the OP hasn’t completely thought through. We could conceivably have any number of the essentially the same instrument on different channels and most of the time we don’t want them all playing through the same VSTi at once. How do you account for that?

Last edited by ashcat_lt; 05-19-2020 at 09:59 AM.
ashcat_lt is offline   Reply With Quote
Old 05-19-2020, 10:26 AM   #5
preachers
Human being with feelings
 
preachers's Avatar
 
Join Date: Feb 2010
Location: Jilin
Posts: 190
Default

Quote:
Originally Posted by ashcat_lt View Post
Edit 2 - oh but now what happens if there’s two guitars in the song!?! Now we need the various instances to communicate via gmem or global namespace... but actually I think this might be an area the OP hasn’t completely thought through. We could conceivably have any number of the essentially the same instrument on different channels and most of the time we don’t want them all playing through the same VSTi at once. How do you account for that?
I'm not an expert myself at this kind of things, but I think all the problem should be well solved by those VST softsynths themselves. What I want to do is to configure Reaper as one of them, so all the answers are to look inside those plugins, how do they treat these problems? I don't have the knowledge to do this and hope someone could help.
preachers is offline   Reply With Quote
Old 05-19-2020, 11:44 AM   #6
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 4,857
Default

Quote:
Originally Posted by preachers View Post
...how do they treat these problems? .
Well generally they have sixteen individual synths each of which is capable of creating any of the sounds you might choose via PC*. If you want to have 15 tubas, you just tell all 15 of those “synths” to make a tuba sound.

You’re doing something significantly different. You’d have to have 15 duplicates of whatever track you’ve set up as a tuba just in case. Yes, tuba is an absurd choice, and it’s not likely you’ll really need 15 of anything, but you very often will have two or three guitars in a song. We can figure out how to distribute them to several instances, and even let extras go through to your actual GM synth, but you’d have to decide how many of each you want to account for in your template.



*Well often channel 10 is the only one that does drum kits and sometimes can only do drum kits
ashcat_lt is offline   Reply With Quote
Old 05-19-2020, 03:47 PM   #7
preachers
Human being with feelings
 
preachers's Avatar
 
Join Date: Feb 2010
Location: Jilin
Posts: 190
Default

Quote:
Originally Posted by ashcat_lt View Post
Well generally they have sixteen individual synths each of which is capable of creating any of the sounds you might choose via PC*. If you want to have 15 tubas, you just tell all 15 of those “synths” to make a tuba sound.
It seems like there's no way of doing it automatically without having any drawback, so maybe the only way is to manually send programs to different tracks.
This one is somewhat near my requirement:https://forum.cockos.com/showthread.php?t=67115
The plugin will detect MIDI input and show active channels. From here, we can change it a little bit.

First, I need the program name to be shown when a channel is active so I can tell which instrument is playing.

Second, columns should show tracks, they should act something like the Reaper Routing Matrix, column numbers equal to track numbers instead of having 16 fixed tracks.

Now I can create a master MIDI track (or Dummy track), load this plugin here, then by linking MIDI channels to audio tracks it send the signal to that track(send MIDI only without audio). By saving configurations to presets I have different arrangements.

See this: https://ibb.co/M7gfVmH
preachers 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 07:13 AM.


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