public void AddPlayedBeat(TimedBeatId timedBeat, ISoundId sound) { var coord = grid.Coordinates(sound.Instrument, timedBeat.T); var expiry = timedBeat.T + 0.75f * pattern.Info.TotalBeats; var mark = new BeatMark(timedBeat.Id, coord, beatPaints.Paint(BeatStatus.Pending), expiry, sound.Mark); beatMarks.Enqueue(mark); }
public Beat(ISoundId sound, Velocity velocity) { this.Sound = sound; this.Velocity = velocity; if (velocity.Value == 0) { throw new ArgumentException("Velocity should not be null " + this); } }
public void Add(TimeInUnits t, ISoundId sound, Velocity v) { List <PatternBeat> beatsAtT; if (!beats.TryGetValue(t, out beatsAtT)) { beatsAtT = new List <PatternBeat>(1); beats.Add(t, beatsAtT); } var patternBeat = new PatternBeat(t, sound, v); if (beatsAtT.Any(p => Equals(p.Sound, sound))) { throw new ArgumentException(string.Format("Duplicate beat on {0} at t={1}", sound.Name(), t.Index)); } beatsAtT.Add(patternBeat); if (!preferredInstrumentsOrder.Contains(sound)) { preferredInstrumentsOrder.Add(sound); } }
public void AddPlayedBeat(TimedBeatId timedBeat, ISoundId sound) { beatsDrawer.AddPlayedBeat(timedBeat, sound); }
private static SoundData ToData(ISoundId sound, SoundsList sounds) { return(new SoundData { Technique = sound.Technique, Instrument = sound.Instrument.Name, Id = sounds.IndexOf(sound), Mark = sound.Mark }); }
public void AddBeat(ISoundId sound, TimedBeatId beat, Velocity v) { //todo: pass sound information to matcher perInstrumentMatchers[sound.Instrument].AddPlayed(beat, resultsCollector); }
public static string Name(this ISoundId soundId) { return(soundId.Instrument.Name + "." + soundId.Technique); }
public int IndexOf(ISoundId sound) { return(Array.IndexOf(sounds, sound)); }
public PatternBeat(TimeInUnits t, ISoundId sound, Velocity velocity) { T = t; Sound = sound; Velocity = velocity; }