From alsa-devel-owner@alsa.jcu.cz  Tue May  5 11:03:08 1998
Received: from pat.bath.ac.uk (qmailr@pat.bath.ac.uk [138.38.32.2])
	by marvin.jcu.cz (8.8.8/8.8.8) with SMTP id LAA18761
	for <alsa-devel@jcu.cz>; Tue, 5 May 1998 11:02:45 +0200
Received: (qmail 16175 invoked from network); 5 May 1998 09:02:42 -0000
Received: from solomon.bath.ac.uk (HELO bath.ac.uk) (mmdf@138.38.32.1)
  by pat.bath.ac.uk with SMTP; 5 May 1998 09:02:42 -0000
Received: from tobi.bath.ac.uk by solomon.bath.ac.uk id aa24088;
          5 May 98 10:02 BST
Message-ID: <354ED590.794B@bath.ac.uk>
Date: Tue, 05 May 1998 10:02:08 +0100
From: "P.J.Leonard" <P.J.Leonard@bath.ac.uk>
MIME-Version: 1.0
To: alsa-devel@jcu.cz
Subject: Re: New Sequencer core
References: <199805022222.AAA11745@obelix.fvdpol.inter.nl.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Frank van de Pol wrote:
> 
> Hi Paul,
> 
> here's some more thoughts for our 'melting pot'...
> 
> Frank.

[snip lots of good stuff]


 I was doing some work on my sequencer over the weekend. I was wondering
what the best
way to organise the allocation of voices:

In my scheme of things a Voice has a table of effects which implements
the interface to a given
device. A voice also has an lookup table which maps midi input events
onto these effects. 
However this is not really anything to do with my querry.

 Plan.

 A singleton VoiceManager provides the high level interface.

 An application requests a voice using the folling infomation.


SYNTHTYPE:VOICETYPE:patchname:id

e.g 

 AWE32:VOICE:piano2:1

 *:VOICE:harp:2

 GUS:DRUM:jazz:1


explination:

 - SYNTHTYPE  is the synth type the voice manager will attempt to
allocate a voice on the requested
              device. Otherwise ?

 - VOICETYPE  the type of channel required. This is a normal voice of
drum. Maybe polyphonic or mono ?

 - patchname  name of the patch (for example GM). It could also be A
program id + bank id ?
              it could also be a traditional midi port and channel.

 - id         two or more tracks may want to share the same voice
channel. e.g. splitting the drum track
              into snare/ high hat etc. If you want to share a channel
you use the same id. If you want
              to use the patch but have a different channel you would
use 2 distinct ids. 


 Note that a wild "*" flag could be used if we don't care.

 I was going to code this up in a string ? 

 The voice manager has the task of returning a reference to a voice when
given a string. YOu can also free
voices (the voice manager can reference count if it is owned by more
than one).

 Hmmmm, I am not so happy about all this. But I am not happy with the
midi port + channel stuff because 
in my opinion it sucks. If you want a drum channel you use channel 10
(OR is it 16). The AWE32 driver
supports the DRUMS on any channel. This is useful if you want to use a
heavy reverb on a snare but leave
the rest of the kit dry (impossible if you play the kit using a single
channel).
 
 Also merging sections from 2 different songs is not much fun if you
have to sort out the clashes between
all the channels.

 cheers Paul.

