%{ A first attempt at notation input for Balinese gamelan. Note that this is just one of many possible mappings. Ideally we'd like to support them all with just one input i (ding) -- h o (dong) -- c e (deng) -- d u (dung) -- f a (dang) -- g %} % all complaints to % map gamelan names to "western" pitches pitchnamesGamelan = #`( (i . ,(ly:make-pitch -1 6 NATURAL)) (o . ,(ly:make-pitch 0 0 NATURAL)) (e . ,(ly:make-pitch 0 1 NATURAL)) (u . ,(ly:make-pitch 0 3 NATURAL)) (a . ,(ly:make-pitch 0 4 NATURAL))) #(ly:parser-set-note-names parser pitchnamesGamelan) % "reverse" mapping, to enable printing NoteNames % This trick thanks to Valentin Villenave: pitchnamesGamelanR = #`(("b" . "i") ("c" . "o") ("d" . "e") ("f" . "u") ("g" . "a")) gmlNoteNamesStencil = #(lambda (grob) (let* ((default-name (ly:grob-property grob 'text)) (new-name (assoc-get default-name pitchnamesGamelanR))) (ly:grob-set-property! grob 'text new-name) (ly:text-interface::print grob)))