| Author |
Message |
TrampFanny
Joined: Jun 28, 2009 Posts: 1 Location: UK
|
Posted: Sun Jun 28, 2009 1:41 pm Post subject:
Pitch shift to given frequency |
 |
|
Hello!
I'm just getting started with Chuck and have been playing with a simple sequencer looping wav files etc. This is brilliant, and as a next step I would like to be able to change the pitch of the files as they play.
I've experimented using PitShift but what I was hoping for was something where I could pass in a desired frequency / midi note I would like the sample played at. Any pointers for how this can be achieved? |
|
|
Back to top
|
|
 |
mrcold

Joined: Jun 18, 2009 Posts: 157 Location: USA
Audio files: 24
|
Posted: Sun Jun 28, 2009 2:24 pm Post subject:
|
 |
|
I'm not sure.. but it seems like it could be possible.. but probably compilcated. First of all, you would need a way of telling the computer what pitch the original file is actually playing. After that, the computation of changing the pitch to the desired one probably shouldn't be tooooo difficult. I haven't really look into them but the Unit Analyzers probably can help you out with this.
in any case.. I am just a noob, so I don't really know what I'm talking about.
cheers |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 5457 Location: San Antonio, Tx, USA
Audio files: 236
|
Posted: Sun Jun 28, 2009 4:41 pm Post subject:
|
 |
|
A while back there was a thread about pitch detection and Kassen created a really nifty algorithm for doing it. You could dig that up and use it for the pitch detection, then take the ratio of the frequencies and set your PitShift to that. Have fun and good luck.
Les _________________ No matter how much society beats it out of me, I STILL want to make the world a better place. I am sick of the abuse yet I am powerless to stop it. |
|
|
Back to top
|
|
 |
DrumAliens

Joined: Jul 10, 2008 Posts: 26 Location: UK
Audio files: 1
|
Posted: Tue Jun 30, 2009 10:54 am Post subject:
|
 |
|
| If you find the frequency of the original you can then change the frequency. By changing the speed that the wav file is played back by using SndBuf.rate or SndBuf.freq |
|
|
Back to top
|
|
 |
Kassen
Janitor


Joined: Jul 06, 2004 Posts: 7682 Location: The Hague, NL
G2 patch files: 3
|
Posted: Sat Jul 04, 2009 9:56 am Post subject:
|
 |
|
The Pitch-shifter would do, as would .rate() in SndBuf or LiSa. One could also use FFT-based re-synthesis or even re-pitch in a granular way...
It all depends on your needs. most of the time some analysis ahead of time would be very useful, the "analysis" section of the examples demonstrates how you can find the (likely) pitch of a given sound. Of course you could also record yourself playing a acoustical instrument, that way you'd know what pitch the sample was as well. Another way would be to simply ask your favourite wave-editor, most have a function to tell you the pitch of a given sample.
You could even say you don't care what the pitch is as you will know that increasing it by amounts like 1.5 and other simple fractions will sound "in tune" regardless of what it originally was  _________________ Kassen |
|
|
Back to top
|
|
 |
|