We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Sonia - frequency (Read 1120 times)
Sonia - frequency
Feb 26th, 2007, 6:26pm
 
Does anyone know if it's possible to change the frequency/tempo pitch (of a sample sound) in Sonia?
Re: Sonia - frequency
Reply #1 - Feb 26th, 2007, 9:34pm
 
From Sonia reference page ( http://sonia.pitaru.com/ ) :

// Play a sample a twice its origianl speed.
// Notes: Make sure to include the specified audio file in your project's 'data' folder.

Sample mySample;

void setup() {
 size(100,100);
 Sonia.start(this);
 mySample = new Sample("sine.aiff");
 mySample.setSpeed(2);
 mySample.repeat();
}

public void stop(){
 Sonia.stop();
 super.stop();
}
Re: Sonia - frequency
Reply #2 - Feb 26th, 2007, 10:24pm
 
Cheers I have managed all that but I really want to be able to change the tempo pitch which I can't see a method for. Do I have to use a JSyn pluggin? and if so how?
Re: Sonia - frequency
Reply #3 - Feb 26th, 2007, 10:38pm
 
I'm not sure what you mean by "tempo pitch".  By increasing the pitch by a factor of n, you also naturally change the tempo by a factor of n, and vice-versa.  (Half speed plays an octave lower, or half the frequency)

Maybe you mean timestretching?  i.e. changing the length, or speed of a sound but keep the apparent pitch the same?

Or do you want to perform a pitch shift, where the pitch changes but the apparent tempo remains the same?
Re: Sonia - frequency
Reply #4 - Feb 26th, 2007, 10:43pm
 
I would like to do a pitch shift and then if possible change the frequency of the sound.

(Basically going nuts with as many manipulations as I can)

sorry am totally new to these sound libraries - thanks for your help.

Do you use setSpeed - for time stretching?
Re: Sonia - frequency
Reply #5 - Feb 26th, 2007, 11:03pm
 
To clarify, pitch and frequency basically mean the same thing.

If you have a sinewave at 440 hz (frequency), its an A note (pitch).  If you double the frequency to 880 hz, it is the A note 1 octave higher, playing at twice the original speed.

As far as pitch shifting and time stretching, sonia does not offer these functions.  They are actually very tricky to do well in realtime (especially timestretch).  

However, if you wanted to create the samples ahead of time, by manually writing an audio buffer, these effects are possible.  

Hope this helps.
Page Index Toggle Pages: 1