sr	=	44100
kr	=	4410
ksmps	=	10
nchnls	=	1
;----------------------------------------
	instr	1	;example use of buzz
ibigsin	=	1	;requires a large sine wave table
ifund	=	cpspch(p5)
kgate	linen	p4,.1,p3,.5
knharm	linseg	1,p3/2,p6,p3/2,1	;vary n harmonics
asig	buzz	kgate,ifund,knharm,ibigsin
	out	asig
	endin
;-----------------------------------------
	instr	2	;example use of gbuzz
ibigcos	=	2	;requires a large cosine table
ilow	=	(p10 == 0 ? 1 : p10)	;lowest n harmonics for gbuzz
ifund	=	cpspch(p5)
kgate	linen	p4,.1,p3,.5
knharm	linseg	p6,p3/2,p7,p3/2,p6	;vary n harmonics
krfac	linseg	p8,p3/2,p9,p3/2,p8	;vary amp scale factor
asig	gbuzz	kgate,ifund,knharm,ilow,krfac,ibigcos
	out	asig
	endin


;Test score for buzztest.orc
;large sine wave table for buzz
f01	0	8192	10	1
;large cosine wave table for gbuzz
f02	0	8192	9	1	1	90
;test buzz instrument
;nn	st	dur	amp	pch	nh
i01	0	10	20000	6.00	30
s
;test gbuzz instrument
;first, just vary nh over time
;nn	st	dur	amp	pch	nhmin	nhmax	rmin	rmax	ilow
i02	0	10	20000	6.00	1	50	1	1	1
;next, just vary r factor over time
i .	+	.	.	.	50	50	.25	1
;vary both nh and r
i .	+	.	.	.	1	50	.25	1
;set lowest harmonic to 8
i .	+	.	.	.	1	42	.25	1	8
e


Download buzztest.orc

 

Download buzztest.sco