sc/music-xml [ Modules ]

[ Top ] [ Modules ]

music-xml/xml-get-mark [ Functions ]

[ Top ] [ music-xml ] [ Functions ]

DESCRIPTION

 xml-get-mark:
 Translation function for music-xml marks (dynamics, accents, etc.). Not
 generally called by the user but the list of symbols that can be used will
 be useful. If <silent> then non-existing marks will not produce
 warnings/errors (but we'll return nil). 
 default to the config setting
 (print silent)

SYNOPSIS

                  ;; if returns a string then xml-articulation will be called,
                  ;; otherwise (dir ...) (tech ...)
                  ;; also possible: (art "accent" "below") or a list of
                  ;; strings, in which case there'll be 2+ xml-articulation
                  (a "accent")       ; accent
                  (s "staccato")
                  (ss "staccatissimo") ; MDE Thu Dec 2 15:16:27 2021, Heidhausen
                  (as '("accent" "staccato"))
                  (at '("accent" "tenuto"))
                  (ts "detached-legato")
                  (te "tenuto")
                  ;; tech means xml-technical will be called; see bottom of
                  ;; this function
                  (lhp '(tech "stopped" a))
                  (bartok '(tech "snap-pizzicato" a))
                  ;; todo: could also add the <sound> tag here to change
                  ;; midi-programme (see MozartTrio.xml for e.g.)
                  ;; dir means xml-direction will be called
                  (pizz '(wds "pizz." a))
                  (ord '(wds "ord."))
                  (pizzp '(wds "(pizz.)"))
                  (clb '(wds "clb"))
                  (cl '(wds "cl"))
                  (col-legno '(wds "col legno"))
                  (clt '(wds "clt"))
                  (arco '(wds "arco"))
                  (batt '(wds "batt"))
                  (spe '(wds "spe"))
                  (sp '(wds "sul pont."))
                  (st '(wds "sul tasto"))
                  (mv '(wds "molto vib"))
                  (sv '(wds "senza vib"))
                  (poco-crini '(wds "poco crini"))
                  (nail '(tech "fingernails" a))
                  (stopped (no-xml-mark 'stopped))
                  ;; so unmeasured tremolo is implicit
                  (t3 '(orn "tremolo" nil 3))
                  (flag '(tech "harmonic" a))
                  ;; MDE Fri Dec  7 18:11:29 2018 -- dorico still doesn't handle
                  ;; the little circles to start/end a hairpin 
                  (niente '(wds "niente"))
                  (pppp  '(dyn "pppp"))
                  (ppp  '(dyn "ppp"))
                  (pp  '(dyn "pp"))
                  (p  '(dyn "p"))
                  (mp  '(dyn "mp"))
                  (mf  '(dyn "mf"))
                  (f  '(dyn "f"))
                  (ff  '(dyn "ff"))
                  (fff  '(dyn "fff"))
                  (ffff  '(dyn "ffff"))
                  ;; todo: find out how to put dynamics in parentheses; for now
                  ;; just put in the dynamic without
                  (pppp-p '(dyn "pppp"))
                  (ppp-p '(dyn "ppp"))
                  (pp-p '(dyn "pp"))
                  (p-p '(dyn "p"))
                  (mp-p '(dyn "mp"))
                  (mf-p '(dyn "mf"))
                  (f-p '(dyn "f"))
                  (ff-p '(dyn "ff"))
                  (fff-p '(dyn "fff"))
                  (ffff-p '(dyn "ffff"))
                  (sfz '(dyn "sfz"))
                  (downbow '(tech "down-bow" a))
                  (upbow '(tech "up-bow" a))
                  (open '(tech "fingering" a 0))
                  (I '(wds "I"))
                  (II '(wds "II"))
                  (III '(wds "III"))
                  (IV '(wds "IV"))
                  (V '(wds "V"))
                  (VI '(wds "VI"))
                  (VII '(wds "VII"))
                  (VIII '(wds "VIII"))
                  ;; guitar string numbers; todo: find a way of circling them
                  (c1 "1")
                  (c2 "2")
                  (c3 "3")
                  (c4 "4")
                  (c5 "5")
                  (c6 "6")
                  ;; music xml doesn't seem to have separate slur and phrase
                  ;; marks so we'll simply use the slur tag with number=1 for
                  ;; slurs and number=2 for phrases
                  (beg-sl '(not "slur" "number=\"1\" type=\"start\""))
                  (end-sl '(not "slur" "number=\"1\" type=\"stop\""))
                  (beg-phrase '(not "slur" "number=\"2\" type=\"start\""))
                  (end-phrase '(not "slur" "number=\"2\" type=\"stop\""))
                  (beg-gliss '(not "glissando" "number=\"1\" type=\"start\" line-type=\"solid\""))
                  (end-gliss '(not "glissando" "number=\"1\" type=\"stop\" line-type=\"solid\""))
                  (beg-8va '(dir "octave-shift"
                             ;; it really is down, probably because what's
                             ;; notated is an 8ve lower than sounding
                             "dash-length=\"7.5\" size=\"8\" space-length=\"7.5\" type=\"down\""))
                  (end-8va '(dir "octave-shift" "size=\"8\" type=\"stop\""))
                  (beg-8vb '(dir "octave-shift"
                             "dash-length=\"7.5\" size=\"-8\" space-length=\"7.5\" type=\"up\""))
                  (end-8vb '(dir "octave-shift" "size=\"-8\" type=\"stop\""))
                  (beg-15ma '(dir "octave-shift"
                              "dash-length=\"7.5\" size=\"15\" space-length=\"7.5\" type=\"down\""))
                  (end-15ma '(dir "octave-shift" "size=\"15\" type=\"stop\""))
                  (beg-15mb '(dir "octave-shift"
                              "dash-length=\"7.5\" size=\"-15\" space-length=\"7.5\" type=\"up\""))
                  (end-15mb '(dir "octave-shift" "size=\"-15\" type=\"stop\""))
                  ;; noteheads
                  (circled-x '(hd "circle-x"))
                  (x-head '(hd "x"))
                  (triangle '(hd "triangle"))
                  (triangle-up '(hd "inverted triangle"))
                  (airy-head (no-xml-mark 'airy-head))
                  (none '(hd "none"))
                  ;; the On and Off versions were for lilypond; here we only
                  ;; need the On version (or preferably, just improv but for
                  ;; compatibility...) 
                  (improvOn '(hd "slash"))
                  (improvOff nil)
                  (wedge '(hd "fa"))
                  (square '(hd "la"))
                  ;; todo: look at xml doc for harmonic and sort out a way of
                  ;; representing artificial harms in xml
                  (flag-head '(hd "diamond"))
                  (flag-dots-on (no-xml-mark 'flag-dots-on))
                  (flag-dots-off (no-xml-mark 'flag-dots-off))
                  (trill-f (no-xml-mark 'trill-f))
                  (trill-n (no-xml-mark 'trill-n))
                  (trill-s (no-xml-mark 'trill-s))
                  (beg-trill-a (xml-beg-trill stream))
                  (end-trill-a (xml-end-trill stream))
                  (slash (no-xml-mark 'slash))
                  (arp '(not "arpeggiate" "default-x=\"-12\"  number=\"1\""))
                  (arrow-up (no-xml-mark 'arrow-up))
                  (arrow-down (no-xml-mark 'arrow-down))
                  (cresc-beg '(dir "wedge" nil
                               "spread=\"0\" type=\"crescendo\"" b))
                  (cresc-end '(dir "wedge" nil
                               "spread=\"15\" type=\"stop\"" b))
                  (dim-beg '(dir "wedge" nil
                             "spread=\"15\" type=\"diminuendo\"" b))
                  (dim-end '(dir "wedge" nil
                             "spread=\"0\" type=\"stop\"" b))
                  (<< (no-xml-mark '<<))
                  (>> (no-xml-mark '>>))
                  ;; we could faff around with lexical variables and manipulate
                  ;; the niente property of "wedge" but as this would be
                  ;; post-gen anyway we can do it in the notation software
                  (hairpin0 (no-xml-mark 'hairpin0))
                  (pause (xml-pause stream))
                  ;; seems there is a fermata-shape element but damned if I can
                  ;; find out where it could go and be interpreted correctly.
                  ;; MDE Mon Mar 27 13:09:50 2017 -- see xml-pause above
                  (long-pause (xml-pause stream)); "lunga"))
                  (short-pause (xml-pause stream)); "breva"))
                  (aeolian-light (no-xml-mark 'aeolianLight))
                  (aeolian-dark (no-xml-mark 'aeolianDark))
                  ;; this one uses the graphic for close bracket
                  (bracket-end (no-xml-mark 'bracketEnd))
                  (mphonic (no-xml-mark 'mphonic))
                  (mphonic-arr (no-xml-mark 'mphoniArr))
                  (mphonic-cons (no-xml-mark 'mphonicCons))
                  (mphonic-diss (no-xml-mark 'mphonicDiss))
                  (mphonic-cluster (no-xml-mark 'mphonicCluster))
                  (sing (no-xml-mark 'sing))
                  (high-sine (no-xml-mark 'high-sine))
                  (noise (no-xml-mark 'noise))
                  (focus (no-xml-mark 'focus))
                  (balance (no-xml-mark 'balance))
                  (alternate (no-xml-mark 'alternate))
                  (sing-arr (no-xml-mark 'singArr))
                  (arrow-up-down (no-xml-mark 'arrowUpDown))
                  ;; no need to fiddle with these: can do in notation software,
                  ;; no? 
                  (start-arrow (no-xml-mark 'start-arrow))
                  (end-arrow (no-xml-mark 'end-arrow))
                  (harm '(tech "harmonic" a "<natural />"))
                  (sost '(wds "sost."))
                  (sost-up '(wds "sost.*"))
                  (sost^ (no-xml-mark 'sost^)) ;"\\sostenutoOff\\sostenutoOn ")
                  (ped '(dir "pedal" nil "line=\"yes\" type=\"start\""))
                  (ped^ '(dir "pedal" nil "line=\"yes\" type=\"change\""))
                  (ped-up '(dir "pedal" nil "line=\"yes\" type=\"stop\""))
                  (uc '(wds "una corda" nil b))
                  (tc '(wds "tre corde" nil b))

music-xml/xml-salzedo [ Functions ]

[ Top ] [ music-xml ] [ Functions ]

AUTHOR

 Ruben Philipp <me@rubenphilipp.com>

 CREATED
 2023-12-19

DESCRIPTION

 This function returns the MusicXML-markup for a harp salzedo pedalling
 indication from a given salzedo-list (cf. harp-salzedo-to-tl-set).
 
 N.B.: Though the MusicXML standard provides the facility to define
 harp pedal indications (via <harp-pedals>), most music notation programs,
 as of now (2023-12-19), do not support this specific element. Thus, the
 harp pedalling can be included via a <words>-tag. This can be achieved by
 setting the respective config variable accordingly via
 (set-sc-config 'xml-salzedo-as-text t).
  The pedal instruction is then given with the respective characters as
 defined in the SMuFL Harp techniques table
 (https://w3c.github.io/smufl/latest/tables/harp-techniques.html). 
 For correct representation, the font-family attribute is set to the
 music font. As some notation programs are not capable of dealing with
 generic font-families (e.g. "music"), a list of common music/engraving
 font-families is given as the standard value to the font-family argument.

 If (get-sc-config 'xml-salzedo-as-text) = NIL, the salzedo mark will be
 output according to the MusicXML-standard (via the <harp-pedals> element). 

ARGUMENTS

 - The output stream.
 - A salzedo list.

OPTIONAL ARGUMENTS

 keyword-arguments:
 - :as-text. When T, the pedal mark will be exported as a <words> text mark,
   instead of the MusicXML <harp-pedals> element (see above).
   Default = The value of (get-sc-config 'xml-salzedo-as-text).
 - :placement. The location of the text mark. Default = 'b.
 - :font-size. The font size. Default = 14.
 - :font-family. The font family used to display the mark. This should be
   SMuFL compatible. Default = The value of
   (get-sc-config 'xml-engraving-font).

RETURN VALUE

 The MusicXML-markup for the pedal indication written to the stream.

SYNOPSIS

(defun xml-salzedo (stream salzedo &key
                                     (as-text
                                      (get-sc-config 'xml-salzedo-as-text))
                                     (placement 'b)
                                     (font-size 14)
                                     (font-family
                                      (get-sc-config 'xml-engraving-font)))