Exemple #1
0
        private BeatEffect ReadBeatEffects(NoteEffect effect)
        {
            /*
             * The first byte is effects flags:
             *
             * - *0x01*: vibrato
             * - *0x02*: wide vibrato
             * - *0x04*: natural harmonic
             * - *0x08*: artificial harmonic
             * - *0x10*: fade in
             * - *0x20*: tremolo bar or slap effect
             * - *0x40*: beat stroke direction
             * - *0x80*: *blank*
             *
             * - Tremolo bar or slap effect: :ref:`byte`. If it's 0 then
             * tremolo bar should be read (see :meth:`readTremoloBar`). Else
             * it's tapping and values of the byte map to:
             *
             * - *1*: tap
             * - *2*: slap
             * - *3*: pop
             *
             * - Beat stroke direction. See :meth:`readBeatStroke`.*/
            var beatEffects = new BeatEffect();
            var flags1      = GpBase.ReadByte()[0];

            effect.Vibrato      = ((flags1 & 0x01) != 0) || effect.Vibrato;
            beatEffects.Vibrato = ((flags1 & 0x02) != 0) || beatEffects.Vibrato;
            beatEffects.FadeIn  = ((flags1 & 0x10) != 0);
            if ((flags1 & 0x20) != 0)
            {
                var flags2 = GpBase.ReadByte()[0];
                beatEffects.SlapEffect = (SlapEffects)flags2;
                if (beatEffects.SlapEffect == SlapEffects.None)
                {
                    beatEffects.TremoloBar = ReadTremoloBar();
                }
                else
                {
                    GpBase.ReadInt();
                }
            }
            if ((flags1 & 0x40) != 0)
            {
                beatEffects.Stroke = ReadBeatStroke();
            }
            if ((flags1 & 0x04) != 0)
            {
                effect.Harmonic = new NaturalHarmonic();
            }
            if ((flags1 & 0x08) != 0)
            {
                effect.Harmonic = new ArtificialHarmonic();
            }

            return(beatEffects);
        }
Exemple #2
0
    public bool isDefault()
    {
        BeatEffect def = new BeatEffect();

        return(stroke == def.stroke && hasRasgueado == def.hasRasgueado &&
               pickStroke == def.pickStroke && fadeIn == def.fadeIn &&
               vibrato == def.vibrato && tremoloBar == def.tremoloBar &&
               slapEffect == def.slapEffect);
    }
Exemple #3
0
    private BeatEffect readBeatEffects(NoteEffect effect)
    {
        /*
         * The first byte is effects flags:
         *
         * - *0x01*: vibrato
         * - *0x02*: wide vibrato
         * - *0x04*: natural harmonic
         * - *0x08*: artificial harmonic
         * - *0x10*: fade in
         * - *0x20*: tremolo bar or slap effect
         * - *0x40*: beat stroke direction
         * - *0x80*: *blank*
         *
         * - Tremolo bar or slap effect: :ref:`byte`. If it's 0 then
         * tremolo bar should be read (see :meth:`readTremoloBar`). Else
         * it's tapping and values of the byte map to:
         *
         * - *1*: tap
         * - *2*: slap
         * - *3*: pop
         *
         * - Beat stroke direction. See :meth:`readBeatStroke`.*/
        var beatEffect = new BeatEffect();
        var flags1     = GPBase.readSignedByte()[0];
        var flags2     = GPBase.readSignedByte()[0];

        //effect.vibrato = ((flags1 & 0x01) != 0) || effect.vibrato;
        beatEffect.vibrato = ((flags1 & 0x02) != 0) || beatEffect.vibrato;
        beatEffect.fadeIn  = ((flags1 & 0x10) != 0);
        if ((flags1 & 0x20) != 0)
        {
            var value = GPBase.readSignedByte()[0];
            beatEffect.slapEffect = (SlapEffect)value;
        }
        if ((flags2 & 0x04) != 0)
        {
            beatEffect.tremoloBar = readTremoloBar();
        }

        if ((flags1 & 0x40) != 0)
        {
            beatEffect.stroke = readBeatStroke();
        }
        if ((flags2 & 0x02) != 0)
        {
            var direction = GPBase.readSignedByte()[0];
            beatEffect.pickStroke = (BeatStrokeDirection)direction;
        }
        return(beatEffect);
    }