示例#1
0
 private void ReadMixTableChangeDurations(MixTableChange tableChange)
 {
     if (tableChange.Volume != null)
     {
         tableChange.Volume.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Balance != null)
     {
         tableChange.Balance.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Chorus != null)
     {
         tableChange.Chorus.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Reverb != null)
     {
         tableChange.Reverb.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Phaser != null)
     {
         tableChange.Phaser.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Tremolo != null)
     {
         tableChange.Tremolo.Duration = GpBase.ReadSignedByte()[0];
     }
     if (tableChange.Tempo != null)
     {
         tableChange.Tempo.Duration = GpBase.ReadSignedByte()[0];
         tableChange.HideTempo      = false;
     }
 }
示例#2
0
 private void readMixTableChangeDurations(MixTableChange tableChange)
 {
     if (tableChange.volume != null)
     {
         tableChange.volume.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.balance != null)
     {
         tableChange.balance.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.chorus != null)
     {
         tableChange.chorus.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.reverb != null)
     {
         tableChange.reverb.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.phaser != null)
     {
         tableChange.phaser.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.tremolo != null)
     {
         tableChange.tremolo.duration = GPBase.readSignedByte()[0];
     }
     if (tableChange.tempo != null)
     {
         tableChange.tempo.duration = GPBase.readSignedByte()[0];
         tableChange.hideTempo      = false;
     }
 }
示例#3
0
        private MixTableChange ReadMixTableChange(Measure measure)
        {
            var tableChange = new MixTableChange();

            ReadMixTableChangeValues(tableChange, measure);
            ReadMixTableChangeDurations(tableChange);
            return(tableChange);
        }
        protected MixTableChange ReadMixTableChange()
        {
            MixTableChange mtc        = new MixTableChange();
            byte           instrument = ReadByte(); //instrument

            Skip(16);
            int    volume     = (SByte)ReadByte();
            int    pan        = (SByte)ReadByte();
            int    chorus     = (SByte)ReadByte();
            int    reverb     = (SByte)ReadByte();
            int    phaser     = (SByte)ReadByte();
            int    tremolo    = (SByte)ReadByte();
            string tempoName  = ReadHeaderEntry(); //tempoName
            int    tempoValue = ReadInt();

            if (volume >= 0)
            {
                ReadByte();
            }
            if (pan >= 0)
            {
                ReadByte();
            }
            if (chorus >= 0)
            {
                ReadByte();
            }
            if (reverb >= 0)
            {
                ReadByte();
            }
            if (phaser >= 0)
            {
                ReadByte();
            }
            if (tremolo >= 0)
            {
                ReadByte();
            }
            if (tempoValue >= 0)
            {
                Skip(1);
                if (Version.Minor != "00")
                {
                    Skip(1);
                }
            }
            ReadByte();
            Skip(1);
            if (Version.Minor != "00")
            {
                ReadHeaderEntry();
                ReadHeaderEntry();
            }

            return(new MixTableChange());
        }
示例#5
0
 public BeatEffect()
 {
     FadeIn         = false;
     FadeOut        = false;
     VolumeSwell    = false;
     PickStroke     = BeatStrokeDirections.None;
     HasStrummed    = false;
     Stroke         = null;
     SlapEffect     = SlapEffects.None;
     Vibrato        = false;
     Chord          = null;
     TremoloBar     = null;
     MixTableChange = null;
 }
示例#6
0
        private void ReadMixTableChangeValues(MixTableChange tableChange, Measure measure)
        {
            var instrument = GpBase.ReadSignedByte()[0];
            var volume     = GpBase.ReadSignedByte()[0];
            var balance    = GpBase.ReadSignedByte()[0];
            var chorus     = GpBase.ReadSignedByte()[0];
            var reverb     = GpBase.ReadSignedByte()[0];
            var phaser     = GpBase.ReadSignedByte()[0];
            var tremolo    = GpBase.ReadSignedByte()[0];
            var tempo      = GpBase.ReadInt()[0];

            if (instrument >= 0)
            {
                tableChange.Instrument = new MixTableItem(instrument);
            }
            if (volume >= 0)
            {
                tableChange.Volume = new MixTableItem(volume);
            }
            if (balance >= 0)
            {
                tableChange.Balance = new MixTableItem(balance);
            }
            if (chorus >= 0)
            {
                tableChange.Chorus = new MixTableItem(chorus);
            }
            if (reverb >= 0)
            {
                tableChange.Reverb = new MixTableItem(reverb);
            }
            if (phaser >= 0)
            {
                tableChange.Phaser = new MixTableItem(phaser);
            }
            if (tremolo >= 0)
            {
                tableChange.Tremolo = new MixTableItem(tremolo);
            }
            if (tempo >= 0)
            {
                tableChange.Tempo   = new MixTableItem(tempo);
                measure.Tempo.Value = tempo;
            }
        }
示例#7
0
    private void readMixTableChangeValues(MixTableChange tableChange, Measure measure)
    {
        var instrument = GPBase.readSignedByte()[0];
        var volume     = GPBase.readSignedByte()[0];
        var balance    = GPBase.readSignedByte()[0];
        var chorus     = GPBase.readSignedByte()[0];
        var reverb     = GPBase.readSignedByte()[0];
        var phaser     = GPBase.readSignedByte()[0];
        var tremolo    = GPBase.readSignedByte()[0];
        var tempo      = GPBase.readInt()[0];

        if (instrument >= 0)
        {
            tableChange.instrument = new MixTableItem(instrument);
        }
        if (volume >= 0)
        {
            tableChange.volume = new MixTableItem(volume);
        }
        if (balance >= 0)
        {
            tableChange.balance = new MixTableItem(balance);
        }
        if (chorus >= 0)
        {
            tableChange.chorus = new MixTableItem(chorus);
        }
        if (reverb >= 0)
        {
            tableChange.reverb = new MixTableItem(reverb);
        }
        if (phaser >= 0)
        {
            tableChange.phaser = new MixTableItem(phaser);
        }
        if (tremolo >= 0)
        {
            tableChange.tremolo = new MixTableItem(tremolo);
        }
        if (tempo >= 0)
        {
            tableChange.tempo = new MixTableItem(tempo);
            measure.tempo().value = tempo;
        }
    }
        protected MixTableChange ReadMixTableChange()
        {
            MixTableChange mtc = new MixTableChange();

            ReadByte(); //instrument
            int volume     = (SByte)ReadByte();
            int pan        = (SByte)ReadByte();
            int chorus     = (SByte)ReadByte();
            int reverb     = (SByte)ReadByte();
            int phaser     = (SByte)ReadByte();
            int tremolo    = (SByte)ReadByte();
            int tempoValue = ReadInt();

            if (volume >= 0)
            {
                ReadByte();
            }
            if (pan >= 0)
            {
                ReadByte();
            }
            if (chorus >= 0)
            {
                ReadByte();
            }
            if (reverb >= 0)
            {
                ReadByte();
            }
            if (phaser >= 0)
            {
                ReadByte();
            }
            if (tremolo >= 0)
            {
                ReadByte();
            }
            if (tempoValue >= 0)
            {
                //mtc.Tempo.NewValue = tempoValue;
                ReadByte();
            }

            return(mtc);
        }
示例#9
0
        private void ReadMixTableChangeFlags(MixTableChange tableChange)
        {
            /* The meaning of flags:
             *
             * - *0x01*: change volume for all tracks
             * - *0x02*: change balance for all tracks
             * - *0x04*: change chorus for all tracks
             * - *0x08*: change reverb for all tracks
             * - *0x10*: change phaser for all tracks
             * - *0x20*: change tremolo for all tracks*/

            var flags = GpBase.ReadSignedByte()[0];

            if (tableChange.Volume != null)
            {
                tableChange.Volume.AllTracks = ((flags & 0x01) != 0);
            }
            if (tableChange.Balance != null)
            {
                tableChange.Balance.AllTracks = ((flags & 0x02) != 0);
            }
            if (tableChange.Chorus != null)
            {
                tableChange.Chorus.AllTracks = ((flags & 0x04) != 0);
            }
            if (tableChange.Reverb != null)
            {
                tableChange.Reverb.AllTracks = ((flags & 0x08) != 0);
            }
            if (tableChange.Phaser != null)
            {
                tableChange.Phaser.AllTracks = ((flags & 0x10) != 0);
            }
            if (tableChange.Tremolo != null)
            {
                tableChange.Tremolo.AllTracks = ((flags & 0x20) != 0);
            }
        }
        protected MixTableChange ReadMixTableChange()
        {
            int[] pos = new int[8];
            int   i;
            int   n;
            int   aux;

            MixTableChange mtc = new MixTableChange();

            // For easier processing, creates an array
            MixTableElement[] elements = new MixTableElement[8];

            for (i = 0; i < 8; i++)
            {
                elements[i] = new MixTableElement();
            }

            n = 0;
            for (i = 0; i < 7; i++)
            {
                aux = ReadByte();
                if ((i != 0) && (aux != 255))
                {
                    pos[n] = i;
                    n++;
                }
                elements[i].NewValue = aux;
            }
            // The tempo field is different (needs an integer)
            aux = ReadInt();
            if (aux != -1)
            {
                pos[n] = i;
                n++;
            }

            elements[7].NewValue = aux;

            // Skip the instrument field

            for (i = 0; i < n; i++)
            {
                aux = ReadByte();
                if (elements[pos[i]].NewValue != 255)
                {
                    elements[pos[i]].ChangeDuration = aux;
                }
            }

            int applyToAllTracks = ReadByte();

            // The instrument and the tempo are not affected
            for (i = 0; i < 6; i++)
            {
                if ((applyToAllTracks & (1 << i)) != 0)
                {
                    elements[i + 1].ApplyToAllTracks = true;
                }
            }
            // The tempo always applies to all the tracks.
            elements[7].ApplyToAllTracks = true;

            // Sets all the values
            mtc.Instrument = elements[0];
            mtc.Volume     = elements[1];
            mtc.Balance    = elements[2];
            mtc.Chorus     = elements[3];
            mtc.Reverb     = elements[4];
            mtc.Phaser     = elements[5];
            mtc.Tremolo    = elements[6];
            mtc.Tempo      = elements[7];

            return(mtc);
        }
        protected MixTableChange ReadMixTableChange()
        {
            int[] pos = new int[8];
            int i;
            int n;
            int aux;

            MixTableChange mtc = new MixTableChange();

            // For easier processing, creates an array
            MixTableElement[] elements = new MixTableElement[8];

            for (i = 0; i < 8; i++)
                elements[i] = new MixTableElement();

            n = 0;
            for (i = 0; i < 7; i++)
            {
                aux = ReadByte();
                if ((i != 0) && (aux != 255))
                {
                    pos[n] = i;
                    n++;
                }
                elements[i].NewValue = aux;
            }
            // The tempo field is different (needs an integer)
            aux = ReadInt();
            if (aux != -1)
            {
                pos[n] = i;
                n++;
            }

            elements[7].NewValue = aux;

            // Skip the instrument field

            for (i = 0; i < n; i++)
            {
                aux = ReadByte();
                if (elements[pos[i]].NewValue != 255)
                {
                    elements[pos[i]].ChangeDuration = aux;
                }
            }

            int applyToAllTracks = ReadByte();

            // The instrument and the tempo are not affected
            for (i = 0; i < 6; i++)
            {
                if ((applyToAllTracks & (1 << i)) != 0)
                {
                    elements[i + 1].ApplyToAllTracks = true;
                }
            }
            // The tempo always applies to all the tracks.
            elements[7].ApplyToAllTracks = true;

            // Sets all the values
            mtc.Instrument = elements[0];
            mtc.Volume = elements[1];
            mtc.Balance = elements[2];
            mtc.Chorus = elements[3];
            mtc.Reverb = elements[4];
            mtc.Phaser = elements[5];
            mtc.Tremolo = elements[6];
            mtc.Tempo = elements[7];

            return mtc;
        }
        protected MixTableChange ReadMixTableChange()
        {
            MixTableChange mtc = new MixTableChange();

            ReadByte(); //instrument
            int volume = (SByte)ReadByte();
            int pan = (SByte)ReadByte();
            int chorus = (SByte)ReadByte();
            int reverb = (SByte)ReadByte();
            int phaser = (SByte)ReadByte();
            int tremolo = (SByte)ReadByte();
            int tempoValue = ReadInt();
            if (volume >= 0)
            {
                ReadByte();
            }
            if (pan >= 0)
            {
                ReadByte();
            }
            if (chorus >= 0)
            {
                ReadByte();
            }
            if (reverb >= 0)
            {
                ReadByte();
            }
            if (phaser >= 0)
            {
                ReadByte();
            }
            if (tremolo >= 0)
            {
                ReadByte();
            }
            if (tempoValue >= 0)
            {
                //mtc.Tempo.NewValue = tempoValue;
                ReadByte();
            }

            return mtc;
        }
        protected MixTableChange ReadMixTableChange()
        {
            MixTableChange mtc = new MixTableChange();
            byte instrument = ReadByte(); //instrument

            Skip(16);
            int volume = (SByte)ReadByte();
            int pan = (SByte)ReadByte();
            int chorus = (SByte)ReadByte();
            int reverb = (SByte)ReadByte();
            int phaser = (SByte)ReadByte();
            int tremolo = (SByte)ReadByte();
            string tempoName = ReadHeaderEntry(); //tempoName
            int tempoValue = ReadInt();
            if (volume >= 0)
            {
                ReadByte();
            }
            if (pan >= 0)
            {
                ReadByte();
            }
            if (chorus >= 0)
            {
                ReadByte();
            }
            if (reverb >= 0)
            {
                ReadByte();
            }
            if (phaser >= 0)
            {
                ReadByte();
            }
            if (tremolo >= 0)
            {
                ReadByte();
            }
            if (tempoValue >= 0)
            {
                Skip(1);
                if (Version.Minor != "00")
                    Skip(1);
            }
            ReadByte();
            Skip(1);
            if (Version.Minor != "00")
            {
                ReadHeaderEntry();
                ReadHeaderEntry();
            }

            return new MixTableChange();
        }