slippery chicken documentation - output

## Output

The musical material generated by slippery chicken can be written to files in various formats. The user is not required to apply any of these in order for slippery chicken to generate its data, but the data generated is not audible or printable without them.

The generation of MIDI files requires no installation or external use of additional software, as they are created using a small subset of the Common Music (Heinrich Taube) implementation that comes bundled with slippery chicken. The MIDI files generated can be imported into notation software such as Finale, Sibelius, or the open-source alternative MuseScore for further editing.

The printable output options involve either Common Music Notation (CMN) or LilyPond. CMN must be installed and loaded into the Lisp environment before use, as is described on the installation page. The LilyPond application can be obtained from lilypond.org.

### + MIDI

MIDI output can be generated by slippery chicken using the `midi-play` method. This method takes as its only required argument a `slippery-chicken` object, e.g. the global variable defined as the first argument to the `make-slippery-chicken` function.

The method also requires a path name and file name for the output it generates. These can be set using the optional keyword argument `:midi-file`. If no value is passed to this argument by the user, output is written to `"/tmp/sc.mid"` by default. The user is encouraged to add the suffix `.mid` to the file name to facilitate opening the file later.

A common straightforward application of this method may look like this:

    (midi-play +name-of-sc-object+ :midi-file "/path/to/output-file.mid")

The optional keyword argument `:start-section` indicates the section from which output is to begin. This is set to `1` by default. The value passed here must be a section ID as defined in the `set-map` and `rthm-seq-map`.

#### Setting MIDI parameters

The various settings for MIDI parameters are specified in slippery chicken within the context of the component they apply to. For example, program (or "patch") numbers are specified using the `:midi-program` keyword in the definition of `instrument` objects (see the source code documentation on the `make-instrument` function), and MIDI channel numbers are specified in the `ensemble` block of the `make-slippery-chicken` function (see the page on ensembles). Information on the features and limitations of microtonal MIDI output can also be found on the ensembles page.

Specifics on all of the arguments for this method can be found in the source code documentation for `slippery-chicken/midi-play`.

close

### + CMN

CMN's output can be useful as a preview, as it is easy to generate the whole score within Lisp and CMN generally runs faster than LilyPond. In some cases however, CMN will produce collisions of symbols on the page that can only be adjusted manually using external software such as Adobe Illustrator or the open-source application Inkscape. The use of LilyPond is encouraged for generating printable output that may require less post-generation tweaking.

The `cmn-display` method takes as its only required argument a `slippery-chicken` object, e.g. the variable defined as the first argument to `make-slippery-chicken`.

The `cmn-display` method also requires a directory path and output file name. These are set to `"/tmp/cmn.eps"` by default. CMN generates encapsulated post-script files, so adding the `.eps` suffix to the file name will facilitate opening the file later.

A common straightforward application of this method may look like this:

    (cmn-display +name-of-sc-object+ :file "/path/to/output-file.eps")

The keyword argument `:write-section-info` causes the method to print text information about the given `slippery-chicken` object into the score when set to `T`.

Specifics on all of the arguments for this method can be found in the source code documentation for `slippery-chicken/cmn-display`.

close

### + Outputting sets and rthm-seqs with CMN

The `cmn-display` method can also be used to generate printable output of individual `set-palette` or `rthm-palette` objects by applying the method directly to them:

    (let ((sp (make-set-palette
                'sp-data
                '((set1 ((c3 g3 cs4 e4 fs4 a4 bf4 c5 d5 f5 gf5 af5 ef6)))
                  (set2 ((c3 fs3 cs4 e4 g4 a4 b4 c5 df5 f5 g5 af5 ef6)))
                  (set3 ((d3 f3 cs4 e4 fs4 a4 b4 c5 d5 e5 fs5 af5 ef6)))
                  (set4 ((d3 e3 cs4 ef4 fs4 a4 b4 c5 d5 e5 fs5 af5 d6)))))))
      (cmn-display sp :file "/tmp/sp-out.eps" :break-line-each-set nil))

    (let ((rsp (make-rsp
                'rsp-frag
                '((seq1 ((((2 4) q +e. s)
                          ((s) e (s) q)
                          (+e. s { 3 (te) te te } ))
                         :pitch-seq-palette (1 2 3 4 5 6 7)))
                  (seq2 ((((3 4) (e.) s { 3 te te te } +q)
                          ({ 3 +te (te) te } e e (q)))
                         :pitch-seq-palette (2 3 4 5 6 7 8)))
                  (seq3 ((((2 4) e e { 3 te te te })
                          ((5 8) (e) e e e s s))
                         :pitch-seq-palette (3 4 5 6 7 8 9 10 1 2)))))))
      (cmn-display rsp :file "/tmp/rsp-out.eps"))

More information on this can be found in the documentation for `set-palette/cmn-display` and `rthm-seq-palette/cmn-display`.

close

### + Including sets in CMN output

close

The user can have slippery chicken print the sets for each sequence on separate staves at the bottom of a score by setting the `display-sets` keyword argument of `cmn-display` to `T` when applied to a complete `slippery-chicken` object:

    (let ((sc-piece
           (make-slippery-chicken
            '+sc-piece+
            :title "sc piece"
            :instrument-palette +slippery-chicken-standard-instrument-palette+
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5)))
                           (2 ((af3 bf3 c4 df4 ef4 f4 g4 af4)))
                           (3 ((fs3 gs3 as3 b3 cs4 ds4 es4 fs4))))
            :set-map '((1 (1 2 3)))
            :rthm-seq-palette '((1 ((((2 4) (e) e e e))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((vn (1 1 1))))))))
      (cmn-display sc-piece :file "/tmp/sc-piece.eps" :display-sets t))

More information on this can be found in the documentation for slippery-chicken/cmn-display.

NB: There is no `cmn-display` method for `rthm-seq-map` objects, as this would essentially be the same as applying the method to the `slippery-chicken` object.

### + LilyPond

While slippery chicken doesn't run LilyPond automatically, as it does CMN, the `write-lp-data-for-all` method produces the files the LilyPond application needs to typeset the given musical material.

The `write-lp-data-for-all` method produces `.ly` files for the full score and each of the individual players ("parts") of the given `slippery-chicken` object. It generates the file names of its output automatically based on the `title` slot argument of that object. The file for the full score can be easily identified by the underscore placed at the beginning of the file name and the addition of the `-score` suffix to the end of the file name. The files for the parts can be identified by file names consisting of the ID assigned to the player in the `ensemble` block, plus the addition of the suffix `-part`. The `-def` file generated need not be accessed directly by the user, but are required by LilyPond.

As with the other output methods, this method also takes as its first argument a `slippery-chicken` object, e.g. the global variable defined as the first argument to the `make-slippery-chicken` function. The only other argument required for the simplest usage of `write-lp-data-for-all` is the output path, which can be specified using the keyword argument `:base-path`. As opposed to the methods for the MIDI and CMN output, the `write-lp-data-for-all` method requires no file name with the path, as slippery chicken generates the file names for this method automatically. If no output path is specified by the user, the method uses the default path of `"/tmp/"`.

A common straightforward application of this method may look like this:

    (write-lp-data-for-all +name-of-sc-object+ :base-path "/tmp/")

LilyPond was originally designed for use with the command-line, and although it's packaged as a standalone executable now for Mac (LilyPond.app) and Windows (LilyPad.exe), command-line usage is still an option.

NB: As of March 2012, the LilyPond.app was not yet compatible with Mac OSX 10.7.x ("Lion"). However, LilyPond can still be used on Lion from the command-line. Please refer to the documentation on the LilyPond website for more information on how to do this.

NB: LilyPond can take a long time to render output of larger scores, during which time it is unresponsive and may appear to have hung or frozen.

Specifics on all of the arguments for this method can be found in the source code documentation for `slippery-chicken/write-lp-data-for-all`.

close

### + Third-party SVG editors

While both CMN and LilyPond strive to produce scores without the need for further editing, some tweaking of the output may occasionally be desired. In addition to modifying any of the text-based LilyPond files generated, the `.eps` and `.pdf` files that these applications produce can also be manually manipulated using vector graphics editing software such as Adobe Illustrator or an open-source alternative such as Inkscape. Editing scalable vector graphic files (SVG), such as the `.eps` or `.pdf` files produced by CMN and LilyPond, is easy and very intuitive, as whole objects (e.g. note-heads, stems, beams, bars, flags, dynamics, articulations etc.) can be simply clicked and dragged.

close

### + CLM sound file output

CLM output in slippery chicken is generated using the `clm-play` method. In its most straightforward form that output can be generated as such:

    (clm-play +sc-object+ 1 nil 'source-sndfile-grp-1)

A detailed description of the `clm-play` method, including instructions for generating output, can be found on the slippery chicken and CLM page.

close