Ejemplo n.º 1
0
        public Timesig getTimesigAt(int clock)
        {
            Timesig ret = new Timesig();

            ret.numerator   = 4;
            ret.denominator = 4;
            int index = 0;
            int c     = Count;

            for (int i = c - 1; i >= 0; i--)
            {
                index = i;
                if (this[i].Clock <= clock)
                {
                    break;
                }
            }
            ret.numerator   = this[index].Numerator;
            ret.denominator = this[index].Denominator;
            return(ret);
        }
Ejemplo n.º 2
0
        public Timesig getTimesigAt(int clock, ByRef <int> bar_count)
        {
            int index = 0;
            int c     = Count;

            for (int i = c - 1; i >= 0; i--)
            {
                index = i;
                if (this[i].Clock <= clock)
                {
                    break;
                }
            }
            TimeSigTableEntry item = this[index];
            Timesig           ret  = new Timesig();

            ret.numerator   = item.Numerator;
            ret.denominator = item.Denominator;
            int diff          = clock - item.Clock;
            int clock_per_bar = 480 * 4 / ret.denominator * ret.numerator;

            bar_count.value = item.BarCount + diff / clock_per_bar;
            return(ret);
        }