ソースを参照

Removed amen_brother break. Removed unnecessary source and voice modules. Added thumb piano sample

mitchmindtree 8 年 前
コミット
69d0bc2ad4
4 ファイル変更0 行追加60 行削除
  1. BIN
      assets/amen_brother.wav
  2. BIN
      assets/thumbpiano A#3.wav
  3. 0 12
      src/source.rs
  4. 0 48
      src/voice.rs

BIN
assets/amen_brother.wav


BIN
assets/thumbpiano A#3.wav


+ 0 - 12
src/source.rs

@@ -1,12 +0,0 @@
-
-/// The source of samples, which may be either dynamic or static.
-pub trait Source {}
-
-pub struct Dynamic;
-
-pub struct Static;
-
-
-pub trait PcmSampleSource {
-    fn samples<I, S>(&self) -> I where I: Iterator<Item=S>;
-}

+ 0 - 48
src/voice.rs

@@ -1,48 +0,0 @@
-use {pitch, time, Velocity};
-
-pub type Playhead = time::Samples;
-
-/// The current state of the Voice's note playback.
-#[derive(Copy, Clone, Debug, PartialEq)]
-pub enum NoteState {
-    /// The note is current playing.
-    Playing,
-    /// The note has been released and is fading out.
-    Released(Playhead),
-}
-
-/// A single monophonic voice of a `Sampler`.
-#[derive(Clone, Debug, PartialEq)]
-pub struct Voice {
-    note: Option<(NoteState, pitch::Hz, Velocity)>,
-    playhead: Playhead,
-}
-
-impl Voice {
-
-    /// Construct a new `Voice`.
-    pub fn new() -> Self {
-        Voice {
-            note: None,
-            playhead: time::Samples(0),
-        }
-    }
-
-    /// Trigger playback with the given note.
-    #[inline]
-    pub fn note_on(&mut self, hz: pitch::Hz, vel: Velocity) {
-        self.note = Some((NoteState::Playing, hz, vel));
-    }
-
-    /// Release playback of the current note if there is one.
-    #[inline]
-    pub fn note_off(&mut self) {
-        if let Some(&mut(ref mut state, _, _)) = self.note.as_mut() {
-            *state = NoteState::Released(time::Samples(0));
-        }
-    }
-
-    pub fn fill_buffer<S>(&mut self, buffer: &mut [S]) {
-    }
-
-}