Re: Pentatonic Diatonic Transposition?

2011-01-20 Thread Marc Hohl

Am 21.01.2011 03:05, schrieb Daniel:

Hello,


Hello Daniel,


I have recently discovered Lilypond, and wow. It is just great. I have been
looking for something like this for a long time.

:-)

I have a question on how to diatonically transpose a motive in a non-major or
minor scale in this case, a pentatonic.

For instance, suppose I have this pentatonic {a c d e g } and I have a phrase
that is {a c g e} and now I want that phrase to start on g so transposed
diatonically to the "mode" (its not really, but that is basically what I want)
of that a pentatonic it would be {g a e d}.

If I use regular "\transpose a g {MyPhrase}" it will come out {g bes f d} and
include notes that are not in my original a minor pentatonic.

Can I define my own modes? I know that \dorian, \ionian are in there somewhere,
can I make my own scale\modes somehow and just use those?


This issue came up in 2008 and John Mandereau wrote some functions
which IMHO do exactly what you need, please look at

http://lists.gnu.org/archive/html/lilypond-user/2008-12/msg00805.html

HTH,

Marc

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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread Daniel
Marc Hohl  hohlart.de> writes:

> 
> Am 21.01.2011 03:05, schrieb Daniel:
> > Hello,
> >
> This issue came up in 2008 and John Mandereau wrote some functions
> which IMHO do exactly what you need, please look at
> 
> http://lists.gnu.org/archive/html/lilypond-user/2008-12/msg00805.html
> 
> HTH,
> 
> Marc
> 

Unfortunately
>From his documentation below, This only works with 7 note scales and wont work
with Pentatonic scales. Also, even with a 7 note scaleI can't get this to
work as expected after trying several different things. The "mode transpose"
always seems to add sharps or flats even when the original snippet has none.

"All these functions except degree-transpose are currently limited to
scales and modes of length 7; using scales with different length
requires a pitch representation that separates notions of degree and
note name, that is, it requires scales definitions different from those
currently in ly/scale-definitions-init.ly and more complex functions for
converting between LilyPond pitch representation and "modal" pitch
representation."



Any other ideas?

Thanks for the info!

Daniel




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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread Marc Hohl

Am 21.01.2011 08:46, schrieb Basso Ridiculoso:

Hello Marc,

Danke für deine antwort zu meine frage! :)

Its funny you point out those functins, because I have been looking at 
that...but I have not been able to make it work. I hope you don't mind 
a direct reply to your email.
No problem, but since others may encounter the same problem, it is 
better to discuss it on the

list, so I redirect the reply to -user.


I don't believe I can define only a 5 note scale with his function, it 
will only do 7 notes?

Sorry, I overlooked the term "pentatonic" in your first mail.
I think that heptatonic scales are somewhat "hardcoded" in lilypond, but 
I am not sure about this.


And the only syntax example I have seen on using that is about 2 years 
old and it isn't obvious what I would transpose.


I have been working from this one..but no dice so far.
http://article.gmane.org/gmane.comp.gnu.lilypond.general/43719/match=john+mandereau+transpose

And here is where get lost

% mix between lydian and mixolydian
milydian = #`(
   (0 . 0)
   (1 . 0)
   (2 . 0)
   (3 . ,SHARP)
   (4 . 0)
   (5 . 0)
   (6 . ,FLAT))

melodie = \relative c' { \times 2/3 { cis8 d e } f2 }



\new Staff {
   \time 3/4
   \melodie
   \mode*Transpose*  g \milydian #-3 d' \lydian \melodie % IV ->  I
   \mode*Transpose*  g \milydian #3 e' \lydian \melodie % IV ->  VII


}

So I guess I would define
MyPentatonc = #`(
   (0 . 0)  % the root a
   (1 . ,SHARP) %to get c?
   (2 . 0)  %the note d
   (3 . 0) %the note e
   (5 . ,SHARP)) %the note g?



This is assuming that the (1.0) distance is a whole step?

No. IMHO the first number is the number of the note within the scale,
whereas the second number is 0 when the note is not altered, otherwise
you have to wite ,FLAT or ,SHARP, respectively.

I don't think that pentatonic scales are supported as-is, but I could be 
wrong.

Perhaps anyone more familiar with the internals can chime in?


So then, how do I say "diatonically transpose to 'mode' of g' within 
that scale? I dont get what he is doing with the \modetranspose and 
the \lydian etc. Do I have to define each mode of the pentatonic 
somewhere as well?


Thanks for answering so quick! Any help would be appreciate


Sorry for not being able to be more helpful...

Regards,
Marc

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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread Michael Ellis
On Fri, Jan 21, 2011 at 4:41 AM, Daniel  wrote:
> Any other ideas?
>

Hi Daniel,

Here's a partial, but very general solution that will modally
transpose within any scale (or any ordered set of pitches) of any
length using modulo arithmetic.  To make it usable in LilyPond, you'll
need to wrap it in one or music functions that can

1. Extract pitch names from  music as strings or, better yet as symbols.
2. Run the pitch names through a transposer created with the scheme
function below
3. Deal with octave issues so that your melodic outline is preserved.
This is probably the trickiest part.
4. Insert the modified pitches back into the music stream.

Cheers,
Mike

#(use-modules (srfi srfi-1))  %needed for list-index and list-ref

#(define (make-modal-transposer scale)
;; Returns a transposer  for the specified scale
;; Usage example:
;;Create a transposer for C major pentatonic
;;(define c-pent (make-modal-transposer '(c d e g a)))
;;
;;Apply to sequence of pitch names,
;;specifying the starting pitch of the desired mode as
;;the first argument to the transposer.
;;(c-pent  'd   '(c c e d a))==> '(d d g e c)

(define (index item lis)
(list-index (lambda (x) (equal? item x)) lis))

(lambda (mode-pitch pitch-sequence)
(if (not (member mode-pitch scale))
(error "Transposition target pitch not in scale!"))
(map
(lambda (p)
(if (not (member p scale))
(error "Sequence pitch not in scale!"))
(list-ref scale
(modulo (+ (index p scale) (index mode-pitch scale))
(length scale

pitch-sequence)))

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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread m...@apollinemike.com
Hey Daniel,

Check out http://wiki.lilynet.net/index.php/JM_diatonic-transpose.ly .

Cheers,
MS

On Jan 20, 2011, at 9:05 PM, Daniel wrote:

> Hello,
> 
> I have recently discovered Lilypond, and wow. It is just great. I have been
> looking for something like this for a long time.
> 
> I have a question on how to diatonically transpose a motive in a non-major or
> minor scale in this case, a pentatonic.
> 
> For instance, suppose I have this pentatonic {a c d e g } and I have a phrase
> that is {a c g e} and now I want that phrase to start on g so transposed
> diatonically to the "mode" (its not really, but that is basically what I want)
> of that a pentatonic it would be {g a e d}. 
> 
> If I use regular "\transpose a g {MyPhrase}" it will come out {g bes f d} and
> include notes that are not in my original a minor pentatonic.
> 
> Can I define my own modes? I know that \dorian, \ionian are in there 
> somewhere,
> can I make my own scale\modes somehow and just use those?
> 
> Thanks for any advice or snippets!
> 
> Daniel
> 
> 
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> http://lists.gnu.org/mailman/listinfo/lilypond-user

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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread Marc Hohl

Am 21.01.2011 05:26, schrieb m...@apollinemike.com:

Hey Daniel,

Check out http://wiki.lilynet.net/index.php/JM_diatonic-transpose.ly .
This is more or less the same info I emailed him - unfortunately, we 
both missed
the fact that he asked for _pentatonic_ transposition, which isn't 
supported by

the file mentioned above :-(

But it looks as if Michael Ellis has posted a working solution...

Regards,

Marc


Cheers,
MS

On Jan 20, 2011, at 9:05 PM, Daniel wrote:


Hello,

I have recently discovered Lilypond, and wow. It is just great. I 
have been

looking for something like this for a long time.

I have a question on how to diatonically transpose a motive in a 
non-major or

minor scale in this case, a pentatonic.

For instance, suppose I have this pentatonic {a c d e g } and I have 
a phrase

that is {a c g e} and now I want that phrase to start on g so transposed
diatonically to the "mode" (its not really, but that is basically 
what I want)

of that a pentatonic it would be {g a e d}.

If I use regular "\transpose a g {MyPhrase}" it will come out {g bes 
f d} and

include notes that are not in my original a minor pentatonic.

Can I define my own modes? I know that \dorian, \ionian are in there 
somewhere,

can I make my own scale\modes somehow and just use those?

Thanks for any advice or snippets!

Daniel


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



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



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


Re: Pentatonic Diatonic Transposition?

2011-01-21 Thread Daniel
Marc Hohl  hohlart.de> writes:

> 
> Am 21.01.2011 05:26, schrieb mike  apollinemike.com:
> > Hey Daniel,
> >
> > Check out http://wiki.lilynet.net/index.php/JM_diatonic-transpose.ly .
> This is more or less the same info I emailed him - unfortunately, we 
> both missed
> the fact that he asked for _pentatonic_ transposition, which isn't 
> supported by
> the file mentioned above 
> 


Its ok, I do appreciate the help and the quick responses no matter what.

I will take a look at that last suggestion and see if I can get it working.

I do have the notes as text already and I think I can make this work. Thanks so
much.

Lilypond is awesome!

Daniel


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


Re: Pentatonic Diatonic Transposition?

2011-01-23 Thread Patrick Schmidt

Hi Michael,

nice work! I just think that the name modal transposition is a little  
misleading in this case. At first I thought that I could change the  
mode of a tune with your function e.g. transpose music from c\major  
to c\minor or something like that.
I just had the idea that it might be useful to add some more scales  
to the standard LP mode names (\ionian, \dorian ...) such as e.g.  
\majorPenta, \minorPenta. Maybe there's a way to extend your code and/ 
or the function of the existing \transpose-command to also be able to  
do real modal transpositions such as e.g.



\transpose c\ionian c\locrian \mymusic %or
\transpose c\majorPenta c\minorPenta \mymusic % etc.
\transpose c a \pentatonicmusic %or


This way users wouldn't have to declare scales and when no modal  
change is intended  we could just use \transpose.


just my 2 cents...

Thanks,

patrick


Am 23.01.2011 um 00:45 schrieb Michael Ellis:

On Sat, Jan 22, 2011 at 12:09 AM, Daniel  
 wrote:

Lilypond is awesome!


I agree!  This topic was interest to me, so here's a cut at a working
solution based on my earlier post.  The attached file,
modaltranspose.ly defines a new music function, \modalTranspose that
works almost like the normal chromatic \transpose but takes one extra
argument: the scale to use for the transposition.   Here's the usage
example from the file

%% -- Demo --

%% Just to show it works with normally transposed music, too:-)
dPentScale =  \transpose c d { c'4 d' e' g' a'1 }
mymotive = \transpose c d { c'4 c' e' d' c'1}

%% And here's an octatonic example
cOctatonicScale = {c'4 d' ees' f' ges' aes' a' b'}
octamotive = {c'4 ees' ges' a' b' aes' f' d' }

\score {
 \new Staff {
\tempo "" 2=120
\mark "Pentatonic"
\dPentScale
\mymotive
\modalTranspose d' e' \dPentScale \mymotive
\mymotive
\break
\mark "Octatonic"
\cOctatonicScale
\octamotive
\modalTranspose c' a' \cOctatonicScale \octamotive
\octamotive
{ees'1} %% Can't stand not resolving :-)
 }

\layout {}
\midi {}
}

%% ---

Seems to work with arbitrary scales, but be aware that the code will
(intentionally) throw an error if any pitch in what you're transposing
is not in the scale.  I'm not sure what other result is reasonable for
arbitrary scales.

The code Probably has some other bugs, too :-)  I'm open to
suggestions for improvement before I submit it to LSR.


Cheers,
Mike___ 


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



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


Re: Pentatonic Diatonic Transposition?

2011-01-23 Thread Michael Ellis
On Sun, Jan 23, 2011 at 7:21 AM, Patrick Schmidt  wrote:
> Hi Michael,
>
> nice work! I just think that the name modal transposition is a little
> misleading in this case.

Thanks, Patrick! I agree that the name may be confusing.  I considered
calling it something like \scalarImitation, since that's also
musically correct description of what it does.

FWIW, if you wanted to recast a passage in C-major to c-minor
(aeolian) you could use it this way:

cAeolian = { a b c d e f g }
\transpose a c \modalTranspose c a \cAeolian \somemusic

provided, of course, that \somemusic contained only notes in the key of C.

I'm pressed for time today, but will try to give a more thoughtful
reply to the other points in your message this evening.  Perhaps some
others on the list will weigh in with more suggestions in the
meantime.


Cheers,
Mike

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


Re: Pentatonic Diatonic Transposition?

2011-01-23 Thread Tim McNamara

On Jan 23, 2011, at 6:21 AM, Patrick Schmidt wrote:

> nice work! I just think that the name modal transposition is a little 
> misleading in this case. At first I thought that I could change the mode of a 
> tune with your function e.g. transpose music from c\major to c\minor or 
> something like that.

That's not changing the mode of a song.  That's changing the key.  C major has 
no sharps or flats, C (natural) minor has three flats (C harmonic minor and C 
melodic minor are special cases in terms of notation).  

Modes are within a single key:  Ionian, Dorian, Phyrgian, Lydian, Mixolydian, 
Aeolian, Locrian starting on the 1st through the 7th scale steps with in the 
key, respectively.  

> I just had the idea that it might be useful to add some more scales to the 
> standard LP mode names (\ionian, \dorian ...) such as e.g. \majorPenta, 
> \minorPenta. Maybe there's a way to extend your code and/or the function of 
> the existing \transpose-command to also be able to do real modal 
> transpositions such as e.g.
> 
> 
> \transpose c\ionian c\locrian \mymusic %or
> \transpose c\majorPenta c\minorPenta \mymusic % etc.
> \transpose c a \pentatonicmusic %or
> 
> 
> This way users wouldn't have to declare scales and when no modal change is 
> intended  we could just use \transpose.

Changing from C Ionian to C Locrian is a key change, not a modal change.  C 
Locrian is the seventh mode of Db major.

C major pentatonic is a different key than C minor pentatonic, the latter 
having the same key signature as Eb.

Since "modal transposition" necessarily happens within a single key, I am not 
sure that "transposition" is the correct terminology (IMHO modes are largely a 
waste of time for performing musicians but that's a whole 'nother discussion 
that doesn't belong here).
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user