lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : Extract notes from chords, with silence when there are none


From: Gilles Thibault
Subject: RE : Extract notes from chords, with silence when there are none
Date: Wed, 16 Sep 2015 23:07:51 +0200

 

 

Provenance : Courrier pour Windows 10

 

 



> That's right.  I just want any two notes that play simultaneously to be

> returned by separate index values into the extraction function, and any

> other index values to return something that will be silent (either a skip

> or a rest). 

 

I don't want this behaviour for my purpose but if you do want a rest for indexes out of range, you just have one line to change in the code.

 

First make sur you have the latest version of chord.ly at

http://gillesth.free.fr/Lilypond/chord/

 

Change the line 39

  ((null? res) (list-ref notes (1- len))) ; last note

 

by that

 

((null? res)

       (let ((note (list-ref notes (1- len)))) ; last note

            (make-music 'RestEvent

                                    'duration (ly:music-property note 'duration))))

 

You'll get the joined image

( to compare with snippet

http://lsr.di.unimi.it/LSR/Item?id=545)

 

 

 

 

 

 

Attachment: extract-with-rests.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]