Re: Map voices to channels in MIDI output

2011-03-20 Thread Jan Nieuwenhuizen
Keith OHara schreef op vr 18-03-2011 om 21:30 [-0700]:

 The code seems to work, but requires great effort to understand.

Good, yes alas.

 I was suggesting that, having decided what you want in the MIDI, you
 might simplify the design.

That would be nice and I'm sure that it can be simplified
quite a bit.

The thing is, we won't know until some time after 2.14 if the current
default (voice-track, instrument-channel) works well for everyone. 

The old 'staff default is fairly ok for listening, but messes up the
voices.  That's bad for anyone wanting to do some postprocesing with it.

The new 'voice flavour seems to be unfit for listening purposes, but
is by far the most convenient option for postprocessing.

Do you thing anything should go in the NEWS file?

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-18 Thread Keith OHara

On Wed, 16 Mar 2011 06:39:26 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:


Keith OHara schreef op di 15-03-2011 om 23:09 [-0700]:


I tried to summarize what the relevant classes do, and indicated the
desired extensions in [[ ]] below :



Not really:

* midiChannelMapping = #'instrument (default)
   midiInstrument - MIDI channel
voice - track

* midiChannelMapping = #'staff (old)
   Staff - MIDI channel - track
voices are merged and unrecoverable

* midiChannelMapping = #'voice (nice, but unsupported)

Staff+voice - channel
midi-port -Staff-Track
(staff 1, voice 1 -- channel 0
2 -- channel 1
   (staff 2, voice 1 -- channel 0,
etc.)


The code seems to work, but requires great effort to understand.

I was suggesting that, having decided what you want in the MIDI, you might 
simplify the design.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-16 Thread Keith OHara

On Tue, 15 Mar 2011 13:53:41 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:

To create a new track for each voice as we do now,
still seems a bit like a kludge to fix MIDI's brokenness.


It is, at least, the same kludge others (classicalmidiconnection.com) use when 
they have more than 16 simultaneous lines of music.  To have some sympathy for 
the brokenness, remember that MIDI is primarily a delivery protocol to playback 
hardware.


I tried to summarize what the relevant classes do, and indicated the desired 
extensions in [[ ]] below :

Objects of class Audio_staff correspond to MIDI tracks
Each Audio_Staff contains
   the list of audio_items that will go onto a midi_track

Objects of class Staff_performer correspond MIDI channels.
Each Staff_performer has
   a channel number,
   optionally a MidiInstrument, midiMinimumVolume, etc.,
   one [[or more]] objects of class Audio_Staff.
This class implements the LilyPond performer Staff_performer

Normally each Staff_performer gets a unique MIDI channel number,
[[ but if midiChannelMapping==#'instrument then Staff_performers with the same 
midiInstrument share a channel number.  Program-changes and midiVolume events 
from each Staff_performer will affect the shared MIDI channel.]]

Staff_performer is responsible for routing Audio_items to the appropriate 
Audio_staff.
Normally there is one Audio_staff per Staff_performer,
[[ but if midiTrackMapping==#'voice then each uniquely-named Voice has its own 
Audio_staff.]]

I still have the net change to midi output at 
http://codereview.appspot.com/4271043/ in case it is useful.
Should the Audio_staff be promoted to Track_performer, in Voice context by 
default, and collect its own Audio_items?
Do you still want all those maps ?


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-16 Thread Jan Nieuwenhuizen
Keith OHara schreef op di 15-03-2011 om 23:09 [-0700]:
 On Tue, 15 Mar 2011 13:53:41 -0700, Jan Nieuwenhuizen
 jann...@gnu.org wrote:

 It is, at least, the same kludge others (classicalmidiconnection.com)
 use when they have more than 16 simultaneous lines of music.  To have
 some sympathy for the brokenness, remember that MIDI is primarily a
 delivery protocol to playback hardware.

Sure.

 I tried to summarize what the relevant classes do, and indicated the
 desired extensions in [[ ]] below :

 Objects of class Staff_performer correspond MIDI channels.

Not really:

* midiChannelMapping = #'instrument (default)
  
midiInstrument - MIDI channel
voice - track

* midiChannelMapping = #'staff (old)
  
Staff - MIDI channel - track
voices are merged and unrecoverable

* midiChannelMapping = #'voice (nice, but unsupported)

Staff+voice - channel
midi-port -Staff-Track
(staff 1, voice 1 -- channel 0
2 -- channel 1
   (staff 2, voice 1 -- channel 0,
etc.)
 

 Each Staff_performer has
 a channel number,
 optionally a MidiInstrument, midiMinimumVolume, etc.,

not really, these can change

   one [[or more]] objects of class Audio_Staff.
 This class implements the LilyPond performer Staff_performer

yes

 Normally each Staff_performer gets a unique MIDI channel number,
 [[ but if midiChannelMapping==#'instrument then Staff_performers with
 the same midiInstrument share a channel number.  Program-changes and
 midiVolume events from each Staff_performer will affect the shared
 MIDI channel.]]

Yes, although normally is [[ ...]] is the default.

 Staff_performer is responsible for routing Audio_items to the
 appropriate Audio_staff.

Yes

 Normally there is one Audio_staff per Staff_performer,

   for 'staff and for 'voice, not for 'instrument

 [[ but if midiTrackMapping==#'voice then each uniquely-named Voice has
 its own Audio_staff.]]

no, that's for 'instrument

 I still have the net change to midi output at
 http://codereview.appspot.com/4271043/ in case it is useful.

Ok.

 Should the Audio_staff be promoted to Track_performer, in Voice
 context by default, and collect its own Audio_items?
 Do you still want all those maps ?

Not sure, if it works and is nicer, I'm all for it.  However, I
do want to keep these three output options for now.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-15 Thread Jan Nieuwenhuizen

 1) re-balancing the instruments (because the new implementation messed up the 
 equalizer)

Do you have a test file for that?  As far as I can see, the velocity
still comes through the equalizer.

 2) implementing (de)crescendi on held notes (which sometimes works 
 accidentally in 2.12, due I think to notes in other voices creating volume 
 changes on the held note)

Right.

  In fact, this should do it

 Segfaults during midi generation.

Do you have a .ly file?

Jan.
-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-15 Thread Jan Nieuwenhuizen
Keith OHara schreef op ma 14-03-2011 om 13:50 [-0700]:
 On Mon, 14 Mar 2011 02:14:14 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:

 Midi tracks (from a Staff with midiInstrument) sometimes contain a
 program change event, sometimes not, depending on the path taken
 through Staff_performer::acknowledge_audio_element() on the way to
 new_audio_staff().  Temporary voices create tracks without the program
 change.  If we use the new midiChannelMapping=#'voice, the notes in
 such voices sound as default piano.

A temporary voice, creating a new track, sounds as a piano?  The
original voice and new temporary voice are in different tracks,
but have the same channel number.

So, it /is/ possible after all to have two channels 0 that
sound as different instruments, in different tracks?  Is this
without even using ports?

That would be great!

 (Unfortunately for me, the player I formerly used, NotationPlayer,
 gets confused by Tracks with no program change containing notes
 directed to a Channel that had an earlier program change.)

What exactly do you mean by `confused'?

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-15 Thread Keith OHara

On Tue, 15 Mar 2011 01:50:32 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:

1) re-balancing the instruments

Do you have a test file for that?

We have input\regression\midi-volume-equaliser.ly; the equalizer is still 
effective, but the values will probably need re-balancing if you implemnt 
dynamics differently.


 In fact, this should do it
Segfaults during midi generation.

Do you have a .ly file?


Nevermind. I got confused somehow other bug; it looks like what I tested was
announce_element (Audio_element_info (audio_staff, 0));
+  if (!instrument_string_.empty ())
+set_instrument (channel_, voice);
staff_map_[voice] = audio_staff;
return audio_staff;
Sorry.
Using set_instrument() /after/ adding audio_staff to staff_map_[] does work.  
NotationPlayer is re-assured and plays the midi correctly.


If we use the new midiChannelMapping=#'voice, the notes in
such voices sound as default piano.


A temporary voice, creating a new track, sounds as a piano?  The
original voice and new temporary voice are in different tracks,
but have the same channel number.


No no.  If we let the temporary Voice use the channel of its Staff then midi 
players give it the sound already set on that channel (unless the player is 
'confused').  If we map new Voices to new channels, midi players sound the new 
channel as piano, and in the current design there is not yet any means to 
change the instrument, so there seems no point in having 
midiChannelMapping=#'voice.


What exactly do you mean by `confused'?


My 'confused' midi-player would revert the channel Piano sound if a temporary 
Voice created a new track sharing the channel with existing Voices.  This 
player would sound all Voices on that channel as Piano.  Your suggestion to put 
program changes on these new tracks removes the 'confusion'.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-15 Thread Jan Nieuwenhuizen
Keith OHara schreef op di 15-03-2011 om 13:24 [-0700]:
 On Tue, 15 Mar 2011 01:50:32 -0700, Jan Nieuwenhuizen jann...@gnu.org 
 wrote:

 We have input\regression\midi-volume-equaliser.ly; the equalizer is
 still effective, but the values will probably need re-balancing if you
 implemnt dynamics differently.

Ah, okay.

 Using set_instrument() /after/ adding audio_staff to staff_map_[] does
 work.  NotationPlayer is re-assured and plays the midi correctly.

Good, pushed.

 No no.  If we let the temporary Voice use the channel of its Staff
 then midi players give it the sound already set on that channel
 (unless the player is 'confused').  If we map new Voices to new
 channels, midi players sound the new channel as piano, and in the
 current design there is not yet any means to change the instrument, so
 there seems no point in having midiChannelMapping=#'voice.

Well, other than that it's the easiest for midi2ly to recreate
the ly, and using ports looks like a thing that could be easily
supported in midi players like timidity.  To create a new track
for each voice as we do now, still seems a bit like a kludge
to fix MIDI's brokenness.

  What exactly do you mean by `confused'?
 
 My 'confused' midi-player would revert the channel Piano sound if a
 temporary Voice created a new track sharing the channel with existing
 Voices.  This player would sound all Voices on that channel as Piano.
 Your suggestion to put program changes on these new tracks removes the
 'confusion'

Ah, okay.  Too bad.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Keith OHara schreef op zo 13-03-2011 om 17:05 [-0700]:

 Sensible, but this leaves a partially-finished major change in the
 branch that Graham just tagged as 2.14 release candidate.

What's partial about the change?  Also, the old behaviour
should be mostly reproducible by setting midiChannelMapping?

 Do you want the new MIDI output in 2.14

Yes.

Jan

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Keith OHara schreef op zo 13-03-2011 om 21:55 [-0700]:

 I don't know of any yet, and I will not be looking for any.
 The changes within the past week were significant enough that I expect
 complaints from people who use MIDI.

That would be nice!  Esp. if they send patches.  MIDI support in
LilyPond is flaky and stale.  Looking at the state of midi2ly and
the silly small bugs that I fixed the past month, I can hardly
imagine that people used it much since 1998.

 Right.  Mostly I just want to be sure Jan knows you've branched for a
 potential stable release, in case he needs to pull back any
 half-implemented changes.

I apologise for landing this big change without proper review in
master.  Excuse: midi2ly was in a terrible state, I need a test
suite and lilypond's MIDI-output needed to be fixed to enable that.

Also, comments and remarks in the code along with my understanding
of MIDI, let me to believe that voice-channel mapping was the
right thing to do and that the old solution of having channel# ==
track# was an ugly and strange hack.  I never understood (nor anyone
working on the MIDI code until now), that channels in different tracks
are linked.

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Keith OHara schreef op zo 13-03-2011 om 00:19 [-0800]:

 The MIDI port assignments are still being written to the output file;
 I don't know if that is intended.

Fix pushed.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Reinhold Kainhofer
Am Montag, 14. März 2011, um 10:21:53 schrieb Jan Nieuwenhuizen:
 Keith OHara schreef op zo 13-03-2011 om 21:55 [-0700]:
  I don't know of any yet, and I will not be looking for any.
  The changes within the past week were significant enough that I expect
  complaints from people who use MIDI.
 
 That would be nice!

There are some problems with the new method:

-) All staves with \partcombine now use four (!) different midi tracks: shared, 
one, two and solo (because partcombine internally uses four voices)

-) The order of the tracks in the midi file is wrong: I would expect all the 
voices from the same staff to be grouped together, and everything to be inthe 
same order as in the PDF. However, now all lyrics (BTW, why do lyrics get a 
separate track at all, shouldn't they be in the same track as the music events 
they belong to?) are placed at the very bottom, and all tracks generated by 
partcombine are then placed after all the lyrics

Cheers,
Reinhold
-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Reinhold Kainhofer schreef op ma 14-03-2011 om 10:49 [+0100]:

Hi Reinold,

 There are some problems with the new method:
 
 -) All staves with \partcombine now use four (!) different midi tracks: 
 shared, 
 one, two and solo (because partcombine internally uses four voices)

Yes, is that a problem?  Won't this allow midi2ly to nicely recreate the
original, instead of from the previous merged output?

Does midiChannelMapping == #'staff still produce the old output?

 -) The order of the tracks in the midi file is wrong: I would expect all the 
 voices from the same staff to be grouped together, and everything to be inthe 
 same order as in the PDF.

Isn't that the case?  That would be weird, audio_staffs should be
created as they appear and still in the same order as before.

 However, now all lyrics (BTW, why do lyrics get a 
 separate track at all, shouldn't they be in the same track as the music 
 events 
 they belong to?)

Good question.  I think it would be nice if lyrics would be added to the
track of their lyricsto-voice.

 are placed at the very bottom, and all tracks generated by 
 partcombine are then placed after all the lyrics

Weird.  I would very much appreciate small test cases that I can add
to the midi test suite!

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Keith OHara

On Mon, 14 Mar 2011 02:14:14 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:


Keith OHara schreef op zo 13-03-2011 om 17:05 [-0700]:


Sensible, but this leaves a partially-finished major change in the
branch that Graham just tagged as 2.14 release candidate.


What's partial about the change?



Nothing critical.


Dynamics are newly implemented as note-on-velocity,
but the old implementation as channel-volume is still there, causing 
instruments of the same type to partially influence each others' loudness.

Voices potentially get their own Channel, or even their own Port, thus 
conceptually have their own midiInstrument, etc., but these remain properties 
of Staff.  Fortunately, we can still move Staff_performer from \Staff to \Voice 
and set Voice.midiInstrument as in 
http://lilypond.org/doc/v2.12/Documentation/user/lilypond/Creating-MIDI-files#Creating-MIDI-files

Midi tracks (from a Staff with midiInstrument) sometimes contain a program 
change event, sometimes not, depending on the path taken through 
Staff_performer::acknowledge_audio_element() on the way to new_audio_staff().  
Temporary voices create tracks without the program change.  If we use the new 
midiChannelMapping=#'voice, the notes in such voices sound as default piano.

(Unfortunately for me, the player I formerly used, NotationPlayer, gets 
confused by Tracks with no program change containing notes directed to a 
Channel that had an earlier program change.)


Nothing critical.



Do you want the new MIDI output in 2.14


Yes.


Why?


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Keith OHara schreef op ma 14-03-2011 om 13:50 [-0700]:

 Dynamics are newly implemented as note-on-velocity,
 but the old implementation as channel-volume is still there, causing
 instruments of the same type to partially influence each others'
 loudness.

What would the correct fix be?  What to do with volume settings
vs velocity?

We could revert the velocity changes, and have 'voice mode not
reuse channels...

 (Unfortunately for me, the player I formerly used, NotationPlayer,
 gets confused by Tracks with no program change containing notes
 directed to a Channel that had an earlier program change.)

So it would be prudent for each new track to always set the
instrument?  That should be doable.

 Why?

It's better and newer!  I can imagine that the default be
reverted to 'staff mode.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen schreef op ma 14-03-2011 om 22:19 [+0100]:
 Keith OHara schreef op ma 14-03-2011 om 13:50 [-0700]:

  (Unfortunately for me, the player I formerly used, NotationPlayer,
  gets confused by Tracks with no program change containing notes
  directed to a Channel that had an earlier program change.)
 
 So it would be prudent for each new track to always set the
 instrument?  That should be doable.

In fact, this should do it

diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc
index 35b1746..7a539db 100644
--- a/lily/staff-performer.cc
+++ b/lily/staff-performer.cc
@@ -115,6 +115,8 @@ Staff_performer::new_audio_staff (string voice)
   announce_element (Audio_element_info (audio_staff, 0));
   announce_element (Audio_element_info (name_, 0));
   staff_map_[voice] = audio_staff;
+  if (!instrument_string_.empty ())
+set_instrument (channel_, voice);
   return audio_staff;
 }
 
Does that fix your player?

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-14 Thread Keith OHara

On Mon, 14 Mar 2011 14:19:46 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:


Keith OHara schreef op ma 14-03-2011 om 13:50 [-0700]:


Dynamics are newly implemented as note-on-velocity,
but the old implementation as channel-volume is still there,


What would the correct fix be?


Well, MIDI note-on-velocity is intended for dynamics.  MIDI channel volume is 
intended for balance, like Lilypond's midiMinimumVolume.
In a development branch, implementing note dynamics purely as note-on-velocity 
would allow MIDI-interested-hackers to use volume for :
1) re-balancing the instruments (because the new implementation messed up the 
equalizer)
2) implementing (de)crescendi on held notes (which sometimes works accidentally 
in 2.12, due I think to notes in other voices creating volume changes on the 
held note)


We could revert the velocity changes, and have 'voice mode not
reuse channels...

Very sensible for the stable version.


Do you want the new MIDI output in 2.14

Yes.

Why?

It's better and newer!


Oh!  That's where we've misunderstood each other.
Lilypond uses an even/odd version numbering system.  2.14 has an even minor 
version number, meaning it is a stable release.  I'm not a programmer, but I've 
worked with them enough to know that better and newer things usually require 
some time before becoming stable.



So it would be prudent for each new track to always set the
instrument?  That should be doable.


Prudent.


In fact, this should do it

diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc
@@ @@ Staff_performer::new_audio_staff (string voice)
+  if (!instrument_string_.empty ())
+set_instrument (channel_, voice);


Segfaults during midi generation.

Thinking the segfault might be have same cause as what Neil uncovered
  http://lists.gnu.org/archive/html/lilypond-devel/2011-03/msg00375.html
I applied the 'obvious' fix for that problem, which is two lines above your 
suggestion.
This fix allowed make check to succeed, so I pushed 8b9e7a706f .  Please adjust 
if the 'obvious' is not what you intended.

Adding set_instrument() as above still segfaults.  It seems channel_ == 0 at 
this point.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Keith OHara

On Sat, 12 Mar 2011 12:35:16 -0800, Jan Nieuwenhuizen jann...@gnu.org wrote:


Ok, pushed.  Something much like the previous output can still
be selected, just like the voice-channel mapping for reproducing
voice and staff mapping with the current midi2ly.



It generally works.

The MIDI port assignments are still being written to the output file; I don't 
know if that is intended.

I see you encode dynamics as MIDI note-on-velocity.  (This is much better than 
the old way of encoding dynamics as MIDI volume!)  The old encoding of dynamics 
in MIDI volume is still being output, though.  I assume you want to remove 
this, because with the default mapping of instrument-type to channel, two 
instruments of the same type fight over the volume of that channel.

The overall change is quite big.  I combined the midi-output-related changes 
since 2.13.51 into one patch at http://codereview.appspot.com/4271043/  so we 
can see what needs to be documented.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread David Kastrup
Keith OHara k-ohara5...@oco.net writes:

 On Sat, 12 Mar 2011 12:35:16 -0800, Jan Nieuwenhuizen jann...@gnu.org wrote:

 Ok, pushed.  Something much like the previous output can still
 be selected, just like the voice-channel mapping for reproducing
 voice and staff mapping with the current midi2ly.


 It generally works.

 The MIDI port assignments are still being written to the output file;
 I don't know if that is intended.

 I see you encode dynamics as MIDI note-on-velocity.  (This is much
 better than the old way of encoding dynamics as MIDI volume!)

Since not all instruments are percussive (like a piano is), it would
make sense to also (optionally?) encode dynamic changes during note
duration as expression signals.  Otherwise a crescendo on sustained
notes (like a string instrument or a wind instrument or an accordion can
deliver) will not happen.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Keith OHara
Keith OHara k-ohara5a5a at oco.net writes:

 
 I see you encode dynamics as MIDI note-on-velocity.  (This is much better 
 than 
 the old way of encoding dynamics as MIDI volume!)  

Except that using MIDI volume for dynamics lets LilyPond perform (de)crescendos 
on a held note.  Somebody might complain if that goes away.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread David Kastrup
Keith OHara k-ohara5...@oco.net writes:

 Keith OHara k-ohara5a5a at oco.net writes:

 I see you encode dynamics as MIDI note-on-velocity.  (This is much
 better than
 the old way of encoding dynamics as MIDI volume!)  

 Except that using MIDI volume for dynamics lets LilyPond perform
 (de)crescendos on a held note.  Somebody might complain if that goes
 away.

I just mentioned how to get around this.  People just don't pay
attention.  I might as well be talking to my computer.  Which is pretty
much what it looks like to the other people in the ward.  House, I mean.
I think I'll step outside and take a look at the horses.  Which reminds
me that I still need to help getting the board back into place that
Kelly knocked out when she got impatient at feeding time this morning.
Somebody better turn down that expression pedal of hers.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Marc Hohl

Am 13.03.2011 09:43, schrieb David Kastrup:

Keith OHarak-ohara5...@oco.net  writes:


Keith OHarak-ohara5a5aat  oco.net  writes:


I see you encode dynamics as MIDI note-on-velocity.  (This is much
better than
the old way of encoding dynamics as MIDI volume!)

Except that using MIDI volume for dynamics lets LilyPond perform
(de)crescendos on a held note.  Somebody might complain if that goes
away.

I just mentioned how to get around this.  People just don't pay
attention.
No, I think it isn't due to not paying attention, but due to the delay 
in delivering
answers to mailing lists. The difference between your message and 
Keith's were
five minutes and my thunderbird looks for new messages every 10 minutes 
- see?

I might as well be talking to my computer.


Oh man, how I wait for that. The possibility to shout at your operating 
system
doing it wrong over and over again until it reboots silently with a 
sorry message
on the screen would make me switch over to windows again, just as a late 
revenge ;-)

   Which is pretty
much what it looks like to the other people in the ward.  House, I mean.
I think I'll step outside and take a look at the horses.  Which reminds
me that I still need to help getting the board back into place that
Kelly knocked out when she got impatient at feeding time this morning.
Somebody better turn down that expression pedal of hers.

Does she have a USB port?

Regards,

Marc


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread James Lowe


-Original Message-
From: Marc Hohl m...@hohlart.de
Date: Sun, 13 Mar 2011 09:53:42 +0100
To: David Kastrup d...@gnu.org
Cc: Lilypond Dev lilypond-devel@gnu.org
Subject: Re: Map voices to channels in MIDI output

I might as well be talking to my computer.

Oh man, how I wait for that. The possibility to shout at your operating
System

I find that sticking my two fingers up at the screen in disgust and
walking off gives me a lot of satisfaction.

Which is pretty
much what it looks like to the other people in the ward.  House, I mean.
I think I'll step outside and take a look at the horses.  Which reminds
me that I still need to help getting the board back into place that
Kelly knocked out when she got impatient at feeding time this morning.
Somebody better turn down that expression pedal of hers.
Does she have a USB port?

PLEASE! This is a family message message group!

James




___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Jan Nieuwenhuizen
Keith OHara schreef op zo 13-03-2011 om 00:19 [-0800]:

 I see you encode dynamics as MIDI note-on-velocity.  (This is much
 better than the old way of encoding dynamics as MIDI volume!)  The old
 encoding of dynamics in MIDI volume is still being output, though.  I
 assume you want to remove this, because with the default mapping of
 instrument-type to channel, two instruments of the same type fight
 over the volume of that channel.

We had this volume - voice-bug posted

   http://lists.gnu.org/archive/html/bug-lilypond/2011-03/msg00146.html

and when mapping instrument - channel instead of staff - channel
(or voice - channel and get ports to work), this makes changing
the volume of two similar sounding voices impossible.

To my surprise, I found out that this note on velocity was not being
used.  We'll have to see what volume changes should go where exactly.
I note that some suggestions have been made, and I look forward to
any patches to back them up.

I'm not removing anything just yet until we find a good way to
test these things or get some more info.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread David Kastrup
Jan Nieuwenhuizen jann...@gnu.org writes:

 To my surprise, I found out that this note on velocity was not being
 used.  We'll have to see what volume changes should go where exactly.
 I note that some suggestions have been made, and I look forward to any
 patches to back them up.

Considering that the mechanisms of Lilypond's Midi generation are not
documented anywhere (including the documentation of internals), the
likelihood of any patches to back them up is slim.  If any patches are
to appear, they will be by the usual suspects already familiar with this
part of the code and its design.

-- 
David Kastrup


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Graham Percival
On Sun, Mar 13, 2011 at 10:00:24AM +, James Lowe wrote:
 
 -Original Message-
 From: Marc Hohl m...@hohlart.de
 I might as well be talking to my computer.
 
 Oh man, how I wait for that. The possibility to shout at your operating
 System
 
 I find that sticking my two fingers up at the screen in disgust and
 walking off gives me a lot of satisfaction.

I found that completely bewildering when I first came here -- I'd
never heard of a two-finger rude gesture before!  One-finger,
sure, I saw it all the time.  But two-finger?  Not in western
Canada, at least.

It made for a funny lesson one day.  A student was waiting for me
to help him while I helped somebody else, so I called out I'll be
there in two minutes and helpfully held up two fingers to
reinforce the two bit (it was a noisy computer lab).  Apparently
the finger gesture gave the wrong message.  :)

 Does she have a USB port?
 
 PLEASE! This is a family message message group!

Yeah!  Think of all the children who are sending in patches!

Cheers,
- Graham

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread David Kastrup
Graham Percival gra...@percival-music.ca writes:

 On Sun, Mar 13, 2011 at 10:00:24AM +, James Lowe wrote:
 
 -Original Message-
 From: Marc Hohl m...@hohlart.de
 I might as well be talking to my computer.
 
 Oh man, how I wait for that. The possibility to shout at your operating
 System
 
 I find that sticking my two fingers up at the screen in disgust and
 walking off gives me a lot of satisfaction.

 I found that completely bewildering when I first came here -- I'd
 never heard of a two-finger rude gesture before!  One-finger, sure, I
 saw it all the time.  But two-finger?  Not in western Canada, at
 least.

A one-finger gesture would not be offensive to a binary entity.

-- 
David Kastrup

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Marc Hohl

Am 13.03.2011 11:00, schrieb James Lowe:


-Original Message-
From: Marc Hohlm...@hohlart.de
Date: Sun, 13 Mar 2011 09:53:42 +0100
To: David Kastrupd...@gnu.org
Cc: Lilypond Devlilypond-devel@gnu.org
Subject: Re: Map voices to channels in MIDI output


I might as well be talking to my computer.

Oh man, how I wait for that. The possibility to shout at your operating
System

I find that sticking my two fingers up at the screen in disgust and
walking off gives me a lot of satisfaction.

No, the computer has to react accordingly ;-)

Which is pretty
much what it looks like to the other people in the ward.  House, I mean.
I think I'll step outside and take a look at the horses.  Which reminds
me that I still need to help getting the board back into place that
Kelly knocked out when she got impatient at feeding time this morning.
Somebody better turn down that expression pedal of hers.

Does she have a USB port?

PLEASE! This is a family message message group!

Sorry, I didn't think of anything offending or unsuitable for anyone ...

Marc

James







___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Colin Campbell

On 11-03-13 05:21 AM, Graham Percival wrote:

On Sun, Mar 13, 2011 at 10:00:24AM +, James Lowe wrote:

-Original Message-
From: Marc Hohlm...@hohlart.de

I might as well be talking to my computer.

Oh man, how I wait for that. The possibility to shout at your operating
System

I find that sticking my two fingers up at the screen in disgust and
walking off gives me a lot of satisfaction.

I found that completely bewildering when I first came here -- I'd
never heard of a two-finger rude gesture before!  One-finger,
sure, I saw it all the time.  But two-finger?  Not in western
Canada, at least.

It made for a funny lesson one day.  A student was waiting for me
to help him while I helped somebody else, so I called out I'll be
there in two minutes and helpfully held up two fingers to
reinforce the two bit (it was a noisy computer lab).  Apparently
the finger gesture gave the wrong message.  :)


Does she have a USB port?

PLEASE! This is a family message message group!

Yeah!  Think of all the children who are sending in patches!



I would *really* love the ability to patch my children!

Colin

--
The test of our progress is not whether we add more to the abundance
of those who have much, it is whether we provide enough for those who
have too little.
-Franklin D. Roosevelt, 32nd US President (1882-1945)


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Jan Nieuwenhuizen
Colin Campbell schreef op zo 13-03-2011 om 10:02 [-0600]:

 I would *really* love the ability to patch my children!

Patching parents first is easier and more effective.

Jan

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Keith OHara

On Sun, 13 Mar 2011 03:20:51 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:


I'm not removing anything just yet until we find a good way to
test these things or get some more info.


Sensible, but this leaves a partially-finished major change in the branch that 
Graham just tagged as 2.14 release candidate.

Do you want the new MIDI output in 2.14, or can it be worked on in a separate 
branch, to be finished in development 2.15 ?


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Graham Percival
On Sun, Mar 13, 2011 at 05:05:51PM -0700, Keith OHara wrote:
 On Sun, 13 Mar 2011 03:20:51 -0700, Jan Nieuwenhuizen jann...@gnu.org wrote:
 
 I'm not removing anything just yet until we find a good way to
 test these things or get some more info.
 
 Sensible, but this leaves a partially-finished major change in the branch 
 that Graham just tagged as 2.14 release candidate.

If there is a critical regression, then go ahead and add an issue
number and I'll announce the cancellation of that release
candidate.

 Do you want the new MIDI output in 2.14, or can it be worked on in a separate 
 branch, to be finished in development 2.15 ?

We're not delaying for new features.  Stuff like footnotes can be
added in 2.14.1.  This can go there too.

Cheers.
- Graham

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-13 Thread Keith OHara

On Sun, 13 Mar 2011 17:10:48 -0700, Graham Percival gra...@percival-music.ca 
wrote:


If there is a critical regression, then go ahead and add an issue


I don't know of any yet, and I will not be looking for any.
The changes within the past week were significant enough that I expect 
complaints from people who use MIDI.


We're not delaying for new features.


Right.  Mostly I just want to be sure Jan knows you've branched for a potential 
stable release, in case he needs to pull back any half-implemented changes.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-12 Thread Jan Nieuwenhuizen
Keith OHara schreef op vr 11-03-2011 om 09:16 [-0800]:
 On Fri, 11 Mar 2011 01:32:39 -0800, Jan Nieuwenhuizen jan...@gnu.org wrote:

 The structure that *can* contain several channels is a Port, separate
 Ports corresponding to separate cables in the hardware.  One can
 optionally specify a different Port for each Track (making Tracks and
 Channels no longer purely orthogonal)
   http://www.somascape.org/midi/tech/mfile.html#meta
 but I have no reason to expect a software midi player to support
 multiple ports.

Ugh.  I have just pushed fixes for setting the instrument and assigning
each track to a new port.  It would be nice if you could test it, but
afaics it does not work with timidity, alas.

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-12 Thread Keith OHara

On Sat, 12 Mar 2011 05:48:08 -0800, Jan Nieuwenhuizen jann...@gnu.org wrote:


Ugh.  I have just pushed fixes for setting the instrument and assigning
each track to a new port.  It would be nice if you could test it, but
afaics it does not work with timidity, alas.



I see (with hexedit) the new midi events for instrument changes on all voices, 
and port settings.

I have only one sound card in my system.  All players I tried (Timidity(linux) 
WindowsMediaPlayer NotationPlayer and Podium) route all ports to this one sound 
card.  You send the instrument changes just before the first note in the voice, 
and some players change the instrument sound on the channel at that moment.

All instruments on a given channel still have the same instrument sound and 
volume at any given moment.


To associate several Tracks with one staff,
you could write [ the Staff name ] into Track Name [...]


I think this is the best solution, although I think it's a custom
solution and thus clumsy?


My description was clumsy.
TrackName is an optional field, and LilyPond 2.12 fills it with the name of the 
Staff context, if any.  It seems quite natural for Lilypond 2.14 to write the 
name of the Staff context as TrackName for each track associated with that 
Staff.


I'll be looking into this.  I think I'll be doing

No Port setting (ie, single port)
midiInstrument - Channel
   (possibly with option: Staff_performer - Channel)
Voice - Track


That looks very nice.
Staff_performer responds to properties like midiInstrument that belong to a 
channel, and right now each Staff_performer contains one Audio_staff as a 
member.  Performance::output writes each Audio_staff as a midi track.
If Staff_performer can contain multiple Audio_staff members, with some mapping 
from voices to individual Audio_staffs, that could be really elegant (maybe 
with some editing of class names).


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-12 Thread Jan Nieuwenhuizen
Keith OHara schreef op za 12-03-2011 om 10:00 [-0800]:

 I see (with hexedit) the new midi events for instrument changes on all
 voices, and port settings.
 
 I have only one sound card in my system.  All players I tried
 (Timidity(linux) WindowsMediaPlayer NotationPlayer and Podium) route
 all ports to this one sound card.  You send the instrument changes
 just before the first note in the voice, and some players change the
 instrument sound on the channel at that moment.
 
 All instruments on a given channel still have the same instrument
 sound and volume at any given moment.

Okay, thanks!

 My description was clumsy.
 TrackName is an optional field, and LilyPond 2.12 fills it with the
 name of the Staff context, if any.  It seems quite natural for
 Lilypond 2.14 to write the name of the Staff context as TrackName for
 each track associated with that Staff.

That makes sense.  I'm using staff-id:voice-id right now.
Midi2ly will need a bit of work to re-arrange that output onto
staves.

 That looks very nice.

Ok, pushed.  Something much like the previous output can still
be selected, just like the voice-channel mapping for reproducing
voice and staff mapping with the current midi2ly.

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-11 Thread Jan Nieuwenhuizen
Neil Puttock schreef op do 10-03-2011 om 21:41 [+]:
 On 10 March 2011 21:04, Jan Nieuwenhuizen jann...@gnu.org wrote:

 Doesn't that still fall foul of the lack of synchronization between
 Staff_performer instances though?  For example, if I have two staves
 with one voice each, both voices will still be allocated the same
 channel

Why would that be a problem?  They're in different tracks.

 (and so will the instruments, if set) unless channel_map_ is
 static.

Are you saying that the instrument of channel 0 of track 1 is
somehow linked to the instrument of channel 0 of track 2?

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-11 Thread Jan Nieuwenhuizen
Keith OHara schreef op do 10-03-2011 om 18:15 [-0800]:

  It works for me, [...]
 
 Oh!  Thanks for checking.

 I'll post a report on the bug list with the (very tiny) midi files and see if 
 it's just my midi players (timidity and WMP)

Thanks.  Note that I now found that if there are two voices on one
staff, taking track 1 channels 0 and 1, only channel 0's instrument
is set, so the second voice sounds as the default piano.

It would be nice to have a test for that to check when it's fixed.

 Long term, though, I don't see how your approach can handle orchestral 
 scores, where there usually are more than 16 voices.

I hope this new solution is better than the previous one: that had
a maximum of 15 staffs + 1 percussion and would wrap around after
16 different staffs/instruments.  Now, we have an unlimited number
of staffs, and 15 voices per staff (or one percussion).  I hope.

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-11 Thread Keith OHara

On Fri, 11 Mar 2011 01:32:39 -0800, Jan Nieuwenhuizen jan...@gnu.org wrote:


Neil Puttock schreef op do 10-03-2011 om 21:41 [+]:


both voices will still be allocated the same channel


Why would that be a problem?  They're in different tracks.



Are you saying that the instrument of channel 0 of track 1 is
somehow linked to the instrument of channel 0 of track 2?



Yes. The player should remember the instrument assigned to each channel, 
regardless of which track set the instrument.  The physical model is a midi 
cable, where the receiver sees only the messages, not the track structure.

Tracks and Channels are orthogonal organizations.
Tracks organize the file; channels distinguish data streams down the (real or 
virtual) cable.

The structure that *can* contain several channels is a Port, separate Ports 
corresponding to separate cables in the hardware.  One can optionally specify a 
different Port for each Track (making Tracks and Channels no longer purely 
orthogonal)
 http://www.somascape.org/midi/tech/mfile.html#meta
but I have no reason to expect a software midi player to support multiple ports.


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-11 Thread Jan Nieuwenhuizen
Keith OHara schreef op vr 11-03-2011 om 09:16 [-0800]:
 On Fri, 11 Mar 2011 01:32:39 -0800, Jan Nieuwenhuizen jan...@gnu.org wrote:

 The structure that *can* contain several channels is a Port, separate
 Ports corresponding to separate cables in the hardware.  One can
 optionally specify a different Port for each Track (making Tracks and
 Channels no longer purely orthogonal)
   http://www.somascape.org/midi/tech/mfile.html#meta
 but I have no reason to expect a software midi player to support
 multiple ports.

So if we put track 0 to port 0, track 1 to port 1 etc., we would
technically be correct?  Midi players would have the option to
ignore ports, as long as they do not lump together channel 0 of
track 0 and channel 0 of track 1 -- a midi player does see the
tracks after all.

Technical correctness probably has little merit if no player
supports it, but it is worth a try.  Setting ports should be
quite easy and if major players support this, we're safe.

Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-11 Thread Keith OHara

On Fri, 11 Mar 2011 10:12:59 -0800, Jan Nieuwenhuizen jann...@gnu.org wrote:


Technical correctness probably has little merit if no player
supports it, but it is worth a try.  Setting ports should be
quite easy and if major players support this, we're safe.



I know nothing about this, but some other people with similar goals are
http://www.classicalmidiconnection.com/2port.htm



Remember, without this hack, midi2ly cannot
recreate it's own midi files if they use voices.



With the fixes in the above commits, even wtk1-fugue2.ly (one of
the nice test examples that was removed and not put back) can
be nicely recreated by midi2ly.



To preserve more organizational information, use more Tracks.
There can be up to 65535 Tracks in a midi file.  The correspondence could be:
 single Port
 Staff_performer - Channel
 Voice - Track

midi2ly puts each track on its own staff by default (which is probably safest, 
and not a problem because re-arranging the variables in staves is one of the 
easier things to do in LilyPond).  To associate several Tracks with one staff, 
you could write a staff-association into Track Name ( event 0xFF03 ).


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-10 Thread Keith OHara

Jan,
 Commits e5380f2 and 8dc343b break the MIDI output from all the examples in the 
documentation that use midiInstrument, and the regtest 
‘midi-volume-equaliser.ly’.  The midi output is much less useful for 
proofreading, because all the voices sound the same.

The problem is that the all settings at Staff context go out on the same midi 
channel 0.  It does not matter that they are in different 'tracks' because 
tracks are merely for file organization; track information does not go down the 
cable.  Now, it is possible to route different tracks to different MIDI ports 
(corresponding to separate cables) but LilyPond does not do this routing, and I 
don't think many software midi players support multiple ports anyway.

Do you need to see bug reports on the tracker ?
or can we revert these two commits until your change is complete ?

Actually, I think the existing LilyPond solution, of moving the midi performer 
to Voice context, can do what your sponsor needs.  I'll try it and comment on 
the tracker issue 1548.
--
Keith


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-10 Thread Jan Nieuwenhuizen
Keith OHara schreef op do 10-03-2011 om 10:40 [-0800]:

   Commits e5380f2 and 8dc343b break the MIDI output from all the
 examples in the documentation that use midiInstrument, and the regtest
 ‘midi-volume-equaliser.ly’.  The midi output is much less useful for
 proofreading, because all the voices sound the same.

It works for me, and I think Neil also could not confirm this, so

 Do you need to see bug reports on the tracker ?

yes, we need to be able to verify this.

 Actually, I think the existing LilyPond solution, of moving the midi
 performer to Voice context, can do what your sponsor needs.  I'll try
 it and comment on the tracker issue 1548.

It's a nice hack and it probably works, but I'd rather do the right
thing by default.  Remember, without this hack, midi2ly cannot
recreate it's own midi files if they use voices.

I didn't know this was in the documentation and it should probably
be removed.

With the fixes in the above commits, even wtk1-fugue2.ly (one of
the nice test examples that was removed and not put back) can
be nicely recreated by midi2ly.

Greetings,
Jan

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-10 Thread Neil Puttock
On 10 March 2011 19:57, Jan Nieuwenhuizen jann...@gnu.org wrote:

 It works for me, and I think Neil also could not confirm this, so]

I'm afraid I can now (I was puzzled by Keith's report initially since
I'd only tested midiInstrument settings on a single stave).

All staves default to channel 0 for midi instruments (since channel_
is never set).

Cheers,
Neil

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-10 Thread Jan Nieuwenhuizen
Neil Puttock schreef op do 10-03-2011 om 20:11 [+]:
 On 10 March 2011 19:57, Jan Nieuwenhuizen jann...@gnu.org wrote:

 All staves default to channel 0 for midi instruments (since channel_
 is never set).

I see, whenever a new channel is opened (for a new voice)
by the staff-performer, it should also set the instrument
there.  Actually, that's nicer than doing it in
Staff_performer::process_music ()

Greetings,
Jan.

-- 
Jan Nieuwenhuizen jann...@gnu.org | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-10 Thread Neil Puttock
On 10 March 2011 21:04, Jan Nieuwenhuizen jann...@gnu.org wrote:

 I see, whenever a new channel is opened (for a new voice)
 by the staff-performer, it should also set the instrument
 there.  Actually, that's nicer than doing it in
 Staff_performer::process_music ()

Doesn't that still fall foul of the lack of synchronization between
Staff_performer instances though?  For example, if I have two staves
with one voice each, both voices will still be allocated the same
channel (and so will the instruments, if set) unless channel_map_ is
static.

Cheers,
Neil

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-09 Thread Neil Puttock
On 9 March 2011 00:09, Keith OHara k-ohara5...@oco.net wrote:

 In 2.13.53, I cannot find a way to make midiInstrument have effect.

I can't confirm this; apart from instruments which my MIDI output
doesn't seem to support, every instrument I've tried works fine.

Can you post a snippet showing the problem?

Cheers,
Neil

___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Map voices to channels in MIDI output

2011-03-09 Thread Keith OHara
Neil Puttock n.puttock at gmail.com writes:
 On 9 March 2011 00:09, Keith OHara k-ohara5a5a at oco.net wrote:
 
  In 2.13.53, I cannot find a way to make midiInstrument have effect.
 
 Can you post a snippet showing the problem?

Let's use the manual example I linked earlier, but give names to the Voice 
contexts.  Obviously this needs further re-arrangement now that midi channels 
go with the Voice, but I can't see a way to arrange it so it does work.

\score {
  
\new Staff {
  \key g \major
  \time 2/2
  \set Staff.midiInstrument = #flute
  \set Staff.midiMinimumVolume = #0.7
  \set Staff.midiMaximumVolume = #0.9
  \new Voice = flauto \relative c''' {
r2 g\mp g fis~
fis4 g8 fis e2~
e4 d8 cis d2
  }
}
\new Staff {
  \key g \major
  \set Staff.midiInstrument = #clarinet
  \set Staff.midiMinimumVolume = #0.3
  \set Staff.midiMaximumVolume = #0.6
  \new Voice = clarinetto \relative c'' {
b1\p a2. b8 a
g2. fis8 e
fis2 r
  }
}
%{%}
  \layout {}
  \midi {
\context {
  \Score
  tempoWholesPerMinute = #(ly:make-moment 72 2)
}
  }
}

The program change commands that set the midiInstrument go to channel 0. The 
\xC049 below sets channel 0 to flute, then the other track has x\C047 trying to 
set the same channel to clarinet.

030: 6f72 3a20 00ff 011e 474e 5520 4c69 6c79  or: GNU Lily
040: 506f 6e64 2032 2e31 332e 3534 2020 2020  Pond 2.13.54
050: 2020 2020 2020 00ff 5804 0201 1208 00ff..X...
060: 5103 065b 9a00 ff2f 004d 5472 6b00   Q..[.../.MTrk...
070: 7000 ff03  c049 00ff 0405 666c 7574  p..Iflut



___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel


Map voices to channels in MIDI output

2011-03-08 Thread Keith OHara

Is there more to this change, started in commit e5380f2, on the way?

In 2.13.53, I cannot find a way to make midiInstrument have effect.
There is also the problem reported on -bugs  
http://lists.gnu.org/archive/html/bug-lilypond/2011-03/msg00152.html

Maybe the previous workaround to have one channel per voice could be a model ?
 http://lilypond.org/doc/v2.13/Documentation/notation/creating-midi-files

That workaround did allow changing midiInstrument and midiVolume as in
 http://lilypond.org/doc/v2.13/Documentation/notation/controlling-midi-dynamics
if we set those properties in Voice instead of Staff.
-
Keith


___
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel