Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
            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);
                }
            }
Ejemplo n.º 4
0
 public void AddPlayedBeat(TimedBeatId timedBeat, ISoundId sound)
 {
     beatsDrawer.AddPlayedBeat(timedBeat, sound);
 }
Ejemplo n.º 5
0
 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
     });
 }
Ejemplo n.º 6
0
 public void AddBeat(ISoundId sound, TimedBeatId beat, Velocity v)
 {
     //todo: pass sound information to matcher
     perInstrumentMatchers[sound.Instrument].AddPlayed(beat, resultsCollector);
 }
Ejemplo n.º 7
0
 public static string Name(this ISoundId soundId)
 {
     return(soundId.Instrument.Name + "." + soundId.Technique);
 }
Ejemplo n.º 8
0
 public int IndexOf(ISoundId sound)
 {
     return(Array.IndexOf(sounds, sound));
 }
Ejemplo n.º 9
0
 public PatternBeat(TimeInUnits t, ISoundId sound, Velocity velocity)
 {
     T        = t;
     Sound    = sound;
     Velocity = velocity;
 }