/*
* Copyright (c) 2021, PockelHockel.
* This software is licensed under the GNU General Public License v3.0
*/
//! `simple_tones` is an easy to use crate which provides abilities to write down and play music compositions easily.
//! Based on [`rodio`](https://crates.io/crates/rodio).
//! # Example
//! ```rust
//! use simple_tones::{Note, NoteDuration, Player};
//!
//! type ND = NoteDuration;
//!
//! let song = vec![
//! Note::new("C4".parse().unwrap(), ND::Quarter),
//! Note::new("C4".parse().unwrap(), ND::Quarter),
//! Note::new("D4".parse().unwrap(), ND::Eighth),
//! Note::new("Eb4".parse().unwrap(), ND::Eighth),
//! // |
//! Note::new("D4".parse().unwrap(), ND::HalfDotted),
//! // |
//! Note::new("C4".parse().unwrap(), ND::Eighth),
//! Note::new("G3".parse().unwrap(), ND::Eighth),
//! Note::new("Ab4".parse().unwrap(), ND::Quarter),
//! Note::new("G3".parse().unwrap(), ND::Eighth),
//! Note::new("F3".parse().unwrap(), ND::Eighth),
//! // |
//! Note::new("G3".parse().unwrap(), ND::HalfDotted),
//! // |
//! Note::new("C4".parse().unwrap(), ND::Quarter),
//! Note::new("C4".parse().unwrap(), ND::Quarter),
//! Note::new("D4".parse().unwrap(), ND::Eighth),
//! Note::new("Eb4".parse().unwrap(), ND::Eighth),
//! // |
//! Note::new("F4".parse().unwrap(), ND::HalfDotted),
//! // |
//! Note::new("G4".parse().unwrap(), ND::Eighth),
//! Note::new("Eb4".parse().unwrap(), ND::Eighth),
//! Note::new("D4".parse().unwrap(), ND::Eighth),
//! Note::new("C4".parse().unwrap(), ND::Eighth),
//! Note::new("Bb4".parse().unwrap(), ND::Quarter),
//! // |
//! Note::new("C4".parse().unwrap(), ND::HalfDotted),
//! // |
//! Note::new("F3".parse().unwrap(), ND::Half),
//! ];
//! let np = Player::from_bpm(55);
//! np.play(song.iter());
//! ```
use Duration;
use ;
pub use crate*;
/// The [`Player`](struct.Player.html) is a struct used to play an `Iterator` of types implementing [`Play`](trait.Note.html).
/// # Example
/// ```rust
/// use simple_tones::{Note, NoteDuration, Player};
///
/// let song = vec![
/// Note::new("C4".parse().unwrap(), NoteDuration::Quarter),
/// Note::new("C4".parse().unwrap(), NoteDuration::Quarter),
/// Note::new("D4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("Eb4".parse().unwrap(), NoteDuration::Eighth),
/// // |
/// Note::new("D4".parse().unwrap(), NoteDuration::HalfDotted),
/// // |
/// Note::new("C4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("G3".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("Ab4".parse().unwrap(), NoteDuration::Quarter),
/// Note::new("G3".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("F3".parse().unwrap(), NoteDuration::Eighth),
/// // |
/// Note::new("G3".parse().unwrap(), NoteDuration::HalfDotted),
/// // |
/// Note::new("C4".parse().unwrap(), NoteDuration::Quarter),
/// Note::new("C4".parse().unwrap(), NoteDuration::Quarter),
/// Note::new("D4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("Eb4".parse().unwrap(), NoteDuration::Eighth),
/// // |
/// Note::new("F4".parse().unwrap(), NoteDuration::HalfDotted),
/// // |
/// Note::new("G4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("Eb4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("D4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("C4".parse().unwrap(), NoteDuration::Eighth),
/// Note::new("Bb4".parse().unwrap(), NoteDuration::Quarter),
/// // |
/// Note::new("C4".parse().unwrap(), NoteDuration::HalfDotted),
/// // |
/// Note::new("F3".parse().unwrap(), NoteDuration::Half),
/// ];
/// let np = Player::from_bpm(55);
/// np.play(song.iter());
/// ```