Example #1
0
 void SetGlobalPause()
 {
     Native.SetBeatTime(globalBeatTime);
     Native.Pause(pause_);
     lastSampledTime = AudioSettings.dspTime;
     globalPause     = pause_;
 }
Example #2
0
        public void StartScheduled(double timeToStart)
        {
            lastSampledTime = AudioSettings.dspTime;
            double deltaTime = timeToStart - lastSampledTime;

            globalBeatTime = -deltaTime * globalBpm / SECONDS_PER_MIN;
            Native.SetBeatTime(globalBeatTime);
        }
Example #3
0
        void FixedUpdate()
        {
            double time      = AudioSettings.dspTime;
            double deltaTime = time - lastSampledTime;

            lastSampledTime = time;

            globalBeatTime += deltaTime * globalBpm / SECONDS_PER_MIN;
            Native.SetBeatTime(globalBeatTime);
        }
Example #4
0
        /// <summary>
        /// Resets time and all sequencers from the beginning.
        /// </summary>
        public void Reset()
        {
            globalBeatTime = -waitToSync;
            Native.SetBeatTime(globalBeatTime);
            lastSampledTime = AudioSettings.dspTime;

            if (OnReset != null)
            {
                OnReset();
            }
        }