surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.13k stars 400 forks source link

Can't use Surge as Audio Effect on Ableton 10 #859

Closed hems closed 4 years ago

hems commented 5 years ago

Describe the bug Surge can only be instantiated as Instrument on Ableton 10.0.1.

To Reproduce Just try dragging Surge as an effect and it won't work, it will show the "forbidden mouse icon"

Also you can't add Surge on a Send/Return channel because of that issue :(

Expected behavior Be able to drag as effect

Additional context Some Effects such as Native Instruments Reaktor shows up duplicated, one as "Reaktor" and another as "Reaktor Effect" and i guess that's how they go around that ?

For instance you can route audio to a "Surge Instrument" and use it as expected, but because Surge is not an effect you can't drag it into an effect-chain just like other effects.

baconpaul commented 5 years ago

So this one is a bit tough. On windows VST2 with cubase you can do a trick where you copy the DLL and then surge reacts OK (here's this weird bit of code I stared at forever before I understood this

   char path[1024];
   extern void* hInstance;
   GetModuleFileName((HMODULE)hInstance, path, 1024);
   _strlwr(path);

   if (strstr(path, "_fx") || strstr(path, "_FX"))
   {
      plug_is_synth = false;
      setUniqueID('cjsx'); // identify
   }
   else
   {
      isSynth();
      plug_is_synth = true;
      setUniqueID('cjs3'); // identify
   }

) but on mac and vst3 you have no such luck in the current code base.

So this is a bit tedious - you need another pipeline which rebuilds the Surge.component as SurgeFX.component in premake, in the scripts, and so on, and then just does the necessary change. Or you need to make SurgeFX.component a symlink to Surge.component and have the AU check on module name (which is probably easiest but has ramifications in the installer) but the symlink probably won't change the bundle name since that comes from info.plist.

So it's all a bit tedious and hard to test.

My gut is the idea I sketched here for AU at least (have the installer make a symlink or perhaps complete copy with modified info.plist of SurgeFX.component from Surge.component and have the code use BundleName) is the way I would attack it. But hard.

hems commented 5 years ago

@baconpaul i know nothing about plugin development, but taking GForce as an example:

image

They have 2 AU one of them with FX on the filename, so i reckon their solution is pretty close to your windows solution...

I'm not sure how your OSX pipeline is setup but glancing at build-osx.sh I would guess at build time you would duplicate the .xcodepoj and name it "surge-fx", change some of the configs inside of it such as "BundleName" and "FileName", build then copy the FX AU / VST to another folder and then delete that duplicated project?

Definitely not the smoothest solution, but seems to be what other developers have to make.

baconpaul commented 5 years ago

Yeah the particular nuance of splitting our pipeline with premake and the associated scripts would be annoying but that’s what we would have to do (unless we could do something easier by having two entry points and one build and two info.plists which is what I would try first with the AU).

Ugly and a bit painful.

hems commented 5 years ago

@baconpaul indeed painfull.. perhaps we could create a question on StackOverflow and see which sort of answers people would come up with as ideal ? maybe someone have a simpler hack?

baconpaul commented 5 years ago

there are some stack overflow issues for sure (like energy xt) but this one I think is just "someone does all the tedious typing". Make a split allayer.cpp; add a second stage to the premake; add a second stage to build osx; add a second asset to the installer; make sure the pipelines run. That sort of thing.

I would say "making surge work as an effect" is probably fairly easy but "making surge work as an effect which distributes in the nightlies and release builds reliably" is a lot of typing...

williamfields commented 5 years ago

I am also not able to get Surge to work as an an audio effect in REAPER. Can anyone reproduce?

baconpaul commented 5 years ago

Are you using the VST2? There is some code in the codebase which means if you copy the VST2 dll on windows from "Surge.dll" to "Surge_fx.dll" it changes the way it loads, apparently to let more incalcitrant hosts load as an effect. The synth also supports audio in so perhaps you could put it as a synth on a bus and use the audio in oscillator?

I don't use reaper or windows, but I hope those thoughts help.

williamfields commented 5 years ago

Thank you @baconpaul. I will give it a try and report back later.

williamfields commented 5 years ago

Ok, I think my problem here is that the new version, when renamed to Surge_fx and running as a VST, does not respond to MIDI note triggers coming in. The old version did.

As a workaround, I can use the new VSTi version instead, but this is a bit of a pain because it adds to the incoming audio instead of replacing it (in REAPER at least).

baconpaul commented 5 years ago

Ugh OK; I actually don’t know how to debug that. But VST2 sort of has a high bar between FX and Instrument and I’m not sure how that interacts with reaper. I’m really sorry!

We did discuss on slack one day taking the scene effects (from filter ->effects routing) and making that a standalone 4 in 2 out VST effect but that also woulldn’t solve your problem.

Mind if I ask: What precisely are you trying to do? Like what’s an end result from a routing fx and midi perspective you are looking for? May help percolate an idea or two.

williamfields commented 5 years ago

Basically, I am doing FM using Shortcircuit as the modulator and Surge as the carrier. So, when there is a MIDI note on, it triggers both Shortcircuit to play the modulator and Surge to play the carrier. Inside Surge, OSC1 is a sine wave and OSC2 is the incoming audio signal. OSC1 is being FM-modulated by OSC2.

This used to work fine until I upgraded to the new version of Surge today. Again, the difference seems to be that the old "_fx" version of Surge responded to MIDI note messages. The new "_fx" version does not.

It would be nice if this was fixed. But it is not a huge deal for me because I have a work-around. (Shall I submit a separate Issue for tracking this?)

BTW, I really appreciate the team's efforts to resurrect and improve Surge. I bought Surge back in 2008, and I have been a heavy user ever since. I thought it was forever abandoned, so I am super excited that it is back! :)

baconpaul commented 5 years ago

Gotcha. Can I just ask one more question - what was the version of surge that worked? Was it one of the ones in the open source 1.6 family (in which case we broke something in the last few months) or was it 1.5.2 (in which case it maybe never worked since it was GPL3ed).

And thanks for the kind words! It’s been fun getting it back into shape.

williamfields commented 5 years ago

The version I used before was 1.5.1.0.

baconpaul commented 5 years ago

OK cool thank you. That’s super useful.

So yeah lets open another issue for this. I can do it in the morning if you want or you are welcome to also.

I took a look at the code and there’s nothing in particular about the code in fx mode that drops midi. The only places it makes a difference are in the id and the vst2 type, but perhaps the vst2 type selected is incorrect. Hmm - a bit tricky for me to debug since, like I said, I don’t really know how to set up reaper to do the routing (if you could include a bit of that in the issue that would be great too!)

baconpaul commented 5 years ago

Oh hey looking at the code now I think I even see what the problem is. Let me open another issue and add my commentary there and a few questions.

baconpaul commented 5 years ago

Linking this to #1005

mortfell commented 5 years ago

Hey @hems did you ever get Surge working as an effect in Ableton? It doesn't work as an "insert" effect (and it seems like that might not really happen anytime soon), but the instrument version is fully usable as an effect in any configuration you can imagine with the proper routing.

As of "Live 10.1" it's now super easy and fast to set up external side-chain in AU, VST and VST3 plugins (they made it work the same way as in the Live's built in fx like compressor and auto filter)

I've been experimenting with it a bunch over the past couple days, if anyone is interested here is a Live 10.1 project with some routing ideas for Surge: -midi controlled "gate" effect -midi latched fx rack -synth with a sample as the fm source Surge EFFECT Live 10.1 examples.zip

hems commented 5 years ago

Hey @hems did you ever get Surge working as an effect in Ableton?

i didn't try it again, but when i tried was dragging it into a RETURN track, which is not possible at the moment due to this limitation :(

your workaround seems to "solve" the issues or at least "work around it" 🎶

mortfell commented 5 years ago

Ah yes, thats true... I just thought of something actually... In 10.1 you can set the sidechain input of a track to be anything INCLUDING sends.

So you could for instance have:

double work around

I just tried it and it totally works! Its like a double work around and kinda ugly haha but.. I've definitely done weirder routing things in Live sessions before, so it's totally doable if you really wanted to use it as a send effect.

hems commented 5 years ago

@mortfell that's definitely a work around and a great proof of concept, i'm not sure if Live 10 fixed the "routing latency" on the sends issue tough.

As far as i remember, if you have send A and send B and then you set "send A" to output to a different track other than "master" it will then introduce latency on send A and things can de-rail pretty badly when played together with the original sound source which went to the sends.

Did i explain myself well?

Anyway i'll do some tests once i get a chance, thanks a lot for looking at this ( :

i really appreciate 🍻

mortfell commented 5 years ago

No problem

Yes now that you say it, i do remember that issue of timing on sends from back in Live 8 days. Seems like it's still introducing some uncompensated latency 😢 Could be fine for a reverb or delay, but not for other stuff.

Its still very usable as an effect on a midi track the you route audio from another track too, so hopefully most configurations you could need are possible in some way or another. There is also a beta of another effect which is JUST the fx from Surge, no modulation or oscillators or anything else: https://github.com/surge-synthesizer/surge-fx

In #1005 I tried to compile all the issues people had talked about re. using Surge as an audio effect. Seems like there is a plan to make a properly functioning "Surge_FX" plugin which still includes all the modulation etc. as a VST3 down the line.

baconpaul commented 5 years ago

may be a bit of a longer line though.... this one is a touch tricky I'm sorry!

mortfell commented 5 years ago

No apology necessary, that makes sense. I'm there is more important less finicky stuff ahead of this in the line of importance.

baconpaul commented 4 years ago

@mortfell with the 1.6.5 candidate VST3 can we route properly to the audio channel in live 10.1 now? If so lets close this issue and migrate users away from the VST2

mortfell commented 4 years ago

You can't load an instrument plugin anywhere other than an instrument slot in Live, so you can't do it in the same way as REAPER, but you can redirect audio input into an instrument. That works with both VST2 and VST3!

baconpaul commented 4 years ago

OK great I’m going to close this then. Thank you!