Re: : Re: transpose range

2017-06-30 Thread Gianmaria Lari
Dear Peter,

I only spent one hour on it and I have not been able to make it working as
I need. It is not clear to me the value I have to set to set the instrument
range  from c, to b,.

But I think that when I will have more time I should be able to modify your
code for that.

* * *

By the way this is a part of your code:

  ((equal? instrument "basso" )
   (if  (< pt -26)  (begin (set! o (+ o 1))) )
   (if  (< pt -24)  (begin (set! o (+ o 1))) )
   (if  (< pt -18)  (begin (set! o (+ o 1))) )

   (if  ( > pt 52/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 41/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 29/2)  (begin (set! o (- o 1))) )
   )

I'm not sure to understand how does it work but I wonder if wouldn't be
possible to check if the note is higher than the instrument upper bound and
if yes just set the note octave to the upper allow octave? And the opposite
in case the note is lower than the lower bound

Thank you Peter for you help.
Gianmaria
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: : Re: transpose range

2017-06-29 Thread David Kastrup
"Peter Gentry"  writes:

> Gianmaria 
>
>  
>
> I have modified the procedure to use pitch-tones to define the
> instrument range.  It makes little difference to the result.
>
>  
>
> I haven’t looked at the possibility of rebuilding the pitch just using
> pitch-tones (yet)

You would not want to do that since you only want to change the octave
without losing enharmonic information.  The calculation could likely be
simplified quite a bit.

-- 
David Kastrup

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


RE: : Re: transpose range

2017-06-29 Thread Peter Gentry
Gianmaria 

 

I have modified the procedure to use pitch-tones to define the instrument 
range.  It makes little difference to the result.

 

I haven’t looked at the possibility of rebuilding the pitch just using 
pitch-tones (yet)

 

Have you had any luck yet?

 

\version "2.19.15"
% -
% include function file instrument_ranges.ly
% usuage include --> \include "./ranges/instrument_ranges.ly"
% usuage call -->   \naturalizeInstrumentRange "instrument" music
% this function will confine all pitches to the individual instruments range
% Note the ranges refer to music transposed for each instrument not the true pitches.
% use % for comment outside scheme function -  use ; inside scheme functions
% -

#(define (naturalize-instrument-range p instrument )
  (let ((o (ly:pitch-octave p))
  (a (* 4 (ly:pitch-alteration p)))
;; alteration, a, in quarter tone steps, for historical reasons
  (n (ly:pitch-notename p))
  (pt (ly:pitch-tones p)))
(define np 0)
(define op (+ (* 14 o) (* n 2) (/ a 2)))


(cond

;; clarinet range e to f#'   (-4 to 29/2)

((equal? instrument "clarinet" )
   (if  (< pt -16)(begin (set! o (+ o 1))) )
   (if  (< pt -10)(begin (set! o (+ o 1))) )
   (if  (< pt -4) (begin (set! o (+ o 1))) )

   (if  ( > pt 52/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 41/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 29/2)  (begin (set! o (- o 1))) )
)
; bass clarinet range eb to f'  (-9/2 to 29/2)

   ((equal? instrument "bass clarinet eb" )
   (if  (< pt -33/2)  (begin (set! o (+ o 1))) )
   (if  (< pt -21/2)  (begin (set! o (+ o 1))) )
   (if  (< pt -9/2)  (begin (set! o (+ o 1))) )

   (if  ( > pt 52/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 41/2)  (begin (set! o (- o 1))) )
   (if  ( > pt 29/2)  (begin (set! o (- o 1))) )
 )
; bass clarinet range c to f'   (-6 to 29/2)

((equal? instrument "bass clarinet c" )
(if  (< pt -18)  (begin (set! o (+ o 1))) )
(if  (< pt -12)  (begin (set! o (+ o 1))) )
(if  (< pt -6)  (begin (set! o (+ o 1))) )

(if  ( > pt 52/2)  (begin (set! o (- o 1))) )
(if  ( > pt 41/2)  (begin (set! o (- o 1))) )
(if  ( > pt 29/2)  (begin (set! o (- o 1))) )
)
;; flute range c to c''  (0 to 18)

((equal? instrument "flute")
(if   (< pt -12)  (begin (set! o (+ o 1))) )
(if   (< pt -6)   (begin (set! o (+ o 1))) )
(if   (< pt 0)(begin (set! o (+ o 1))) )

(if  ( > pt 30)   (begin (set! o (- o 1))) )
(if  ( > pt 24)   (begin (set! o (- o 1))) )
(if  ( > pt 18)   (begin (set! o (- o 1))) )
)
;; alto range d to c''  (1 to 31/2)

 ((equal? instrument "alto")
(if  (< pt -11) (begin (set! o (+ o 1))) )
(if  (< pt -5)  (begin  (set! o (+ o 1))) )
(if  (< pt  1)  (begin  (set! o (+ o 1))) )

(if  ( > pt 55/2)  (begin (set! o (- o 1))) )
(if  ( > pt 43/2)  (begin (set! o (- o 1))) )
(if  ( > pt 31/2)  (begin (set! o (- o 1))) )
) )

(ly:make-pitch o n (/ a 4))

))

% -
% a variable for the notehaed color on pitch change
% -

my-color = #(x11-color 'red)

% -
% this function rebuilds the music object optionally changing pitch and notehead color
% -
#(define (instrumentrange music instrument )

; extract the various portions of the music object
(let ((es (ly:music-property music 'elements))
   (e   (ly:music-property music 'element))
   (p   (ly:music-property music 'pitch)))

; rebuild any 'elements unchanged
(if (pair? es)
   (ly:music-set-property! music 'elements
   (map (lambda (x) (instrumentrange x instrument)) es)))

; rebuild any 'element unchanged
 (if (ly:music? e) (ly:music-set-property! music 'element
(instrumentrange e instrument )))

;rebuild the pitch and if a changed pitch add the color tweak
(if (ly:pitch? p)
  (let ((new-pitch (naturalize-instrument-range p instrument)))
  (ly:music-set-property! music 'pitch new-pitch)
  (if (and (not (equal? p new-pitch)) (color? my-color))
  (ly:music-set-property! music 'tweaks
  (acons  'color my-color
   (acons 'style 'harmonic-mixed
 (ly:music-property music 'tweaks)))

 music))

naturalizeInstrumentRange =
#(define-music-function (parser location  instrument m )
  ( string? ly:music? )
  (instrumentrange m instrument ))

% -
% the Lily test file calling 

Re: : Re: transpose range

2017-06-27 Thread Anthony Youngman



On 26/06/17 22:56, Peter Gentry wrote:

dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox GNU LilyPond 2.19.59 
Processing `/usr/local/share/lilypond/2.19.59/ly/scheme-sandbox.ly'
Parsing...
guile> (apply - (map ly:pitch-tones (list #{ eis #} #{ fes #})))
1/2
guile>


--
David Kastrup

A semi tone difference is indeed noticeable but surely there is no semitone 
between e sharp and f flat?
It’s the same key on the piano! Where is the semitone?
Instead of enlightening me you simply reply with a superior and dismissive tone 
which is uncalled for.


Two little points.

Firstly, please DON'T reply beneath someone else's signature. Okay, 
you're probably using a broken email client (otherwise it wouldn't let 
you), but it makes things *really* confusing, especially if a non-broken 
client tries to "correct" things and makes it even worse, and


Secondly, if someone comes back at you like this, your immediate 
reaction should be "hang on, is this a corner case" - that's a 
programming term - it's a place where either reality or your assumptions 
change - and it's an *extremely* common cause of errors because all too 
often reality and assumptions don't change in exactly the same place! As 
indeed, is exactly what happened here.


I "often" play in six flats, and am interested in pentatonic (ie all 
black note) folk music, so it was instantly obvious to me what David was 
talking about, although if you're not into that you might not notice 
straight away. And why do people assume everyone plays the piano? My 
piano skills are Grade 0, despite me being a pretty decent amateur 
musician ...


Cheers,
Wol

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


Re: Transpose range Apology

2017-06-27 Thread David Kastrup
"Peter Gentry"  writes:

> Apologies you must think me some kind of retarded idiot.

It's not uncommon for my attempts at joking to bounce.

> I must learn to think a bit before mistyping rubbish but at 76 these
> niceties seem a lost cause.

I've given up much earlier than that.

-- 
David Kastrup

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


Re: Transpose range Apology

2017-06-27 Thread Peter Gentry
Apologies you must think me some kind of retarded idiot. I must learn to
think a bit before mistyping rubbish but at 76 these niceties seem a lost
cause.

 

Yes yes yes there is a problem with the tone tone semitone tone tone tone
semitone  notation and the octave note alteration calculation.

 

In my defence I hurriedly sent of a response to a question with some very
old code. At the time I did not solve the problem of computing a unique
number to represent the pitch.

 

The approximation in the code works because I was only interested in
modifying the octave component of the pitch.  The problem only has an impact
in the calculation of the range of an instrument and has never caused a
problem although I accept it could at the end points of each instrument
range.

 

So please don't be too hard on an old codger who just tried to help a fellow
dabbler out.

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


Re: : Re: transpose range

2017-06-26 Thread David Kastrup
"Peter Gentry"  writes:

> A semi tone difference is indeed noticeable but surely there is no
> semitone between e sharp and f flat?

There is.

> It’s the same key on the piano!

It isn't.

> Where is the semitone?

e sharp (a white key) is a semitone above f flat (another white key) and
your proposed procedure would have been oblivious of that.

That is different to the situation between f sharp and g flat (which
your proposed procedure is designed for) since there is an actual black
key between f and g.

> Instead of enlightening me you simply reply with a superior and
> dismissive tone which is uncalled for.

I let LilyPond _calculate_ that semitone of difference.  Apparently the
code example was too obtuse.  I would not have thought so since we were
talking about Scheme code in the first place, but then I am probably
more skilled talking with computers than humans.

-- 
David Kastrup

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


Re: : Re: transpose range

2017-06-26 Thread Gianmaria Lari
Thank you Peter and David for your help. I'll make some tests in the
followings hours.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: : Re: transpose range

2017-06-26 Thread Thomas Morley
2017-06-26 23:56 GMT+02:00 Peter Gentry <peter.gen...@sunscales.co.uk>:
>
>
> -Original Message-
> From: David Kastrup [mailto:d...@gnu.org]
> Sent: 26 June 2017 15:31
> To: Peter Gentry <peter.gen...@sunscales.co.uk>
> Cc: Lilypond <lilypond-user@gnu.org>
> Subject: Re: : Re: transpose range
>
> "Peter Gentry" <peter.gen...@sunscales.co.uk> writes:
>
>> From: David Kastrup [mailto:d...@gnu.org]
>>
>> "Peter Gentry" <peter.gen...@sunscales.co.uk> writes:
>>>
>>> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n
>>> 2) (/ a 2))) “op is a unique number representing the pitch of the
>>> note”
>>
>>> Uh, that's pretty bad since it sees eis as equal to fes.  Anything
>>> wrong with just using (ly:pitch-tones p) instead?
>>
>> a. I had not heard of ly:pitch-tones p) b. for most folks eis is the
>> same sound as fes. Neither my battered old ears or my tuner could
>> detect the difference.  
>
> Well, I am glad that you don't sing in my hearing range then and you should 
> throw away that tuner.
>
> A semitone difference is quite noticeable.
>
> dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox GNU LilyPond 
> 2.19.59 Processing `/usr/local/share/lilypond/2.19.59/ly/scheme-sandbox.ly'
> Parsing...
> guile> (apply - (map ly:pitch-tones (list #{ eis #} #{ fes #})))
> 1/2
> guile>
>
>
> --
> David Kastrup
>
> A semi tone difference is indeed noticeable but surely there is no semitone 
> between e sharp and f flat?

There is.

> It’s the same key on the piano!

Nope.

> Where is the semitone?

David gave you the proof ;)

> Instead of enlightening me you simply reply with a superior and dismissive 
> tone which is uncalled for.

e sharp and f are the same key, same for e and f flat, but not e sharp
and f flat.
You confused them. As far as I understand David made a joke to have
you rethink what you wrote ;)

Cheers,
  Harm

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


RE: : Re: transpose range

2017-06-26 Thread David Nalesnik
Hi,

On Jun 26, 2017 4:57 PM, "Peter Gentry" <peter.gen...@sunscales.co.uk>
wrote:



-Original Message-
From: David Kastrup [mailto:d...@gnu.org]
Sent: 26 June 2017 15:31
To: Peter Gentry <peter.gen...@sunscales.co.uk>
Cc: Lilypond <lilypond-user@gnu.org>
Subject: Re: : Re: transpose range

"Peter Gentry" <peter.gen...@sunscales.co.uk> writes:

> From: David Kastrup [mailto:d...@gnu.org]
>
> "Peter Gentry" <peter.gen...@sunscales.co.uk> writes:
>>
>> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n
>> 2) (/ a 2))) “op is a unique number representing the pitch of the
>> note”
>
>> Uh, that's pretty bad since it sees eis as equal to fes.  Anything
>> wrong with just using (ly:pitch-tones p) instead?
>
> a. I had not heard of ly:pitch-tones p) b. for most folks eis is the
> same sound as fes. Neither my battered old ears or my tuner could
> detect the difference.  

Well, I am glad that you don't sing in my hearing range then and you should
throw away that tuner.

A semitone difference is quite noticeable.

dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox GNU LilyPond
2.19.59 Processing `/usr/local/share/lilypond/2.19.59/ly/scheme-sandbox.ly'
Parsing...
guile> (apply - (map ly:pitch-tones (list #{ eis #} #{ fes #})))
1/2
guile>


--
David Kastrup

A semi tone difference is indeed noticeable but surely there is no semitone
between e sharp and f flat?
It’s the same key on the piano! Where is the semitone?


E sharp/F or F flat/E are the same key on the piano.  E sharp and F flat
are a semitone apart.

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


RE: : Re: transpose range

2017-06-26 Thread Peter Gentry


-Original Message-
From: David Kastrup [mailto:d...@gnu.org] 
Sent: 26 June 2017 15:31
To: Peter Gentry <peter.gen...@sunscales.co.uk>
Cc: Lilypond <lilypond-user@gnu.org>
Subject: Re: : Re: transpose range

"Peter Gentry" <peter.gen...@sunscales.co.uk> writes:

> From: David Kastrup [mailto:d...@gnu.org]
>
> "Peter Gentry" <peter.gen...@sunscales.co.uk> writes:
>>
>> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n
>> 2) (/ a 2))) “op is a unique number representing the pitch of the 
>> note”
>
>> Uh, that's pretty bad since it sees eis as equal to fes.  Anything 
>> wrong with just using (ly:pitch-tones p) instead?
>
> a. I had not heard of ly:pitch-tones p) b. for most folks eis is the 
> same sound as fes. Neither my battered old ears or my tuner could  
> detect the difference.  

Well, I am glad that you don't sing in my hearing range then and you should 
throw away that tuner.

A semitone difference is quite noticeable.

dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox GNU LilyPond 2.19.59 
Processing `/usr/local/share/lilypond/2.19.59/ly/scheme-sandbox.ly'
Parsing...
guile> (apply - (map ly:pitch-tones (list #{ eis #} #{ fes #})))
1/2
guile> 


--
David Kastrup

A semi tone difference is indeed noticeable but surely there is no semitone 
between e sharp and f flat?
It’s the same key on the piano! Where is the semitone? 
Instead of enlightening me you simply reply with a superior and dismissive tone 
which is uncalled for.



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


Re: : Re: transpose range

2017-06-26 Thread David Kastrup
"Peter Gentry"  writes:

> From: David Kastrup [mailto:d...@gnu.org] 
>
> "Peter Gentry"  writes:
>>
>> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n
>> 2) (/ a 2))) “op is a unique number representing the pitch of the
>> note”
>
>> Uh, that's pretty bad since it sees eis as equal to fes.  Anything
>> wrong with just using (ly:pitch-tones p) instead?
>
> a. I had not heard of ly:pitch-tones p)
> b. for most folks eis is the same sound as fes. Neither my battered old ears 
> or my tuner could  detect the difference.  

Well, I am glad that you don't sing in my hearing range then and you
should throw away that tuner.

A semitone difference is quite noticeable.

dak@lola:/usr/local/tmp/lilypond$ lilypond scheme-sandbox
GNU LilyPond 2.19.59
Processing `/usr/local/share/lilypond/2.19.59/ly/scheme-sandbox.ly'
Parsing...
guile> (apply - (map ly:pitch-tones (list #{ eis #} #{ fes #})))
1/2
guile> 


-- 
David Kastrup

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


RE: : Re: transpose range

2017-06-26 Thread Peter Gentry


-Original Message-
From: David Kastrup [mailto:d...@gnu.org] 
Sent: 26 June 2017 13:43
To: Peter Gentry <peter.gen...@sunscales.co.uk>
Cc: 'Gianmaria Lari' <gianmarial...@gmail.com>; Lilypond <lilypond-user@gnu.org>
Subject: Re: : Re: transpose range

"Peter Gentry" <peter.gen...@sunscales.co.uk> writes:

> You will need to modify the attach file (instrument_ranges.ly) since you are 
> only interested in one instrument. 
>
>  
>
> A numeric pitch can be constructed from three components of the 
> lilypond pitch p
>
>  
>
> 1.The octave o obtained from  (ly:pitch-octave p))  
> 2.The note n obtained from (ly:pitch-notename p))  
> 3.The semitone  a  obtained from the alteration  (* 4 
> (ly:pitch-alteration p))  note alteration is in quarter tone steps
>
>  
>
> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n 2) (/ a 
> 2)))  “op is a unique number representing the pitch of the note”

Uh, that's pretty bad since it sees eis as equal to fes.  Anything wrong with 
just using (ly:pitch-tones p) instead?

--
David Kastrup

a. I had not heard of ly:pitch-tones p)
b. for most folks eis is the same sound as fes. Neither my battered old ears or 
my tuner could  detect the difference.  




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


Re: : Re: transpose range

2017-06-26 Thread David Kastrup
"Peter Gentry"  writes:

> You will need to modify the attach file (instrument_ranges.ly) since you are 
> only interested in one instrument. 
>
>  
>
> A numeric pitch can be constructed from three components of the lilypond 
> pitch p
>
>  
>
> 1.The octave o obtained from  (ly:pitch-octave p))  
> 2.The note n obtained from (ly:pitch-notename p))  
> 3.The semitone  a  obtained from the alteration  (* 4 
> (ly:pitch-alteration p))  note alteration is in quarter tone steps
>
>  
>
> The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n 2) (/ a 
> 2)))  “op is a unique number representing the pitch of the note”

Uh, that's pretty bad since it sees eis as equal to fes.  Anything wrong
with just using (ly:pitch-tones p) instead?

-- 
David Kastrup

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


RE: : Re: transpose range

2017-06-26 Thread Peter Gentry
You will need to modify the attach file (instrument_ranges.ly) since you are 
only interested in one instrument. 

 

A numeric pitch can be constructed from three components of the lilypond pitch p

 

1.  The octave o obtained from  (ly:pitch-octave p))  
2.  The note n obtained from (ly:pitch-notename p))  
3.  The semitone  a  obtained from the alteration  (* 4 
(ly:pitch-alteration p))  note alteration is in quarter tone steps

 

The numeric pitch (op) is calculated by (define op (+ (* 14 o) (* n 2) (/ a 
2)))  “op is a unique number representing the pitch of the note”

 

The procedure contains the instrument ranges as numeric pitches derived as 
above. 

 

See ;; clarinet range e to f#'  -1 2 0  to 2 3 0  (-10 to 35)

 

The current pitch is compared with the ranges and the octave 
increased/decreased as needed to bring the pitch into the range.

 

The note head and colour is modified to make all the changes visible on the 
score.

 

You can prune the procedure or add your instrument.

 

To call the procedure  

 

At top of the music file 

 

  \include "./instrument_ranges.ly"  (assumes the file is in the includes 
folder specified in Frescobaldi properties)

 

In a score block

 

\score {

  {

\naturalizeInstrumentRange "flute" {

\include "Boufill_Op8No3_Cc_M2_L1.ly" } }  (or sequential music)

  }

} % end of score block 

 

I hope this helps.

 

From: Gianmaria Lari [mailto:gianmarial...@gmail.com] 
Sent: 25 June 2017 16:25
To: Peter Gentry <peter.gen...@sunscales.co.uk>
Cc: Lilypond <lilypond-user@gnu.org>
Subject: Re: : Re: transpose range

 

Yes, I'm very much interested. I will use it with left hand bass note for 
standard bass accordion notation; for that we use only one octave range so jump 
are normal.

 

Have a look to the attached file in case you want understand better

 

Thanks a lot, g.

 

 

 

On 25 June 2017 at 13:58, Peter Gentry <peter.gen...@sunscales.co.uk 
<mailto:peter.gen...@sunscales.co.uk> > wrote:

Yes there is a way but it has disadvantages. 

 

Often the result is awkward jumps. I indicate changed notes by note head style 
and colour so that it is easier to edit the results.

 

If you are still interested let me know and I will send you the scheme 
procedure and an example. I allow for different instruments having different 
ranges.

 

\version "2.19.15"
% -
% useage
% include this file --> \include "./instrument_ranges.ly"
% best to save the file in the same folder as any other includes
% call -->\naturalizeInstrumentRange "instrument" music
% this function will confine all pitches to the individual instruments range
% Note the ranges refer to music transposed for each instrument not the true pitches.
% use % for comment outside scheme function -  use ; inside scheme functions
% -

#(define (naturalize-instrument-range p instrument )
  (let ((o (ly:pitch-octave p))
  (a (* 4 (ly:pitch-alteration p)))
;; alteration, a, in quarter tone steps, for historical reasons
  (n (ly:pitch-notename p)))
(define np 0)
(define op (+ (* 14 o) (* n 2) (/ a 2)))



;; clarinet range e to f#'  -1 2 0  to 2 3 0  (-10 to 35)
(cond
   ((equal? instrument "clarinet" )
   (if  (< op -38)  (begin (set! o (+ o 1))) )
   (if  (< op -24)  (begin (set! o (+ o 1))) )
   (if  (< op -10)  (begin (set! o (+ o 1))) )
   (if  ( > op 62)  (begin (set! o (- o 1))) )
   (if  ( > op 48)  (begin (set! o (- o 1))) )
   (if  ( > op 35)  (begin (set! o (- o 1))) )
)
; bass clarinet range eb to f'  -1 2 -2  to 2 3 0 (-11 to 34)

   ((equal? instrument "bass clarinet eb" )
   (if  (< op -39)  (begin (set! o (+ o 1))) )
   (if  (< op -25)  (begin (set! o (+ o 1))) )
   (if  (< op -11)  (begin (set! o (+ o 1))) )
   (if  ( > op 62)  (begin (set! o (- o 1))) )
   (if  ( > op 48)  (begin (set! o (- o 1))) )
   (if  ( > op 34)  (begin (set! o (- o 1))) )
 )
; bass clarinet range c to f'  -1 0  0 to 2 3 0 (-14 to 34)

((equal? instrument "bass clarinet c" )
(if  (< op -42)  (begin (set! o (+ o 1))) )
(if  (< op -28)  (begin (set! o (+ o 1))) )
(if  (< op -14)  (begin (set! o (+ o 1))) )
(if  ( > op 62)  (begin (set! o (- o 1))) )
(if  ( > op 48)  (begin (set! o (- o 1))) )
(if  ( > op 34)  (begin (set! o (- o 1))) )
)
;; flute range c to c''  0 0 0   to 2 3 0  (0 to 41)

((equal? instrument "flute")
(if   (< op -28)  (begin (set! o (+ o 1))) )
(if   (< op -14)  (begin (set! o (+ o 1))) )
(if   (< op 0)(begin (set! o (+ o 1))) )
(if  ( > op 62)   (begin (set! o (- o 1))) )

: Re: transpose range

2017-06-25 Thread Peter Gentry
Yes there is a way but it has disadvantages. 

 

Often the result is awkward jumps. I indicate changed notes by note head
style and colour so that it is easier to edit the results.

 

If you are still interested let me know and I will send you the scheme
procedure and an example. I allow for different instruments having different
ranges.

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


Re: transpose range

2017-06-25 Thread Manuela Gößnitzer
You need to split the music expression, I cannot think of a different
solution because

\transpose c e, \music

would be too low.

2017-06-25 10:29 GMT+02:00 Gianmaria Lari :

> The result of a transpose operation sometimes generate notes that are too
> high (or too low) for my needs. In this case I would like to have these
> notes one octave lower (or higher).
>
> Is there any way to indicate a range where the notes should stay when
> applying a transpose function?
>
> Here it is an example code with the issue.
>
> \version "2.19.60"
> music = \fixed c' {c e g c}
>
> {\music}
> {\transpose c e \music} %b is too high
> {  e' gis' b e'} % this is ok
>
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user