 2010/03/12
|
Last update 2006/10/10
 The Labs - Design & Functionality For The NetPackage to Design and Compose Sounds
In the tradition of PicArt we present
SoundArt, a script-based sound-design language which is meant
design and compose simple sounds, not music.
- Introduction
- Interpreter
- Examples
- Download
- Tones & Frequencies
- Samples & Loops
SoundArt is meant as package to write a small codebase
to define a sound, a tone. It is not meant to compose music-pieces,
but solely to design a sound. The approach taken is a simple
stack-oriented language alike PostScript or PicArtScript.
This example illustrates SoundArt quite well, on the left the "eletrical/symbolic"
approach, two oscillators whereas one is scaled, and then both signals added;
SoundArtScript in white letters, and the resulting analog signal.
Language

| | The SoundArtScript language is based on a very simple stack-based
interpreter language, it is parsed and converted in a fast format
which then is called 44,100 times a second to construct the tone
you defined with various oscillators.
Tokens:
- Operands: <float>, e.g. 2.1, 1, 1e3
- Operators: +, * etc.
- Oscillators: sine, pulse etc.
- Effects: delay etc.
- Comment: # which indicates a comment til end-of-line
|
Oscillators

| | | In: | Command: | Out: | Description: |
| freq | sine | v | sine-oscillator |
| freq | pulse | v | pulse-oscillator |
| freq | saw | v | saw-oscillator |
|
The output of
all oscillators are values between -1.0 .. +1.0. freq is in Hz, or
a note: C, C#, D, D#, E, F, F#, G, G#, A, A#, B (default octave 4): A is equal A4 which is
440Hz, or C#3, A2, etc. (see section below on Tones & Frequencies).
More oscillators to come, also WAV files to include.
|
Filters & Effects

| | | In: | Command: | Out: | Description: |
| | noise | v | noise |
| time | delay | v | delay (time in secs) |
|
More effects and filters to come.
|
Numerical Functions

| | | In: | Command: | Out: | Description: |
| a b | + | c | add two numbers c=a+b |
| a b | - | c | substract two numbers c=a-b |
| a b | * | c | multiply two numbers c=a*b |
| a b | / | c | divide two numbers c=a/b |
| a | = | b | a=a*.5+.5 (convert -1..+1 -> 0..1) |
| a | dup | a a | duplicate one number |
| a b | exch | b a | exchange two numbers on stack |
|
|
Simple Tone

| |
creates a 400Hz sine tone, try this code:
|
echo "400 sine" | ./soundart -
|
|
Pulsating Tone

| |
The first line defines a 10Hz pulse, the = is required to
convert the -1..+1 to 0..-1 (the same as 0.5 * 0.5 +).
The 2nd line defines again the 400Hz sine tone, and the last
* mixes (multiplies) the pulse with the 400Hz tone,
result is a 400Hz busy-phone-line like tone.
|
Octave

| | |
C4 sine D4 sine E4 sine F4 sine
|
|
G4 sine A4 sine B4 sine C5 sine
|
This runs 8 oscillators, soundart automatically sums them up and
rescales them.
|
Pulsating Tone with Echo

| | |
10 pulse = # pulsation
|
|
1 sine 400 * 100 + 400 + pulse * # varying pitch
|
|
.5 * # half amplitude
|
|
dup .05 delay .6 * + # add 0.05s delayed
|
|
dup .03 delay .6 * + # add 0.03s delayed
|
the indentation is just done for viewability, you could just make
it an one-liner as well.
|
More complex examples to come.
soundart.tar.gz
Version 0.004 (May 9, 2001).
Supported platforms: FreeBSD, Linux, check the README
This is a very early state software (considered ALPHA), so don't
expect too much about stability.
Usage

| | |
USAGE: [-trace] [-duration <secs>] [-wav <filename>] <file>
|
If file is defined as '-' then stdin the source-code should be provided:
|
echo "400 sine" | ./soundart -
|
With an existing source-code (test.sa):
To write a WAV-file:
|
./soundart -wav test.wav test.sa
|
|
| SoundArt5. Tones & Frequencies
|
Since the input for oscillators are in Hz, you may want to know about
how notes relate to frequencies.
one octave: C, D, E, F, G, A, B
A4 has been adapted as 440Hz.
Pythagorean Scale

| | C=f, D=9/8f, E=81/64f, F=4/3f, G=3/2f, A=27/16f, B=243/128f
By Backus, John. The Acoustical Foundations of Music.
2nd ed. New York: W.W. Norton and Co., 1977 *)
therefore C4 = A4*16/27 = 260.740Hz,
C1 = 260.740Hz / 8 = 32.592 (division by 8 means minus 3 octaves (23 = 8)), fbase = C1 = 32.592Hz
For several octaves this gives:
xoct = ratio[x] * fbase * (1<<(oct-1))
whereas x = { C, D, E, F, G, A, B }, oct = { 1..n },
ratio = { 1., 9./8., 81./64., 4./3., 3./2., 27./16., 243./128. }
|
Well Tempered

| | xoct = 2 (x / 12) * fbase * (1<<(oct-1))
whereas x = { C = 0, C# = 1, D = 2, D# = 3, E = 4, F = 5, F# = 6, G = 7, G# = 8, A = 9 , A# = 10, B = 11 }, oct = { 1..n },
|
More Infos

| |
|
Additional to freq you also can use the tones with octave
(default octave 4) like:
which is the same as "A4 sine" which corresponds to "440 sine" then.
| SoundArt6. Samples & Loops
|

Hipocrisy of the finest: "I agree that no single company can create all the hardware and software. Openness is central because it's the foundation of choice." -- Steve Balmer (Microsoft) blaming Apple regarding iPhone, February 18, 2009Last update 2006/10/10 
All Rights Reserved - (C) 1997 - 2009 by The Labs.Com |