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.

PreviewAttachmentSize
Tonic and QCPlugin.zip707.47 KB

zanroversi's picture
Re: QC to synthesizer Tonic

EDIT :

This updated version is far better...

The use of the Tonic's ControlParameter system increases reliability a lot. I removed the message queue.

Enable patch or start rendering leads to the same results (did not before), with a good application of actual patch parameters.

Added volume, vibrato, tremolo, delay dry/wet controls.

Added a trigger (if the trigger button state is changed, the metronom will stop pulsing. Changing the metroFreq will restart it). ADSR enveloppe is triggered on leading edge only.

You may use several instance of the patch in a composition.

greetings !

PreviewAttachmentSize
Tonic and QCPlugin 3.zip736.13 KB