|
From: | Jean ABOU SAMRA |
Subject: | Re: Controlling midi dynamics |
Date: | Tue, 16 Jul 2019 15:11:50 +0200 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \version "2.19.83" midiMinimumVolume + (midiMaximumVolume - midiMinimumVolume) * fraction These are the volume coefficients ('fraction' above) applied to each dynamic. %} #(define (my-dynamic-absolute-volume-function dynamic-name) (assoc-get dynamic-name '( ; Adjust these values to get what you would like. ; You can add other dynamics. ; If an dynamic name is not found, the default dynamic values are used. ("ff" . 0.95) ("pp" . 0.3) ) (default-dynamic-absolute-volume dynamic-name))) %{ These are the default equalizations applied to each MIDI instrument. An equalization consists in (min . max) where min is the value to apply for midiMinimumVolume and max for midiMaximumVolume. Keep refering to the formula above! %} #(define (my-instrument-equalizer instrument-name) (assoc-get instrument-name '( ; Adjust these values to get what you would like. ; You can add other instrument names. ; If an instrument name is not found, the default equalizer is used. ("violin" . (0.1 . 0.4)) ("cello" . (0.5 1.0)) ) (default-instrument-equalizer instrument-name))) \midi { \context { \Score instrumentEqualizer = #my-instrument-equalizer dynamicAbsoluteVolumeFunction = #my-dynamic-absolute-volume-function } } violin = \new Voice \relative { c'4\pp d e f g\ff a b c } cello = \new Voice \relative { a,4\pp b c d e\ff f gis a } \score { << \new Staff \with { midiInstrument = "violin" } { \violin } \new Staff \with { midiInstrument = "cello" } { \cello } >> \midi { } } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% You can use an instrument equalizer and custom dynamic absolute volume values at the same time. Of course, instrument equalization can be achieved using \set Staff.midiMinimumVolume = min \set Staff.maximumVolume = max … but the power of an instrument equalizer is that you can put it in a separate file and \include it, as you say that you generally want to hear the cello louder and the violin less loud. By the way, I find that the example given on in selected snippets at "Replacing default MIDI instrument equalization" is overly complicated. Why define the alist empty to append to it later? And why not just use assoc-get? It could be easily improved. Best regards, Jean Abou Samra
|
[Prev in Thread] | Current Thread | [Next in Thread] |