예제 #1
0
        public override void ReadFromString(ref string[] nodeParams)
        {
            base.ReadFromString(ref nodeParams);

            if (UIUtils.CurrentShaderVersion() > 15305)
            {
                m_fresnelType      = (FresnelType)Enum.Parse(typeof(FresnelType), GetCurrentParam(ref nodeParams));
                m_normalType       = (NormalType)Enum.Parse(typeof(NormalType), GetCurrentParam(ref nodeParams));
                m_viewType         = (ViewType)Enum.Parse(typeof(ViewType), GetCurrentParam(ref nodeParams));
                m_normalizeVectors = Convert.ToBoolean(GetCurrentParam(ref nodeParams));
            }
            else
            {
                if (UIUtils.CurrentShaderVersion() >= 13202)
                {
                    m_normalSpace = (ViewSpace)Enum.Parse(typeof(ViewSpace), GetCurrentParam(ref nodeParams));
                }
                else
                {
                    m_normalSpace = ViewSpace.World;
                }

                if (m_normalSpace == ViewSpace.World)
                {
                    m_normalType = NormalType.WorldNormal;
                }
                else
                {
                    m_normalType = NormalType.TangentNormal;
                }
            }
            UpdatePort();
        }
예제 #2
0
    public static void main(string[] args)
    {
        // Create our combatants:
        ElementalType cerberus = new FireType();
        ElementalType hydra    = new WaterType();
        ElementalType heracles = new NormalType();

        // persephone attacks poseidon:
        float multiplier = cerberus.Attack(hydra);

        Console.WriteLine("Persephone attacks Poseidon and deals " + multiplier + " x damage!");

        // poseidon attacks back:
        multiplier = hydra.Attack(cerberus);
        Console.WriteLine("Poseidon attacks back and deals " + multiplier + " x damage!");

        // Heracles attacks Poseidon:
        multiplier = heracles.Attack(hydra);
        Console.WriteLine("Heracles attacks Poseidon and deals " + multiplier + " x damage!");

        // Persephone attacks Heracles:
        multiplier = cerberus.Attack(heracles);
        Console.WriteLine("Persephone attacks Heracles and deals " + multiplier + " x damage!");

        Console.WriteLine("The battle has ended!");
    }
예제 #3
0
        public override void DrawProperties()
        {
            base.DrawProperties();

            EditorGUI.BeginChangeCheck();
            m_fresnelType = (FresnelType)EditorGUILayoutEnumPopup("Type", m_fresnelType);
            m_normalType  = (NormalType)EditorGUILayoutEnumPopup("Normal Vector", m_normalType);
            m_viewType    = (ViewType)EditorGUILayoutEnumPopup("View Vector", m_viewType);
            if (EditorGUI.EndChangeCheck())
            {
                UpdatePort();
            }

            if (!m_biasPort.IsConnected && m_biasPort.Visible)
            {
                m_biasPort.FloatInternalData = EditorGUILayoutFloatField(m_biasPort.Name, m_biasPort.FloatInternalData);
            }
            if (!m_scalePort.IsConnected && m_scalePort.Visible)
            {
                m_scalePort.FloatInternalData = EditorGUILayoutFloatField(m_scalePort.Name, m_scalePort.FloatInternalData);
            }
            if (!m_powerPort.IsConnected && m_powerPort.Visible)
            {
                m_powerPort.FloatInternalData = EditorGUILayoutFloatField(m_powerPort.Name, m_powerPort.FloatInternalData);
            }

            m_normalizeVectors = EditorGUILayoutToggle("Normalize Vectors", m_normalizeVectors);
        }
예제 #4
0
 public MessageMidiEvent(long tick, byte midiChannel, NormalType type, byte par1, byte par2)
     : base(tick)
 {
     this.midiChannel = midiChannel;
     this.type        = type;
     this.parameter1  = par1;
     this.parameter2  = par2;
 }
예제 #5
0
 public MidiMessage(long absTicks, byte _midiChannel, byte par1, byte par2, NormalType _type)
 {
     AbsoluteTicks     = absTicks;
     this._midiChannel = _midiChannel;
     _parameter1       = par1;
     _parameter2       = par2;
     this._type        = _type;
 }
예제 #6
0
파일: NodeBase.cs 프로젝트: wachel/block
 public override void OnGUI(EditorGuiBase gui)
 {
     label      = gui.textField("name", label);
     scale      = gui.silder("scale", scale, 0f, 10f);
     bias       = gui.silder("bias", bias, -5f, 5f);
     normalType = (NormalType)gui.enumPopup("normal type", normalType);
     height     = gui.floatField("height", height);
 }
예제 #7
0
        public ConstantNormal( NormalType Type, Vector Vector )
            : base(Type)
        {
            if ( Vector.Length() == 0.0f )
            {
                throw new ArgumentException( "Vector.Length() == 0.0f" );
            }

            this.Vector = Vector;
        }
예제 #8
0
        public void TestConvertTypeToTypeLink()
        {
            string type     = "System.Collections.Generic.Dictionary<System.Int32[], System.Collections.Generic.List<System.String>>";
            string ourType  = "Vsxmd.Units.TestType";
            var    norm     = NormalType.CreateNormalType(type);
            var    subTypes = norm.SubTypes.ToList();

            Assert.AreEqual(subTypes.Count, 2);
            Assert.AreEqual(norm.DisplayTypeName, "Dictionary");
            Assert.AreEqual(norm.ShortTypeName, "Dictionary-2");
            var subSub = subTypes.Last();

            Assert.AreEqual(subSub.SubTypes.Count(), 1);

            MemberName name = new MemberName("T:Vsxmd.Units.AssemblyUnit");

            Assert.AreEqual(norm.GetLink(name), "https://docs.microsoft.com/dotnet/api/System.Collections.Generic.Dictionary-2");
            var ourNorm = NormalType.CreateNormalType(ourType);

            Assert.AreEqual(ourNorm.GetLink(name), "./../TestType/TestType.md");
            //Assert.AreEqual(norm.ToMarkdownLink(name), "[Dictionary](https://docs.microsoft.com/dotnet/api/System.Collections.Generic.Dictionary-2)<[Int32[]](https://docs.microsoft.com/dotnet/api/System.Int32), [List](https://docs.microsoft.com/dotnet/api/System.Collections.Generic.List-1)<[String](https://docs.microsoft.com/dotnet/api/System.String)>>");

            string ret = norm.ToString("Ns.Tn --- Ns.Tn-Gc<Rs{, }>Am");
        }
예제 #9
0
        private static void loadDirectly(Stream midiStream, List <MidiTrack> midiTracks, ref ushort timeDivision)              // returns the MIDI loaded in the List of all individual tracks
        {
            BinaryReader midiBinaryStream = new BinaryReader(midiStream);

            midiStream.Position = 0xA;      // seek to the amount of tracks in MIDI data
            int numTracks = midiBinaryStream.ReadByte() << 8 | midiBinaryStream.ReadByte();

            timeDivision = (ushort)(midiBinaryStream.ReadByte() << 8 | midiBinaryStream.ReadByte());
            // finished reading the header data, now continue transscribing the tracks

            for (int currentTrack = 0; currentTrack < numTracks; currentTrack++)
            {
                MidiTrack cTrk = new MidiTrack();
                midiTracks.Add(cTrk);     // we have to create the object of the track first and we can add it later to out track list if the track was transscribed into it's objects
                long       currentTick     = 0;
                NormalType lastEventType   = NormalType.NoteOFF;
                byte       lastMidiChannel = 0;
                // check if the track doesn't begin like expected with an MTrk string
                byte[] textString = new byte[4];
                midiBinaryStream.Read(textString, 0, 4);
                if (Encoding.ASCII.GetString(textString, 0, 4) != "MTrk")
                {
                    throw new Exception("Track doesn't start with MTrk string!");
                }
                byte[] intArray = new byte[4];
                midiBinaryStream.Read(intArray, 0, 4);    // read the track length
                // this value isn't even needed, so we don't do further processing with it; I left it in the code for some usage in the future; no specific plan???

                // now do the event loop and load all the events
                #region EventLoop
                while (true)
                {
                    // first thing that is done is getting the next delta length value and add the value to the current position to calculate the absolute position of the event
                    currentTick += readVariableLengthValue(midiBinaryStream);

                    // now check what event type is used and disassemble it

                    byte eventTypeByte = midiBinaryStream.ReadByte();

                    // do a jumptable for each event type

                    if (eventTypeByte == 0xFF)      // if META Event
                    {
                        byte   metaType   = (byte)midiStream.ReadByte();
                        long   metaLength = readVariableLengthValue(midiBinaryStream);
                        byte[] metaData   = new byte[metaLength];
                        midiBinaryStream.Read(metaData, 0, (int)metaLength);

                        if (metaType == 0x2F)
                        {
                            break;        // if end of track is reached, break out of the loop, End of Track Events aren't written into the objects
                        }
                        cTrk.midiEvents.Add(new MetaMidiEvent(currentTick, metaType, metaData));
                    }
                    else if (eventTypeByte == 0xF0 || eventTypeByte == 0xF7)        // if SysEx Event
                    {
                        long   sysexLength = readVariableLengthValue(midiBinaryStream);
                        byte[] sysexData   = new byte[sysexLength];
                        midiBinaryStream.Read(sysexData, 0, (int)sysexLength);
                        cTrk.midiEvents.Add(new SysExMidiEvent(currentTick, eventTypeByte, sysexData));
                    }
                    else if (eventTypeByte >> 4 == 0x8)     // if Note OFF command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = midiBinaryStream.ReadByte();
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteOFF, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.NoteOFF;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0x9)     // if Note ON command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = midiBinaryStream.ReadByte();
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteON, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.NoteON;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0xA)     // if Aftertouch command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = midiBinaryStream.ReadByte();
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteAftertouch, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.NoteAftertouch;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0xB)     // if MIDI controller command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = midiBinaryStream.ReadByte();
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.Controller, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.Controller;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0xC)     // if Preset command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = 0x0;    // unused
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.Program, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.Program;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0xD)     // if Channel Aftertouch command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = 0x0;    // unused
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.ChannelAftertouch, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.ChannelAftertouch;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 == 0xE)     // if Pitch Bend command
                    {
                        byte par1 = midiBinaryStream.ReadByte();
                        byte par2 = midiBinaryStream.ReadByte();
                        cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.PitchBend, par1, par2));
                        // save the last event type and channel
                        lastEventType   = NormalType.PitchBend;
                        lastMidiChannel = (byte)(eventTypeByte & 0xF);
                    }
                    else if (eventTypeByte >> 4 < 0x8)
                    {
                        byte par1 = eventTypeByte;
                        byte par2;
                        switch (lastEventType)
                        {
                        case NormalType.NoteOFF:
                            par2 = midiBinaryStream.ReadByte();
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteOFF, par1, par2));
                            break;

                        case NormalType.NoteON:
                            par2 = midiBinaryStream.ReadByte();
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteON, par1, par2));
                            break;

                        case NormalType.NoteAftertouch:
                            par2 = midiBinaryStream.ReadByte();
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteAftertouch, par1, par2));
                            break;

                        case NormalType.Controller:
                            par2 = midiBinaryStream.ReadByte();
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.Controller, par1, par2));
                            break;

                        case NormalType.Program:
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.Program, par1, 0x0));
                            break;

                        case NormalType.ChannelAftertouch:
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.ChannelAftertouch, par1, 0x0));
                            break;

                        case NormalType.PitchBend:
                            par2 = midiBinaryStream.ReadByte();
                            cTrk.midiEvents.Add(new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.PitchBend, par1, par2));
                            break;
                        }
                    }
                    else
                    {
                        throw new Exception("Bad MIDI event at 0x" + midiBinaryStream.BaseStream.Position.ToString("X8") + ": 0x" + eventTypeByte.ToString("X2"));
                    }
                }                                                                                                           // end of the event transscribing loop
                #endregion
            }                                                                                                               // end of the track loop
        }                                                                                                                   // end of function loadDirectly
예제 #10
0
        //ToDo : Correct
        internal BaseMember GetBase(BaseMember member)
        {
            //Get a list of all members of this type
            TypeMember    typeMem = _Members.OfType <TypeMember>().FirstOrDefault(x => x.TypeName == member.TypeName);
            List <string> bases   = typeMem.Implements;

            bases.Add(typeMem.Base);
            IEnumerable <BaseMember> potentials = _Members.Where(x => bases.Any(y => x.ID.TypeName == NormalType.CreateNormalType(y).FileName &&
                                                                                x.ID.FriendlyName == NormalType.CreateNormalType(y).FileName));

            //If can't find any members of same type with same defintion (method, prop, field etc.), return null and allow calling member to handle.
            if (potentials.Count() == 0)
            {
                return(null);
            }

            // To do : resolve this for multi returns.
            return(potentials.First());
        }
예제 #11
0
 public NormalTimerRecorder(NormalType normalType)
 {
     this.workState  = WorkState.Normal;
     this.normalType = normalType;
 }
예제 #12
0
        }                                                                                                                 // end of function loadDirectly

        private static void loadAndConvertTypeZero(string filePath, List <MidiTrack> midiTracks, ref ushort timeDivision) // returns the MIDI loaded in the List of all individual MIDI channels split up into 16 tracks
        {
            // FileStreams seem to have their own buffering layer so there is no need for an additional Buffered Stream
            FileStream   midiFileStream   = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
            BinaryReader midiBinaryStream = new BinaryReader(midiFileStream);

            midiFileStream.Position = 0xC;      // seek to the amount of tracks in the MIDI file
            timeDivision            = (ushort)(midiBinaryStream.ReadByte() << 8 | midiBinaryStream.ReadByte());
            // finished reading the header data, now continue transscribing the single track to multiple ones, depending on the channel

            for (int i = 0; i < 16; i++)
            {
                midiTracks.Add(new MidiTrack());     // we have to create tracks for each MIDI channel (i.e. 16)
            }
            long currentTick = 0;

            NormalType lastEventType   = NormalType.NoteOFF;
            byte       lastMidiChannel = 0;

            // check if the track doesn't begin like expected with an MTrk string
            byte[] textString = new byte[4];
            midiBinaryStream.Read(textString, 0, 4);
            if (Encoding.ASCII.GetString(textString, 0, 4) != "MTrk")
            {
                throw new Exception("Track doesn't start with MTrk string!");
            }
            byte[] intArray = new byte[4];
            midiBinaryStream.Read(intArray, 0, 4);    // read the track length
            // this value isn't even needed, so we don't do further processing with it; I left it in the code for some usage in the future; no specific plan???

            // now do the event loop and load all the events and remap the channels
            #region EventLoop
            while (true)
            {
                // first thing that is done is getting the next delta length value and add the value to the current position to calculate the absolute position of the event
                currentTick += readVariableLengthValue(midiBinaryStream);

                // now check what event type is used and disassemble it
                byte eventTypeByte = midiBinaryStream.ReadByte();

                // do a jumptable for each event type
                if (eventTypeByte == 0xFF)      // if META Event
                {
                    byte   metaType   = (byte)midiFileStream.ReadByte();
                    long   metaLength = readVariableLengthValue(midiBinaryStream);
                    byte[] metaData   = new byte[metaLength];
                    midiBinaryStream.Read(metaData, 0, (int)metaLength);

                    if (metaType == 0x2F)
                    {
                        break;        // End of track events aren't loaded into the objects
                    }
                    midiTracks[0].midiEvents.Add(
                        new MetaMidiEvent(currentTick, metaType, metaData));
                }
                else if (eventTypeByte == 0xF0 || eventTypeByte == 0xF7)        // if SysEx Event
                {
                    long   sysexLength = readVariableLengthValue(midiBinaryStream);
                    byte[] sysexData   = new byte[sysexLength];
                    midiBinaryStream.Read(sysexData, 0, (int)sysexLength);
                    midiTracks[0].midiEvents.Add(
                        new SysExMidiEvent(currentTick, eventTypeByte, sysexData));
                }
                else if (eventTypeByte >> 4 == 0x8)     // if Note OFF command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = midiBinaryStream.ReadByte();
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteOFF, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.NoteOFF;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0x9)     // if Note ON command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = midiBinaryStream.ReadByte();
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteON, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.NoteON;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0xA)     // if Aftertouch command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = midiBinaryStream.ReadByte();
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.NoteAftertouch, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.NoteAftertouch;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0xB)     // if MIDI controller command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = midiBinaryStream.ReadByte();
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.Controller, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.Controller;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0xC)     // if Preset command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = 0x0;
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.Program, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.Program;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0xD)     // if Channel Aftertouch command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = 0x0;
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.ChannelAftertouch, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.ChannelAftertouch;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 == 0xE)     // if Pitch Bend command
                {
                    byte par1 = midiBinaryStream.ReadByte();
                    byte par2 = midiBinaryStream.ReadByte();
                    midiTracks[eventTypeByte & 0xF].midiEvents.Add(
                        new MessageMidiEvent(currentTick, (byte)(eventTypeByte & 0xF), NormalType.PitchBend, par1, par2));
                    // now backup channel and Normal Type for truncated commands
                    lastEventType   = NormalType.PitchBend;
                    lastMidiChannel = (byte)(eventTypeByte & 0xF);
                }
                else if (eventTypeByte >> 4 < 0x8)
                {
                    byte par1 = eventTypeByte;
                    byte par2;
                    switch (lastEventType)
                    {
                    case NormalType.NoteOFF:
                        par2 = midiBinaryStream.ReadByte();
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteOFF, par1, par2));
                        break;

                    case NormalType.NoteON:
                        par2 = midiBinaryStream.ReadByte();
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteON, par1, par2));
                        break;

                    case NormalType.NoteAftertouch:
                        par2 = midiBinaryStream.ReadByte();
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.NoteAftertouch, par1, par2));
                        break;

                    case NormalType.Controller:
                        par2 = midiBinaryStream.ReadByte();
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.Controller, par1, par2));
                        break;

                    case NormalType.Program:
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.Program, par1, 0x0));
                        break;

                    case NormalType.ChannelAftertouch:
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.ChannelAftertouch, par1, 0x0));
                        break;

                    case NormalType.PitchBend:
                        par2 = midiBinaryStream.ReadByte();
                        midiTracks[lastMidiChannel].midiEvents.Add(
                            new MessageMidiEvent(currentTick, lastMidiChannel, NormalType.PitchBend, par1, par2));
                        break;
                    }
                }
                else
                {
                    throw new Exception("Bad MIDI event at 0x" + midiBinaryStream.BaseStream.Position.ToString("X8") + ": 0x" + eventTypeByte.ToString("X2"));
                }
            }
            #endregion
            midiFileStream.Close();
        }
예제 #13
0
 public override float GetAttackMultiplier(NormalType attackType)
 {
     // A normal move against water is effective:
     return(this.EFFECTIVE);
 }
예제 #14
0
 public virtual float GetAttackMultiplier(NormalType attackType)
 {
     return(1.0f);
 }