Hello,
Is there a way to do sub-block manipulation on each sample-block in
real-time in PD?
For example, if I have a 64 sample block and all the samples in that
block are zeros except for sample 30 which is a one, and I wanted to
shift all samples up 30 bins (with wrapping) so that now all samples
in this block are zeros except bin 60 which is a one, how would I do
that (without writing my own external)?
If I understand the basic objects correctly, a simple [+~ 30] would
turn the sample block above from all zeros except bin 30 which is a
one into a sample block of all 30's except bin 30 which would now be a
31, right?
Essential, my question is are there bitwise operators such as [>>] and
[<<] exept working on samples instead of bits.
Interestingly, convolution is basically an audio rate 'and' [&&~], right?
Thanks for the help! -thewade
hi, in the zexy library you have an object [z~] which does samplewise delay. marius.
thewade schrieb:
Hello,
Is there a way to do sub-block manipulation on each sample-block in real-time in PD?
For example, if I have a 64 sample block and all the samples in that block are zeros except for sample 30 which is a one, and I wanted to shift all samples up 30 bins (with wrapping) so that now all samples in this block are zeros except bin 60 which is a one, how would I do that (without writing my own external)?
If I understand the basic objects correctly, a simple [+~ 30] would turn the sample block above from all zeros except bin 30 which is a one into a sample block of all 30's except bin 30 which would now be a 31, right?
Essential, my question is are there bitwise operators such as [>>] and [<<] exept working on samples instead of bits. Interestingly, convolution is basically an audio rate 'and' [&&~], right?
Thanks for the help! -thewade
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Sat, 4 Nov 2006, thewade wrote:
For example, if I have a 64 sample block and all the samples in that block are zeros except for sample 30 which is a one, and I wanted to shift all samples up 30 bins (with wrapping) so that now all samples in this block are zeros except bin 60 which is a one, how would I do that (without writing my own external)?
use both [lrshift~ 30] and [lrshift~ -34]. You need two because it's zero-padding instead of wrapping.
the helpfile for [lrshift~] is not available through usual means because someone made a typo in the filename five years ago or something.
If I understand the basic objects correctly, a simple [+~ 30] would turn the sample block above from all zeros except bin 30 which is a one into a sample block of all 30's except bin 30 which would now be a 31, right?
yes.
Essential, my question is are there bitwise operators such as [>>] and [<<] exept working on samples instead of bits. Interestingly, convolution is basically an audio rate 'and' [&&~], right?
no, convolution is a bunch of sample-wise shifts and [*~] and [+~] together (as many as there are values in the convolution kernel).
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Quoting Mathieu Bouchard matju@artengine.ca:
the helpfile for [lrshift~] is not available through usual means because someone made a typo in the filename five years ago or something.
Nice! That is exactly the answer I was looking for! Thank you!
I will poke around in the help files to see if I can find the
incorrectly-named help for this object, to see what the related
objects are.
Essential, my question is are there bitwise operators such as [>>]
and [<<] exept working on samples instead of bits. Interestingly,
convolution is basically an audio rate 'and' [&&~], right?no, convolution is a bunch of sample-wise shifts and [*~] and [+~] together (as many as there are values in the convolution kernel).
Yes, but conceptually convolution is converting time domain sounds
into frequency domain, storing the values in a sample block, and
multiplying the two blocks together (and normalizing of course). So if
one block has no sound at 300Hz and the other block does, the
resulting block does NOT have sound at 300Hz, right?
So if your block size was four and you had one FFT block that was:
0,1,0,1
And another that was:
0,0,0,1
The convolved "real" sound block (before going to ifft~) would be
0,0,0,1
Right?
Thanks for the object-pointer and the brain-fix! -thewade
On Sun, 5 Nov 2006, thewade wrote:
Quoting Mathieu Bouchard matju@artengine.ca: I will poke around in the help files to see if I can find the incorrectly-named help for this object, to see what the related objects are.
It's just named rlshift~ instead. Else it should work fine (unless you have additional -path -helppath required, which may happen on some setups)
no, convolution is a bunch of sample-wise shifts and [*~] and [+~] together (as many as there are values in the convolution kernel).
Yes, but conceptually convolution is converting time domain sounds into frequency domain, storing the values in a sample block, and multiplying the two blocks together (and normalizing of course).
Convolution can be defined in two completely equivalent ways: one as polynomial product in the time domain (using a "z-series" representation) and one as the complex multiplication of two frequency spectra using an infinite blocksize.
Almost all of the time, the time-domain representation is taught first. This might be especially important as the frequency-domain only becomes tangible once some kind of Fourier transform is in place, and the polynomial product is certainly easier to explain than the Fourier transform. (and that's even more true for realtime)
But if you want to apply convolutions with large kernels and/or large pieces of data, you really have to use [fft~] (for sound) or [#fft] (for spatial-frequencies of images).
So if one block has no sound at 300Hz and the other block does, the resulting block does NOT have sound at 300Hz, right?
Right.
So if your block size was four and you had one FFT block that was: 0,1,0,1 And another that was: 0,0,0,1 The convolved "real" sound block (before going to ifft~) would be 0,0,0,1 Right?
Yes, supposing each of those values is a complex number. But that's because "AND" is a special case of multiplication, because:
0*0 = 0 0*1 = 0 1*0 = 0 1*1 = 1
so * over {0,1} is exactly AND.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
lrshift~ needs to have a second inlet, or a float method to change the argument (grumble....gripe....moan) :P
I'd volunteer to add it, but what would the procedure be like for that? Chuck
On 11/6/06, Mathieu Bouchard matju@artengine.ca wrote:
On Sun, 5 Nov 2006, thewade wrote:
Quoting Mathieu Bouchard matju@artengine.ca: I will poke around in the help files to see if I can find the incorrectly-named help for this object, to see what the related objects are.
It's just named rlshift~ instead. Else it should work fine (unless you have additional -path -helppath required, which may happen on some setups)
no, convolution is a bunch of sample-wise shifts and [*~] and [+~] together (as many as there are values in the convolution kernel).
Yes, but conceptually convolution is converting time domain sounds into frequency domain, storing the values in a sample block, and multiplying the two blocks together (and normalizing of course).
Convolution can be defined in two completely equivalent ways: one as polynomial product in the time domain (using a "z-series" representation) and one as the complex multiplication of two frequency spectra using an infinite blocksize.
Almost all of the time, the time-domain representation is taught first. This might be especially important as the frequency-domain only becomes tangible once some kind of Fourier transform is in place, and the polynomial product is certainly easier to explain than the Fourier transform. (and that's even more true for realtime)
But if you want to apply convolutions with large kernels and/or large pieces of data, you really have to use [fft~] (for sound) or [#fft] (for spatial-frequencies of images).
So if one block has no sound at 300Hz and the other block does, the resulting block does NOT have sound at 300Hz, right?
Right.
So if your block size was four and you had one FFT block that was: 0,1,0,1 And another that was: 0,0,0,1 The convolved "real" sound block (before going to ifft~) would be 0,0,0,1 Right?
Yes, supposing each of those values is a complex number. But that's because "AND" is a special case of multiplication, because:
0*0 = 0 0*1 = 0 1*0 = 0 1*1 = 1
so * over {0,1} is exactly AND.
_ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list