Re: MIDI & repeats

2022-08-15 Thread Benjamin Tordoff
Just to close the loop on this, the snippet below seems to work and doesn't 
directly modify the midi limits 9which might be hard to set back). I suspect 
this can still be simplified by someone more knowledgable than me. Along the 
way I discovered two things:
Changing the midiMaximumVolume / midiMinimumVolume only takes effect when the 
next dynamic is hit (maybe answers the question in Lukas's suggested snippet?).
The documentation for controlling midi dynamics suggests the mapping of 
dynamics to midi volumes is in midi.scm, but that file doesn't really mention 
dynamics. Unless I've missed something it is actually defined in midi-init.ly 
 (lines 21-35). If the documentation really is wrong I'd 
be happy to try and contribute a fix for that link, but I would need someone to 
hold my hand through the process.
Thanks for all the help.

Ben

---
\version "2.23.10"

music = \fixed c' {
  f1
  \repeat volta 2 {

% Implement the ff - pp dynamic
<>_\markup{\dynamic ff - \dynamic pp}
  \once \hide DynamicText
  \tag MIDI \volta 1 <>-\ff
  \tag MIDI \volta 2 <>-\pp

g1
a1
  }
}

\score { 
\removeWithTag MIDI \music 
}
\score { 
\unfoldRepeats \music 
\midi {}
}
---


> On 3 Aug 2022, at 07:03, Benjamin Tordoff  wrote:
> 
> I’ll give that a go - thanks for both suggestions.
> 
> Ben
> 
>> 
>> On 2 Aug 2022, at 19:25, Lukas-Fabian Moser  wrote:
>> 
>> Hi Benjamin,
>> 
>>> Am 02.08.22 um 18:10 schrieb Benjamin Tordoff:
>>> Hi all, I’m wondering if there’s a smart way to make the midi output for a 
>>> particular part do the following two things (both common in Sousa marches):
>>> 
>>> 1. Have a part play only on 2nd time through the repeat.
>>> 2. Have different dynamic for 1st and 2nd times through repeat.
>>> 
>>> A minimal example of how I would typically typeset this is below but 
>>> produces midi output that plays all repeats with uniform volume. I've had a 
>>> good hunt around the internet for examples of doing this but either I'm 
>>> searching for the wrong things or this is a somewhat obscure request!
>>> 
>>> Thanks in advance.
>> 
>> Some of this can be achieved using the \volta command:
>> 
>> \version "2.23.7"
>> 
>> myScore =
>> \relative {
>>  <>^"2nd time left, 3rd time right!"
>>  \repeat volta 3
>>  {
>>\tag MIDI \volta 2 \set midiPanPosition = -1
>>% \tag MIDI \volta 2 \set midiMaximumVolume = 0 % does not do anything; 
>> why?
>>\tag MIDI \volta 3 \set midiPanPosition = 1
>>c'4 d \tag MIDI \volta 3 <>\pp e f
>>  }
>> }
>> 
>> \score {
>>  \removeWithTag MIDI \myScore
>> }
>> 
>> \score {
>>  \unfoldRepeats \myScore
>>  \midi {}
>>  \layout {} % for debugging only
>> }
>> 
>> Here I used a tag to keep the print version of the score clean from all the 
>> MIDI stuff.
>> 
>> I just do not know why the setting of midiMaximumVolume does not do anything 
>> if put inside a \volta construction. For the pan position, it works like a 
>> charm...
>> 
>> Lukas
>> 
> 



Re: MIDI & repeats

2022-08-02 Thread Benjamin Tordoff
I’ll give that a go - thanks for both suggestions.

Ben

> 
> On 2 Aug 2022, at 19:25, Lukas-Fabian Moser  wrote:
> 
> Hi Benjamin,
> 
>> Am 02.08.22 um 18:10 schrieb Benjamin Tordoff:
>> Hi all, I’m wondering if there’s a smart way to make the midi output for a 
>> particular part do the following two things (both common in Sousa marches):
>> 
>> 1. Have a part play only on 2nd time through the repeat.
>> 2. Have different dynamic for 1st and 2nd times through repeat.
>> 
>> A minimal example of how I would typically typeset this is below but 
>> produces midi output that plays all repeats with uniform volume. I've had a 
>> good hunt around the internet for examples of doing this but either I'm 
>> searching for the wrong things or this is a somewhat obscure request!
>> 
>> Thanks in advance.
> 
> Some of this can be achieved using the \volta command:
> 
> \version "2.23.7"
> 
> myScore =
> \relative {
>   <>^"2nd time left, 3rd time right!"
>   \repeat volta 3
>   {
> \tag MIDI \volta 2 \set midiPanPosition = -1
> % \tag MIDI \volta 2 \set midiMaximumVolume = 0 % does not do anything; 
> why?
> \tag MIDI \volta 3 \set midiPanPosition = 1
> c'4 d \tag MIDI \volta 3 <>\pp e f
>   }
> }
> 
> \score {
>   \removeWithTag MIDI \myScore
> }
> 
> \score {
>   \unfoldRepeats \myScore
>   \midi {}
>   \layout {} % for debugging only
> }
> 
> Here I used a tag to keep the print version of the score clean from all the 
> MIDI stuff.
> 
> I just do not know why the setting of midiMaximumVolume does not do anything 
> if put inside a \volta construction. For the pan position, it works like a 
> charm...
> 
> Lukas
> 



Re: MIDI & repeats

2022-08-02 Thread Lukas-Fabian Moser

Hi Benjamin,

Am 02.08.22 um 18:10 schrieb Benjamin Tordoff:

Hi all, I’m wondering if there’s a smart way to make the midi output for a 
particular part do the following two things (both common in Sousa marches):

1. Have a part play only on 2nd time through the repeat.
2. Have different dynamic for 1st and 2nd times through repeat.

A minimal example of how I would typically typeset this is below but produces 
midi output that plays all repeats with uniform volume. I've had a good hunt 
around the internet for examples of doing this but either I'm searching for the 
wrong things or this is a somewhat obscure request!

Thanks in advance.


Some of this can be achieved using the \volta command:

\version "2.23.7"

myScore =
\relative {
  <>^"2nd time left, 3rd time right!"
  \repeat volta 3
  {
    \tag MIDI \volta 2 \set midiPanPosition = -1
    % \tag MIDI \volta 2 \set midiMaximumVolume = 0 % does not do 
anything; why?

    \tag MIDI \volta 3 \set midiPanPosition = 1
    c'4 d \tag MIDI \volta 3 <>\pp e f
  }
}

\score {
  \removeWithTag MIDI \myScore
}

\score {
  \unfoldRepeats \myScore
  \midi {}
  \layout {} % for debugging only
}

Here I used a tag to keep the print version of the score clean from all 
the MIDI stuff.


I just do not know why the setting of midiMaximumVolume does not do 
anything if put inside a \volta construction. For the pan position, it 
works like a charm...


Lukas




Re: MIDI & repeats

2022-08-02 Thread Henning Hraban Ramm

Am 02.08.22 um 18:10 schrieb Benjamin Tordoff:

Hi all, I’m wondering if there’s a smart way to make the midi output for a 
particular part do the following two things (both common in Sousa marches):

1. Have a part play only on 2nd time through the repeat.
2. Have different dynamic for 1st and 2nd times through repeat.

A minimal example of how I would typically typeset this is below but produces 
midi output that plays all repeats with uniform volume. I've had a good hunt 
around the internet for examples of doing this but either I'm searching for the 
wrong things or this is a somewhat obscure request!


You already have different blocks for PDF and MIDI, that’s a start.

In such cases, I usually define more, smaller parts that I combine 
differently, like


first = { s1 | s1 | }
second = { c''1 | c''1 | }

notes = {
\repeat volta 2 { \second }
}

midis = {
\first \second
}

Also, use another variable for dynamics that you can combine like

<< \dynamics \notes >>

Hraban



Thanks in advance.

Ben


\version "2.23.10"

notes = {
   \repeat volta 2 {
 <>^\markup{(2nd time only)}
 c''1 | c''1 |
   }
   \repeat volta 2 {
 <>_\markup {\dynamic "pp" "(2nd time " \dynamic "ff" ")"}
 d''1 | d''1 |
   }
}

\score { % PDF output
   << \new Staff \notes >>
   \layout {}
}

\score { % MIDI output
   \unfoldRepeats << \new Staff \notes >>
   \midi {}
}







MIDI & repeats

2022-08-02 Thread Benjamin Tordoff
Hi all, I’m wondering if there’s a smart way to make the midi output for a 
particular part do the following two things (both common in Sousa marches):

1. Have a part play only on 2nd time through the repeat.
2. Have different dynamic for 1st and 2nd times through repeat.

A minimal example of how I would typically typeset this is below but produces 
midi output that plays all repeats with uniform volume. I've had a good hunt 
around the internet for examples of doing this but either I'm searching for the 
wrong things or this is a somewhat obscure request!

Thanks in advance.

Ben


\version "2.23.10"

notes = {
  \repeat volta 2 {
<>^\markup{(2nd time only)}
c''1 | c''1 |
  }
  \repeat volta 2 {
<>_\markup {\dynamic "pp" "(2nd time " \dynamic "ff" ")"}
d''1 | d''1 |
  }
}

\score { % PDF output
  << \new Staff \notes >>
  \layout {}
}

\score { % MIDI output
  \unfoldRepeats << \new Staff \notes >>
  \midi {}
}




Re: Midi repeats

2013-01-21 Thread Johan Vromans
"Peter Gentry"  writes:

> Where am I going wrong.

You apply \unfoldRepeats to the score, which is probably not what you
want. All repeats will be spelled out in the print.

It is better to assign your music to a variable

myMusic = {
  << 
  ...
  >>
}

and use two \score blocks:

\score {
  \myMusic
}
\score {
  \unfoldRepeats \myMusic
  \midi { }
}

Another thing to watch for: If one of the voices has \repeat's then they
show in all staves, so it may be possible that some of the included
files do not have actual \repeat's in them.

Hope this helps.

-- Johan

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


RE:No MIDI repeats

2013-01-21 Thread Peter Gentry
Blast. Ignore me the converted files haven't all been edited . You were 
correct... 



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


Re: Midi repeats

2013-01-21 Thread David Kastrup
"Peter Gentry"  writes:

> The individual music files all contain volta repeats and the score pdf
> is produced correctly but the MIDI output does not include repeats.

Maybe the individual music files (of which you show none) don't contain
volta repeats.  You can let bars look like a volta repeat, but unless
you actually write \repeat volta 2 ..., the music is not a volta repeat.

-- 
David Kastrup


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


Midi repeats

2013-01-21 Thread Peter Gentry
The individual music files all contain volta repeats and the score pdf is 
produced correctly but the MIDI output does not include
repeats.

Where am I going wrong.

\version "2.16.0"
\score {
\unfoldRepeats 
  << 
<<
  \new Staff = "Oboe"
  <<
\new Voice = "Flute"  {  
  \set Staff.midiInstrument = "flute"
   << \include "Cass_Cc_M5_L1.ly" >> }
  >>
  \new Staff = "Clarinet"
  <<
\new Voice = "Clarinet"  {  \transposition bes  
 \set Staff.midiInstrument = "clarinet"
  << \include "Cass_Bb_M5_L2.ly" >> }
  >>
  \new Staff = "French Horn"
  <<
\new Voice = "Clarinet"  { \transposition bes  
 \set Staff.midiInstrument = "clarinet" << \include "Cass_Bb_M5_L3.ly" 
>> }
  >>
  \new Staff = "Bassoon"
  <<
\new Voice = "Bass"  { \transposition bes,  
 \set Staff.midiInstrument = "clarinet" 
 << \include "Cass_BBb_M5_L4.ly" >> }
  >>
>>
  >>
 \midi { }
}


regards
Peter Gentry 



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