[CLAM] AudioPorts Usage

Xavier Amatriain xavier at create.ucsb.edu
Tue Sep 13 11:00:57 PDT 2005


I guess you are implementing a vst plugin or something similar, right? 
If so, you can either write the samples to a CLAM::Audio object on each 
call to the Process function or (better) write them to an independent 
Outport that you can connect to the SpectralAnalysis Inport. I recommend 
you read this other thread on the CLAM mailing list:

http://iua-mail.upf.es/mailman/public-archives/clam/msg00435.html

BTW, in any case if you are writing a vst plugin, the real problem is 
how to adapt the size of the incoming buffer to the one configured at 
the Spectral Analysis. We have a couple of working implementations but 
none of them are clean enough so as to be in the main distribution. All 
of them are loosely based on Stephan Letz's very interesting article 
"Callback Adaptation Techniques" [1]


[1] 
kmt.hku.nl/~pieter/SOFT/CMP/src/portaudio/pa_asio/Callback_adaptation_.pdf




Thomas Andrea wrote:

> Hi,
> First of all thanks for the reply.
> Sorry, I'm going to be more explicit...
>
> I want to do the spectral process inside a callback function. The 
> callback function provides a certain number of samples in each call. I 
> want to catch these samples, put it in a CLAM::Audio object an then 
> pass this object to the CLAM::SpectralAnalysis object. There is some 
> way to do this with clam ports or I should use the 
> CLAM::SpectralAnalysis::Do(Audio in, Spectrum out) method?
>
>
>> From: Pau Arumi <parumi at iua.upf.es>
>> To: Thomas Andrea <thomas.an at hotmail.com>
>> CC: clam at iua.upf.es
>> Subject: Re: [CLAM] AudioPorts Usage
>> Date: Tue, 13 Sep 2005 14:24:52 +0200
>>
>> In the example PortsAndControlsUsage_example.cxx all ports are used 
>> in an implicit way.
>> I mean that ports are there as processing attributes. And to do port 
>> related stuff
>> you send messages to the processing variable:
>> Doing things like this one:
>>        audioOut.GetInPort("Audio Input").SetSize( size );
>> or this :
>>        CLAM::ConnectPorts(osc, "Audio Output", myProc, "Audio Input");
>>
>>
>> Could you be more explicit on what do you have problems?
>>
>> On the other hand, you might be interested to use the Network object, 
>> which provide
>> a higer level interface because it hides the calls processings Do().
>> Have into account that clam processings (specially spectral ones) 
>> often works with
>> different hop-sizes, so it is good that the network cares for the 
>> correct Do() scheduling.
>>
>> About networks, this is the example to start : NetworkUsage_example.cxx
>>
>> Pau
>>
>>
>> Thomas Andrea wrote:
>>
>>> Hi,
>>>
>>> I have seen some examples like PortsAndControlsUsage but I don't 
>>> understand the use of the AudioPort objects(AudioInPort and 
>>> AudioOutPort).
>>>
>>> Exactly I want to connect an audio stream to the AudioInPort of the 
>>> SpectralAnalysis object.
>>>
>>> Any suggestion?
>>>
>>
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's 
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>
> _______________________________________________
> CLAM mailing list
> CLAM at iua.upf.es
> http://www.iua.upf.es/mtg/clam



-- 
/******************************************
 *          Xavier Amatriain   		  *
 *          Research Director 		  *
 *  		  CREATE		  *
 * University of California Santa Barbara *
 ******************************************/






More information about the clam-users mailing list