[SoundComp-Develop] Design discussion: first language example
Status: Pre-Alpha
Brought to you by:
jssr67
|
From: <js...@ya...> - 2009-12-28 23:32:54
|
Here I give an early preview on how the language might look like. If there are parts of the terminology that are unclear, please ask, it is imperative that we all know what each other is talking about when it comes to that level.
It may be a good idea for the documentation staff ^^ to create a glossary for SoundComp musical and/or signal processing terminology if we otherwise have difficulties clarifying the terms.
-----------------------------------------------------------------------------------------
"SampleRate"=44100;
Process("Flute"): Inputs("Frequency" type Stream, "Gate" type Stream), Outputs("SoundData" type Stream) {
Envelope("ENote"){"Attack"=0.05, "Decay"=0, "Sustain"=1, "Release"=0, "Gate"=Flute.Gate }
Envelope("ENoise"){"Attack"=0, "Decay"=0.15, "Sustain"=0.01, "Release"=0.15, "Gate"=Flute.Gate }
Sine("GNote"){"Frequency"=Flute.Frequency }
PinkNoise("PNoise"){ }
Mixer("FMixer"){"Input1"=PNoise.OUT,"Input1"=Enoise.OUT, "Input1"=0.5, "Input2"=GNote.OUT, "Input2"=ENote.OUT }
"SoundData"=FMixer.OUT
}
Process("MixAll"): Inputs({"VFlute"} type Stream ) {
Mixer("PMixer"){?????????
------------ we need a definition as to what to mix
up here for a mixer that is a "catch-all-voices"
in an instrument. I haven't found a suitable def yet.
}
Process("PWave"): Inputs("Stream" type Stream) {
Outfile("WWave") { "Format"={"Mono", "16Bit"}, "Filename"="Test.Wav", "Stream"=PWave.Stream }
}
PWave.Stream=PMixer.OUT
}
Scale("ital"){
"Do"=440;
"Re"=500;
"Mi"=560;
"Fa"=600;
"Sol"=660;
}
Voice("VFlute"): Process("Flute"){
VFlute.BPM=25;GateMode(-.015, {0.15,5%,-0.05,95%}, 0.5, -1);
Scale("ital");
!Do:8, !Re, !Mi, !Fa, !Sol:2, !:8, !Fa, !Mi, !Re, !Do:2 ;
Scale(WellTempered);
!a1:8, !b1, !c#2, !d2, !e2:2;
VFlute.BPM=30;
!a1:10,!b1,!a1,!g#1,!a1, !c#2:6, !b1, !g#1,!a1,2
}
-----------------------------------------------------------------------------------------
This could mean in detail:
"SampleRate"=<number> determines the sample rate of the whole project (you cannot have more than one).
Process("Flute") - we want to define our own signal process, it should be referred with the name Flute.
Inputs("Frequency", "Gate") - this process has 2 parameter inputs, both accept number streams, their names are "Frequency" and "Gate". These shall later on be used for determining the pitch and the note start/stop information (but this is not said here, it is just random names).
Outputs("SoundData") - this process has one output stream.
Envelope(....){...} incorporates an envelope generator with the given parameters into the process. This and many following are predefined process element types.
Sine(...){...}incorporates a sine generator. Its frequency control input is connected to the Flute process Frequency input.
PinkNoise(...) incorporates a pink noise generator.
Mixer("FMixer") defines a mixer that sums up the sine and the noise. It has 2 input channels, if a channel is connected multiple times, all the sources for that input are multiplied (that functionality is a speciality of mixers).
Process("MixAll") another process. This is going to sum up the different notes of the voice "VFlute". Here my language definition still has holes and has to be further specified.
Outfile(...) { ...} specifies a ProcessElement that shall write its input Stream into a .wav file.
Scale("ital") defines a user-defined scale with 5 note names and the corresponding frequencies (these intervals are not really good sounding, just an example).
Voice("VFlute") starts the definition of a voice playing a melody with the "Flute" process.
Several timing parameters are given:
VFlute.BPM=25 means that the tempo in this voice is to be set (from the timestamp this is seen) to 100 beats per minute. It is given in whole notes (you might also write 100/4 to write tempo 100 beats in quarter notes).
GateMode(a, { b, c, d,e}, f, g) controls event timing:
a: Each note start is delayed by a against the global time (here, negative delay meaning the gate is a bit ahead of the rhythm. This is usual as many sounds need a small amount of time to swell up to noticeable volume).
b: The minimum "on" time of the gate is 0.15 secs.
c: The minimum "on" time of the gate is 5% of the note length but must leave at least 5% over for off-time (this limits short notes)
d: the maximum "on" time of the gate ends 0.05 secs before the note end according to note length.
e: the maximum "on" time of the gate ends at 95% of the note length (this limits long notes).
f: the life cycle of the note ends 0.5 secs after gate off.
g: this is reserved for future use. -1 should be a "no-op".
The rest is selecting scales and notes for the melody. Note that note lengths are written reciprocal, so !Do:2 means a half note of pitch "Do". this is so because writing reciprocal values usually will save typing as most note lengths are usually reciprocal natural numbers. If no note length is given, repeat the previous. If no pitch is given, repeat the previous.
------------- Now to the bad points: --------------
What is missing? mainly how to connect the sound data of the individual notes to the instrument mixer. They have to be mixed since instruments may be polyphonic, or even monophonic instruments may produce time-overlapping sounds. So each note needs its own process instance.
Also, the link between the note event pitch/gate and the "Frequency"/"Gate" inputs of the corresponding process is nowhere defined in the given text. It should not work by using these special names, the link has to work with arbitrary input names - this is important as a process might have multiple frequency or gate inputs. I haven't really thought much about that problem yet.
Maybe someone sees even more definition gaps - then, by all means, please make them public early. We need to close them.
If you have ideas how to make the syntax more intuitive but still unambiguous, this is very important, too.
Jan
__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
|