Csound Csound-dev Csound-tekno Search About

[Csnd] problems with fof

Date2013-09-12 16:11
Fromluis jure
Subject[Csnd] problems with fof
i find the FOF technique very powerful and versatile, and i have used it
to very good effect in the past. 

but now i'm trying to dig a bit deeper, and i find that the output is
somewhat distorted. i perceive a significant amount of energy in
inharmonic components in the spectrum, confirmed by observing the
spectrogram. the effect is more or less pronounced depending on the
parameters used, but i haven't been able to produce a "clean" harmonic
output.

so i would like to ask the collective wisdom:

- is this an inherent flaw of the technique?
- is it a problem in the implementation of the opcode in csound?
- does it work only for a extremely precise tuning of the parameters?
- am i paranoid?


best,


lj

Date2013-09-12 18:13
FromVictor Lazzarini
SubjectRe: [Csnd] problems with fof
perhaps if you could give us a simple example of what you mean, we can have a look.

Victor
On 12 Sep 2013, at 16:11, luis jure  wrote:

> 
> i find the FOF technique very powerful and versatile, and i have used it
> to very good effect in the past. 
> 
> but now i'm trying to dig a bit deeper, and i find that the output is
> somewhat distorted. i perceive a significant amount of energy in
> inharmonic components in the spectrum, confirmed by observing the
> spectrogram. the effect is more or less pronounced depending on the
> parameters used, but i haven't been able to produce a "clean" harmonic
> output.
> 
> so i would like to ask the collective wisdom:
> 
> - is this an inherent flaw of the technique?
> - is it a problem in the implementation of the opcode in csound?
> - does it work only for a extremely precise tuning of the parameters?
> - am i paranoid?
> 
> 
> best,
> 
> 
> lj
> 
> 
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>            https://sourceforge.net/p/csound/tickets/
> csound5:
>            https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 



Date2013-09-12 21:19
FromOeyvind Brandtsegg
SubjectRe: [Csnd] problems with fof

There might be some inharmonic components generated depending on the relationship between grain rate and the frequency of the waveform inside each grain.  Also,  if you modulate parameters quickly each grain will be different and that may disturb pitch perception.
Or you could try doing it with partikkel as it generally has better resolution for some of the parameters.
Best
Oeyvind

Den 12. sep. 2013 17:11 skrev "luis jure" <ljc@internet.com.uy> følgende:

i find the FOF technique very powerful and versatile, and i have used it
to very good effect in the past.

but now i'm trying to dig a bit deeper, and i find that the output is
somewhat distorted. i perceive a significant amount of energy in
inharmonic components in the spectrum, confirmed by observing the
spectrogram. the effect is more or less pronounced depending on the
parameters used, but i haven't been able to produce a "clean" harmonic
output.

so i would like to ask the collective wisdom:

- is this an inherent flaw of the technique?
- is it a problem in the implementation of the opcode in csound?
- does it work only for a extremely precise tuning of the parameters?
- am i paranoid?


best,


lj


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2013-09-12 21:24
Fromluis jure
SubjectRe: [Csnd] problems with fof
AttachmentsNone  foftest.csd  foftest.png  

Date2013-09-12 22:22
FromVictor Lazzarini
SubjectRe: [Csnd] problems with fof
It looks a bit like aliasing, which I guess can happen depending on sizes of tables, and on parameters.
Have you tried larger tables (> 16384) for both sine and sigmoid? Also your grain size is a bit
small, did you try doubling it (0.04)?

On 12 Sep 2013, at 21:24, luis jure  wrote:

> 
> on 2013-09-12 at 18:13 Victor Lazzarini wrote:
> 
>> perhaps if you could give us a simple example of what you mean, we can
>> have a look.
> 
> actually, the example in the manual fof.csd might do. but since it is
> more complex (five fofs in parallel with formant morphing) i attach a
> minimal fof instrument with an image of a spectrum section of its output,
> as shown by snd (i also tried sonicvisualiser and wavesurfer). showing the
> spectrum in dB and cutting at -90dB you can see a small but in my opinion
> significant amount of energy in spurious components. cutting at -100dB
> several other inharmonic components appear around higher harmonics. for
> this analysis i used a blackman window of 8192 points. i think these
> artifacts are clearly perceptible, but then again i can't really trust my
> monitors, unfortunately... (perhaps my ears either?).
> 
> 
> 
> 
> 
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>            https://sourceforge.net/p/csound/tickets/
> csound5:
>            https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 
> 
> 



Date2013-09-12 22:23
Fromluis jure
SubjectRe: [Csnd] problems with fof
AttachmentsNone  foftest.csd  

Date2013-09-13 00:12
FromOeyvind Brandtsegg
SubjectRe: [Csnd] problems with fof
Yes I see them.
I think it is related either to the relationship between grain rate
and sr, and/or to the relationship between grain rate and the
fundamantal frequency inside each grain.
Could you try this score line
i1    0    4    441    1260
at sr=44100 and see of they are gone then?

Since you have overlapping grains the phase of the sound (inside) of
the previous grain is not necessarily aligned, unless you have an
integer ration between grain rate and grain pitch, this may cause some
distortion and pitch fluctuation.
Also, if your grain rate is not an integer subdivision of the sr, and
the grain generation does not take special caution, your grains will
not come at regular intervals. This is because normally a grain needs
to start at a sample boundary, either on this sample or the next
sample. If the grain rate is not an integer subdivision then some
grains will be slightly offset in time (up to one half a sample
displaced in time).
Partikkel (and I think syncgrain and siblings too(?)) does
interpolation of the grain start time to alleviate this problem, so
all grain rates are available with those grain generators.
Interpolation of grain start time is actually done by a slight offset
of the phase of the waveform inside each grain, but the practical
result is as if the grain started between sample boundaries. It is not
perfect, but a lot better than without this kind of interpolation.

best
Oeyvind




2013/9/12 luis jure :
>
> on 2013-09-12 at 22:19 Oeyvind Brandtsegg wrote:
>
>> There might be some inharmonic components generated depending on the
>> relationship between grain rate and the frequency of the waveform inside
>> each grain.
>
> should this happen, really? i can't say i fully understand the maths of
> the DSP involved, but i think the spectrum should be harmonic in all cases.
>
> i modified the previous orchestra a little bit to experiment with
> different relationships between fundamental and formant frequencies, and i
> think i discovered something interesting: at sr=48000 and 96000 the output
> is fairly clean in all cases, while at sr=44100 there are lots of
> sub-harmonics, that is harmonics of a fundamental = 1/4 of the grain rate.
> i attach the modified orchestra.
>
>
>
>
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://flyndresang.no/
http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://soundcloud.com/t-emp

Date2013-09-13 00:31
Fromluis jure
SubjectRe: [Csnd] problems with fof
AttachmentsNone  foftest.csd  

Date2013-09-13 00:45
Fromluis jure
SubjectRe: [Csnd] problems with fof
on 2013-09-13 at 01:12 Oeyvind Brandtsegg wrote:

> Partikkel (and I think syncgrain and siblings too(?)) does
> interpolation of the grain start time to alleviate this problem, so
> all grain rates are available with those grain generators.
> Interpolation of grain start time is actually done by a slight offset
> of the phase of the waveform inside each grain, but the practical
> result is as if the grain started between sample boundaries. It is not
> perfect, but a lot better than without this kind of interpolation.

sounds like an important improvement, oeyvind. could something like this
be implemented in the fof opcode?


best,


lj