Re: how to automatically add ovtaves to some pitches

2020-11-28 Thread Stefan Thomas
Dear Mark,
thanks for Your tip. I have now a working solution.
But I would like to do it in another way, with
whenPitchAbove =
#(define-scheme-function
   (pitch proc)
   (ly:pitch? procedure?)
   (lambda (m)
 (let ((p (ly:music-property m 'pitch)))
   (if (and (ly:pitch? p) (ly:pitch? p1 p2)
(ly:pitch? ly:pitch>  #})))
  #{ \customOutOfRange $low-pitch $high-pitch #octaveBelow $music #}))


%% it works!

music = \relative c' {
  c4 d e f
  g a b c
  d e f g a b c2
}



music =  { \makeOctavesOutOfRange c' c'' \music  }
\new Staff \music
% END OF SNIPPET

Am Sa., 28. Nov. 2020 um 16:02 Uhr schrieb Mark Knoop :

> At 14:53 on 28 Nov 2020, Stefan Thomas wrote:
> > Dear community,
> > I wanted to add an octavation only to specific pitches. I hope that
> > the following snippet shows better what I want. Unfortunately it
> > doesn't work.
> >  SNIPPET
> > \version "2.20.0"
> >
> > % a pitch filter
> > whenPitchAbove =
> > #(define-scheme-function
> > (pitch proc)
> > (ly:pitch? procedure?)
> > (lambda (m)
> > (let ((p (ly:music-property m 'pitch)))
> > (if (and (ly:pitch? p) (ly:pitch > (proc m)
> > m
> > % add octave below
> > okT = #(define-music-function (x) (ly:music?)
> > #{
> > \context Voice <<$x \transpose c' c { $x } >>
> > #})
> >
> > global = {
> > \time 6/8  \clef "treble_8"  }
> > Music =  {
> > \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'
> > dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }
> >
> > MusicWithOnlySomeOctaves = {
> > \musicMap \whenPitchAbove c''  \okT \Music
> > }
> >  END OF THE SNIPPET %%
>
> Have a look at the \customOutOfRange function in this snippet
>
> http://lsr.di.unimi.it/LSR/Item?id=773
>
> >> At 10:51 on 28 Nov 2020, Stefan Thomas wrote:
> >>>* Dear community,*
> >>>* I would like to add automatically an octabe to certain pitches, e.g.*
> >>>* higher than d''.*
> >>>* I have in mind something like this:*
> >>>* %% SNIPPET*
> >>>* \version "2.18.2"*
> >>>* global = {*
> >>>* \time 6/8  \clef "treble_8"  }*
> >>>* okT = #(define-music-function (x) (ly:music?)*
> >>>*#{*
> >>>*  \context Voice <<$x \transpose c' c { $x } >>*
> >>>*#})*
> >>>* Music =  {*
> >>>* \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'*
> >>>* dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }*
> >>>* MusicWithOctaves = {*
> >>>* \global \okT dis'' fis' a' d'' fis' a'  \okT dis'' fis' \okT e'' f'*
> >>>* \okT dis'' fis' a' \okT d'' fis' a' \okT dis'' fis' \okT e'' f'*
> >>>* }*
> >>>* %% END SNIPPET*
> >>>* I thought it could be done with musicMap but I can't get it to work.*
> >>>* Has someone a hint for me?*
> >> http://lsr.di.unimi.it/LSR/Item?id=445
> --
> Mark Knoop
>


Re: how to automatically add ovtaves to some pitches

2020-11-28 Thread Mark Knoop
At 14:53 on 28 Nov 2020, Stefan Thomas wrote:
> Dear community,
> I wanted to add an octavation only to specific pitches. I hope that
> the following snippet shows better what I want. Unfortunately it
> doesn't work.
>  SNIPPET
> \version "2.20.0"
>
> % a pitch filter
> whenPitchAbove =
> #(define-scheme-function
> (pitch proc)
> (ly:pitch? procedure?)
> (lambda (m)
> (let ((p (ly:music-property m 'pitch)))
> (if (and (ly:pitch? p) (ly:pitch (proc m)
> m
> % add octave below
> okT = #(define-music-function (x) (ly:music?)
> #{
> \context Voice <<$x \transpose c' c { $x } >>
> #})
>
> global = {
> \time 6/8  \clef "treble_8"  }
> Music =  {
> \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'
> dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }
>
> MusicWithOnlySomeOctaves = {
> \musicMap \whenPitchAbove c''  \okT \Music
> }
>  END OF THE SNIPPET %%

Have a look at the \customOutOfRange function in this snippet

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

>> At 10:51 on 28 Nov 2020, Stefan Thomas wrote:
>>>* Dear community,*
>>>* I would like to add automatically an octabe to certain pitches, e.g.*
>>>* higher than d''.*
>>>* I have in mind something like this:*
>>>* %% SNIPPET*
>>>* \version "2.18.2"*
>>>* global = {*
>>>* \time 6/8  \clef "treble_8"  }*
>>>* okT = #(define-music-function (x) (ly:music?)*
>>>*#{*
>>>*  \context Voice <<$x \transpose c' c { $x } >>*
>>>*#})*
>>>* Music =  {*
>>>* \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'*
>>>* dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }*
>>>* MusicWithOctaves = {*
>>>* \global \okT dis'' fis' a' d'' fis' a'  \okT dis'' fis' \okT e'' f'*
>>>* \okT dis'' fis' a' \okT d'' fis' a' \okT dis'' fis' \okT e'' f'*
>>>* }*
>>>* %% END SNIPPET*
>>>* I thought it could be done with musicMap but I can't get it to work.*
>>>* Has someone a hint for me?*
>> http://lsr.di.unimi.it/LSR/Item?id=445
--
Mark Knoop



Re: how to automatically add ovtaves to some pitches

2020-11-28 Thread Stefan Thomas
Dear community,
I wanted to add an octavation only to specific pitches. I hope that the
following snippet shows better what I want. Unfortunately it doesn't work.
 SNIPPET
\version "2.20.0"

% a pitch filter
whenPitchAbove =
#(define-scheme-function
   (pitch proc)
   (ly:pitch? procedure?)
   (lambda (m)
 (let ((p (ly:music-property m 'pitch)))
   (if (and (ly:pitch? p) (ly:pitch>
   #})

global = {
\time 6/8  \clef "treble_8"  }
Music =  {
\global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'
dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }

MusicWithOnlySomeOctaves = {
 \musicMap \whenPitchAbove c''  \okT \Music
}
 END OF THE SNIPPET %%

> At 10:51 on 28 Nov 2020, Stefan Thomas wrote:
> >* Dear community,*
> >* I would like to add automatically an octabe to certain pitches, e.g.*
> >* higher than d''.*
> >* I have in mind something like this:*
> >* %% SNIPPET*
> >* \version "2.18.2"*
> >* global = {*
> >* \time 6/8  \clef "treble_8"  }*
> >* okT = #(define-music-function (x) (ly:music?)*
> >*#{*
> >*  \context Voice <<$x \transpose c' c { $x } >>*
> >*#})*
> >* Music =  {*
> >* \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'*
> >* dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }*
> >* MusicWithOctaves = {*
> >* \global \okT dis'' fis' a' d'' fis' a'  \okT dis'' fis' \okT e'' f'*
> >* \okT dis'' fis' a' \okT d'' fis' a' \okT dis'' fis' \okT e'' f'*
> >* }*
> >* %% END SNIPPET*
> >* I thought it could be done with musicMap but I can't get it to work.*
> >* Has someone a hint for me?*
> http://lsr.di.unimi.it/LSR/Item?id=445
>
>
> --
> Mark Knoop
>
>


Re: how to automatically add ovtaves to some pitches

2020-11-28 Thread Mark Knoop
At 10:51 on 28 Nov 2020, Stefan Thomas wrote:
> Dear community,
> I would like to add automatically an octabe to certain pitches, e.g.
> higher than d''.
> I have in mind something like this:
> %% SNIPPET
> \version "2.18.2"
> global = {
> \time 6/8  \clef "treble_8"  }
> okT = #(define-music-function (x) (ly:music?)
>#{
>  \context Voice <<$x \transpose c' c { $x } >>
>#})
> Music =  {
> \global dis'' fis' a' d'' fis' a' dis'' fis' e'' f'
> dis'' fis' a' d'' fis' a' dis'' fis' e'' f' }
> MusicWithOctaves = {
> \global \okT dis'' fis' a' d'' fis' a'  \okT dis'' fis' \okT e'' f'
> \okT dis'' fis' a' \okT d'' fis' a' \okT dis'' fis' \okT e'' f'
> }
> %% END SNIPPET
> I thought it could be done with musicMap but I can't get it to work.
> Has someone a hint for me?

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


--
Mark Knoop