cp -r wave singenThe recursive copy,
cp -r
, is necessary because oct
stores data using a hierarchical directory structure. Of course, if the facet singen
exists already, you must remove it with rm -r
first before copying.
pigi
.
cp -r
". You can use the file browser shown on
page 2-23; just double click on the name "singen" in the lower window of the browser.
XMgraph
star and the wire attached to it. The easiest way to do this is draw a box (click-drag) around the star and its input wire, press "s" to select these objects, and then press "D" to delete them. (You may want to enlarge your window to make it easier to work.)
XMgraph
star used to be and connect it to the output of the Sin
star. The output port is the icon in the system palette with an arrowhead (an input port, by contrast, has a fish tail), as shown above.
- Type "out" as a text argument, including quotation marks.
- Type "c" for create. Again, note that the create command has a different action than before. It names input or output terminals when given a text argument.
- Execute make-schem-icon in the
pigi
"Extend" menu ("@"). - The dialog box should contain:
Palette: ./user.pal
This specifies the name of the palette that will contain your icon. By convention, we usually put galaxy icons in the palette called "user.pal" in the current directory. Hence, this is the default name. - Since you had already created an icon for the "wave" universe, and that icon was copied by your
cp -r
, vem
asks whether it is OK to overwrite the icon. Click "OK". Wait until make-schem-icon is done. Vem
informs you that it is done with a message in the vem
console window, which may be buried by now.
user.pal
" using open-palette ("O"). The newly created galaxy icon should appear in this palette along with the same special icon we saw before, called a cursor. A cursor distinguishes a palette from other types of facets and it determines where the next icon will be placed.
user.pal
" palette. We can now use our sine generator galaxy simply by instantiating our icon into another schematic.
modulation
".
XMgraph
". The "XMgraph
" star can be found again in the "Signal Sinks" subpalette of the SDF palette. The multiplier star, called Mpy
, is in the "Arithmetic" subpalette.
To make a galaxy parameterizable, we create formal parameters in the galaxy and then link the formal parameters to the actual parameters of the instances contained in the galaxy. The terms, "formal" and "actual" parameters, are analogous to formal and actual parameters in any procedural programming language. An example will make this clear.
- Execute edit-params ("e"). An empty parameter window will appear, looking like this:
name: freq
type: float
value: PI/50The value will be the default value. Then click on "OK". Recall that you can use "tab" to move from one field to the next of the dialog box and "Return" instead of "OK". Hence, the dialog can be managed from the keyboard without requiring the mouse.
We just created a new formal parameter called "freq" with a default value of "PI/50". Additional parameters may be added or old ones changed. The default value of a formal parameter can always be changed by executing edit-params in the background of the galaxy. Executing edit-params on the icon representing the galaxy changes the parameter values only for the instance represented by the icon. It overrides the default value specified in the background of the galaxy definition. The possible types for parameters are listed in table
Ramp
icon in the singen
window. - Execute edit-params and fill in the dialog as follows:
step: freq
value: 0.0
This allows the freq parameter of a singen instance to control the increment of the internal ramp star, thus controlling the output frequency.
singen
instances to "PI/5" by using edit-params. This singen
will be ten times the frequency of the other.
modulation
and put it in init.pal
.