Skip to content

Commit bdd4098

Browse files
committed
update
1 parent 9ff468c commit bdd4098

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

core/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::{
1515
error::{Error, MusicalError, Result},
1616
intervals::*,
1717
notes::Note,
18-
pitch::{IntoPitch, Pitch, PitchClass, PitchTy},
18+
pitch::{IntoPitch, Pitch, Pitches, PitchTy},
1919
primitives::*,
2020
utils::*,
2121
};
@@ -37,6 +37,7 @@ pub mod types;
3737

3838
pub mod prelude {
3939
pub use super::error::prelude::*;
40+
pub use super::intervals::prelude::*;
4041
pub use super::notes::prelude::*;
4142
pub use super::ops::prelude::*;
4243
pub use super::pitch::prelude::*;

core/src/macros/notes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
Appellation: notes <module>
33
Contrib: FL03 <jo3mccain@icloud.com>
44
*/
5+
#![allow(unused)]
56

67
macro_rules! notes {
7-
($($suffix:literal)? $name:ident {$($cls:ident($value:expr)),* $(,)?} ) => {
8+
($(suffix: $suffix:literal;)? $name:ident {$($cls:ident($value:expr)),* $(,)?} ) => {
89

910
paste::paste! {
1011
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]

core/src/notes/note.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Appellation: note <module>
33
Contrib: FL03 <jo3mccain@icloud.com>
44
*/
5-
use crate::{IntoPitch, Octave, Pitch};
5+
use crate::{IntoPitch, Octave, Pitch, Pitches};
66

77
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
88
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
@@ -24,6 +24,10 @@ impl Note {
2424
pitch: pitch.into_pitch(),
2525
}
2626
}
27+
pub fn class(&self) -> Pitches {
28+
self.pitch.class()
29+
}
30+
2731
/// Returns an instance of the note's octave
2832
pub fn octave(&self) -> Octave {
2933
self.octave
@@ -63,7 +67,7 @@ impl Note {
6367

6468
impl core::fmt::Display for Note {
6569
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
66-
write!(f, "{}.{}", self.pitch, self.octave)
70+
write!(f, "{}.{}", self.class(), self.octave)
6771
}
6872
}
6973

core/src/traits/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#[doc(inline)]
66
pub use self::notable::Notable;
77

8+
#[doc(hidden)]
89
pub mod harmonic;
910
pub mod notable;
1011
pub mod symbols;

core/src/traits/symbols.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Contrib: FL03 <jo3mccain@icloud.com>
44
*/
55

6+
/// [Symbolic] is used to describe a type that has some
7+
/// symbolic representation.
8+
///
9+
///
610
pub trait Symbolic {
711
fn symbol(&self) -> &str;
812
}
13+
14+

0 commit comments

Comments
 (0)