Exemple #1
0
        protected override void OnSurfaceClick(Point pt)
        {
            byte value = (byte)FromVerticalPosition(pt.Y);
            long pos   = PixelToTick(pt.X);
            long snap  = SnapToGridInternal(pos);

            AddNoteRequested?.Invoke(this, new AddNoteRequestedEventArgs(new Note(value, 100, snap, _lastLength)));
        }
Exemple #2
0
        protected override void OnSurfaceClick(Point pt)
        {
            NoteViewModel lastPressedNote = LastPressedItem as NoteViewModel;
            byte          value           = (byte)FromVerticalPosition(pt.Y);
            byte          velocity        = lastPressedNote?.Velocity ?? 100;
            int           pos             = PixelToTick(pt.X);
            int           snap            = SnapToGridInternal(pos);
            int           length          = lastPressedNote?.Length ?? TimeResolution;

            AddNoteRequested?.Invoke(this, new AddNoteRequestedEventArgs(new Note(value, velocity, snap, length)));
        }