Re: Function to select a subset of a pattern?

2024-10-24 Thread David Kastrup
stefano franchi writes: >> >> >> > Here is an example implementation. Negative numbers in the first >> > element count from the end of the list, negative numbers in the second >> > element indicate the elements to be removed from the right rather than >> > taken from the left (-1 removes none, -

Re: Function to select a subset of a pattern?

2024-10-24 Thread stefano franchi
> > > > Here is an example implementation. Negative numbers in the first > > element count from the end of the list, negative numbers in the second > > element indicate the elements to be removed from the right rather than > > taken from the left (-1 removes none, -2 removes 1, -3 removes 2: > > s

Re: Function to select a subset of a pattern?

2024-10-24 Thread Walt North
I like this. However I do have two questions. I notice this comment. /The music in question needs to actually be of a kind that has an/ /'elements field./ So that would explain why when I try a \relative scale it throws an error.  So \relative mode does not create an elements field? Also,

Re: Function to select a subset of a pattern?

2024-10-24 Thread David Kastrup
David Kastrup writes: > stefano franchi writes: > >> Is there a lilypond function that would allow me to extract a subset from a >> pattern? >> >> For instance, let's say I have a simple A - natural scale and I want to get >> the first five notes. Is there a function, call it \pick, that would a

Re: Function to select a subset of a pattern?

2024-10-24 Thread David Kastrup
stefano franchi writes: > Is there a lilypond function that would allow me to extract a subset from a > pattern? > > For instance, let's say I have a simple A - natural scale and I want to get > the first five notes. Is there a function, call it \pick, that would allow > me to do something like:

Function to select a subset of a pattern?

2024-10-24 Thread stefano franchi
Is there a lilypond function that would allow me to extract a subset from a pattern? For instance, let's say I have a simple A - natural scale and I want to get the first five notes. Is there a function, call it \pick, that would allow me to do something like: \scale = { a b c d e f g} \pick 0 4