lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support for controlling MIDI expression (issue 114500045 by address@


From: ht . lilypond . development
Subject: Re: Support for controlling MIDI expression (issue 114500045 by address@hidden)
Date: Wed, 06 Aug 2014 09:18:36 +0000

Reviewers: J_lowe,

Message:
On 2014/08/05 09:12:06, J_lowe wrote:
This has now been approved, I assume you still have push access so if
so make
sure you push to HEAD:staging and not directly to master.

Having been just an occasional small contributor, I believe I've never
had
direct commit access to the code repository (nor have I ever felt that
I'd
really need or deserve it because of the same reason).  I've certainly
never set up a Savannah user account for making commits as described in
Section 3.4.10 of the Contributor's guide.  However, I'll be happy to do
this
if it will make things easier in the future - should I thus go ahead
with
setting up a Savannah account at this point?

Also, as I indicated in the Tracker, does this require any additional
documentation in the Notation Reference (sections 3.5.x) and if so can
you make
a new tracker perhaps or send some suggestion to the bug list so it
gets picked
up for the future additions.

From reading Chapter 5 of the Contributor's guide I get the impression
that the
proper way to document this feature is to submit an LSR snippet since
any
real example of using the new feature will likely depend on a Scheme
helper
function such as the one shown in the Tracker issue.

Documentation about this feature would likely fall (at least from a
technical
point of view) under the list of context properties mentioned in issue
3601, so
it would be best to document this one along with those.


However: you mentioned in the Tracker comment that the MIDI section of
the
Notation Reference is going to be reorganized.  Does this reorganization
already include many extensions to the current documentation?  Should I
wait
for this reorganization to be completed before suggesting anything?

The reason why I'm asking is that I fear that any documentation about
the MIDI
context properties alone will easily be just too technical to be useful
without
adding more details also to the existing documentation about how
different
LilyPond concepts relate to MIDI: how MIDI channels work in LilyPond
(for
example, the existing documentation about MIDI channels doesn't mention
the
midiChannelMapping context property, which is however significant in
understanding the potential caveats in using the MIDI context properties
of
issue 3601 and this issue) and how LilyPond's handling of dynamics
relates to
the technical concepts of controlling volume in MIDI (especially with
the new
MIDI expression context property; see the tracker issue for some
technical
comments).  Therefore, instead of starting to suggest changes to current
documentation on MIDI, it would probably be better to wait until after
the
section has been reorganized (especially if this reorganization already
adds
new documentation).  Anyway, I'm ready to try adding some new
documentation about the context properties (which I'll likely send to
the bug
list instead of changing the Texinfo sources myself, however).


Description:
Support for controlling MIDI expression

Please review this at https://codereview.appspot.com/114500045/

Affected files (+7, -1 lines):
  M lily/audio-item.cc
  M lily/include/audio-item.hh
  M lily/midi-control-function-performer.cc
  M lily/midi-item.cc
  M scm/define-context-properties.scm


Index: lily/audio-item.cc
diff --git a/lily/audio-item.cc b/lily/audio-item.cc
index 8204d45d1cb85ed498d0d78feefbb867999832c7..4d63ff8d23b4e646df87ad8638f91c097eb49af6 100644
--- a/lily/audio-item.cc
+++ b/lily/audio-item.cc
@@ -217,6 +217,7 @@ Audio_control_function_value_change::context_properties_[] = { // property name, enum constant, lower bound for range, upper bound for range
   { "midiBalance",     BALANCE,      -1.0, 1.0 },
   { "midiPanPosition", PAN_POSITION, -1.0, 1.0 },
+  { "midiExpression",  EXPRESSION,    0.0, 1.0 },
   { "midiReverbLevel", REVERB_LEVEL,  0.0, 1.0 },
   { "midiChorusLevel", CHORUS_LEVEL,  0.0, 1.0 },
   // extra element to signify the end of the mapping, must be kept last
Index: lily/include/audio-item.hh
diff --git a/lily/include/audio-item.hh b/lily/include/audio-item.hh
index b70474385329c45437ffaf707abf9db223cedc10..bd996a582c1a273ee54e9988c57a7e1538202b0c 100644
--- a/lily/include/audio-item.hh
+++ b/lily/include/audio-item.hh
@@ -144,7 +144,7 @@ public:
   // Supported control functions.
   enum Control
   {
-    BALANCE = 0, PAN_POSITION, REVERB_LEVEL, CHORUS_LEVEL,
+    BALANCE = 0, PAN_POSITION, EXPRESSION, REVERB_LEVEL, CHORUS_LEVEL,
// pseudo value for representing the size of the enum; must be kept last
     NUM_CONTROLS
   };
Index: lily/midi-control-function-performer.cc
diff --git a/lily/midi-control-function-performer.cc b/lily/midi-control-function-performer.cc index 36f21637763e5bf94686a6abcdc1c52157831156..29a8fd2790eb222a318ce49d8ee103ecfcd9a900 100644
--- a/lily/midi-control-function-performer.cc
+++ b/lily/midi-control-function-performer.cc
@@ -125,6 +125,7 @@ ADD_TRANSLATOR (Midi_control_function_performer,
                 /* read */
                 "midiBalance "
                 "midiPanPosition "
+                "midiExpression "
                 "midiReverbLevel "
                 "midiChorusLevel ",

Index: lily/midi-item.cc
diff --git a/lily/midi-item.cc b/lily/midi-item.cc
index 4909217c4319c108cca8aba6b22ea9533e5c9b37..514436c79c6a2763533713850a2e91d2ac219516 100644
--- a/lily/midi-item.cc
+++ b/lily/midi-item.cc
@@ -393,6 +393,7 @@ Midi_control_function_value_change::to_string () const

       {  8, 40 }, // balance
       { 10, 42 }, // pan position
+      { 11, 43 }, // expression
       { 91, -1 }, // reverb level (only coarse resolution available)
       { 93, -1 }  // chorus level (only coarse resolution available)
     };
Index: scm/define-context-properties.scm
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index b88c8f59f891ce93809c67ba60e081b367afe1c9..5f92397dca3bbe9ad206af59cd302dd9aed82c71 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -458,6 +458,9 @@ associated with the current context. Ranges address@hidden@w{-1} address@hidden,
 where the address@hidden@w{-1} (@code{#LEFT}),@tie{}0 (@code{#CENTER})
 address@hidden (@code{#RIGHT}) correspond to hard left, center, and hard
 right, respectively.")
+     (midiExpression ,number? "Expression control for the MIDI
+channel associated with the current context.  Ranges from 0
address@hidden (0=off,@tie{}1=full effect).")
      (midiReverbLevel ,number? "Reverb effect level for the MIDI
 channel associated with the current context.  Ranges from 0
 address@hidden (0=off,@tie{}1=full effect).")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]