Post-generation data editing
While it is the goal of slippery chicken, Common Music
Notation (CMN) and LilyPond to generate finished pieces and scores
without the need for further tweaking, some editing of the
post-generation output may be occasionally desired. In addition to the
option of using third-party software to tweak the output (either by
editing the .eps
or .pdf
files directly using
SVG editing software or by importing the generated MIDI files into
notation software, as described on
the output page), editing the generated
data from within the Lisp environment is also possible.
The make-slippery-chicken
function generates
a slippery-chicken
object when it is run (evaluated) in
Lisp. This object contains all of the data generated by slippery
chicken for the given piece and is assigned to the variable given
as the first argument to the make-slippery-chicken
function. Since this is a global variable, the data remains accessible
to the user after it has been generated and can be modified within
the slippery-chicken
object.
+ Events vs. notes
The primary two kinds of data within a
given slippery-chicken
object that the user will want to
modify are its event
objects and its notes.
An event
in slippery chicken consists of an
individual rhythm
object, either a note or a rest, and
all of the data associated with that object, such as its duration,
its pitch if it is not a rest (or pitches if it is a chord), and any
marks or clefs attached to it, etc.
A note is a non-rest event
. Some of the
post-generation editing methods will have arguments
for event
numbers within a specific bar or sequence, and
others will require the note number.
+ Basic usage
A number of methods exist for editing data within
a slippery-chicken
object, and these will all take as
their first argument the global variable created for the
given slippery-chicken
object. The other arguments
required for these methods can be found in the source code
documentation for
the slippery
chicken post-generation editing methods, but will generally
consist of at least the bar-number and event- or note-number of the
data to be changed, and the new value to be set.
For example, adding a ppp
mark to the 2nd note of the
3rd bar of the va
part of
the slippery-chicken
object
named +post-gen-data-eds+
after it has been
generated (outside of the scope of
the make-slippery-chicken
function) can be done in the
following manner:
(let ((pgde (make-slippery-chicken '+post-gen-data-eds+ :title "post-gen data eds" :instrument-palette +slippery-chicken-standard-instrument-palette+ :ensemble '(((vn (violin :midi-channel 1)) (va (viola :midi-channel 2)) (vc (cello :midi-channel 3)))) :tempo-map '((1 (q 60))) :set-palette '((1 ((c3 d3 e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5)))) :set-map '((1 (1 1 1 1))) :rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -)) :pitch-seq-palette ((1 2 3 4 5 6 7 8))))) :rthm-seq-map '((1 ((vn (1 1 1 1)) (va (1 1 1 1)) (vc (1 1 1 1)))))))) (add-mark-to-note +post-gen-data-eds+ 3 2 'va 'ppp) (cmn-display +post-gen-data-eds+ :file "/tmp/post-gen-data-eds.eps"))
+ A few specific methods for post-generation data editing
The full list of methods available for post-generation editing of the
data in a slippery-chicken
object can be found in the
source code documentation for the
the slippery-chicken-edit
file. A few of these methods will also be mentioned here in brief:
change-pitch
: Change the pitch of an event. Arguments:+sc-object+
,bar-num
,note-num
,player
,new-pitch
.(change-pitch +post-gen-data-eds+ 3 2 'va 'c4)
add-mark-to-note
: Add an articulation, dynamic, performance technique or other mark to a note. Arguments:+sc-object+
,bar-num
,note-num
,player
,mark
.(add-mark-to-note +post-gen-data-eds+ 3 2 'va 'ppp)
rm-marks-from-note
: Remove one or more specified marks from a note. Arguments:+sc-object+
,bar-num
,note-num
,player
,mark
.(rm-marks-from-note +post-gen-data-eds+ 3 2 'va 'ppp)
trill
: (LilyPond only.) Place a trill indication (with trill note) in the score starting on the specified note and spanning to the next. Arguments:+sc-object+
,player
,start-bar
,start-event
,trill-note
.(trill +post-gen-data-eds+ 'va 3 2 'd4)
tie-over-rests
: Extend the duration of a specified note over all directly subsequent rests. Arguments:+sc-object+
,bar-num
,note-num
,player
;&key
arguments:end-bar
,:auto-beam
,:consolidate-notes
.(tie-over-rests +post-gen-data-eds+ 1 1 'va :auto-beam 'q :consolidate-notes t)
tie-over-all-rests
: Increase the duration of all notes that immediately precede rests to extend over all directly subsequent rests. Arguments:+sc-object+
,player
,start-bar
,end-bar
;&key
arguments:start-note
,:auto-beam
,:consolidate-notes
(tie-over-all-rests +post-gen-data-eds+ 'va 1 3 :consolidate-notes t)
re-bar
: Reorganize the data of a givenslippery-chicken
object into new bars. This method will only combine short bars into longer ones; it won't split up longer bars and recombine them. Best when used with the:min-time-sig
argument.(re-bar +post-gen-data-eds+ :min-time-sig '(4 4))
move-events
: Copy all events from one player to another and delete that data from the first player. This method can copy segments of bars from the source but can only paste full bars into the target player; i.e., any existing events in the target player's part at the beginning of the start-bar or end of the end-bar will be deleted and replaced with rests, making this method best for copying into completely empty bars. Arguments:+sc-object+
,from-player
,to-player
,start-bar
,start-event
,end-bar
,end-event
.(move-events +post-gen-data-eds+ 'vn 'vc 1 1 3 1)
double-events
: Copy all events from one player to one or more other players, without deleting the source data from the original player's part. This method can copy segments of bars from the source but can only paste full bars into the target player; i.e., any existing events in the target player's part at the beginning of the start-bar or end of the end-bar will be deleted and replaced with rests, making this method best for copying into completely empty bars. Arguments:+sc-object+
,master-player
,doubling-players
,start-bar
,start-event
,end-bar
,end-event
.(double-events +post-gen-data-eds+ 'vn '(va vc) 1 1 3 1)
+ All post-generation editing methods
add-arrow-to-events
add-clef
add-event-to-bar
add-mark-all-players
add-mark-before-note
add-mark-to-event
add-mark-to-note
add-mark-to-notes-from-to
add-marks-sh
add-marks-to-note
add-marks-to-notes
add-tuplet-bracket-to-bar
add-tuplet-brackets-to-beats
auto-accidentals
auto-beam
auto-clefs
auto-slur
change-bar-line-type
change-pitch
change-pitches
change-time-sig
delete-bars
delete-clefs
delete-events
delete-rehearsal-letter
delete-slur
double-events
enharmonic-spellings
enharmonics
force-artificial-harmonics
force-rest-bars
move-clef
move-events
note-add-bracket-offset
process-events-by-time
re-bar
remove-extraneous-dynamics
replace-events
replace-multi-bar-events
replace-tempo-map
respell-bars
respell-notes
respell-notes-for-player
rest-to-note
rm-marks-from-note
rm-marks-from-notes
rm-slurs
sc-delete-beams
sc-delete-marks
sc-delete-marks-before
sc-delete-marks-from-event
sc-force-rest
sc-move-dynamic
sc-remove-dynamic
sc-remove-dynamics
set-cautionary-accidental
set-rehearsal-letter
tie
tie-all-last-notes-over-rests
tie-over-all-rests
tie-over-rest-bars
tie-over-rests
trill
unset-cautionary-accidental