well then, thanks for doing my homework! ;) nice one. (i like how it gives a kind of flanger effect on the drum loop i tried it with, almost more like a filter, because of the high noise portion of the signal, i suppose.) cheers, robbert
Thomas Mayer thomas@dergrossebruder.org wrote:
Hello,
after all the discussion about looping samplers etc., I have made a small abstraction patch that does pitchshifting. It uses susloop~ and the higher math externals, and I don't know if standard Pd has all those installed. Left input takes the sound, right input transposion in halftones. It is designed for a sample rate of 44100 Hz, but you can change that with a little editing.
So, yet another thing, anyone should have patched in Pd accomplished ;)
cu Thomas
robbert van hulzen wrote:
well then, thanks for doing my homework! ;) nice one. (i like how it gives a kind of flanger effect on the drum loop i tried it with, almost more like a filter, because of the high noise portion of the signal, i suppose.) cheers, robbert
The patch is just a little dirty hack with looping a 10 ms long sample (or cutting off a bit when pitching down). It would be better to do that with Fourier transformation, but I am too stupid^H^H^H^H^H^H^inexperienced to do that in Pd ;)
"Prisons are needed only to provide the illusion that courts and police are effective. They're a kind of job insurance." (Leto II. in: Frank Herbert, God Emperor of Dune) http://thomas.dergrossebruder.org/
On Wed, 2007-02-28 at 23:00 +0100, Thomas Mayer wrote:
robbert van hulzen wrote:
well then, thanks for doing my homework! ;) nice one. (i like how it gives a kind of flanger effect on the drum loop i tried it with, almost more like a filter, because of the high noise portion of the signal, i suppose.) cheers, robbert
The patch is just a little dirty hack with looping a 10 ms long sample (or cutting off a bit when pitching down). It would be better to do that with Fourier transformation, but I am too stupid^H^H^H^H^H^H^inexperienced to do that in Pd ;)
hi thomas
i posted once an fft-based pitchshifter, which is based on millers I07.phase.vocoder.pd . you can get it here: http://lists.puredata.info/pipermail/pd-list/2006-03/036241.html be aware, that it is quite cpu-hungry.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
peter,
use this construction:
[phasor~] | | [r arraylength] | | [*~ ] | [tabread4~ arrayname]
where, "arraylength" is the value obtained from the outlet of [soundfiler] when you load your sample.
the speed of the phasor should be set at ( 44100 / arraylength ) to play at a normal pitch (assuming your samplerate is 44100hz)..and multiplying or dividing this value by a scalar you can change the pplayback speed
2007/3/2, hard off hard.off@gmail.com:
peter,
use this construction:
[phasor~] | | [r arraylength] | | [*~ ] | [tabread4~ arrayname]
where, "arraylength" is the value obtained from the outlet of [soundfiler] when you load your sample.
the speed of the phasor should be set at ( 44100 / arraylength ) to play at a normal pitch (assuming your samplerate is 44100hz)..and multiplying or dividing this value by a scalar you can change the pplayback speed
What about aliasing?
Hallo, Denis Trapeznikoff hat gesagt: // Denis Trapeznikoff wrote:
2007/3/2, hard off hard.off@gmail.com:
use this construction:
[phasor~] | | [r arraylength] | | [*~ ] | [tabread4~ arrayname]
where, "arraylength" is the value obtained from the outlet of [soundfiler] when you load your sample.
What about aliasing?
Aliasing will happen as usual.
Now it depends on the content of the "arrayname" table. If "arrayname" is "const 0", you get no aliasing of course, if it contains one period of a sine wave, you have a construct like [osc~] and you will get aliasiang starting at phasor~ frequency = Nyquist = SR/2. If "arrayname" contains two periods of a sine, it's like playing an [osc~] with two times the [phasor~] frequency so you start to alias at a phasor~ frequency of 0.5 Nyquist and so on for arbitrary signals.
Frank Barknecht _ ______footils.org_ __goto10.org__
Could aliasing be avoided by using a multi-pole low pass filter at nyquist before sending the signal to the dac?
~Kyle
On 3/5/07, Frank Barknecht fbar@footils.org wrote:
Hallo, Denis Trapeznikoff hat gesagt: // Denis Trapeznikoff wrote:
2007/3/2, hard off hard.off@gmail.com:
use this construction:
[phasor~] | | [r arraylength] | | [*~ ] | [tabread4~ arrayname]
where, "arraylength" is the value obtained from the outlet of [soundfiler] when you load your sample.
What about aliasing?
Aliasing will happen as usual.
Now it depends on the content of the "arrayname" table. If "arrayname" is "const 0", you get no aliasing of course, if it contains one period of a sine wave, you have a construct like [osc~] and you will get aliasiang starting at phasor~ frequency = Nyquist = SR/2. If "arrayname" contains two periods of a sine, it's like playing an [osc~] with two times the [phasor~] frequency so you start to alias at a phasor~ frequency of 0.5 Nyquist and so on for arbitrary signals.
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
Could aliasing be avoided by using a multi-pole low pass filter at nyquist before sending the signal to the dac?
No: Alias frequencies aren't too high, they are wrong frequencies, that have been mirrored at the Nyquist border. As soon as you try to play a sinewave at Nyquist + x, what you get is a sine at Nyquist - x, and you cannot lowpass out this frequency after it has been introduced.
You can however upsample your signal first, then use a lowpass filter, then downsample again. See this chapter in The Book for more info: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node194.html and J07.oversampling.pd
Frank Barknecht _ ______footils.org_ __goto10.org__
I don't want to change the subject (and if needed, we can start a new thread), but as this might be a related topic, here it is...
What would it take to turn this into a "Slowdown" abstraction? Basically, I am interested in slowing down the tempo of a sound, but NOT changing the pitch...
Am I off-base on this? Or can this be used as the starting point for what I described?
Thanks,
Mike
On 3/5/07, Frank Barknecht fbar@footils.org wrote:
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
Could aliasing be avoided by using a multi-pole low pass filter at nyquist before sending the signal to the dac?
No: Alias frequencies aren't too high, they are wrong frequencies, that have been mirrored at the Nyquist border. As soon as you try to play a sinewave at Nyquist + x, what you get is a sine at Nyquist - x, and you cannot lowpass out this frequency after it has been introduced.
You can however upsample your signal first, then use a lowpass filter, then downsample again. See this chapter in The Book for more info: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node194.html and J07.oversampling.pd
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Helpfile B.14.sampler.rockafella may be a good place to start.
On Mon, 5 Mar 2007 14:15:26 -0600 "Mike McGonagle" mjmogo@gmail.com wrote:
I don't want to change the subject (and if needed, we can start a new thread), but as this might be a related topic, here it is...
What would it take to turn this into a "Slowdown" abstraction? Basically, I am interested in slowing down the tempo of a sound, but NOT changing the pitch...
Am I off-base on this? Or can this be used as the starting point for what I described?
Thanks,
Mike
On 3/5/07, Frank Barknecht fbar@footils.org wrote:
Hallo, Kyle Klipowicz hat gesagt: // Kyle Klipowicz wrote:
Could aliasing be avoided by using a multi-pole low pass filter at nyquist before sending the signal to the dac?
No: Alias frequencies aren't too high, they are wrong frequencies, that have been mirrored at the Nyquist border. As soon as you try to play a sinewave at Nyquist + x, what you get is a sine at Nyquist - x, and you cannot lowpass out this frequency after it has been introduced.
You can however upsample your signal first, then use a lowpass filter, then downsample again. See this chapter in The Book for more info: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node194.html and J07.oversampling.pd
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-- Help the Environment, Plant a Bush back in Texas!
"I place economy among the first and most important republican virtues, and public debt as the greatest of the dangers to be feared. To preserve our independence, we must not let our rulers load us with perpetual debt." -- Thomas Jefferson, third US president, architect and author (1743-1826)
"Give Peace a Chance" -- John Lennon (9 October 1940 _ 8 December 1980)
Peace may sound simple_one beautiful word_ but it requires everything we have, every quality, every strength, every dream, every high ideal. _Yehudi Menuhin (1916_1999), musician
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
You can however upsample your signal first, then use a lowpass filter, then downsample again. See this chapter in The Book for more info: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node194.html and J07.oversampling.pd
i kind of hoped that tabread4 would do some kind of interpolation which might magically stop aliasing..
Hallo, Peter Worth hat gesagt: // Peter Worth wrote:
You can however upsample your signal first, then use a lowpass filter, then downsample again. See this chapter in The Book for more info: http://crca.ucsd.edu/~msp/techniques/latest/book-html/node194.html and J07.oversampling.pd
i kind of hoped that tabread4 would do some kind of interpolation which might magically stop aliasing..
It does interpolation, but unfortunatly that won't get rid of aliasing. :(
Frank Barknecht _ ______footils.org_ __goto10.org__
2007/3/6, Peter Worth peterworth2@googlemail.com:
i kind of hoped that tabread4 would do some kind of interpolation which might magically stop aliasing..
As Frank mentioned, it does, but "interpolation" in itself is a heavily overloaded word. Consider linear interpolation: it is, it is done, but during upsampling, sine wave at Nyquist transforms into triangular and sub-Nyquist sines are high-freq distorted, too... :( Interpolation is the field, where the question of "how" is, IMO, of even greater importance than that of "if".
2007/3/6, Peter Worth peterworth2@googlemail.com:
i kind of hoped that tabread4 would do some kind of interpolation which might magically stop aliasing..
hmmm.... could we have some way of interpolating, just short of magic, that would stop aliasing during downsampling?
tabread4~ takes an input of the integer/non-integer value to look up in the table. What if, as a function of the derivative of this signal input, we could adjust the interpolating function to eliminate high frequencies that would be aliased?
first off, any interpolating polynomial causes distortion. First place to start is with the sinc function, which is not a polynomial. sinc(t)=sin(pi*t)/t It is the optimal interpolating function for band-limited signals, and is valid when the signals are infinitely long. Over all frequencies less than the Nyquist frequency, the continuous signal is exactly as it was before sampling. There is some funkiness at exactly the Nyquist frequency, because only the cosine component (using real-valued signals) is left after sampling. (This is always a good case to consider first) sinc(fs*t) has a spectrum of unity for frequencies between -fs/2 and fs/2. Now suppose we want to use the sinc as an interpolating function, where the playback speed is increased. Then we get rid of the excess spectrum, to eliminate aliasing. Where we have a playback speed of k (where k>1) we can modify our interpolating function to sinc(fs*t/k), changing the spectrum to -fs/(2k) to fs/(2k), preventing aliasing.
So, there's a lesson to be learned from the sinc function. If we wanted to interpolate values at a higher speed that normal, we would stretch our interpolating function out over a longer time.
If we take Lagrange interpolating polynomials and continue to increase the degree, we will get successively better approximations to the sinc function. *But* the polynomials will always have infinite frequency content--They are not band-limited, but they are compact. Possibly, we could take these polynomials, and just stretch them out, like the sinc, to get comparable performance (not perfect, but quick)
There's another way to interpolate values that is based on Fourier Transforms. Taking our signal, we compute a discrete fourier transform, and replace the discrete vectors of the inverse transform with continuous functions. Then, we have a continuous signal that interpolates in between samples, and to play at higher speeds, we would throw away the higher frequencies, to prevent aliasing.
Using this method, our interpolating function of order N becomes (2/N)*[1+sum{ j=1:N/2 ; cos(pi*t*fs*j) }
We could limit the number N to say, 4 or 8, and throw away some of the cosines as needed.
The fourier method, I just mentioned, is not in fact a good interpolator, but if you were playing back at higher speeds than normal, I don't think it should matter.
Somebody, please give me a job. I have nothing to do at the machine shop except analyze math problems while running the CNC. Well, later,
Chuck