Re: select a note in a chord

2019-02-02 Thread Valentin Villenave
On 2/2/19, David Kastrup wrote: > What you flatteringly call "my" thought would additionally maintain > "circular" order of the pitches, basically rotating pitches and then > octavating as needed to make sure that later pitches don't end up before > earlier pitches. Yep. That would be a great

Re: select a note in a chord

2019-02-02 Thread David Kastrup
Valentin Villenave writes: > On 1/29/19, Davide Bonetti wrote: >> Ok, now it works well! > > Greetings everybody, > > David K. raised an interesting question with regard to the > \invertChords function: > https://codereview.appspot.com/365840043/#msg18 > > Basically (IIUC), he’s thinking that >

Re: select a note in a chord

2019-02-02 Thread Valentin Villenave
On 1/29/19, Davide Bonetti wrote: > Ok, now it works well! Greetings everybody, David K. raised an interesting question with regard to the \invertChords function: https://codereview.appspot.com/365840043/#msg18 Basically (IIUC), he’s thinking that \invertChords 1 should ideally result in

Re: select a note in a chord

2019-01-29 Thread Davide Bonetti
Ok, now it works well! D. Il 28/01/2019 21:11, Valentin Villenave ha scritto: On 1/28/19, Davide Bonetti wrote: It reminds me something that happens when a variable in lilypond is called with $ instead of # , but in scheme I don't see this difference. Could it be something like that? Nope,

Re: select a note in a chord

2019-01-28 Thread Valentin Villenave
On 1/28/19, Davide Bonetti wrote: > It reminds me something that happens when a variable in lilypond is > called with $ instead of # , but in scheme I don't see this difference. > Could it be something like that? Nope, it turned out to be a lot more idiotic: I was modifying the 'octavation

Re: select a note in a chord

2019-01-28 Thread Davide Bonetti
Hi Valentin and everybody. So, now the chord name is preserved when \dropNote or \raiseNote is applied once, but not when is applied twice or more. It reminds me something that happens when a variable in lilypond is called with $ instead of # , but in scheme I don't see this difference.

Re: select a note in a chord

2019-01-23 Thread Valentin Villenave
On 1/19/19, Davide Bonetti wrote: > For the sake of the discussion, I copy there the code as it now is: Greetings Davide and everybody, although these chord-transform functions were only intended for written voicings (i.e. not ChordNames), David K. had a brilliant idea: by setting the

Re: select a note in a chord

2019-01-19 Thread Aaron Hill
On 2019-01-19 9:32 am, Davide Bonetti wrote: %% rise a note of a chord, in num position from below riseNote = If a little pedantry is permitted, the verb should be "raise" not "rise". The subtlety involves that we are *causing* a note to rise, therefore we are raising the note. Of course,

Re: select a note in a chord

2019-01-19 Thread Davide Bonetti
For the sake of the discussion, I copy there the code as it now is: (thanks to Valentin and David) D. %% #(define-public (move-chord-note n direction)    (_i "Transpose a note (numbered as @var{n}) by one octave in @var{direction}." )    (lambda (music) (let*

Re: select a note in a chord

2019-01-19 Thread Davide Bonetti
Il 19/01/2019 08:36, Valentin Villenave ha scritto: On 1/18/19, David Kastrup wrote: Music functions share the same namespace as all other Scheme functions and variables OK, perhaps a better name would be \dropNote then (much like \hideNotes etc.). Good choice. Anyway, I like these

Re: select a note in a chord

2019-01-18 Thread Valentin Villenave
On 1/18/19, David Kastrup wrote: > Music functions share the same namespace as all other Scheme functions > and variables OK, perhaps a better name would be \dropNote then (much like \hideNotes etc.). Anyway, I like these functions (thanks to both of you guys) and I wonder if they could be made

Re: select a note in a chord

2019-01-18 Thread David Kastrup
Davide Bonetti writes: > Great! > Everything very interesting. > In this case, drop is a lilypond music function, so I assume it will > not interfere with slri (but I don't know what slri is) (srfi srfi-1), not slri, sorry for messing this up. It is a standard module of Scheme for list

Re: select a note in a chord

2019-01-18 Thread Davide Bonetti
Great! Everything very interesting. In this case, drop is a lilypond music function, so I assume it will not interfere with slri (but I don't know what slri is) Cheers D. Il 18 gennaio 2019 01:21:31 CET, David Kastrup ha scritto: >David Kastrup writes: > >> Valentin Villenave writes: >>

Re: select a note in a chord

2019-01-17 Thread David Kastrup
David Kastrup writes: > Valentin Villenave writes: > >> On 1/18/19, David Kastrup wrote: >>> This is not really an issue for string-manipulation. >> >> Agreed. Nevertheless, I was pleasantly surprised to see that >> ly:parser-include-string could accept an incomplete expression. >>

Re: select a note in a chord

2019-01-17 Thread David Kastrup
Valentin Villenave writes: > On 1/18/19, David Kastrup wrote: >> This is not really an issue for string-manipulation. > > Agreed. Nevertheless, I was pleasantly surprised to see that > ly:parser-include-string could accept an incomplete expression. > (Previously, ly:parser-parse-string would

Re: select a note in a chord

2019-01-17 Thread Valentin Villenave
On 1/18/19, David Kastrup wrote: > This is not really an issue for string-manipulation. Agreed. Nevertheless, I was pleasantly surprised to see that ly:parser-include-string could accept an incomplete expression. (Previously, ly:parser-parse-string would have been much less flexible here.) >

Re: select a note in a chord

2019-01-17 Thread David Kastrup
Valentin Villenave writes: > On 1/17/19, Davide Bonetti wrote: >> I worked on your example, and here is the result. > > Nice! > >> I'm sure there is a better way to write the inversion function, but I >> haven't find a way to program the repetition of a function in scheme. > > This is certainly

Re: select a note in a chord

2019-01-17 Thread Valentin Villenave
On 1/17/19, Davide Bonetti wrote: > I worked on your example, and here is the result. Nice! > I'm sure there is a better way to write the inversion function, but I > haven't find a way to program the repetition of a function in scheme. This is certainly not the most elegant way, but it seems

Re: select a note in a chord

2019-01-17 Thread Davide Bonetti
I worked on your example, and here is the result. The "\drop n" function drop the nth note from above, an can be nested (to do drop 2 drop 4) The funcion "\rise n" function rise the nth note from below, an can be nested too The "\inversion n" function do the inversions of the chord. I'm

Re: select a note in a chord

2019-01-15 Thread David Kastrup
Valentin Villenave writes: > On 1/15/19, Davide Bonetti wrote: >> I modified >> (if (and (music-is-of-type? music 'event-chord) >> (> l n)) >> with >> (if (and (music-is-of-type? music 'event-chord) >> (>= l n)) > > Nice catch! I’ve updated the

Re: select a note in a chord

2019-01-15 Thread Valentin Villenave
On 1/15/19, Davide Bonetti wrote: > I modified > (if (and (music-is-of-type? music 'event-chord) > (> l n)) > with > (if (and (music-is-of-type? music 'event-chord) > (>= l n)) Nice catch! I’ve updated the snippet as well. Additionally, beware

Re: select a note in a chord

2019-01-15 Thread Davide Bonetti
Hello! Il 15/01/2019 11:46, Davide Bonetti ha scritto: But I noticed that it doesn't work on the lowest pitch of a chord (drop 4 on a four note chord, drop 3 on a three note chord) I modified    (if (and (music-is-of-type? music 'event-chord)     (> l n)) with    (if

Re: select a note in a chord

2019-01-15 Thread Davide Bonetti
Now it sorts the pitches too! It can be easily converted to transpose a pitch an octave up changing (ly:make-pitch -1 0) to (ly:make-pitch +1 0) But I noticed that it doesn't work on the lowest pitch of a chord (drop 4 on a four note chord, drop 3 on a three note chord) Cheers Davide Il

Re: select a note in a chord

2019-01-15 Thread Valentin Villenave
On 1/15/19, Valentin Villenave wrote: > (It would be possible to first re-order the notes > automatically and then apply the transformation, but I’m too lazy to > add it right now :-) OK, here’s an improved version: http://lsr.di.unimi.it/LSR/Item?id=1082 Cheers, V.

Re: select a note in a chord

2019-01-14 Thread Valentin Villenave
On 1/14/19, Davide Bonetti wrote: > I'm looking for a function to select a note in a chord. > This can be useful for automatic inversions, or to change the voicing > (like the drop 2 in a four note chord). Hello Davide, Here’s how I would do it (using list-ref and list-set!), but thi

Re: select a note in a chord

2019-01-14 Thread Malte Meyn
Am 14.01.19 um 09:54 schrieb Davide Bonetti: Hello everyone. I'm looking for a function to select a note in a chord. This can be useful for automatic inversions, or to change the voicing (like the drop 2 in a four note chord). Hi Davide, what exactly are you looking for? A music function

select a note in a chord

2019-01-14 Thread Davide Bonetti
Hello everyone. I'm looking for a function to select a note in a chord. This can be useful for automatic inversions, or to change the voicing (like the drop 2 in a four note chord). Cheers. Davide --- Questa e-mail è stata controllata per individuare virus con Avast antivirus. https