コード例 #1
0
        public static PlayPositionSpecifier getPlayPosition()
        {
            var clock   = getCurrentClock();
            var timesig = mVsq.TimesigTable.getTimesigAt(clock);

            var result   = new PlayPositionSpecifier();
            int barCount = mVsq.TimesigTable.getBarCountFromClock(clock);

            int bar_top_clock  = mVsq.TimesigTable.getClockFromBarCount(barCount);
            int clock_per_beat = 480 / 4 * timesig.denominator;
            int beat           = (clock - bar_top_clock) / clock_per_beat;

            result.barCount    = barCount - mVsq.getPreMeasure() + 1;
            result.beat        = beat + 1;
            result.clock       = clock - bar_top_clock - clock_per_beat * beat;
            result.denominator = timesig.denominator;
            result.numerator   = timesig.numerator;
            result.tempo       = mVsq.getTempoAt(clock);

            return(result);
        }
コード例 #2
0
ファイル: InterfaceVersion.cs プロジェクト: cadencii/cadencii
        public static PlayPositionSpecifier getPlayPosition()
        {
            var clock = getCurrentClock();
            var timesig = mVsq.TimesigTable.getTimesigAt( clock );

            var result = new PlayPositionSpecifier();
            int barCount = mVsq.TimesigTable.getBarCountFromClock( clock );

            int bar_top_clock = mVsq.TimesigTable.getClockFromBarCount( barCount );
            int clock_per_beat = 480 / 4 * timesig.denominator;
            int beat = (clock - bar_top_clock) / clock_per_beat;

            result.barCount = barCount - mVsq.getPreMeasure() + 1;
            result.beat = beat + 1;
            result.clock = clock - bar_top_clock - clock_per_beat * beat;
            result.denominator = timesig.denominator;
            result.numerator = timesig.numerator;
            result.tempo = mVsq.getTempoAt( clock );

            return result;
        }