[LAU] generating wavs

Dan S danstowell+lxau at gmail.com
Wed Apr 29 07:20:55 EDT 2009


2009/4/29, Andrew Gaydenko <a at gaydenko.com>:
> Say, I need to generate 1 second, 2 ch, given bps and sr wav filled with
>  (analog) 0.0 except for the only sample in middle with 1.0 value, or some
>  periodic sequence like { -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, ... }, or something
>  else which can be described in few lines of C/Java-like language.
>
>  What is an appropriate software for such simple tasks?

Almost anything, to be honest. If you're comfortable with python then
maybe that, or octave if you know that, if you're comfortable with
Audacity maybe learn how to use the "nyquist prompt".

I use SuperCollider, here's one of your cases done in an interactive session:

~seconds = 1;
~samplerate = 44100;

c = [-1, -1, 1, 1].wrapExtend(~samplerate * ~seconds).stutter(2).as(Signal)

c.plot(numChannels: 2)
c.play(numChannels: 2, mul: 0.05) // BE CAREFUL, turn yr speakers down

f = SoundFile("test.aiff").numChannels_(2);
f.openWrite;
f.writeData(c)
f.close

Dan



More information about the Linux-audio-user mailing list