To represent more complex music than a scale we need a more expressive music representation.
Generate a simple score and output it. =Score.makeScore= expects a
literal score representation consisting of records and returns a
score object. Each record in the literal score representation is an
init method to create a score object (which optionally contains
other score objects), i.e. score object attributes can be set by
specifying init record features.
declare
MyScore = {Score.makeScore
seq(items: [note(duration: 4
pitch: 60
amplitude: 80)
note(duration: 4
pitch: 64
amplitude: 80)
note(duration: 4
pitch: 67
amplitude: 80)]
startTime:0
%% duration 1 corresponds to 1/4 beats, i.e. duration
%% one is a 1/16th note.
timeUnit:beats(4))
unit}
There are various ways to look at scores
Look at the object without inspecting it.
{Browse MyScore}
To inspect the score nesting and parameter values (see
toPPrintRecord doc for additional args)
{Browse {MyScore toPPrintRecord($)}}
To see all score object attributes (see toFullRecord doc for
additional args)
{Browse {MyScore toFullRecord($)}}
To transform the object back into an init record (e.g. for
archiving purposes after a successful search).
{Browse {MyScore toInitRecord($)}}
To listing to the score (you need to have Csound and a sound file player installed and some Strasheela environment variables set correctly). See the doc for more arguments.
{Out.renderAndPlayCsound MyScore unit}
To view the score in common music notation (you need to have lilypond and a PDF viewer installed and some Strasheela environment variables set correctly). See the doc for more arguments.
{Out.renderAndShowLilypond MyScore unit}
Many unset score parameters are often implicitly bound to FD
integers (for details on the init defaults see the class
definitions in ScoreCore.oz). Such parameters can be searched for in a script.
declare
MyScore = {Score.makeScore
seq(items: [note note note])
unit}
{Browse {MyScore toPPrintRecord($)}}
However, it is often sensible to set some parameters directly by
hand. This is most often true for the startTime of the full score
-- leaving the startTime unset would greatly increase the size of
the search space without any further use.
For output into various formats it is also necessary to set the
timeUnit (the timeUnits of all objects are unified). See the doc of
the class TimeParameter for details.