Note: this is a comprehensive explanation of how instance and group assignment works, for the curious. The details below are complicated, but can be simplified as a handful of simple rules.
You may want to follow that link if you aren't concerned with the gory details!
There are four categories of instrument calls in Alda. Each category either has a nickname or doesn't, and either has multiple instances or doesn't.
foo:
If foo
refers to a previously named instrument or group, e.g. piano-1:
...
If foo
is a stock instrument, e.g. piano:
...
piano
yet in the score...
piano
.piano
will reference that instrument.piano
in the score...
piano
s must also be named.)piano
, and it doesn't have a name...
piano
.Else, throws an "unrecognized instrument" error.
foo "bar":
foo
is expected to be a stock instrument. If it's not, an error will be thrown.
If "bar"
was already used as the nickname of another instance, throws an error.
If there is an existing, unnamed instance of foo
in the score, throws an error. (All instances of foo
must be named.)
Creates a new instance named bar
of type foo
, e.g.:
piano "larry":
creates a new instance of the stock piano
named "larry"
larry:
refers to that instance.foo/bar:
If foo
and bar
are the same named instance, e.g. foo/foo
...
If foo
and bar
are the same stock instrument, e.g. piano/piano
...
piano:
, it won't be clear which one you mean.If both foo
and bar
refer to previously named instrument instances...
If both foo
and bar
are stock instruments, e.g. piano/bassoon:
foo:
rules above to select and/or create instances.
If e.g. foo
is a named instrument and bar
is not, or vice versa (e.g. foo/trumpet:
):
foo/bar "baz":
If foo
and bar
are the same named instance, e.g. foo/foo
...
If foo
and bar
are the same stock instrument, e.g. piano/piano
...
baz.piano:
to refer to one of the pianos, it won't be clear which one you mean.If both foo
and bar
refer to previously named instrument instances...
"baz"
which can now be used to refer to those instances as a group.baz.foo
and baz.bar
are available to reference the group members, although you could also just keep calling them foo
and bar
.If both foo
and bar
are stock instruments, e.g. piano/guitar "floop":
...
"floop"
which can now be used to refer to those instances as a group.floop.piano
and floop.guitar
are available to reference the group members.If foo
is a named instrument and bar
is a stock instrument or vice versa, e.g. foo/trumpet "quux":
...
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close