The problem with substituting macro values is that the macro names must be surrounded by spaces.
Function opt2pair provides a workaround for some commands, where options can be specified as
NAME= VALUE (note the space), thus allowing for variable substitutions like
Trigger Beats = $Macro1 , $Macro2 ...What would break if we add the following functionality to macro.expand: Process the line once and replace all occurrences of
$NAME, where
NAME is a simple identifier
and exists as a defined macro
and evaluates to a simple string, by the corresponding value
without requiring
$[i]NAME[/i] to be surrounded by spaces.
My regtests over all examples and library files did not reveal a single change.
With the enhanced functionality it will be (finally!) possible to write
Set Strong 90
Set Normal 70
...
Begin Plectrum Define
G4E 1.0 0 6:$Strong 5-4:0; \
1.5 0 3-1:$Normal; \
2.0 0 4:$Normal; \
2.5 0 3-1:$Normal;
End
and (in .mmarc)
// Sound font.
Set SoundFont AirFont340
// MIDI player.
If EQ $SoundFont Default
SetMidiPlayer timidity -a -U
Else
SetMidiPlayer timidity -c ~/.timidity-$SoundFont.cfg -a -EFchorus=n -EFreverb=n
Endif