Пример #1
0
 public InstrumentExtra(InstrumentExtra copy)
 {
     A = copy.A;
     B = copy.B;
     C = copy.C;
     D = copy.D;
     E = copy.E;
     F = copy.F;
     G = copy.G;
     H = copy.H;
 }
Пример #2
0
 public AdLibInstrument(AdLibInstrument copy)
 {
     ModCharacteristic = copy.ModCharacteristic;
     ModScalingOutputLevel = copy.ModScalingOutputLevel;
     ModAttackDecay = copy.ModAttackDecay;
     ModSustainRelease = copy.ModSustainRelease;
     ModWaveformSelect = copy.ModWaveformSelect;
     CarCharacteristic = copy.CarCharacteristic;
     CarScalingOutputLevel = copy.CarScalingOutputLevel;
     CarAttackDecay = copy.CarAttackDecay;
     CarSustainRelease = copy.CarSustainRelease;
     CarWaveformSelect = copy.CarWaveformSelect;
     Feedback = copy.Feedback;
     FlagsA = copy.FlagsA;
     ExtraA = new InstrumentExtra(copy.ExtraA);
     FlagsB = copy.FlagsB;
     ExtraB = new InstrumentExtra(copy.ExtraB);
     Duration = copy.Duration;
 }
Пример #3
0
        void Struct10Init(Struct10 s10, InstrumentExtra ie)
        {
            s10.Active = 1;
            if (!_scummSmallHeader)
            {
                s10.CurVal = 0;
            }
            else
            {
                s10.CurVal = s10.StartValue;
                s10.StartValue = 0;
            }
            s10.ModWheelLast = 31;
            s10.Count = ie.A;
            if (s10.Count != 0)
                s10.Count *= 63;
            s10.TableA[0] = ie.B;
            s10.TableA[1] = ie.D;
            s10.TableA[2] = ie.F;
            s10.TableA[3] = ie.G;

            s10.TableB[0] = ie.C;
            s10.TableB[1] = ie.E;
            s10.TableB[2] = 0;
            s10.TableB[3] = ie.H;

            Struct10Setup(s10);
        }
Пример #4
0
        void McInitStuff(AdLibVoice voice, Struct10 s10, Struct11 s11, byte flags, InstrumentExtra ie)
        {
            var part = voice.Part;
            s11.ModifyVal = 0;
            s11.Flag0x40 = (byte)(flags & 0x40);
            s10.Loop = (byte)(flags & 0x20);
            s11.Flag0x10 = (byte)(flags & 0x10);
            s11.Param = paramTable1[flags & 0xF];
            s10.MaxValue = maxValTable[flags & 0xF];
            s10.Unk3 = 31;
            if (s11.Flag0x40 != 0)
            {
                s10.ModWheel = (sbyte)(part._modWheel >> 2);
            }
            else
            {
                s10.ModWheel = 31;
            }

            switch (s11.Param)
            {
                case 0:
                    s10.StartValue = voice.Vol2;
                    break;
                case 13:
                    s10.StartValue = voice.Vol1;
                    break;
                case 30:
                    s10.StartValue = 31;
                    s11.S10.ModWheel = 0;
                    break;
                case 31:
                    s10.StartValue = 0;
                    s11.S10.Unk3 = 0;
                    break;
                default:
                    s10.StartValue = (short)AdlibGetRegValueParam(voice.Channel, s11.Param);
                    break;
            }

            Struct10Init(s10, ie);
        }
Пример #5
0
 public AdLibInstrument(byte[] data, InstrumentExtra extraA, byte flagsB, InstrumentExtra extraB, byte duration)
 {
     ModCharacteristic = data[0];
     ModScalingOutputLevel = data[1];
     ModAttackDecay = data[2];
     ModSustainRelease = data[3];
     ModWaveformSelect = data[4];
     CarCharacteristic = data[5];
     CarScalingOutputLevel = data[6];
     CarAttackDecay = data[7];
     CarSustainRelease = data[8];
     CarWaveformSelect = data[9];
     Feedback = data[10];
     FlagsA = data[11];
     ExtraA = new InstrumentExtra(extraA);
     FlagsB = flagsB;
     ExtraB = new InstrumentExtra(extraB);
     Duration = duration;
 }