sounds and source code



I've been pondering...

If we want to put sounds under the GPL, and the GPL requires that source 
code (defined as "the preferred format for editing") be made available in 
the same medium as the binaries, what if we were to create a language for 
semi-abstract description of audio? Then we could (1) satisfy the GPL; 
(2) provide binary-format-independent description of sounds; and (3) 
compile into different formats, say RIFF, AU, MIDI, and MP3, just as C 
can be compiled to run on Intel, Sparc, MIPS, ... You get the idea.

How could we create a practical Sound Description Language? Well, sounds 
have lots of characteristics:

Timbre. We could describe timbre with a list of harmonics and their 
relative strengths ("harm ( 1 .8 .6 .4 .2 )" or with harmonic/strength, 
"harm ( 1 2/.8 4/.4 )"). Or we could use "standard" names, like 
"Trumpet1".

Channels. Just as images in the GIMP have layers, so do sounds. However, 
in images, the layers are fairly static, and can be kept in separate 
blocks; whereas in sounds the layers flow together in time. The channel 
is first assigned a timbre, and then plays a series of notes. For maximum 
flexibility, the channels' notes could be given in "vertical" 
presentation (notes played at the same time are presented together in the 
source) or "horizontally" (channels are presented completely, one at a time).

Pitch. (with "880Hz" or with note/octave, "A1" or "A'") Rests could be 
zeros or "R".

Duration. This is tricky. We could use beats, with a predefined tempo 
("60bpm" would be 1 beat per second). Or, we could introduce the notion 
of measures used in Western musical notation ("timesig 4 4" would be 
common time) and let the compiler determine the number of beats, while we 
use standard note names like "1/4", "1/2", "whole", or "q", "h", "w". 
Dotted notes would have a trailing period ("1/8. 1/16" totals "1/4").

Effects. Filtering, vibrato, sweep, overdrive. To be determined.

How would we put it all together? I'll borrow a notion from WebDot and 
put items into "blocks" with defaults stated at the beginning of the 
block. An example might be better than an attempt at description (I'll 
leave that to someone more skilled).

name "Suzuki Method" {
  tempo 120bpm
  timesig 4 4
  channel1 { Violin1 }
  data {
  % Twinkle Twinkle Little Star
    c0 1 c0 1 g0 1 g0 1 a1 1 a1 1 g0 2
  % How I wonder where you are
    f0 1 f0 1 e0 1 e0 1 d0 1 d0 1 c0 2
  }
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]