コード例 #1
0
ファイル: AudioHelmClock.cs プロジェクト: msp/virtual-gallery
 void SetGlobalPause()
 {
     Native.SetBeatTime(globalBeatTime);
     Native.Pause(pause_);
     lastSampledTime = AudioSettings.dspTime;
     globalPause     = pause_;
 }
コード例 #2
0
        public void StartScheduled(double timeToStart)
        {
            lastSampledTime = AudioSettings.dspTime;
            double deltaTime = timeToStart - lastSampledTime;

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

            lastSampledTime = time;

            globalBeatTime += deltaTime * globalBpm / SECONDS_PER_MIN;
            Native.SetBeatTime(globalBeatTime);
        }
コード例 #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();
            }
        }