(else
(list-ref scale
- (modulo
- (+ (index pitch scale)
- (- (index to-pitch scale)
- (index from-pitch scale)))
- (length scale)))))))
+ (modulo
+ (+ (index pitch scale)
+ (- (index to-pitch scale)
+ (index from-pitch scale)))
+ (length scale)))))))
(define (inverter-factory scale)
"Returns an inverter for the specified @var{scale}.
(else
(list-ref scale
- (modulo
- (+ (index to-pitch scale)
- (- (index around-pitch scale)
- (index pitch scale)))
- (length scale)))))))
+ (modulo
+ (+ (index to-pitch scale)
+ (- (index around-pitch scale)
+ (index pitch scale)))
+ (length scale)))))))
(define (replicate-modify lis n mod-proc)
"Apply @code{(mod-proc lis n)} to each element of a list and
LilyPond scheme pitches, e.g. @code{(ly:make-pitch 0 2 0)}
"
(let ((elements (ly:music-property music 'elements))
- (element (ly:music-property music 'element))
- (pitch (ly:music-property music 'pitch)))
+ (element (ly:music-property music 'element))
+ (pitch (ly:music-property music 'pitch)))
(cond
((ly:pitch? pitch)
(ly:music-set-property! music 'pitch (converter pitch)))
((pair? elements)
- (map (lambda (x) (change-pitches x converter)) elements))
+ (for-each (lambda (x) (change-pitches x converter)) elements))
((ly:music? element)
(change-pitches element converter)))))
"
(let ((elements (ly:music-property music 'elements))
- (element (ly:music-property music 'element))
- (pitch (ly:music-property music 'pitch)))
+ (element (ly:music-property music 'element))
+ (pitch (ly:music-property music 'pitch)))
(cond
((ly:pitch? pitch)
(lambda (lis n)
(map
(lambda (i)
- (ly:make-pitch
- (+ (- n 6) (ly:pitch-octave i))
- (ly:pitch-notename i)
- (ly:pitch-alteration i)))
+ (ly:make-pitch
+ (+ (- n 6) (ly:pitch-octave i))
+ (ly:pitch-notename i)
+ (ly:pitch-alteration i)))
lis)))
(let ((scale (make-scale music)))
(if (ly:dir? span-dir)
(ly:music-set-property! music 'span-direction (- span-dir)))
- (map retrograde-music reversed)
+ (for-each retrograde-music reversed)
music))
and transposes from @var{around} to @var{to}."
(let ((p (ly:music-property music 'pitch)))
(if (ly:pitch? p)
- (ly:music-set-property!
- music 'pitch
- (ly:pitch-transpose to (ly:pitch-diff around p))))
+ (ly:music-set-property!
+ music 'pitch
+ (ly:pitch-transpose to (ly:pitch-diff around p))))
music))
(define-public (music-invert around to music)
"Applies pitch-invert to all pitches in @var{music}."
- (music-map (lambda (x) (pitch-invert around to x)) music))
+ (music-map (lambda (x) (pitch-invert around to x)) music))