COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-21-2011, 01:10 AM   #1
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default Selecting presets from within IPlug

I select a preset from within IPlug when it receives a MIDI Program Change. I have copied the code to do this from effSetProgram:

Code:
ModifyCurrentPreset();
RestorePreset(pMsg->mData1);
This worked fine in REAPER v3.78, but I have just discovered it doesn't work in REAPER v4.01. The plug-in parameters and GUI controls do update, but the selected preset in the list of presets doesn't change. This could be a REAPER bug, but then again, another plug-in I have (ComboSister) still works fine with Program Changes and presets.

Looking back at my code, I now wonder how the host would know the preset has changed in the first place. Any ideas?
Tale is offline   Reply With Quote
Old 08-21-2011, 02:10 AM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

i encountered similar problems when i implemented my preset handling in ES.

if you search in my zip file for InformHostOfProgramChange() you should be able to work out how I fixed it.

Code:
void IPlugVST::InformHostOfProgramChange()
{
	mHostCallback(&mAEffect, audioMasterUpdateDisplay, 0, 0, 0, 0.0f);
}

void IPlugAU::InformHostOfProgramChange()
{
	InformListeners(kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global);
}
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 08-21-2011, 02:14 AM   #3
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Yeah, that must be it. Cheers, thanks a lot!

EDIT: I have found the original commit in your Git repository, and I have extracted the relevant code from it, and REAPER v4.01 now updates the preset selection. Yay!

Last edited by Tale; 08-21-2011 at 03:11 AM.
Tale is offline   Reply With Quote
Old 08-27-2011, 01:03 PM   #4
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by olilarkin View Post
Code:
void IPlugAU::InformHostOfProgramChange()
{
	InformListeners(kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global);
}
This doesn't seem to work for me, at least not in REAPER and AU Lab. I have also tried kAudioUnitProperty_CurrentPreset, but to no avail.
Tale is offline   Reply With Quote
Old 08-27-2011, 01:09 PM   #5
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

me neither in those hosts. au lab seems to be very buggy anyway when it comes to aupresets. In Logic in doesn't work that well (sometimes doesn't update). In Garageband it seems ok.

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 08-28-2011, 12:53 AM   #6
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

OK, thanks. Then I think will disable IPlugAU::InformHostOfProgramChange for now.
Tale is offline   Reply With Quote
Old 08-28-2011, 05:37 AM   #7
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

actually i just tried it in aulab and it works... only in reaper it doesn't work at all and in logic it doesn't always work reliably
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 09-02-2011, 10:16 AM   #8
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

also works fine in Studio One

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 09-26-2011, 10:41 AM   #9
A_SN
Human being with feelings
 
Join Date: Aug 2011
Posts: 89
Default

I just call InformHostOfProgramChange() and for me it works fine in Renoise, doesn't do anything in Reaper and in Ableton Live 8 (all on Windows with a VST) it works but it releases your click, so if you're dragging a slider while it calls InformHostOfProgramChange() well you can't drag it anymore, which is pretty irritating.

Am I doing something wrong or is it IPlug or is it Ableton Live and Reaper that aren't doing it right?
A_SN is offline   Reply With Quote
Old 09-28-2011, 12:33 PM   #10
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Originally Posted by A_SN View Post
I just call InformHostOfProgramChange() and for me it works fine in Renoise, doesn't do anything in Reaper and in Ableton Live 8 (all on Windows with a VST) it works but it releases your click, so if you're dragging a slider while it calls InformHostOfProgramChange() well you can't drag it anymore, which is pretty irritating.

Am I doing something wrong or is it IPlug or is it Ableton Live and Reaper that aren't doing it right?
i think it is probably IPlug that is causing this behaviour, but personally, i wouldn't put preset recall on a slider anyway - i think it's better as forward/back buttons or a menu because it's not the kind of control that someone will "ride". In your case you could only call InformHostOfProgramChange() when the mouse is released.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin 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 02:12 PM.


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