MIDI staffs or voices?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

MIDI staffs or voices?

littlesincanada
Hi,
In performance.cc, there is a comment from Han-Wen:

      /*
    Huh? Why does each staff also have a separate channel? We
    should map channels to voices, not staves. --hwn.
      */

This refers to the fact that tracks are assigned to Audio_staff.
I agree with the comment, but I think that this effect can be achieved
by moving the "Staff_performer" from the Staff context to the Voice
context as the following demonstrates:

\version "2.11.32"

\midi {
  \context {
    \Staff
    \remove "Staff_performer"
  }
  \context {
    \Voice
     \consists "Staff_performer"
    }
}

\score {
  {
      <<{c' d' e' f'} \\ {c' b a g} >>
  }
  \midi{
  }  
}

With the \midi block context modifiers, the output midi file seems to
have 2 tracks, one for each voice, labelled "1" and "2".
Without the modifiers, all the notes are stuffed into a single track.

This is so because the Staff_performer is actually just a note catcher -
it creates a single Audio_staff object and stuffs all the notes received
from any child voices. Putting it in Voice makes it catch only the notes
in the single Voice context in which it resides.

Does anybody agree/disagree that this is more desirable behaviour?

Regards,
Ralph




_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Han-Wen Nienhuys-3
2007/10/20, Ralph Little <[hidden email]>:
> This is so because the Staff_performer is actually just a note catcher -
> it creates a single Audio_staff object and stuffs all the notes received
> from any child voices. Putting it in Voice makes it catch only the notes
> in the single Voice context in which it resides.
>
> Does anybody agree/disagree that this is more desirable behaviour?

IIRC the real problem is the limits that MIDI imposes (IIRC: you can
have only 15 channels/track); putting them at voice level will exhaust
the number of available instruments much quicker for polyphonic
staves.


--
Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

littlesincanada


Han-Wen Nienhuys wrote:

> 2007/10/20, Ralph Little <[hidden email]>:
>  
>> This is so because the Staff_performer is actually just a note catcher -
>> it creates a single Audio_staff object and stuffs all the notes received
>> from any child voices. Putting it in Voice makes it catch only the notes
>> in the single Voice context in which it resides.
>>
>> Does anybody agree/disagree that this is more desirable behaviour?
>>    
>
> IIRC the real problem is the limits that MIDI imposes (IIRC: you can
> have only 15 channels/track); putting them at voice level will exhaust
> the number of available instruments much quicker for polyphonic
> staves.
>  
Hi,
I see what you mean.
If there are no obvious problems the above trick though, it might still
be worth putting it in the LSR for those that want that kind of output....

Regards,
Ralph


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Arvid Grøtting
Ralph Little <[hidden email]> writes:

> If there are no obvious problems the above trick though, it might
> still be worth putting it in the LSR for those that want that kind of
> output....

I'd say it's incredibly useful for those of us that seldom or never
use more than 8 or so voices.  In fact, I'm recompiling 68 or so files
right now to get per-voice midi.

(I've seen this or a similar trick before, but possibly not in a form
directly suitable for use in my include files, and anyway I'd lost
track of what it was.  It's now part of my defaults.  Thanks a million!)

Cheers,

-- Arvid



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Mats Bengtsson-4
Has anyone added it to LSR yet?

   /Mats

Arvid Grøtting wrote:

> Ralph Little <[hidden email]> writes:
>
>  
>> If there are no obvious problems the above trick though, it might
>> still be worth putting it in the LSR for those that want that kind of
>> output....
>>    
>
> I'd say it's incredibly useful for those of us that seldom or never
> use more than 8 or so voices.  In fact, I'm recompiling 68 or so files
> right now to get per-voice midi.
>
> (I've seen this or a similar trick before, but possibly not in a form
> directly suitable for use in my include files, and anyway I'd lost
> track of what it was.  It's now part of my defaults.  Thanks a million!)
>
> Cheers,
>
> -- Arvid
>
>
>
> _______________________________________________
> lilypond-devel mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
>  

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

littlesincanada
In reply to this post by littlesincanada
Hi,
Sorry, I did not submit it for inclusion in the LSR
because I've not had time to verify that there are no issues
with it. I guess if someone has tried it and there are no
side effects, it would be worthwhile submitting it....

Regards,
Ralph


> Has anyone added it to LSR yet?
>
> /Mats


Nervous about who has your email address? Yahoo! Mail can help you win the war against spam.
_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Francisco Vila-4
In reply to this post by Han-Wen Nienhuys-3
El Sat, 20 de Oct de 2007, a las 11:45:28AM -0200, Han-Wen Nienhuys dijo:
> IIRC the real problem is the limits that MIDI imposes (IIRC: you can
> have only 15 channels/track);

They are 16, numbered from 1 to 16 (conventionally) but coded 0 to 15 in binary.
--
F.Vila


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Francisco Vila-4
In reply to this post by littlesincanada
El Fri, 19 de Oct de 2007, a las 09:43:57PM -0700, Ralph Little dijo:

> \version "2.11.32"
>
> \midi {
>  \context {
>    \Staff
>    \remove "Staff_performer"
>  }
>  \context {
>    \Voice
>     \consists "Staff_performer"
>    }
> }
>
> \score {
>  {
>      <<{c' d' e' f'} \\ {c' b a g} >>
>  }
>  \midi{
>  }   }


There is another limitation of MIDI, only smart enough MIDI performers
are able to play the following correctly (substitute it into your
previous example):

{
     <<{d'4 c'2 b4 c'4 r2.} \\ {b4 c' d'2 c'1} >>
 }

If all voices from a staff go to a single MIDI channel, then a
note-off cancels the sound of this note in this channel. This is a very
good reason to assign channels to voices, not staves.

Also note that MIDI tracks can mix notes tagged with different
channels. This way, a staff could translate to a single track with
notes on separated channels into the same track.

Assigning a MIDI output channel to a track is an option in some
sequencers, but you can always leave the channel of each note untouched
if you do not assign channels to tracks.

Could anybody test how this example sounds? c'2 in first measure should
sound as a half note together with part of the d'2 in the other voice;
also, c'1 in the second measure should last as a whole note, not a
quarter note.

--
F. Vila


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Juergen Reuter
In reply to this post by Francisco Vila-4
On Sun, 28 Oct 2007, Paco Vila wrote:

> El Sat, 20 de Oct de 2007, a las 11:45:28AM -0200, Han-Wen Nienhuys dijo:
>> IIRC the real problem is the limits that MIDI imposes (IIRC: you can
>> have only 15 channels/track);
>
> They are 16, numbered from 1 to 16 (conventionally) but coded 0 to 15 in binary.

Yes, but according to the GM standard channel #10 is reserved for drums;
hence only 15 are left.

Greetings,
Juergen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: MIDI staffs or voices?

Ian Stirling-5
On Sunday 28 October 2007 17:42:09 Juergen Reuter wrote:
 
> Yes, but according to the GM standard channel #10 is reserved for drums;
> hence only 15 are left.

  GM standard was foisted on to the industry by Roland,
and many synth makers still do not comply with it.
 My Kurzweil PC2R pays lip service to GM by supplying
GM sounds to be loaded into user memory. I never use it.
Channel 10 is just another channel for me, and in the
following music, the 'cellos are on channel 10 of the
PC2R.

Ian,  http://www.opus131.com/music/mozart40.mp3
--


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel