[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Denemo-devel] Operations on the selection
From: |
Richard Shann |
Subject: |
[Denemo-devel] Operations on the selection |
Date: |
Wed, 12 Nov 2008 11:22:52 +0000 |
I've refined the working of d-NextSelectedObject to step over the
appending position (and changed the semantics of d-GetType when in that
position). This means you can now iterate over objects in the selection.
As an example, here is a script that peppers a score with EighthRests,
putting one after every note/rest in the selection.
A fairly useless activity, but it outlines what can be done. Note that
it starts on the second note of the selection - an initialization would
be needed to avoid this.
Script follows
Richard
;;;;;;; script to pepper a score with rests...
(define isChord (lambda ()
(string=? (d-GetType) "CHORD")))
(define NextChordInSelection (lambda () (if (d-NextSelectedObject)
(if (isChord)
#t
(NextChordInSelection))
#f
)))
(define pepper (lambda ()
(if (NextChordInSelection)
(begin (d-InsertEighthRest)
(pepper))
)))
(d-GoToMark)
(pepper)
- [Denemo-devel] Operations on the selection,
Richard Shann <=