Skip to main content

Crate music21_rs

Crate music21_rs 

Source
Expand description

Rust helpers inspired by selected parts of Python’s music21.

The crate currently focuses on pitch construction, chord naming and lightweight theory utilities such as polyrhythm and tuning-system helpers.

Re-exports§

pub use abc::AbcClef;
pub use abc::abc_chord;
pub use abc::abc_chord_document;
pub use abc::abc_chord_resolution_document;
pub use abc::abc_clef_for_pitches;
pub use abc::abc_duration;
pub use abc::abc_note;
pub use abc::abc_polyrhythm_document;
pub use abc::abc_polyrhythm_voice;
pub use analysis::KeyEstimate;
pub use analysis::estimate_key_from_chords;
pub use analysis::estimate_key_from_pitches;
pub use chord::Chord;
pub use chord::ChordResolutionSuggestion;
pub use chord::GuitarFingering;
pub use chord::GuitarStringFingering;
pub use chord::GuitarTuning;
pub use chord::GuitarTuningString;
pub use chord::IntoNotes;
pub use chord::KnownChordType;
pub use chordsymbol::ChordAlteration;
pub use chordsymbol::ChordQuality;
pub use chordsymbol::ChordSymbol;
pub use duration::Duration;
pub use error::Error;
pub use error::Result;
pub use interval::Interval;
pub use interval::IntervalDirection;
pub use key::Key;
pub use key::KeySignature;
pub use midi::DEFAULT_TICKS_PER_QUARTER;
pub use midi::MidiNote;
pub use midi::midi_notes_from_stream;
pub use midi::read_midi_bytes;
pub use midi::read_midi_bytes_with_tempo;
pub use midi::stream_from_midi_notes;
pub use midi::write_midi_bytes;
pub use note::IntoNote;
pub use note::Note;
pub use pitch::Accidental;
pub use pitch::AccidentalSpecifier;
pub use pitch::CHROMATIC_PITCH_CLASS_NAMES;
pub use pitch::Microtone;
pub use pitch::MicrotoneSpecifier;
pub use pitch::Pitch;
pub use pitch::PitchClass;
pub use pitch::PitchClassSpecifier;
pub use pitch::PitchName;
pub use pitch::PitchOptions;
pub use pitch::pitch_class_name;
pub use polyrhythm::Polyrhythm;
pub use polyrhythm::PolyrhythmAnalysis;
pub use polyrhythm::PolyrhythmEvent;
pub use polyrhythm::PolyrhythmRatioTone;
pub use rest::Rest;
pub use roman::RomanNumeral;
pub use roman::analyze_chord;
pub use roman::analyze_chord_with_root;
pub use scale::DiatonicScale;
pub use stream::Stream;
pub use stream::StreamElement;
pub use stream::StreamEvent;
pub use tuningsystem::ALL_TUNING_SYSTEMS;
pub use tuningsystem::COMMON_TWELVE_TONE_TUNING_SYSTEMS;
pub use tuningsystem::Fraction;
pub use tuningsystem::TuningSystem;

Modules§

abc
ABC notation export helpers. Small ABC notation helpers.
analysis
Key-finding and compact analysis helpers.
chord
Chord construction, common-name analysis and chord input conversion traits.
chordsymbol
Lead-sheet chord-symbol parsing.
duration
Rhythmic duration primitives.
error
Error and result types used by the crate.
interval
Public interval parsing, naming and transposition helpers.
key
Public key and key-signature helpers.
midi
Minimal MIDI import/export helpers.
note
Note construction and pitch access helpers.
pitch
Pitch construction, spelling and pitch-space helpers.
polyrhythm
Polyrhythm timing and pitch-set helpers.
rest
Silent duration-bearing musical event.
roman
Roman numeral parsing and compact harmonic analysis.
scale
Public scale helpers.
stream
Small ordered timeline container.
tuningsystem
Tuning-system ratios, labels and frequency helpers.

Type Aliases§

FloatType
Floating-point type used for pitch space, quarter lengths, and frequencies.
FractionType
Fraction type used by ratio and interval helpers.
IntegerType
Signed integer type used by music21-rs APIs.
Octave
Optional octave number, matching music21’s absent-octave representation.
UnsignedIntegerType
Unsigned integer type used by count-like music21-rs APIs.