Exporting gen~ to AU
So I decided to bite the bullet and try exporting gen~ code into C++ and using it to make an AU, as explained in the wiki.
The xcode project builds completely without any issues (other than semantic issues.. loss of precision), the AU passes validation, it loads up fine in Logic Pro but doesn’t output any sound.
Its a simple gen~ patch which multiplies the input by a variable (1-1000) and clips the signal between -0.9 and 0.9.
Can you provide your example and support information (about max->copy support info to clipboard), and we’ll investigate. We have a number of improvements coming in the 6.1.3 release for code export, including some other example projects for VST and iOS, but it would be good to verify that your issue has been fixed.
Hi Joshua, do you plan some VST code export examples for us poor Windows based maxers :-) ?
thanks and all the best.
Thanks for getting back. Here’s the info:
"version" : "Version 6.1.2 (6a3e522)",
"platform" : "mac",
"arch" : "x64",
"osversion" : "Mac OS X Version 10.7.5 x86_64",
"samplerate" : 44100,
"iovs" : 512,
"sigvs" : 64,
"scheduler_in_audio_interrupt" : "off",
"audio_drivername" : "Core Audio",
"audio_driver_subname" : "",
"eventinterval" : 2,
"overdrive" : "off",
"mixerparallel" : "on",
"mixercrossfade" : 0,
"mixerlatency" : 30.0,
"mixerramptime" : 10.0
I’ve also attached a zip of the xcode project + max patch + AUval log if its of any help.
It looks like you found a bug in how param objects are being parsed, in which the @default attribute is being ignored. This bug is logged as #4764 and is being worked on. There’s a quick workaround in your case however: try changing it to [param DistortMe 1 @min 1 @max 1000].
That said… currently AU params should always be in the 0..1 range (that’s the usual AU policy), so you might want to change it to [param DistortMe 0.001 @min 0.001 @max 1], and connect it to a [* 1000] object to make up the gain. Hopefully we’ll be able to introduce more flexible param range handling for code export in an update soon :-)
It works! Thanks Graham.
I’m more of a hacker than a coder, but this is exciting stuff.
How much more complicated would it be to compile the code into a Max object?
Another possible bug?
Creating [phasor] anywhere in the gen~ patch makes the AU plugin stop outputting sound – even if its unplugged. As a workaround I’m creating a phasor using +, wrap, history etc.
Sorry, false alarm! All is well. It was the AU cache that needed deleting.