Csound Csound-dev Csound-tekno Search About

[Csnd] introducing noise

Date2010-09-14 16:11
FromJoel Ross
Subject[Csnd] introducing noise
I'm trying to find a way to manipulate the ammount of noise present in a sound.
I'd like to be able to have a function between 0 and sr/2 which determines the
ammount of noise in that frequency range. I imagine this as a kind of bandwidth
function, which modulates the frequencies present in the original sound in order
to add noise.

My first attempts involved using cross synthesis between noise
and the sound, using the other pvoc opcodes to alter the bandwidth of the noise
before performing the cross-synthesis. This creates a nasty sound like the worst
kind of digital artifacts, or really bad compression.

My more recent attempts have been using additive synthesis 'by hand'. I use the
pvsftw opcode in order to write out the amplitude and frequency components to
two ftables, and then use recursive udo's two resynthesize this.

Each of the frequencies has a modulation, which adds a random offset to its
frequency at the start of each cycle of the waveform. For static tones
this can produce a nice transition from pitched sound to noise.

The results of this process are some very interesting sounds, however the
problem here are twofold. Firstly, this is an incredibly inefficient technique.
Secondly, artifacts are introduced each time the amplitude or frequencies
change. Smoothing sorts this out, to some extent, however all of this is done
at krate, so ksamps must be equal to 1 or other artifacts are introduced. This
reduces the performance even more significantly.

So firstly, I wonder if anyone has any suggestions for a different method for
achieving this result, and secondly, ideas for an ideal additive
synthesis 'by hand'.
'pvsftw' includes a kflag to check when changes to the data are available,
but I can't think how I could produce a short ramp when this is the case, and
sustain the value when it is not.

Thanks,
 Joel


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-09-14 16:29
FromAaron Krister Johnson
Subject[Csnd] Re: introducing noise
Hi Joel,

If the goal is to add band-limited noise, the first question is if the nature of the noise is modulatory or is it just to add some 'grit' to the sound.

The second question is the nature of the noise itself....if you need equal noise energy per octave across the audible spectrum, you need some pink noise. Otherwise, white noise is fine, but be aware that white noise is more weighed towards high frequencies both in the reality of it, and our perception of it.

Not sure what your goal is, but I suspect that you are looking for adding an organic component ('warmth')....I find it helps to limit this to the slightest amount, just barely or just above barely perceptible. TOo much and you are in the realm of unpleasant painful digital artifact sounding stuff, which I suppose have their use. For instance, you can use low frequency noise to do some LFO work on a bank of oscillators. The "jitter" opcode already exists for such purposes.

The other thing you may be thinking of it narrow band-limited additive noise, where each partial is a 'dirty sine wave'. It is CPU intensive, but one way around this is to do very slight low-freq FM on groups of harmonics, instead of each harmonic. The other way to make this more CPU friendly is to make the noise source (preferably a true non-algorithmic noise source) the same for each harmonic, so that all that's being calulated is each harmonic's bandpass filter profile. Add them together, and boom, good stuff.

On a related note, check out modal synthesis (the 'mode' opcode)--you can really get sweet sounds driving the modes with a sustained noise source, which itself might be filtered in various ways before driving the modes to resonate. I have to say that these days, I'm getting thrilled by the possibilities of various ways of using the 'mode' opcode, almost more than any other.

The 'pvoc' and friends opcodes are nice, but tend to munch CPU in a hurry. I'd do things more in a bank of oscillators (or filters) type way first before going that route.

AKJ

On Tue, Sep 14, 2010 at 10:11 AM, Joel Ross <joel.binarybrain@gmail.com> wrote:
I'm trying to find a way to manipulate the ammount of noise present in a sound.
I'd like to be able to have a function between 0 and sr/2 which determines the
ammount of noise in that frequency range. I imagine this as a kind of bandwidth
function, which modulates the frequencies present in the original sound in order
to add noise.

My first attempts involved using cross synthesis between noise
and the sound, using the other pvoc opcodes to alter the bandwidth of the noise
before performing the cross-synthesis. This creates a nasty sound like the worst
kind of digital artifacts, or really bad compression.

My more recent attempts have been using additive synthesis 'by hand'. I use the
pvsftw opcode in order to write out the amplitude and frequency components to
two ftables, and then use recursive udo's two resynthesize this.

Each of the frequencies has a modulation, which adds a random offset to its
frequency at the start of each cycle of the waveform. For static tones
this can produce a nice transition from pitched sound to noise.

The results of this process are some very interesting sounds, however the
problem here are twofold. Firstly, this is an incredibly inefficient technique.
Secondly, artifacts are introduced each time the amplitude or frequencies
change. Smoothing sorts this out, to some extent, however all of this is done
at krate, so ksamps must be equal to 1 or other artifacts are introduced. This
reduces the performance even more significantly.

So firstly, I wonder if anyone has any suggestions for a different method for
achieving this result, and secondly, ideas for an ideal additive
synthesis 'by hand'.
'pvsftw' includes a kflag to check when changes to the data are available,
but I can't think how I could produce a short ramp when this is the case, and
sustain the value when it is not.

Thanks,
 Joel


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--
Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org


Date2010-09-14 16:58
FromJoel Ross
Subject[Csnd] Re: Re: introducing noise
Hi Aaron,

Thanks for your quick response!

I'm thinking of this in terms of a process which can be applied to concrete
sounds, and yes I want to take it all of the way, to morph the sound between
the original and complete noise, its the digital sound that I was
trying to avoid,
and to some extent I've succeeded.

In order to think about the kind of sound that I'm after, imagine taking a
noise source, and passing it through a bandpass filter with a narrow Q,
and then stacking them up to produce an noisy sawtooth, if you increase
the Q, you can morph between tone and noise. I wanted to imitate this
purely synthetic effect on acoustic sources. I had actually tried my
additive synthesis method with a big bank of bandpass filters as well,
but for some reason large bias creepd in and everything overloaded.
The additive synthesis that I'm talking about replaces the additive synthesis
that you can do in place of the inverse fft.

To illustrate exactly what I'm doing, heres the udo which synthesises
each partial.

opcode modOscil, a, kkk
    aval init 0
    asah init 0
    agate init 0

    kfreq, kamp, kbw xin
    anoise noise 1, 0.1
    asah samphold anoise, agate               ; change and hold each
frequency offset when agate is open
    aphfreq = kfreq + (asah * kbw)              ;multipy freuency
offset by a bandwidth scale
    aphfreq clip aphfreq, 50, 20000
    andx, agate syncphasor aphfreq, aval   ; open agate when phase is reset
    ares tablei andx, 1, 1

    xout ares * kamp

endop

This is run on the output of:
famp  pvsanal   asoundfile, 1024, 256, 1024, 1 ; analyse the signal
kflag pvsftw famp, 3, 2

I ran this very slow modulation process on some test files, and it
does produce a very nice transition, creating really inharmonic, but
actually acoustic sounding sounds, or noisy almost breathy or bowed
tones - except for the clicking artifacts. The problem I think is the
implementation, whether there is a better technique I don't know,
but I'd be happy having this method artifact free for a start, and
the problem there is in the additive synthesis (I can't do an artifact
free resynthesis using a udo at the moment). I think I will start a new
thread regarding the additive synthesis problem.

Thanks again,
 Joel

On 14 September 2010 17:29, Aaron Krister Johnson  wrote:
> Hi Joel,
>
> If the goal is to add band-limited noise, the first question is if the
> nature of the noise is modulatory or is it just to add some 'grit' to the
> sound.
>
> The second question is the nature of the noise itself....if you need equal
> noise energy per octave across the audible spectrum, you need some pink
> noise. Otherwise, white noise is fine, but be aware that white noise is more
> weighed towards high frequencies both in the reality of it, and our
> perception of it.
>
> Not sure what your goal is, but I suspect that you are looking for adding an
> organic component ('warmth')....I find it helps to limit this to the
> slightest amount, just barely or just above barely perceptible. TOo much and
> you are in the realm of unpleasant painful digital artifact sounding stuff,
> which I suppose have their use. For instance, you can use low frequency
> noise to do some LFO work on a bank of oscillators. The "jitter" opcode
> already exists for such purposes.
>
> The other thing you may be thinking of it narrow band-limited additive
> noise, where each partial is a 'dirty sine wave'. It is CPU intensive, but
> one way around this is to do very slight low-freq FM on groups of harmonics,
> instead of each harmonic. The other way to make this more CPU friendly is to
> make the noise source (preferably a true non-algorithmic noise source) the
> same for each harmonic, so that all that's being calulated is each
> harmonic's bandpass filter profile. Add them together, and boom, good stuff.
>
> On a related note, check out modal synthesis (the 'mode' opcode)--you can
> really get sweet sounds driving the modes with a sustained noise source,
> which itself might be filtered in various ways before driving the modes to
> resonate. I have to say that these days, I'm getting thrilled by the
> possibilities of various ways of using the 'mode' opcode, almost more than
> any other.
>
> The 'pvoc' and friends opcodes are nice, but tend to munch CPU in a hurry.
> I'd do things more in a bank of oscillators (or filters) type way first
> before going that route.
>
> AKJ
>
> On Tue, Sep 14, 2010 at 10:11 AM, Joel Ross 
> wrote:
>>
>> I'm trying to find a way to manipulate the ammount of noise present in a
>> sound.
>> I'd like to be able to have a function between 0 and sr/2 which determines
>> the
>> ammount of noise in that frequency range. I imagine this as a kind of
>> bandwidth
>> function, which modulates the frequencies present in the original sound in
>> order
>> to add noise.
>>
>> My first attempts involved using cross synthesis between noise
>> and the sound, using the other pvoc opcodes to alter the bandwidth of the
>> noise
>> before performing the cross-synthesis. This creates a nasty sound like the
>> worst
>> kind of digital artifacts, or really bad compression.
>>
>> My more recent attempts have been using additive synthesis 'by hand'. I
>> use the
>> pvsftw opcode in order to write out the amplitude and frequency components
>> to
>> two ftables, and then use recursive udo's two resynthesize this.
>>
>> Each of the frequencies has a modulation, which adds a random offset to
>> its
>> frequency at the start of each cycle of the waveform. For static tones
>> this can produce a nice transition from pitched sound to noise.
>>
>> The results of this process are some very interesting sounds, however the
>> problem here are twofold. Firstly, this is an incredibly inefficient
>> technique.
>> Secondly, artifacts are introduced each time the amplitude or frequencies
>> change. Smoothing sorts this out, to some extent, however all of this is
>> done
>> at krate, so ksamps must be equal to 1 or other artifacts are introduced.
>> This
>> reduces the performance even more significantly.
>>
>> So firstly, I wonder if anyone has any suggestions for a different method
>> for
>> achieving this result, and secondly, ideas for an ideal additive
>> synthesis 'by hand'.
>> 'pvsftw' includes a kflag to check when changes to the data are available,
>> but I can't think how I could produce a short ramp when this is the case,
>> and
>> sustain the value when it is not.
>>
>> Thanks,
>>  Joel
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>>
>
>
>
> --
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"