Re: Conditional code in the midi block

2024-05-20 Thread Carolyn Beeton
Thank you all for your suggestions. I finally have the flag working after years of just editing my master file when I wanted one track per voice! Thanks, Carolyn > On May 20, 2024, at 6:09 AM, Jean Abou Samra wrote: > >  >> nostaffmidi = >> #(define-scheme-function () () >> (if

Re: Conditional code in the midi block

2024-05-20 Thread David Kastrup
Jean Abou Samra writes: > Alternatively, you can do it more like you were envisioning, but for > technical reasons, you have to start the Scheme code with $ , not # , > and you also have to include an extra \midi { } around the \context > blocks (basically because \context outside \layout or

Re: Conditional code in the midi block

2024-05-20 Thread Thomas Morley
Am So., 19. Mai 2024 um 21:28 Uhr schrieb Carolyn Beeton : > > I would like to include some Staff and Voice context settings in the \midi > block only if a flag is set to ##t and I have not been able to figure out how > to do this. When I try to wrap the \context blocks in a code block with >

Re: Conditional code in the midi block

2024-05-20 Thread Jean Abou Samra
> nostaffmidi = > #(define-scheme-function () () >(if TrackPerVoice #{ \context { \Staff \remove "Staff_performer" } #})) Ah, that proves me wrong. I didn't recall the parser was smart enough for this. > Although, I don't understand why the contents of the scheme functions cannot > be

Re: Conditional code in the midi block

2024-05-20 Thread Jean Abou Samra
> I would like to include some Staff and Voice context settings in the > \midi block only if a flag is set to ##t and I have not been able to > figure out how to do this.  When I try to wrap the \context blocks > in a code block with #{…#} I get this error: > trackPerVoiceMWE.ly:31:16: error:

Re: Conditional code in the midi block

2024-05-20 Thread Timothy Lanfear
On 19/05/2024 20:27, Carolyn Beeton wrote: I would like to include some Staff and Voice context settings in the \midi block only if a flag is set to ##t and I have not been able to figure out how to do this. When I try to wrap the \context blocks in a code block with #{…#} I get this error:

Conditional code in the midi block

2024-05-19 Thread Carolyn Beeton
I would like to include some Staff and Voice context settings in the \midi block only if a flag is set to ##t and I have not been able to figure out how to do this. When I try to wrap the \context blocks in a code block with #{…#} I get this error: trackPerVoiceMWE.ly:31:16: error: syntax