Re: Function for turning music upside-down.

2023-03-28 Thread Jean Abou Samra
Le mardi 28 mars 2023 à 12:15 +0100, Mark Knoop a écrit :
> Actually it does, see \modalInversion

Thanks for correcting me! I didn't remember about it.


signature.asc
Description: This is a digitally signed message part


Re: Function for turning music upside-down.

2023-03-28 Thread Mark Knoop


At 13:10 on 28 Mar 2023, Jean Abou Samra wrote:
> Le mardi 28 mars 2023 à 09:30 +0200, Silvain Dupertuis a écrit :
>> How are enharmonic notes supposed to be treated in such a function?

> Inversion in, e.g., a Bach fugue subject is a bit different, as it
> inverts the diatonic steps but keeps the notes on the scale,
> effectively changing the heard intervals (e.g., in C major, if you
> invert D around C like this, you get B, not B♭); LilyPond doesn't
> implement this.

Actually it does, see \modalInversion

--
Mark Knoop



Re: Function for turning music upside-down.

2023-03-28 Thread Jean Abou Samra
Le mardi 28 mars 2023 à 09:30 +0200, Silvain Dupertuis a écrit :
> How are enharmonic notes supposed to be treated in such a function?

\version "2.24.1"

m = \relative c' { c cis des d dis ees e fes }
{ \m }
\inversion c' c' \m

gives



which looks fine to me. Essentially, both the diatonic step and the
heard pitch are inverted. This is similar to how transposition works.

Inversion in, e.g., a Bach fugue subject is a bit different, as it
inverts the diatonic steps but keeps the notes on the scale,
effectively changing the heard intervals (e.g., in C major, if you
invert D around C like this, you get B, not B♭); LilyPond doesn't
implement this.



signature.asc
Description: This is a digitally signed message part


Re: Function for turning music upside-down.

2023-03-28 Thread Silvain Dupertuis

How are enharmonic notes supposed to be treated in such a function?

Le 28.03.23 à 00:08, Paul Hodges a écrit :
I have been asked to take a piece of music (which I already have in LilyPond), and 
mirror it vertically.  That's to say, to take each note which is n semitones above 
middle c and replace it with the note n semitones below middle c, and vice versa.


Before I start trying to write a function to do this, I thought I'd ask if anyone has or 
is aware of a snippet which can already do this?


Thanks,
Paul



--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org 

Re: Function for turning music upside-down.

2023-03-27 Thread Jean Abou Samra
Le lundi 27 mars 2023 à 23:08 +0100, Paul Hodges a écrit :
> I have been asked to take a piece of music (which I already have in 
> LilyPond), and mirror it vertically.  That's to say, to take each note which 
> is n semitones above middle c and replace it with the note n semitones below 
> middle c, and vice versa.  
> Before I start trying to write a function to do this, I thought I'd ask if 
> anyone has or is aware of a snippet which can already do this?


See 
https://lilypond.org/doc/v2.24/Documentation/notation/changing-multiple-pitches#inversion


signature.asc
Description: This is a digitally signed message part


Function for turning music upside-down.

2023-03-27 Thread Paul Hodges
I have been asked to take a piece of music (which I already have in LilyPond), 
and mirror it vertically.  That's to say, to take each note which is n 
semitones above middle c and replace it with the note n semitones below middle 
c, and vice versa.


Before I start trying to write a function to do this, I thought I'd ask if 
anyone has or is aware of a snippet which can already do this?


Thanks,
Paul