Ejemplo n.º 1
0
        void LinkMc(AdLibPart part, AdLibVoice voice)
        {
            voice.Part = part;
            voice.Next = part._voice;
            part._voice = voice;
            voice.Prev = null;

            if (voice.Next != null)
                voice.Next.Prev = voice;
        }
Ejemplo n.º 2
0
 void PartKeyOff(AdLibPart part, byte note)
 {
     for (var voice = part._voice; voice != null; voice = voice.Next)
     {
         if (voice.Note == note)
         {
             if (part._pedal)
                 voice.WaitForPedal = true;
             else
                 McOff(voice);
         }
     }
 }
Ejemplo n.º 3
0
        void PartKeyOn(AdLibPart part, AdLibInstrument instr, byte note, byte velocity, AdLibInstrument second, byte pan)
        {
            var voice = AllocateVoice(part._priEff);
            if (voice == null)
                return;

            LinkMc(part, voice);
            McKeyOn(voice, instr, note, velocity, second, pan);
        }
Ejemplo n.º 4
0
        public AdlibMidiDriver(IMixer mixer)
            : base(mixer)
        {
            _voiceIndex = -1;

            _parts = new AdLibPart[32];
            for (var i = 0; i < _parts.Length; ++i)
            {
                _parts[i] = new AdLibPart();
                _parts[i].Init(this, (byte)(i + ((i >= 9) ? 1 : 0)));
            }
            _percussion = new AdLibPercussionChannel();
            _percussion.Init(this, 9);
            _timerIncrease = 0xD69;
            _timerThreshold = 0x411B;

            _voices = new AdLibVoice[9];
            for (int i = 0; i < _voices.Length; i++)
            {
                _voices[i] = new AdLibVoice();
            }
        }