Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrGlad committed Jan 14, 2024
1 parent d136727 commit ff6939e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 32 deletions.
42 changes: 22 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

Off grid MIDI editor with following goals:

* Not a DAW: MIDI is the input, MIDI is exported (would like it to be but do not have enough time for that).
* Do not care (much) about measures. Primarily aimed at piano real recordings without strict tempo/bars.
* Not a DAW: MIDI is the input, MIDI is exported (I would like it to be but will not have enough time for that).
* Do not care (much) about measures. Primarily aimed at piano real time recordings without explicit tempo/bars.
* A feature absent in other midi editors I could get my hands on (both commercial and free ones): removing a piece
of MIDI recording as one can remove a time fragment from PCM recording. For some reason DAW authors insist on handling
MIDI recordings differently from PCM sound recordings. In some editors this is actually doable but cumbersome at best.
* Playing/editing very long (up to about 20K of events) files.
Those files are usually recordings of real performances (e.g. from MIDI keyboard).
of MIDI recording as one can remove a time fragment from PCM recording. For some odd reason DAW authors insist on
handling MIDI recordings differently from PCM sound recordings. In some editors this is doable but cumbersome at best.
* Playing/editing very long (up to about 25K of events) files. Those files are usually recordings of real performances
(e.g. from a MIDI keyboard).
* Comfortable workflow with keyboard.
* Allows making fine adjustments of notes and tempo.
* Unlimited undo/redo. Never loose session data. Non destructive edits, do not override original files.
* Flight recorder (always-on MIDI recording).

I'd love this to be in one of commercial or open-source DAWs and even pay money for that, but I do not see it
happening.
I'd love this to be in one of commercial or open-source DAWs and pay money for that, but I do not see it happening.

## Status

Expand All @@ -31,27 +30,30 @@ ALSA wrapper dependency
`apt install libasound2-dev`.

As an VST synth plugin you can use `amsynth`, for example.
I use Pianoteq, but that is a commercial product.
I personally use Pianoteq, but that is a commercial product.

## TODO

- [ ] When start playing send current CC values (will help damper to take effect immediately, not on next change).
- [ ] Highlight undo/redo changes (implemented for notes, need also to emphasise CC values).
- [ ] (improvement) When start playing send current CC values (will help damper to take effect immediately, not on next
change).
- [ ] Location history navigation (e.g. go to a bookmark that was visited recently), with Alt + LeftArrow / RightArrow
- [ ] Adjust tempo for selection.
- [ ] Adjust tempo for a selection.
- [ ] Time marks on stave ("minute:second" from the beginning).
- [ ] Minimize use of unwrap. The biggest contention currently is event data shared between engine and stave.
- [ ] Minimize use of unwrap. The biggest contention currently is event data shared between engine and stave. Maybe can
do this with async or sending update commands to the engine thread (e.g. can just swap to new track copy in the
engine's events source after edits).
- [ ] Multi-track UI (for snippets, flight recorder, and copy/paste buffer). Can show only one at a time, though. Use
tabs?
- [ ] Reduce number of range types (preferring util::Range?)
- [ ] Copy/cut/paste notes and time ranges (should also be supported between tracks).
- [ ] (refactoring) Reduce number of range types (preferring util::Range?)
- [ ] Zoom to fit whole composition.
them are currently visible.
- [ ] Organize commands (keep hotkeys/actions in a collection). This should make the handle_commands easier to read and
enable to have a generated cheatsheet/help UI.
- [ ] Flight recorder (always record what is coming from the MIDI controller into a separate file).
- [ ] Ensure changes are visible even when zoomed out (the events may be too small to be visible as is).
- [ ] Copy/cut/paste.
- [ ] (refactoring) Organize commands (keep hotkeys/actions in a collection). This should make the handle_commands
easier to read and enable to have a generated cheatsheet/help UI.
- [ ] Flight recorder (always record what is coming from the MIDI controller into a separate file or track).
- [ ] (improvement) Ensure changes are visible even when zoomed out (the events may be too small to be visible as is).
- [x] Highlight undo/redo changes (implemented for notes, need also to emphasise CC values).
- [x] Visual hint for out-of-view selected notes. Scroll to the earliest of the selected notes on an action, if none of
them are currently visible.
- [x] Optimize undo history 2: save only minimal diff instead of the whole track.
- [x] Show (scroll to) changing objects before undo/redo. Should scroll some changes into view before animation on an
undo/redo command if none are currently visible.
Expand Down
10 changes: 3 additions & 7 deletions src/stave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl Stave {
&Color32::from_black_alpha(15),
);
let mut note_hovered = None;
let mut should_be_visible = None;
let should_be_visible;
{
let history = self.history.borrow();
let track = history.track.read().expect("Read track.");
Expand Down Expand Up @@ -395,10 +395,6 @@ impl Stave {
&event,
&cc,
),
_ => println!(
"Not displaying event {:?}, the event type is not supported yet.",
event
),
}
}
if let Some(trans) = &self.transition {
Expand Down Expand Up @@ -529,7 +525,7 @@ impl Stave {
))
}) {
if let Some(time_selection) = &self.time_selection.clone() {
self.do_edit_command(&response.ctx, response.id, |stave, track| {
self.do_edit_command(&response.ctx, response.id, |_stave, track| {
tape_delete(track, &(time_selection.start, time_selection.end))
});
}
Expand All @@ -547,7 +543,7 @@ impl Stave {
))
}) {
if let Some(time_selection) = &self.time_selection.clone() {
self.do_edit_command(&response.ctx, response.id, |stave, track| {
self.do_edit_command(&response.ctx, response.id, |_stave, _track| {
tape_insert(&(time_selection.start, time_selection.end))
});
}
Expand Down
5 changes: 0 additions & 5 deletions src/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ pub fn is_cc_switch_on(x: Level) -> bool {
x >= 64
}

pub enum TrackLane {
Note(Pitch),
Controller(ControllerId),
}

#[derive(Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
pub struct Note {
pub pitch: Pitch,
Expand Down

0 comments on commit ff6939e

Please sign in to comment.