public SingleInstrumentBeatsMatcher(IInstrumentId instrumentId, PatternBeatsTimesList patternBeats, BeatTimesList playedBeats, PatternMatcher.Settings settings)
 {
     this.instumentId  = instrumentId;
     this.patternBeats = patternBeats;
     this.playedBeats  = playedBeats;
     this.settings     = settings;
 }
Beispiel #2
0
        public SKPoint Coordinates(IInstrumentId instrument, TimeInUnits t)
        {
            var instrumentIndex = InstrumentIndex(instrument);
            var y = gridRect.Top + (instrumentIndex + 1) * settings.LineHeight;
            var x = gridRect.Left + settings.BeatWidth * t.Index / (float)this.info.UnitsPerBeat.Index;

            return(new SKPoint(x, y));
        }
Beispiel #3
0
        public SKPoint Coordinates(IInstrumentId instrument, float timeInBeats)
        {
            var instrumentIndex = InstrumentIndex(instrument);

            timeInBeats = RecenterTime(timeInBeats);
            var y = gridRect.Top + (instrumentIndex + 1) * settings.LineHeight;
            var x = gridRect.Left + settings.BeatWidth * timeInBeats;

            return(new SKPoint(x, y));
        }
Beispiel #4
0
        private int InstrumentIndex(IInstrumentId instrument)
        {
            var instrumentIndex = instruments.IndexOf(instrument);

            if (instrumentIndex == -1)
            {
                Drumz.Common.Diagnostics.Logger.TellF(Common.Diagnostics.Logger.Level.Error, "Instument not in pattern: {0} not in {1}", instrument.Name, instruments.ToNiceString());
                instrumentIndex = instruments.Length;
            }
            return(instrumentIndex);
        }
Beispiel #5
0
        public static int IndexOf(this IReadOnlyList <IInstrumentId> instruments, IInstrumentId searched)
        {
            var result = 0;

            foreach (var ins in instruments)
            {
                if (Equals(ins, searched))
                {
                    return(result);
                }
                ++result;
            }
            return(-1);
        }
Beispiel #6
0
 public SimpleSoundId(IInstrumentId instrument, string technique, string mark)
 {
     Instrument = instrument;
     Technique  = technique;
     Mark       = mark;
 }