[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-multimedia
Subject:    Re: Async streams?
From:       Stefan Westerfeld <stefan () space ! twc ! de>
Date:       2002-03-07 14:49:08
[Download RAW message or body]

   Hi!

On Wed, Mar 06, 2002 at 08:26:47PM -0600, Michael Zuercher wrote:
> I am attempting to write a better pitch scaler, but have run into some 
> problems.  I have come to the conclusion that I will have to use asyncronous 
> streams since I am going to need a whole block of data before I can output 
> anything.  By using an async stream I can wait for enough data to come in 
> before I do my FFT calculations and output.
> 
> Here is my .idl entry:
> 
> interface Synth_PITCH_SHIFT_FFT : SynthModule {
> 	attribute float speed, frequency;
> 	async in audio stream invalue;
> 	async out audio stream outvalue;
> };

You can't connect a synchronous stream to an asynchronous stream directly.
Thus, what you would need to use you pitch shift module in a stereo effect
would be:

1. convert the stereo effect input from a synchronous to an asynchronous stream
   with a module, which would need an interface like
     interface ... {
	   in audio stream invalue;
	   async out audio stream outvalue;
	 };

2. apply your pitch shift fft

3. convert the stereo effect output from an asynchronous to a synchronous stream
   using a similar interface like above

No such modules exist in aRts by default, so you'd need to write these as well,
to be able to test your module.

I think in your case it would be better to let your pitch shifter use
synchronous streams and to use an internal buffer which buffers input as
long as you can't do an FFT yet. For this time, you'll need to output zero
samples.

So, if your pitch shifter would work with an FFT size of 512, it would add
an implicit delay to the output of 512/44100 seconds, but thats what a real
world implementation of this algorithm on a DSP plugged between a real
microphone and a mixer would also do.

   Cu... Stefan
-- 
  -* Stefan Westerfeld, stefan@space.twc.de (PGP!), Hamburg/Germany
     KDE Developer, project infos at http://space.twc.de/~stefan/kde *-         
_______________________________________________
kde-multimedia mailing list
kde-multimedia@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-multimedia
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic