[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing music objects into scheme functions
From: |
Charles Winston |
Subject: |
Re: Passing music objects into scheme functions |
Date: |
Mon, 14 Aug 2017 12:55:09 -0400 |
Here is the function inside chord-name.scm
;; chordmode-to-exceptions
(define-safe-public (chordmode-to-exceptions chord markup)
"Transform event-chord entered in chord mode to alist
entry in chordSemanticsNameExceptions list
"
(define (is-semantics-event? x)
(ly:in-event-class? x 'chord-semantics-event))
(define (get-semantics chord)
(let* ((elts (ly:music-property chord 'elements))
(semantics-event (filter is-semantics-event? elts))
(semantics-list (ly:event-property semantics-event
'chord-semantics)))
semantics-list))
(list (cons (get-semantics chord) markup)))
And here is my branch which has added chord semantics and new naming
capabilities based on these semantics:
https://github.com/charlesrwinston/lilypond_chords/tree/dev/crw_chordsemantics
> On Aug 14, 2017, at 12:46 PM, Charles Winston <address@hidden> wrote:
>
> Hi developers,
>
> I’m working on chord semantics and creating a new way to input chord name
> exceptions. I want the chord exceptions to be an alist whose keys are the
> chord's semantics list and values are the exception markups. I wrote a
> function that takes an event chord and a markup as parameters and returns an
> alist pair with the correct key and value. I’m trying to test my function,
> and I have this:
>
> chordVar = \chordmode { c1:m7 }
>
> markupVar = \markup { “min7” }
>
> #(chordmode-to-exceptions chordVar markupVar)
>
>
> On the last line I get the following error:
>
> Wrong type argument in position 1 (expecting Prob): ()
>
>
> When i do #(display chordVar) and #(display markupVar) their structures print
> what I expect. Could someone help me understand why this error could be
> happening?
>
> Thanks,
> Charles
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel
- Passing music objects into scheme functions, Charles Winston, 2017/08/14
- Re: Passing music objects into scheme functions,
Charles Winston <=
- Re: Passing music objects into scheme functions, David Kastrup, 2017/08/14
- Re: Passing music objects into scheme functions, Charles Winston, 2017/08/14
- Re: Passing music objects into scheme functions, David Kastrup, 2017/08/14
- Re: Passing music objects into scheme functions, David Kastrup, 2017/08/14
- Re: Passing music objects into scheme functions, Charles Winston, 2017/08/14
- Re: Passing music objects into scheme functions, David Kastrup, 2017/08/14