PatternView
The tracker's pattern editor: one pattern of one node, as a grid of rows and parameter columns.
| Declared in | src/libs/libbahn/bahn/tracker/ui/PatternView.hpp |
| Inherits | QWidget |
| Group | bahn |
Detailed description
The view shows the selected pattern of the selected bahn::Node. Each row is one tick. The columns hold the node's parameters, then the parameters of each lane, and the cursor moves one digit at a time. A gutter at the left shows the row numbers, and the row at the play position is marked while the song plays.
A person types values at the cursor. A note column takes a note from the keyboard, in the base octave. The view sounds a typed note at once on the selected node, and releases it when the key comes up. The view can select, copy, cut, paste, adjust and interpolate a range of values, and its menu adds and removes lanes, and makes, edits, copies and removes patterns.
navigatePattern() selects the node and the pattern to edit.
See also Pattern, SequencerView, NodeView.
Member function documentation
auditionNote
[protected] void PatternView::auditionNote(Value note)
Sound the note note the moment it is typed.
specs/bahn-live-feedback §BLD-1. The editor answers the ear, not only the eye. The note is already written to the row by the caller; this makes it audible without waiting for the playhead to arrive.
It sounds on the SELECTED node, which is the node whose pattern is being edited. Whether that pattern belongs to the current song is irrelevant — the instrument is the instrument either way.
NOTE_OFF is auditioned too (§BLD-1d). A release is feedback: it is how a person hears that the note they were holding has ended. NOTE_NO_VALUE never reaches here, because "this row says nothing" is not an edit.
Playing or stopped, it sounds now
§BLD-1c asked for the note to sound "as though the sequencer reached the edited row", and the first reading of that was to delay the event until the playhead arrives. That is wrong twice: the note is already in the row, so the sequencer will play it on arrival regardless, and delaying the audition means a person editing ahead of the playhead hears nothing at all until the next pass.
Immediate is what the request asked for — "I cannot hear notes as I type them" — and the two events are not a double trigger. They are a preview now and a performance later.
Notes
keyReleaseEvent
[override virtual protected] void PatternView::keyReleaseEvent(QKeyEvent *event)
Reimplements: QWidget::keyReleaseEvent(QKeyEvent *event).
Release the note when the key in event comes up.
A key is two events: down sounds the note, up releases it. Without the second, every note a person types sustains forever on a patch that has no decay of its own.
It releases on ANY note key coming up rather than tracking which key started which note, because the instrument is monophonic — one note sounds at a time, so one release ends it. A polyphonic instrument would need the key-to-note map that this deliberately does not keep.
Auto-repeat is ignored. A held key repeats press AND release at the platform rate, and honoring those would retrigger and cut the note dozens of times a second.