Exemplo n.º 1
0
        private Pitch PlayNote(SwingEvent @event)
        {
            var noteMapper = new NoteMappnig(@event, IntRanges.ToList(), Octave, BasePitch);
            var note       = noteMapper.GetNote();

            _device.SendNoteOn(_channel, note, _velocity);
            return(note);
        }
Exemplo n.º 2
0
 public NoteMappnig(SwingEvent @event, List <int> ranges, int octave, float basePitch)
 {
     _ranges    = ranges;
     _octave    = octave;
     _basePitch = basePitch;
     _event     = @event;
     _theValue  = Math.Abs((_event.Pitch - basePitch));
 }
Exemplo n.º 3
0
 private void AccountValues(SwingEvent @event, Pitch note)
 {
     _pitchValue = @event.Pitch;
     OnPropertyChanged("PitchValue");
     _gy = @event.Gy;
     OnPropertyChanged("Gy");
     _gz = @event.Gz;
     OnPropertyChanged("Gz");
     _prevGy = @event.PrevGy;
     OnPropertyChanged("PrevGy");
     _prevGz = @event.PrevGz;
     OnPropertyChanged("PrevGz");
     Trace.WriteLine(note.ToString());
     if (@event.Pitch > Highest)
     {
         Highest = @event.Pitch;
     }
     if (Math.Abs(@event.Pitch) < Lowest)
     {
         Lowest = Math.Abs(@event.Pitch);
     }
 }