Bypass callback/notification


#1

I have a synth out for sale and found a small bug that I really don't know how to solve properly:

When the instrument is up and running in a DAW, I send a NoteOn midi message (holding a note on the keyboard). Before sending the NoteOff (releasing the note on the keyboard), I bypass the plug-in. When the plug-in is bypassed I release the keyboard (sending NoteOff). When I enable the plug-in again the note obviously continues playing since the NoteOff wasn't parsed in processBlock() because the instrument was bypassed at the time.

My current (seem-to-be-working) approach is to have a check the current time in processBlock() and if there's a gap greater than some value based on blockSize and samplerate I turn off all playing notes. This method is a really ugly hack and will most certainly turn back at me at some point/in some DAW/in some special-case that I cannot think of right now.

So, to the question: Is there any other way do get a notification/read some flag whether the instrument is bypassed by host so I instead could check for actual changes instead of assuming stuff based on gaps in the audio stream.


#2

Interesting. What plugin format are you using? Is that AudioUnit, VST2, ...?


#3

How about AudioProcessor::processBlockBypassed() – all the wrappers call that when the plugin is bypassed.

Rail


#4

Yes, I was about to post that as well, but then I checked and found out that at least for AudioUnit, this AudioProcessor::processBlockBypassed is only called for effects, not for synths. But this is a synth.


#5

Hmm… that’s only in the AU wrapper… The host really should disable the bypass button for a synth anyway.

Rail


#6

Well, Logic does offer you a bypass button for a synth. I believe other hosts do, too. Clicking that button is exactly what this post is about, isn't it?

Apparently, right now a JUCE synth plugin has no way of knowing when this button was clicked.


#7

In RTAS and AAX we have the ability to disable the host’s bypass button. It looks like the VST wrapper will call processBlockBypassed() for a Synth… the only issue is AU… is there a reason why Jules didn’t call processBlockBypassed() for an AU synth? The default processBlockBypassed() is an empty function and the developer could check if it’s a synth in the method.

Rail


#8

It's AU and VST2.

I've only tested the processBlockBypassed() with the AU version (and since it didn't got called I assumed it wouldn't in the VST either). Anyhow, there's still an issue on how to solve this when creating AU's then... 

 

When peeking into juce_AU_Wapper.mm I found this:

 

               #if ! JucePlugin_IsSynth

                else if (ShouldBypassEffect())

                {

                    juceFilter->processBlockBypassed (buffer, midiEvents);

                }

               #endif

I'll remove those precompiler conditionals and see what happens first thing monday...

 

 


#9

Hi sundhage,

Removing the precompiler conditionals won't help you, because the code still would only be called if it is an effect and not a synth:

else if (ShouldBypassEffect()) ...

That ShouldBypassEffect() is AudioUnit code, not JUCE code, so we can't change anything there. Unfortunately there seems to be no equivalent of that function for a synth in the AudioUnit SDK...

 


#10

Ah! Saw that too now...