Old 03-07-2018, 03:29 PM   #1
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,201
Default SWS's MidiToReaControlPath Souce Code

Is same available and legally usable for enhancing it ?

Thanks,
-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-07-2018, 11:01 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,201
Default

@ Xenakios :

What I have in mind is a plugin that features three sliders:
- Midi channel
- CC # "mute"
- CC # "unmute"

When receiving a Midi CC message with fitting Channel and CC # "mute", it will mute the track denoted in the CC val. Same with "unmute".

I did - extremely simple - workalike ReaScripts for mute and unmute, so I do know that simply two API calls need to be done for that. But using the scripts need "MidiToReaControlPath" and hooking actions, which of course is not really user friendly for the "Reaper Live" toolbox I intend to publish (of course free of charge).

As I know that you are experienced with such stuff and have all the tools in place, maybe it's really easy for you to put this together. What do you think ?

-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 03-08-2018 at 07:24 AM.
mschnell is online now   Reply With Quote
Old 03-13-2018, 04:16 AM   #3
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,187
Default

Quote:
Originally Posted by mschnell View Post
maybe it's really easy for you to put this together. What do you think ?
It's always bit of a pain to do new plugin projects, unfortunately. I am not even sure if you mean a VST plugin or a Reaper extension plugin, though...?

MidiToReaControlPath isn't a plugin by SWS, by the way, it was done by Jeffos. I don't think the source code is available.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/

Last edited by Xenakios; 03-13-2018 at 04:22 AM.
Xenakios is offline   Reply With Quote
Old 03-13-2018, 05:56 AM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,881
Default

Yeah, your best bet is probably to try to ask Jeff(os) directly.

https://www.cockos.com/team.php

e.g.
https://fr.linkedin.com/in/jean-fran...ague-697236129

Last edited by nofish; 03-13-2018 at 06:02 AM.
nofish is offline   Reply With Quote
Old 03-13-2018, 01:41 PM   #5
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,201
Default

Unfortunately AFAIK, Jeffos is not available at all, any more.

And MidiToReaConttrolPath is special in that it is a VST (receiving Midi Messages in the normal VST way) that additionally uses the Reaper API (Pushing Midi Messages onto the Reaper Control Path). This obviously is possible, but supposedly needs some spacial care.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-13-2018, 03:09 PM   #6
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 401
Default

It probably use StuffMIDIMessage API call for commands and just bypassing otherwise.
There is no comments it should be used specially, so I guess it is safe to use it from whatever place.
azslow3 is offline   Reply With Quote
Old 03-13-2018, 10:39 PM   #7
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,201
Default

Yep, StuffMIDIMessage, obviously. But same is part of the Reaper API, which is accessible when you do a Reaper Extension DLL, which is dnamically linked to Reaper using the Reaper Extension specifications which provides the call location for the "StuffMIDIMessage()" function.

But MidiToReaControlPath is not a Reaper Extension DLL but a VST DLL, and hence is dynamically linked according to the VST specifications and does not know how to call "StuffMIDIMessage()".

AFAIU, the tricky part is to have a VST it access the Reaper API altogether.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-14-2018, 03:13 AM   #8
azslow3
Human being with feelings
 
Join Date: Nov 2017
Location: Heidelberg, Germany
Posts: 401
Default

Quote:
Originally Posted by mschnell View Post
Yep, StuffMIDIMessage, obviously.
...

But MidiToReaControlPath is not a Reaper Extension DLL but a VST DLL, and hence is dynamically linked according to the VST specifications and does not know how to call "StuffMIDIMessage()".

AFAIU, the tricky part is to have a VST it access the Reaper API altogether.
What about reading the documentation? Obviously
https://www.reaper.fm/sdk/vst/vst_ext.php

Disclaimer: I have not written any release quality VSTs, so the following is IMHO. But working IMHO.
I usually check what I suggest. So I have written a test VST which send all CC to control and pass throw the rest. In my short check it was working as expected.

Mentioned documentation has no examples. More tricky is to find the RIGHT way to process MIDI in VST. The specification is a bit fussy at that place. It seems like that working way is save events in "processEvents" and "sendVstEventsToHost" in "processReplacing".

So parts of the code:
Code:
static void (*StuffMIDIMessage)(int mode, int msg1, int msg2, int msg3) = 0;

MyEffect::MyEffect(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParams){
static char StuffMIDIMessage_Name[] = "StuffMIDIMessage";
...
if(!StuffMIDIMessage)
    StuffMIDIMessage = (void (*)(int, int, int, int))audioMaster(NULL,0xdeadbeef,0xdeadf00d,0,StuffMIDIMessage_Name,0.0);
// I do not use the name directly, GCC complains the parameter is not const
}

void MyEffect::processReplacing(float** inputs, float** outputs, VstInt32 sampleFrames){
 ...
 StuffMIDIMessage(1, midiData[0], midiData[1], midiData[2]);
}
azslow3 is offline   Reply With Quote
Old 03-14-2018, 06:06 AM   #9
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,201
Default

Quote:
Originally Posted by azslow3 View Post
What about reading the documentation? Obviously
https://www.reaper.fm/sdk/vst/vst_ext.php
I did not see this yet.

Thanks for pointing me there.
-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 03-14-2018, 09:47 AM   #10
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,187
Default

Quote:
Originally Posted by azslow3 View Post
Code:
MyEffect::MyEffect(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParams){
An unfortunate problem with that is that the audioMasterCallback is not available easily when using plugin frameworks like IPlug or JUCE. The framework code has to be changed in order to get access to it.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios 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 11:39 PM.


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