Re: Staff customization question.

2016-01-05 Thread Paul Morris
> On Jan 5, 2016, at 11:03 AM, Hwaen Ch'uqi  wrote:
> 
> Yes, I had seen this snippet before. It appears though that this
> function assumes a certain regularity - i.e., by semitones, whole
> tones, etc. In this case, the intervals between pitches are not
> uniform, varying from minor seconds to major thirds. Will this take a
> list of numbers to define each line and space? If so, can I simply
> plug in a series of numbers, or must they be surrounded by parentheses
> and a hash or something? I am quite nervous with Scheme!

For your use-case I would just use a lookup-table (alist) that maps semitones 
to staff positions, as shown in the snippet below.

HTH,
-Paul


\version "2.18"

#(define (my-procedure pitch)
   (let
;; get the semitone of the pitch
((semitone (ly:pitch-semitones pitch))
 ;; lookup-alist maps semitones to positions on the staff
 (lookup-alist
  '((0 . 0)
(2 . 3)
(4 . 6)
(5 . 9)
;; ...edit and add more here as needed
)))
;; for development / debugging to see what semitones you are working with
(display semitone)(newline)
;; lookup the position and return the position that goes with it
(assoc-ref lookup-alist semitone)))

\new Staff \with {
  staffLineLayoutFunction = #my-procedure
} {
  c'4 d' e' f’
}





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Staff customization question.

2016-01-05 Thread Hwaen Ch'uqi
On 1/5/16, Paul Morris  wrote:
>> On Jan 4, 2016, at 8:48 PM, Hwaen Ch'uqi  wrote:
>>
>> Is there a way to create a specific calibration of pitch
>> to line/space where the lowest and highest notes align with the lowest
>> and highest lines?
>
> Briefly, here’s a small hint: setting “staffLineLayoutFunction” in the Staff
> context to a custom scheme procedure is a way to do this.  Try searching the
> LSR for examples of how this is done.
>
> Cheers,
> -Paul
>
>

Yes, I had seen this snippet before. It appears though that this
function assumes a certain regularity - i.e., by semitones, whole
tones, etc. In this case, the intervals between pitches are not
uniform, varying from minor seconds to major thirds. Will this take a
list of numbers to define each line and space? If so, can I simply
plug in a series of numbers, or must they be surrounded by parentheses
and a hash or something? I am quite nervous with Scheme!

Thanks again.

Hwaen Ch'uqi

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Staff customization question.

2016-01-05 Thread Hwaen Ch'uqi
Greetings Paul,

This is EXACTLY what I was looking for: Thank you so much!

Hwaen Ch'uqi


On 1/5/16, Paul Morris  wrote:
>> On Jan 5, 2016, at 11:03 AM, Hwaen Ch'uqi  wrote:
>>
>> Yes, I had seen this snippet before. It appears though that this
>> function assumes a certain regularity - i.e., by semitones, whole
>> tones, etc. In this case, the intervals between pitches are not
>> uniform, varying from minor seconds to major thirds. Will this take a
>> list of numbers to define each line and space? If so, can I simply
>> plug in a series of numbers, or must they be surrounded by parentheses
>> and a hash or something? I am quite nervous with Scheme!
>
> For your use-case I would just use a lookup-table (alist) that maps
> semitones to staff positions, as shown in the snippet below.
>
> HTH,
> -Paul
>
>
> \version "2.18"
>
> #(define (my-procedure pitch)
>(let
> ;; get the semitone of the pitch
> ((semitone (ly:pitch-semitones pitch))
>  ;; lookup-alist maps semitones to positions on the staff
>  (lookup-alist
>   '((0 . 0)
> (2 . 3)
> (4 . 6)
> (5 . 9)
> ;; ...edit and add more here as needed
> )))
> ;; for development / debugging to see what semitones you are working
> with
> (display semitone)(newline)
> ;; lookup the position and return the position that goes with it
> (assoc-ref lookup-alist semitone)))
>
> \new Staff \with {
>   staffLineLayoutFunction = #my-procedure
> } {
>   c'4 d' e' f’
> }
>
>
>
>
>

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Staff customization question.

2016-01-04 Thread Hwaen Ch'uqi
Greetings All,

I am currently writing a piece involving the pat hwaing (circle drum).
It consists of 21 pitched drums. I have figured out how to create an
eleven-line staff;  the number of lines and spaces exactly corresponds
to my needs. Is there a way to create a specific calibration of pitch
to line/space where the lowest and highest notes align with the lowest
and highest lines? The intervals are not entirely uniform. The pitches
are as follows:

g2 b2 c3 e3 f3 g3 b3 c4 e4 f4 g4 a4 b4 c5 d5 e5 f5 g5 a5 b5 c6

Any help would be greatly appreciated!

Hwaen Ch'uqi

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Staff customization question.

2016-01-04 Thread Paul Morris
> On Jan 4, 2016, at 8:48 PM, Hwaen Ch'uqi  wrote:
> 
> Is there a way to create a specific calibration of pitch
> to line/space where the lowest and highest notes align with the lowest
> and highest lines? 

Briefly, here’s a small hint: setting “staffLineLayoutFunction” in the Staff 
context to a custom scheme procedure is a way to do this.  Try searching the 
LSR for examples of how this is done.

Cheers,
-Paul


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user