Csound Csound-dev Csound-tekno Search About

problem of clicks

Date2006-03-15 09:40
FromDrweski nicolas
Subjectproblem of clicks
Hi, 

I have a problem with one instrument.
It clicks on the buzz harmonics and i don't know how
to cure that.

orchestra :

sr = 44100
kr = 4410
ksmps = 10
nchnls = 1 

		instr  	1

kenv1 linen p4, p3*0.3, p3*0.4, p3*0.3
kenv2 linen p4*0.5, p3*05, p3*0.3, p3*0.2
kenv3 linen p4*0.2, p3*0.7, p3*0.2, p3*0.1
kenv4 linen p4*0.1, p3*0.8, p3*0.1, p3*0.1
kline randi 30, 2
a1 buzz   kenv1, p5, kline, p6
a2 buzz   kenv2, p5*1.5, kline, p6
a3 buzz   kenv3, p5*2.1, kline, p6
a4 buzz   kenv4, p5*2.8, kline, p6
out a1+a2+a3+a4

		endin

score :

i 1  	0		10	4000	130.8 	1   
i 1  	0		10	4000	311.1	      1  
i 1  	0		10	4000	440	      1  

thanks
nicoals


	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

Date2006-03-15 09:55
FromRichard Dobson
SubjectRe: problem of clicks
Drweski nicolas wrote:
> Hi, 
> 
> I have a problem with one instrument.
> It clicks on the buzz harmonics and i don't know how
> to cure that.
> 
>..
> kline randi 30, 2
> a1 buzz   kenv1, p5, kline, p6

You are changing the number of harmonics dynamically, which does not do 
what you want. Buzz uses a formula to generate  harmonics, such 
that if you reduce or increase that number during a note, the harmonic 
drops out or starts ~immediately~ - with a click. You will find this in 
the documentation:

"Although both knh and klh may be varied during performance, their 
internal values are necessarily integer and may cause "pops" due to 
discontinuities in the output;
"

You will probably want to do this dynamic reduction using a filter 
(tone, butterlp, etc).

Richard Dobson

Date2006-03-15 13:24
FromDavid Akbari
SubjectRe: problem of clicks
Hi Nicolas,

Using Richard Dobson's advice as well as having a look at your 
orchestra myself there were a few things.

Beyond dynamically changing the harmonics in buzz, you also were 
missing an envelope which can often lead to clicks. Specifically when 
using a p-field based score, I recommend using Istvan Varga's declick 
UDO.

Also it was missing the ftable containing a sinewave necessary for 
buzz. Here's a potential fix (listen and see what you think)





sr = 44100
kr = 4410
ksmps = 10
/* stereo version */
nchnls = 2

/* helps the sound with an envelope */
opcode declick, a, a
ain     xin
aenv    linseg 0, 0.02, 1, p3 - 0.05, 1, 0.02, 0, 0.01, 0
         xout ain * aenv         ; apply envelope and write output
         endop


		instr  	1

kenv1 linen p4, p3*0.3, p3*0.4, p3*0.3
kenv2 linen p4*0.5, p3*05, p3*0.3, p3*0.2
kenv3 linen p4*0.2, p3*0.7, p3*0.2, p3*0.1
kenv4 linen p4*0.1, p3*0.8, p3*0.1, p3*0.1
kline randi 30, 2
a1 buzz   kenv1, p5, kline, p6
a2 buzz   kenv2, p5*1.5, kline, p6
a3 buzz   kenv3, p5*2.1, kline, p6
a4 buzz   kenv4, p5*2.8, kline, p6

/* additions */
amix	=	a1+a2+a3+a4
amix	butlp	amix, 6900
aout	declick	amix
aout	clip	aout, 0, 32767
/* --- */

outs aout, aout

		endin


/* was missing this ftable */
f1	0	16384 10 1
/* --- */

i 1  	0		10	3000	130.8 	1
i 1  	0		10	3000	311.1	      1
i 1  	0		10	3000	440	      1




Version: 3
Render: Real
Ask: Yes
Functions: ioObject
WindowBounds: 538 44 1211 793
Options: -b1024 -A -s -m7 -K -R


ioView background {0, 3818, 65535}
ioListing {7, 3} {374, 642}
ioGraph {380, 3} {253, 642}



-David

On Mar 15, 2006, at 4:40 AM, Drweski nicolas wrote:

> I have a problem with one instrument.
> It clicks on the buzz harmonics and i don't know how
> to cure that.