dear list,
i can create nice wavetables with sinesum.
what would be the easiest process to do the inverse?
reading a wavetable of known size and converting it to it’s sine harmonics gain structure.
fft? i am a little bit lost on how to do this with a wavetable.
or is there a simpler way if i know the number of points and the range of the waveform?
cheers
sorry to post again.
i think sigmund~ can do this.
but i would be thankful for a hint how to calculate it. if it’s fft, then some insight how to use fft on a single wavetable would be very nice.
On 04 Aug 2016, at 09:34, Simon Iten itensimon@gmail.com wrote:
dear list,
i can create nice wavetables with sinesum.
what would be the easiest process to do the inverse?
reading a wavetable of known size and converting it to it’s sine harmonics gain structure.
fft? i am a little bit lost on how to do this with a wavetable.
or is there a simpler way if i know the number of points and the range of the waveform?
cheers
Can you elaborate a bit what you want to do??
I think you better process the table rather than go from one domain to another.
inverse the phase by multiplying by -1, you can "reverse" the table by reading it from back to front.
On Thu, Aug 4, 2016 at 8:53 AM, Simon Iten itensimon@gmail.com wrote:
sorry to post again.
i think sigmund~ can do this.
but i would be thankful for a hint how to calculate it. if it’s fft, then some insight how to use fft on a single wavetable would be very nice.
On 04 Aug 2016, at 09:34, Simon Iten itensimon@gmail.com wrote:
dear list,
i can create nice wavetables with sinesum.
what would be the easiest process to do the inverse?
reading a wavetable of known size and converting it to it’s sine
harmonics gain structure.
fft? i am a little bit lost on how to do this with a wavetable.
or is there a simpler way if i know the number of points and the range
of the waveform?
cheers
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
ah sorry, yes
i want to read a wavetable, say 128 steps and calculate the gain structure to aproximate this wavetable with sine waves. the idea behind this is to get a different sound from wavetables, use low resolution wavetables to get nice sounds (waldorf microwave xt)
so for a saw wave i would want the following numbers.
1 0.5 0.3333 0.25 0.2 and so on…
how to do this for an arbitrary input wavetable?
i looked at the fft examples but it is not clear to me how i would do this with a single wavetable (of known size)
or if there is a “simpler” (without fft) possibility that would be great.
On 04 Aug 2016, at 10:05, José Rafael Subía Valdez jsubiavaldez@gmail.com wrote:
Can you elaborate a bit what you want to do??
I think you better process the table rather than go from one domain to another.
inverse the phase by multiplying by -1, you can "reverse" the table by reading it from back to front.
On Thu, Aug 4, 2016 at 8:53 AM, Simon Iten <itensimon@gmail.com mailto:itensimon@gmail.com> wrote: sorry to post again.
i think sigmund~ can do this.
but i would be thankful for a hint how to calculate it. if it’s fft, then some insight how to use fft on a single wavetable would be very nice.
On 04 Aug 2016, at 09:34, Simon Iten <itensimon@gmail.com mailto:itensimon@gmail.com> wrote:
dear list,
i can create nice wavetables with sinesum.
what would be the easiest process to do the inverse?
reading a wavetable of known size and converting it to it’s sine harmonics gain structure.
fft? i am a little bit lost on how to do this with a wavetable.
or is there a simpler way if i know the number of points and the range of the waveform?
cheers
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list https://lists.puredata.info/listinfo/pd-list
-- José Rafael Subía Valdez www.jrsv.net http://www.jrsv.net/
Hi Simon,
On 04/08/16 09:54, Simon Iten wrote:
ah sorry, yes
i want to read a wavetable, say 128 steps and calculate the gain structure to aproximate this wavetable with sine waves. the idea behind this is to get a different sound from wavetables, use low resolution wavetables to get nice sounds (waldorf microwave xt)
so for a saw wave i would want the following numbers.
1 0.5 0.3333 0.25 0.2 and so on…
how to do this for an arbitrary input wavetable?
i looked at the fft examples but it is not clear to me how i would do this with a single wavetable (of known size)
You could do something like this with [rfft~], but you lose phase information which might be important depending on what you are doing (use fixed-width font to see diagram):
"set appropriate block size, turn off dsp, bang to execute 1 block" | [switch~]
[tabplay~ wavetable] | [rfft~ ] ^ ^ [*~] [*~] \ / [+~] | [sqrt~] | [tabsend~ spectrum]
or if there is a “simpler” (without fft) possibility that would be great.
I don't think you'll get simpler than FFT here. As a bonus you can also get phase information (sinesum has all phases 0, cosinesum all phases pi/2, general wavetable can have arbitrary phases).
You could use [rifft~] instead of sinesum to generate your wavetable, too. Note there may be some issues with normalization (fft->ifft has an amplitude gain equal to the blocksize, iirc).
For a more advanced use of oneshot FFT and IFFT for wave tables, see my bandlimited project: https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html
hi claude,
your bandlimited project works/sounds great! very nice sounds from handdrawn waves.
however i am having trouble getting your example to work. probably just stupidity from my side.
i suppose i don’t understand your:
"set appropriate block size, turn off dsp, bang to execute 1 block”
message. if you find the time, can you have a look at it?
do i not need to run a bang into tabplay in this special one block send scenario?
with my patch i get “kind" of the right thing.
bang to block~ or on-state switch~ has no effect.
cheers
On 04 Aug 2016, at 18:01, Claude Heiland-Allen claude@mathr.co.uk wrote:
Hi Simon,
On 04/08/16 09:54, Simon Iten wrote:
ah sorry, yes
i want to read a wavetable, say 128 steps and calculate the gain structure to aproximate this wavetable with sine waves. the idea behind this is to get a different sound from wavetables, use low resolution wavetables to get nice sounds (waldorf microwave xt)
so for a saw wave i would want the following numbers.
1 0.5 0.3333 0.25 0.2 and so on…
how to do this for an arbitrary input wavetable?
i looked at the fft examples but it is not clear to me how i would do this with a single wavetable (of known size)
You could do something like this with [rfft~], but you lose phase information which might be important depending on what you are doing (use fixed-width font to see diagram):
"set appropriate block size, turn off dsp, bang to execute 1 block" | [switch~]
[tabplay~ wavetable] | [rfft~ ] ^ ^ [*~] [*~] \ / [+~] | [sqrt~] | [tabsend~ spectrum]
or if there is a “simpler” (without fft) possibility that would be great.
I don't think you'll get simpler than FFT here. As a bonus you can also get phase information (sinesum has all phases 0, cosinesum all phases pi/2, general wavetable can have arbitrary phases).
You could use [rifft~] instead of sinesum to generate your wavetable, too. Note there may be some issues with normalization (fft->ifft has an amplitude gain equal to the blocksize, iirc).
For a more advanced use of oneshot FFT and IFFT for wave tables, see my bandlimited project: https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html
Claude
https://mathr.co.uk https://mathr.co.uk/
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list https://lists.puredata.info/listinfo/pd-list
Hi Simon, list,
On 04/08/16 22:51, Simon Iten wrote:
hi claude,
your bandlimited project works/sounds great! very nice sounds from handdrawn waves.
thanks!
however i am having trouble getting your example to work. probably just stupidity from my side.
i suppose i don’t understand your:
"set appropriate block size, turn off dsp, bang to execute 1 block”
message. if you find the time, can you have a look at it?
sure, just a [loadbang]--"0"--[switch~] - this turns off dsp for the canvas (so you might want to put it all in a subpatch unless you're using it as an abstraction). see attached, works for me
do i not need to run a bang into tabplay in this special one block send scenario?
with my patch i get “kind" of the right thing.
- the table “spectrum” only updates once i click into the table (after i hit
the bang).
mm, seems to be a Pd bug or other infelicity. the attached includes a workaround using [tabwrite] which updates the GUI
- i get only 64 values, so i guess my blocksize is still 64?
no, it's that for real signals the second half of the rfft~ output is symmetric to the first, so Pd sets it to 0 and ignores it in rifft~ to avoid confusion.
- if i send a bang to switch~ when dsp is off, i get an error on the console:
bang to block~ or on-state switch~ has no effect.
you have to switch it off with "0" first, and have global dsp on (afaik).
cheers
hth,
On 04 Aug 2016, at 18:01, Claude Heiland-Allen <claude@mathr.co.uk mailto:claude@mathr.co.uk> wrote:
Hi Simon,
On 04/08/16 09:54, Simon Iten wrote:
ah sorry, yes
i want to read a wavetable, say 128 steps and calculate the gain structure to aproximate this wavetable with sine waves. the idea behind this is to get a different sound from wavetables, use low resolution wavetables to get nice sounds (waldorf microwave xt)
so for a saw wave i would want the following numbers.
1 0.5 0.3333 0.25 0.2 and so on…
how to do this for an arbitrary input wavetable?
i looked at the fft examples but it is not clear to me how i would do this with a single wavetable (of known size)
You could do something like this with [rfft~], but you lose phase information which might be important depending on what you are doing (use fixed-width font to see diagram):
"set appropriate block size, turn off dsp, bang to execute 1 block" | [switch~]
[tabplay~ wavetable] | [rfft~ ] ^ ^ [*~] [*~] \ / [+~] | [sqrt~] | [tabsend~ spectrum]
or if there is a “simpler” (without fft) possibility that would be great.
I don't think you'll get simpler than FFT here. As a bonus you can also get phase information (sinesum has all phases 0, cosinesum all phases pi/2, general wavetable can have arbitrary phases).
You could use [rifft~] instead of sinesum to generate your wavetable, too. Note there may be some issues with normalization (fft->ifft has an amplitude gain equal to the blocksize, iirc).
For a more advanced use of oneshot FFT and IFFT for wave tables, see my bandlimited project: https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html
Claude
https://mathr.co.uk https://mathr.co.uk/
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.atmailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
perfect thanks, that makes sense.
On 05 Aug 2016, at 00:04, Claude Heiland-Allen claude@mathr.co.uk wrote:
Hi Simon, list,
On 04/08/16 22:51, Simon Iten wrote:
hi claude,
your bandlimited project works/sounds great! very nice sounds from handdrawn waves.
thanks!
however i am having trouble getting your example to work. probably just stupidity from my side.
i suppose i don’t understand your:
"set appropriate block size, turn off dsp, bang to execute 1 block”
message. if you find the time, can you have a look at it?
sure, just a [loadbang]--"0"--[switch~] - this turns off dsp for the canvas (so you might want to put it all in a subpatch unless you're using it as an abstraction). see attached, works for me
do i not need to run a bang into tabplay in this special one block send scenario?
with my patch i get “kind" of the right thing.
- the table “spectrum” only updates once i click into the table (after i hit
the bang).
mm, seems to be a Pd bug or other infelicity. the attached includes a workaround using [tabwrite] which updates the GUI
- i get only 64 values, so i guess my blocksize is still 64?
no, it's that for real signals the second half of the rfft~ output is symmetric to the first, so Pd sets it to 0 and ignores it in rifft~ to avoid confusion.
- if i send a bang to switch~ when dsp is off, i get an error on the console:
bang to block~ or on-state switch~ has no effect.
you have to switch it off with "0" first, and have global dsp on (afaik).
cheers
hth,
Claude
On 04 Aug 2016, at 18:01, Claude Heiland-Allen <claude@mathr.co.uk mailto:claude@mathr.co.uk> wrote:
Hi Simon,
On 04/08/16 09:54, Simon Iten wrote:
ah sorry, yes
i want to read a wavetable, say 128 steps and calculate the gain structure to aproximate this wavetable with sine waves. the idea behind this is to get a different sound from wavetables, use low resolution wavetables to get nice sounds (waldorf microwave xt)
so for a saw wave i would want the following numbers.
1 0.5 0.3333 0.25 0.2 and so on…
how to do this for an arbitrary input wavetable?
i looked at the fft examples but it is not clear to me how i would do this with a single wavetable (of known size)
You could do something like this with [rfft~], but you lose phase information which might be important depending on what you are doing (use fixed-width font to see diagram):
"set appropriate block size, turn off dsp, bang to execute 1 block" | [switch~]
[tabplay~ wavetable] | [rfft~ ] ^ ^ [*~] [*~] \ / [+~] | [sqrt~] | [tabsend~ spectrum]
or if there is a “simpler” (without fft) possibility that would be great.
I don't think you'll get simpler than FFT here. As a bonus you can also get phase information (sinesum has all phases 0, cosinesum all phases pi/2, general wavetable can have arbitrary phases).
You could use [rifft~] instead of sinesum to generate your wavetable, too. Note there may be some issues with normalization (fft->ifft has an amplitude gain equal to the blocksize, iirc).
For a more advanced use of oneshot FFT and IFFT for wave tables, see my bandlimited project: https://mathr.co.uk/blog/2015-02-12_bandlimited_wavetables.html
Claude
https://mathr.co.uk https://mathr.co.uk/
Pd-list@lists.iem.at mailto:Pd-list@lists.iem.atmailing list UNSUBSCRIBE and account-management ->https://lists.puredata.info/listinfo/pd-list
<wavetablefft2.pd>
hello,
i'm also very interested in artefact free and band limited table reading.
(my work is in the nusmuk-audio svn folder, you will find there tabosci~ that implement a naive anti aliasing filter using table as oscillator).
The best algorythm i found so far to get an alias free, band limited table reading is this one : https://ccrma.stanford.edu/~jos/resample/resample.pdf but i did not had time to implement it in pd.
I would be glad if someone want to do it before me.
cheers cyrille
Le 05/08/2016 à 00:04, Claude Heiland-Allen a écrit :
Hi Simon, list,
On 04/08/16 22:51, Simon Iten wrote:
hi claude,
your bandlimited project works/sounds great! very nice sounds from handdrawn waves.
thanks!
however i am having trouble getting your example to work. probably just stupidity from my side.
i suppose i don’t understand your:
"set appropriate block size, turn off dsp, bang to execute 1 block”
message. if you find the time, can you have a look at it?
sure, just a [loadbang]--"0"--[switch~] - this turns off dsp for the canvas (so you might want to put it all in a subpatch unless you're using it as an abstraction). see attached, works for me
do i not need to run a bang into tabplay in this special one block send scenario?
with my patch i get “kind" of the right thing.
- the table “spectrum” only updates once i click into the table (after i hit
the bang).
mm, seems to be a Pd bug or other infelicity. the attached includes a workaround using [tabwrite] which updates the GUI
- i get only 64 values, so i guess my blocksize is still 64?
no, it's that for real signals the second half of the rfft~ output is symmetric to the first, so Pd sets it to 0 and ignores it in rifft~ to avoid confusion.
- if i send a bang to switch~ when dsp is off, i get an error on the console:
bang to block~ or on-state switch~ has no effect.
you have to switch it off with "0" first, and have global dsp on (afaik).
cheers
hth,
Claude
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list