articulations

Function summary
articulate-bars sequence &key (accent 'ten) (default '-) (parameter :articulation) (section nil)
articulation-at-beginning articulation sequence &key (default 'default)
articulation-at-end articulation sequence &key (default 'default)
articulation-up-to-end articulation sequence &key (default 'default)
attribute-replace new-old-list list-of-attributes
attribute-substitution new old list-of-attributes
disassemble-articulations art
get-full-articulations sequence
merge-articulations arts &key (empty-articulations '(- default))
omn-replace-articulation new sequence
text-attribute &rest args
zip-articulations &rest arts
merge-articulations   arts &key (empty-articulations '(- default))  [Function]

Merges list of OMN articulations to a combined attribute.

Arguments:

  • arts: a list of OMN articulations

  • empty-attributes: articulations to ignore in a combination.

Examples:

    (merge-articulations '(ten ponte ubow)) 
     => ten+ponte+ubow 

    (merge-articulations '(- stacc)) 
     => stacc 

    (merge-articulations '(default default)) 
     => default 

    (merge-articulations '(- -)) 
     => -   

NOTE: Meanwhile there is a buildin function join-attributes, which replaces this function.

disassemble-articulations   art  [Function]

Splits a combined OMN articulations into a list of its individual attributes.

Examples:

    (disassemble-articulations 'leg+ponte) 
     => (leg ponte) 

NOTE: Meanwhile there is a buildin function disjoin-attributes, which replaces this function.

attribute-substitution   new old list-of-attributes  [Function]

Substitute all instances of `old' with `new' in `list-of-attributes'

Examples:

    (attribute-substitution 'pizz 'arco '(ten+arco pizz arco)) 

=> (ten+pizz pizz pizz)

attribute-replace   new-old-list list-of-attributes  [Function]
zip-articulations   &rest arts  [Function]

Expects lists of articulations and combines them to a single list of merged articulations. Shorter lists are circled to the length of the longest.

If arts are list of lists, the result follows the nesting organisation of the first list.

Examples:

    (zip-articulations '(default leg leg default) '(breathy)) 
     (zip-articulations '(- leg leg -) '(breathy)) 
     (zip-articulations '(- leg leg -) '(-)) 
     => (breathy leg+breathy leg+breathy breathy) 
get-full-articulations   sequence  [Function]

[Aux function] Similar to (omn :articulation sequence), but the result includes `leg' and `gliss' symbols for legato 'articulation', which are handled seperately by the function `omn'.

NOTE: as the implementation of omn is not necessarily stable, this function is breakable.

Examples:

    (get-full-articulations '((q g4 leg+gliss q a4 leg q b4 stacc) 
                               (q c4 ten q c5 trem) 
                               )) 
     => ((leg+gliss leg stacc) (ten trem)) 
articulation-at-beginning   articulation sequence &key (default 'default)  [Function]

Returns a list of articulations spanning the given `sequence' (can be nested) with `articulation' at the beginning and `default' for the rest.

Examples:

    (articulation-at-beginning 'pizz '((q q e e) (h.))) 
     => ((pizz default default default) (default)) 

BUG: May not work for OMN sequence.

articulation-at-end   articulation sequence &key (default 'default)  [Function]

Returns a list of articulations spanning the given `sequence' (can be nested) with `articulation' at the beginning and `default' for the rest.

Examples:

    (articulation-at-end 'pizz '((q q e e) (h.))) 
     => ((pizz default default default) (default)) 

BUGS:

  • Does not work if last element in sequence is a rest.

  • May not work for OMN sequence.

articulation-up-to-end   articulation sequence &key (default 'default)  [Function]

Returns a list of articulations spanning the given `sequence' (can be nested) with `articulation' from the beginning to the but-last tone, which carries the default. This is useful for legato slurs over a sublist.

Examples:

    (articulation-up-to-end 'leg '((q q e e) (q q))) 
     => ((leg leg leg leg) (leg default)) 
text-attribute   &rest args  [Function]

Convenient addition of arbitrary text directly the the score. Function transforms an arbitrary symbol, number or string or a list of symbols, numbers and strings into a an articulation symbol that is implicitly registered and can directly be added to an OMN note.

Definition currently only works with multiple integers or floats.

Examples:

    (text-attribute -7 2 13) 
     => -7+2+13 

    (text-attribute 3.14 42) 
     => 3.14+42 

BUGS:

All these examples are not working.

    (text-attribute "this is a test") 
     (text-attribute 42) 
     (text-attribute 'parameters -7 2 13) 
     (text-attribute -7 3.14 16 1/3) 

articulate-bars   sequence &key (accent 'ten) (default '-) (parameter :articulation) (section nil)  [Function]

Add articulations at the first notes of bars (sublists), e.g, a tenuto on every first beat, and staccato otherwise.

Arguments:

  • sequence (sequence of length values or full OMN expression, must be nested): an accent is positioned on every first note in a bar (sublist).

  • parameter (:articulation or :velocity): which parameter to use for the articulations

  • accent (symbol): articulation to use on first notes of bars.

  • default (symbol): articulation to use for all other notes.

  • section (list of ints): position of sublists to process.

NOTE: with some rhythms and OMN input there seems to be some problem (too many accents), but workaround seems to be to use only rhythmic sequence (fractions).

Examples:

    (articulate-bars '((h h) (q q q q) (q q q q) (-q q) (q q q q)) :accent 'marc) 

An example with a tie: existing articulations are preserved. However, in that case `sequence' must be a full OMN expression (i.e. include length and pitch values).

    (articulate-bars '((h c4 h) (q q q q tie) (q q q q) (-q q) (q q q q)) :accent 'marc) 

    (articulate-bars (gen-repeat 3 '((s s s))) :accent 'f :default 'p :parameter :velocity) 

omn-replace-articulation   new sequence  [Function]

Tmp fix for `omn-replace' for articulations, which takes ties into account. As a quick fix, this function does not support the params `section' and `exclude', but it works also for nested sequences.

NOTE: Function always returns a full OMN sequence, i.e., the default pitch c4 is added if no pitch is present in `sequence'.