To start we will use the following Csound orchestra.
instr 1 | Starts an instrument block. |
iamp = (p4 > 0.0 ? (p4*0.001*0dbfs) : (ampdbfs (p4))) | The variable p4 sets the amplitude. Linear values from 0 to 1000 or in dB from 0 to negative values |
asig rand iamp | The opcode "rand" generates a controlled random number at audio rate with amplitude +/- "iamp" then writes the output to the audio variable "asig" |
out asig | The opcode "out" writes the audio data to an external device or stream. |
endin | Ends the current instrument block |
This orchestra is a white noise generator, with only the amplitude control (p4).
To prepare the orchestra file (which is a text file with extension .orc) an header is required, and it will have the following parameters.
sr = 96000 | Sample rate = 96000 |
kr = 96000 | Control rate = 96000 |
ksmps = 1 | sr/kr = 1 |
nchnls = 1 | number of channels of audio outfut |
0dbfs = 8388607 | Sets the value of 0 decibels using full scale amplitude with 24 bit depth |
Copy the complete following instructions in a text file and save it as"myclass1.orc".
sr = 96000
kr = 96000
ksmps = 1
nchnls = 1
0dbfs = 8388607
instr 1
iamp = (p4 > 0.0 ? (p4*0.001*0dbfs) : (ampdbfs (p4)))
asig rand iamp
out asig
endin
You will find a dead box everytime you open a patch within a class which doesn't attend in any subfolder of your running workspace. Now don't worry about it and go forward with the tutorial. |
|
A window with "a new MYCLASS1- 1 has been defined" will pop up.
|
The "Classes in package Chroma User" will appear with the "myclass1-1" class inside.
|
|
The meaning of the first three P-fields is reserved. They specific the instrument number, the start-time and the duration.
i-statement | p1 | p2 | p3 |
i | instrument # | start-time | duration |
|
|
|
Watch out at the loudspeakers' volume. |
Anyway the final result (all the audio file) will be will rescale to your audio setting (see the Normalize Output Level in "Preferences/Audio"). For more details about the amplitude managing see Tutorial GS_02 Amplitude and Internal Editor
All the elements of the workspace are saved inside the main folder. The user classes are saved in the path "Main folder/user/Chroma User". So the new class belongs only to the workspace where it is created. To use it in another workspace you have to copy the .omc file inside the Chroma User at the same place inside the other workspace.