custom plug-in

QC to synthesizer Tonic

zanroversi's picture

Hello,

Tonic is a great C++ Library for audio synthesis !

https://github.com/TonicAudio/Tonic

Porting the lib in Objective-C or writing a middleware was to hard for me so I came to this working but not satisfying solution. (note : I think the Obj-C wrapper included does not match my needs) :

I've made some little modifications to TonicStandaloneDemo exemple in order to get a command line tool that reads commands from the standard input port.

I've specified a list of variables that can be adjusted dynamically by writing messages like :

-variable=value\n

Then I put it in a QCPlugin (64bits, SDK 10.9), as an executable ressource. The plugin manages the command line tool via NSTask and NSPipe and write messages on the standard input when a parameter is changed in QC.

It crashes sometimes, this occurs when you change a variable "too fast", something related to Tonic it seems.

Does anybody knows a best way to drive a C++ command line tool without using standard input ? Or simply slow down the rate at which messages are sent (that's what I tried, with a message queue that is triggered at a fixed rate). More generally, is there existing QCPlugins for sound synthesis inside QC ?

I hope you'll find this interesting or amusing ! Have a good day...

PS : If you need to kill Tonic's process manually : ps aux | grep "Tonic" kill ###

If you do some changes in the code of TonicStandaloneDemo, you'll need to put it again into TonicQC because it need it's own copy, not just a reference.

QuartzCrystal "unable to render" after 4 frames

Hi,

I have an issue with Quartz Crystal, while I'm trying to render a qtz that use a custom plugin (OpenCV image provider). I'm passing a movie into the plugin, then output on a sprite. Nothing terrific...

At between 4 and 10 frames rendered I have this message (translated from French, as QCrystal is very well translated) : "Unable to perform the offscreen rendering".

Could it be that QCrystal doesn't like my way to output images (see code below) ? I'm very bad at manaqging OpenGL and image providers, very very bad :-/

Any advice would be highky appreciated, as I'm in a urge with this rendering ! Thanks a lot !

 
            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
            glClearColor(0., 0., 0., 0.);
            glLoadIdentity();
 
            glPushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT);
            glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
 
            GLuint tex = [imgCV generateTextureInContext:cgl_ctx];
 
            self.outputImage =  [context outputImageProviderFromTextureWithPixelFormat:pixelFormat
                                                                            pixelsWide:[imgCV getSize].width
                                                                            pixelsHigh:[imgCV getSize].height
                                                                                  name:tex
                                                                               flipped:YES
                                                                       releaseCallback:textureReleaseCallback
                                                                        releaseContext:NULL
                                                                            colorSpace:CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB)
                                                                      shouldColorMatch:YES];
 
 
 
            glPopClientAttrib();
            glPopAttrib();