public static void setDifficulty(Mode newMode)
    {
        currentMode = newMode;

        //Rebuild instrument map after changing difficulty
        DrumKit.buildIntstrumentMap();
    }
        /// <summary>
        ///
        /// </summary>
        /// <param name="drumkits"></param>
        private void ReadDrumKitBanks(int drumkits)
        {
            //IMPR  Debug.Assert(drumkits <= TrinityDrumKitBank.DrumKitsPerBankIntConstant);

            if (drumkits > 0)
            {
                int startIndex = _index;
                _index += 2;

                IDrumKitBank bank = (IDrumKitBank)CurrentPcgMemory.DrumKitBanks[0];
                bank.ByteOffset = startIndex;
                bank.ByteLength = DrumKitSize;
                bank.IsWritable = true;
                bank.IsLoaded   = true;

                for (int index = 0; index < drumkits; index++)
                {
                    // Place in PcgMemory.
                    DrumKit drumKit = (DrumKit)bank[index];
                    drumKit.ByteOffset = _index;
                    drumKit.ByteLength = bank.ByteLength;
                    drumKit.IsLoaded   = true;

                    _index += bank.ByteLength;
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="offset"></param>
        private void ReadSingleDrumKit(int offset)
        {
            DrumKitBank bank = (DrumKitBank)(CurrentPcgMemory.DrumKitBanks[_bank]);

            bank.ByteOffset = 0;
            bank.PatchSize  = 0x2218;
            bank.IsWritable = true;
            bank.IsLoaded   = true;

            DrumKit drumKit = (DrumKit)bank[_patchIndex];

            drumKit.ByteOffset = offset;
            drumKit.ByteLength = bank.PatchSize;
            drumKit.IsLoaded   = true;

            IncreaseDrumKit();
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        private void ReadDbk1Chunk()
        {
            int chunkSize = Util.GetInt(CurrentPcgMemory.Content, Index + 4, 4);

            CurrentPcgMemory.Chunks.Collection.Add(new Chunk("DBK1", Index, chunkSize));

            int startIndex = Index;

            Index += Dbk1NumberOfDrumKitsOffset;
            int numberOfDrumKitsInBank = Util.GetInt(CurrentPcgMemory.Content, Index, 4);

            Index += 4;
            int sizeOfADrumKit = Util.GetInt(CurrentPcgMemory.Content, Index, 4);

// ReSharper disable RedundantStringFormatCall
            Console.WriteLine($" Size of a drumkit: {sizeOfADrumKit}");
// ReSharper restore RedundantStringFormatCall
            Index += 4;
            int bankId    = Util.GetInt(CurrentPcgMemory.Content, Index, 4);
            int bankIndex = DrumKitBankId2DrumKitIndex(bankId);

            Index += 4;

            DrumKitBank drumKitBank = (DrumKitBank)CurrentPcgMemory.DrumKitBanks[bankIndex];

            drumKitBank.ByteOffset = startIndex;
            drumKitBank.PatchSize  = sizeOfADrumKit;
            drumKitBank.IsWritable = true;
            drumKitBank.IsLoaded   = true;

            for (int index = 0; index < numberOfDrumKitsInBank; index++)
            {
                // Place in PcgMemory.
                DrumKit drumKit = (DrumKit)drumKitBank[index];
                drumKit.ByteOffset = Index;
                drumKit.ByteLength = sizeOfADrumKit;
                drumKit.IsLoaded   = true;

                Index += sizeOfADrumKit;
            }
        }
Esempio n. 5
0
 public OnHitEventArgs(DrumKit.Instrument hitInstrument, float hitTime)
 {
     HitInstrument = hitInstrument;
     HitTime = hitTime;
 }
Esempio n. 6
0
 public TrackRow(float timeInMs, DrumKit.Instrument instrument)
 {
     this.TimeInMs = timeInMs;
     this.Instrument = instrument;
 }
Esempio n. 7
0
 public static void recordBeat(DrumKit.Instrument instrument)
 {
     float timeSinceStart = (Time.time - recordingStartTime) * 1000; //Calculate time since start, in MS
     TrackRow trackRow = new TrackRow (timeSinceStart, instrument);
     CurrentTrack.addTrackRow(trackRow);
 }