From alsa-devel-owner@alsa.jcu.cz  Wed Feb 24 12:32:05 1999
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id MAA03816;
	Wed, 24 Feb 1999 12:30:29 +0100
Date: Wed, 24 Feb 1999 12:30:28 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: alsa-devel@alsa.jcu.cz
cc: Takashi Iwai <iwai@ww.uni-erlangen.de>
Subject: Re: Instrument abstract layer
In-Reply-To: <9902240838.AA17160@servww1.ww.uni-erlangen.de>
Message-ID: <Pine.LNX.3.96.990224112210.3592B-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Wed, 24 Feb 1999, Takashi Iwai wrote:

> >> It would be flexible that the key number can be given explicitly as
> >> another parameter.
> >> For example, not only drums but sfx presets have different sample per
> >> key.  Most of these tones are defined in somewhere other banks but
> >> possibly with different key number.  Then, we need to alias between
> >> different bank/preset/key combinations.
> 
> > I mean - 0-127 melodic instruments which could be used for the melodic
> > channel. 128-255 drum/fx (note based) instruments. As an extension it
> > could be selected instruments 128-255 as the melodic instrument (this
> > doesn't follow some MIDI standard).
> 
> Yes, I understood it.  It's just like instrument numbers of GUS patch
> loading, isn't it?
> What I wrote is - assume to alias bank 8 / instr 20 / note 64 to
> bank 126 / instr 0 / note 48.  Both source and destination use

No problem with the current implementation. GS alias example:

drumset 8 / instr 156 (note 28) -> drumset 0 / instr 170 (note 42).

> different note numbers.  This can't be handled easily unless we give
> explicitly the note number in instrument identifier, because if we use
> 128-255 for key mapping, the instrument number will be ignored.  The

I'm not sure here which instrument number do you mention here.
The 128-255 range gives to us: 1) the unique instrument identifier,
2) the note to which is the instrument associated

If you are speaking about some internal instrument number specific for the
hardware - this must be handled in an application or alsa library.

> same problem is - how to deal with drumsets with different instrument
> number like standard and jazz drums?

I think that in the drivers (GS/XG emulation) must be handled this
situation in usuall way:

1) look for the required drumset (the number in the bank variable)
2) if not found - fallback to GM drums (a GM drumset)

OK, we are moving the discussion to another theme. I don't want discuss
thing about the GS/XG/GM emulations. I need only to confirm if the
instrument identifier contains all necessary information for an emulation
implementation.

> > If you want mix more instruments from different banks, you can use:
> 
> > 1) bank selection for the drum channel (for GS = program change)
> > 2) different instrument clusters with different priorities (each
> >    note for the instrument range 128-255 can be overriden).
> 
> Hmm, I didn't this understand well.. Could you explain more?

OK. The bank selection == the drumset in the first example. An application
can create own drumset over the instrument aliases. The second example
means that we can have more instruments with SAME bank/program/emulation
identifiers. These instruments will be discerned by the cluster 
identifier. Some priority will be assigned to the instrument cluster.
This priority will be used in the instrument select code to determine
which instrument will be used when the program change / note on event
arrives.

							Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic






