Csound Csound-dev Csound-tekno Search About

[Csnd] noise or "tone"

Date2012-12-28 07:44
FromTarmo Johannes
Subject[Csnd] noise or "tone"
Hello,

what could be a good way to determine wether the sound or a specicf 
part of the sound has a definite pitch (more or less stable harmonic 
partials) or it is  noise ?

I would like to filter out only un-pitched consonants from spoken text, skip 
vowels, write the result to a pvs buffer and play on with the material.

I would think opcode 'partials' could help but please give me some advice.

greetings,
tarmo

Date2012-12-28 14:26
FromDavid Mooney
SubjectRe: [Csnd] noise or "tone"
I don't have Csound stuff handy right now, but take a look at opcodes
that deal with resonators and exciters. You can think of consonants as
exciters and vowels as resonators.

--David Mooney


On Fri, Dec 28, 2012 at 2:44 AM, Tarmo Johannes
 wrote:
> Hello,
>
> what could be a good way to determine wether the sound or a specicf
> part of the sound has a definite pitch (more or less stable harmonic
> partials) or it is  noise ?
>
> I would like to filter out only un-pitched consonants from spoken text, skip
> vowels, write the result to a pvs buffer and play on with the material.
>
> I would think opcode 'partials' could help but please give me some advice.
>
> greetings,
> tarmo
>
>
> 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"
>



-- 
Opaque Melodies
http://opaquemelodies.com

Date2012-12-28 17:07
Fromfrancesco
Subject[Csnd] Re: noise or "tone"
[Please do not shot me, but i get a message from Nabble that say
my messages (2) were not accepted, so this is the third, maybe ...
If so, apologies]

Hello,
only a guess, but could be the plltrack opcode of some utility?
see:
http://csound.1045644.n5.nabble.com/plltrack-opcode-td5716372.html#a5716382

ciao,
francesco.




--
View this message in context: http://csound.1045644.n5.nabble.com/noise-or-tone-tp5719076p5719083.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-12-28 17:38
FromTarmo Johannes
SubjectRe: [Csnd] Re: noise or "tone"

Thanks, good hint!
I will try it oty - when the alock variable of plltrack is low, it is probably noise. If it works, it will be perfect solution.

Tarmo

2012 12 28 19:08 kirjutas kuupäeval "francesco" <ilterzouomo@fastwebnet.it>:
[Please do not shot me, but i get a message from Nabble that say
my messages (2) were not accepted, so this is the third, maybe ...
If so, apologies]

Hello,
only a guess, but could be the plltrack opcode of some utility?
see:
http://csound.1045644.n5.nabble.com/plltrack-opcode-td5716372.html#a5716382

ciao,
francesco.




--
View this message in context: http://csound.1045644.n5.nabble.com/noise-or-tone-tp5719076p5719083.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"


Date2012-12-28 20:39
FromBen Hackbarth
SubjectRe: [Csnd] Re: noise or "tone"
another tactic: try using pvscent to obtain the centroid of the
signal.  in general, if you have a reasonable signal to noise ratio,
the centroid should be higher where these is more vocal noise and less
vocal pitch.  you might be able to gate the sound's amplitude using
that -- it should be more stable than a pitch tracking algorithm imo.

--  ben


On Fri, Dec 28, 2012 at 9:38 AM, Tarmo Johannes
 wrote:
> Thanks, good hint!
> I will try it oty - when the alock variable of plltrack is low, it is
> probably noise. If it works, it will be perfect solution.
>
> Tarmo
>
> 2012 12 28 19:08 kirjutas kuupäeval "francesco" :
>
>> [Please do not shot me, but i get a message from Nabble that say
>> my messages (2) were not accepted, so this is the third, maybe ...
>> If so, apologies]
>>
>> Hello,
>> only a guess, but could be the plltrack opcode of some utility?
>> see:
>>
>> http://csound.1045644.n5.nabble.com/plltrack-opcode-td5716372.html#a5716382
>>
>> ciao,
>> francesco.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/noise-or-tone-tp5719076p5719083.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"
>>
>


Date2013-01-01 21:29
FromBen Hackbarth
SubjectRe: [Csnd] Re: noise or "tone"
i found an old patch where i did something similar with pvscent for
voice processing.  here, a vocal recording is split between L and R
based on whether the signal is noisy or pitched.  the sum of the two
channels create virtually the same mono signal as the original
soundfile.  you have to adjust iCentroidPitchedThresh and
iCentroidNoiseThresh by hand based on characteristics of different
recordings and speakers.  it would certainly have to change from male
to female registers.

i originally used this algorithm to do spectral pitch shifting on the
pitched portions of the sound, then mix the fricative sounds back in
to avoid distortion.  but i think it could work for your application
as well?

there are the results (note the difference between L and R channels):
http://crca.ucsd.edu/~ben/vocalParse.mp3

and here is the code:


-o vocalParse.wav



sr = 44100
ksmps = 16
nchnls = 2
0dbfs = 1

instr 1
ifftsize	=		2048
ioverlap	=		ifftsize / 4
iwinsize	=		ifftsize
iwinshape	=		1; von-Hann window
ain		soundin	  "/Users/ben/Documents/audioGuide/target/cageTarget.aiff"
fftin		pvsanal	ain, ifftsize, ioverlap, iwinsize, iwinshape;
fft-analysis of the audio-signal
kcenter	pvscent	fftin; spectral center

iCentroidPitchedThresh = 1200.
iCentroidNoiseThresh = 3000.

if kcenter != 0 then
	kCentClip  limit  kcenter, iCentroidPitchedThresh, iCentroidNoiseThresh
	kCentScalar = (kCentClip-iCentroidPitchedThresh)/(iCentroidNoiseThresh-iCentroidPitchedThresh)
	kNoiseMix  pow  kCentScalar, 2
	kVoiceMix  pow (1-kCentScalar), 2
endif

aNoiseMix interp kNoiseMix
aVoiceMix interp kVoiceMix

outs	ain*aNoiseMix, ain*aVoiceMix
endin



i 1 0 18.411




--  ben


On Fri, Dec 28, 2012 at 12:39 PM, Ben Hackbarth  wrote:
> another tactic: try using pvscent to obtain the centroid of the
> signal.  in general, if you have a reasonable signal to noise ratio,
> the centroid should be higher where these is more vocal noise and less
> vocal pitch.  you might be able to gate the sound's amplitude using
> that -- it should be more stable than a pitch tracking algorithm imo.
>
> --  ben
>
>
> On Fri, Dec 28, 2012 at 9:38 AM, Tarmo Johannes
>  wrote:
>> Thanks, good hint!
>> I will try it oty - when the alock variable of plltrack is low, it is
>> probably noise. If it works, it will be perfect solution.
>>
>> Tarmo
>>
>> 2012 12 28 19:08 kirjutas kuupäeval "francesco" :
>>
>>> [Please do not shot me, but i get a message from Nabble that say
>>> my messages (2) were not accepted, so this is the third, maybe ...
>>> If so, apologies]
>>>
>>> Hello,
>>> only a guess, but could be the plltrack opcode of some utility?
>>> see:
>>>
>>> http://csound.1045644.n5.nabble.com/plltrack-opcode-td5716372.html#a5716382
>>>
>>> ciao,
>>> francesco.
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://csound.1045644.n5.nabble.com/noise-or-tone-tp5719076p5719083.html
>>> Sent from the Csound - General mailing list archive at Nabble.com.
>>>
>>>
>>> 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"
>>>
>>


Date2013-01-02 16:13
FromTarmo Johannes
SubjectRe: [Csnd] Re: noise or "tone"
thank you all for the suggestions!

I did some small preliminary experience and ideed, pvscent works pretty well!

For me the centroid frequency somewhere around 6000 Hz separated the noisy 
consonants from vowels -  it'a true noise gate - only noise can pass!

thanks!
tarmo



On Tuesday 01 January 2013 13:29:07 Ben Hackbarth wrote:
> i found an old patch where i did something similar with pvscent for
> voice processing.  here, a vocal recording is split between L and R
> based on whether the signal is noisy or pitched.  the sum of the two
> channels create virtually the same mono signal as the original
> soundfile.  you have to adjust iCentroidPitchedThresh and
> iCentroidNoiseThresh by hand based on characteristics of different
> recordings and speakers.  it would certainly have to change from male
> to female registers.
> 
> i originally used this algorithm to do spectral pitch shifting on the
> pitched portions of the sound, then mix the fricative sounds back in
> to avoid distortion.  but i think it could work for your application
> as well?
> 
> there are the results (note the difference between L and R channels):
> http://crca.ucsd.edu/~ben/vocalParse.mp3
> 
> and here is the code:
> 
> 
> -o vocalParse.wav
> 
> 
> 
> sr = 44100
> ksmps = 16
> nchnls = 2
> 0dbfs = 1
> 
> instr 1
> ifftsize	=		2048
> ioverlap	=		ifftsize / 4
> iwinsize	=		ifftsize
> iwinshape	=		1; von-Hann window
> ain		soundin	  
"/Users/ben/Documents/audioGuide/target/cageTarget.aiff"
> fftin		pvsanal	ain, ifftsize, ioverlap, iwinsize, iwinshape;
> fft-analysis of the audio-signal
> kcenter	pvscent	fftin; spectral center
> 
> iCentroidPitchedThresh = 1200.
> iCentroidNoiseThresh = 3000.
> 
> if kcenter != 0 then
> 	kCentClip  limit  kcenter, iCentroidPitchedThresh, iCentroidNoiseThresh
> 	kCentScalar =
> (kCentClip-iCentroidPitchedThresh)/(iCentroidNoiseThresh-iCentroidPitchedTh
> resh) kNoiseMix  pow  kCentScalar, 2
> 	kVoiceMix  pow (1-kCentScalar), 2
> endif
> 
> aNoiseMix interp kNoiseMix
> aVoiceMix interp kVoiceMix
> 
> outs	ain*aNoiseMix, ain*aVoiceMix
> endin
> 
> 
> 
> i 1 0 18.411
> 
> 
> 
> 
> --  ben
> 
> On Fri, Dec 28, 2012 at 12:39 PM, Ben Hackbarth  wrote:
> > another tactic: try using pvscent to obtain the centroid of the
> > signal.  in general, if you have a reasonable signal to noise ratio,
> > the centroid should be higher where these is more vocal noise and less
> > vocal pitch.  you might be able to gate the sound's amplitude using
> > that -- it should be more stable than a pitch tracking algorithm imo.
> > 
> > --  ben
> > 
> > 
> > On Fri, Dec 28, 2012 at 9:38 AM, Tarmo Johannes
> > 
> >  wrote:
> >> Thanks, good hint!
> >> I will try it oty - when the alock variable of plltrack is low, it is
> >> probably noise. If it works, it will be perfect solution.
> >> 
> >> Tarmo
> >> 
> >> 2012 12 28 19:08 kirjutas kuupäeval "francesco" 
:
> >>> [Please do not shot me, but i get a message from Nabble that say
> >>> my messages (2) were not accepted, so this is the third, maybe ...
> >>> If so, apologies]
> >>> 
> >>> Hello,
> >>> only a guess, but could be the plltrack opcode of some utility?
> >>> see:
> >>> 
> >>> http://csound.1045644.n5.nabble.com/plltrack-opcode-td5716372.html#a5716
> >>> 382
> >>> 
> >>> ciao,
> >>> francesco.
> >>> 
> >>> 
> >>> 
> >>> 
> >>> --
> >>> View this message in context:
> >>> http://csound.1045644.n5.nabble.com/noise-or-tone-tp5719076p5719083.html
> >>> Sent from the Csound - General mailing list archive at Nabble.com.
> >>> 
> >>> 
> >>> 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"
> 
> 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"