From d6e75c361c80c6fc471a8b681fbadb7c5e8c4897 Mon Sep 17 00:00:00 2001 From: julien Date: Sun, 29 Sep 2024 18:54:35 +0200 Subject: [PATCH] dow wip --- src/lib.rs | 6 ++++++ src/midi_connection.rs | 1 + src/track.rs | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 806d1e0..4c29901 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,9 @@ +//! Library for developing MIDI Sequencers. +//! +//! To start using `mseq`, create a struct that implements the [`Conductor`] trait. +//! +//! You can then + mod acid; mod arp; mod clock; diff --git a/src/midi_connection.rs b/src/midi_connection.rs index 4b36ff2..6750a34 100644 --- a/src/midi_connection.rs +++ b/src/midi_connection.rs @@ -26,6 +26,7 @@ const NOTE_ON: u8 = 0x90; const NOTE_OFF: u8 = 0x80; const CC: u8 = 0xB0; +#[doc(hidden)] pub trait MidiConnection { fn send_start(&mut self) -> Result<(), MidiError>; fn send_continue(&mut self) -> Result<(), MidiError>; diff --git a/src/track.rs b/src/track.rs index 1e037b6..2770292 100644 --- a/src/track.rs +++ b/src/track.rs @@ -44,10 +44,10 @@ pub trait Track { pub struct DeteTrack { len: u32, notes: Vec<(MidiNote, u32, u32)>, // (Note, start step, length) - pub start_step: u32, + start_step: u32, root: Note, transpose: Option, - pub channel_id: u8, + channel_id: u8, name: String, } @@ -73,6 +73,10 @@ impl Track for DeteTrack { fn get_name(&self) -> String { self.name.clone() } + + fn set_start_step(&mut self, start_step: u32) { + self.start_step = start_step; + } } impl DeteTrack {