[PlanetCCRMA] sound programming

Emiliano Grilli Emiliano Grilli <emiliano.grilli@poste.it>
Sun Feb 1 14:40:02 2004

domenica, 01 febbraio 2004 alle 22:14:33, Christoph Lehmann ha scritto:
> Hi
> I need to synthesize/generate simple sinus tones, which last for a certain time 
> (e.g. 100ms) and have a fade-in and a fade-out of each e.g. 5ms. Lot many of 
> such pieces I need to append to each other
> I can do this very simple with goldwave (well a lot of manual tasks),
> but since I work with linux (well goldwave runs with wine, but not
> excellent): what tool, would you recommend (audacity is quite close but
> not mature enough...)?
> Or if I would like to program the sounds manually , is there any tool
> you can recommend (just generating such sounds, inclusive fade-ins and
> -outs and write the resulting .wav data into a file): would you take c++
> (with which library?) or can I do it with easier languages (python?)..

Csound is perfect for this task I think...
And is included in planetCCRMA.

This is a simple way:

 -d -W -o sine.wav
; ==============================================
sr	=	44100
kr	=	44100
ksmps	=	1

instr 1	

kenv linseg 0,p5,10000,p3 -(p5+p6) ,10000,p6,0
a1 oscil   kenv, p4, 1
out a1


; ==============================================

f1 	0 	4096 	10 	1
;	p2: action	p3: duration	p4: freq	p5: attack		p6: release
i1 	0 			3 				440 		.300 			.600
i1	3			1				660			.100			.100

save this in a file (sine.csd i.e.) and run
$ csound sine.csd

You'll end up with a sine.wav file with 2 sine sounds: one beginning at 0
seconds, lasting 3 seconds, with a frequency of 440 Hz and a fade in of 300
ms, and a fade out of 600 ms. The other beginning at 3 seconds, lasting 1
second, frequency 660 Hz and fade in & fade out of 100 ms.

In the "Cscore" section you can add as many notes as you want (also
generated by another program)
> thanks for a hint
> cheers
> christoph

Emiliano Grilli
Linux user #209089