1#![cfg_attr(docsrs, feature(doc_cfg))]
42#![deny(missing_docs)]
43#![deny(missing_debug_implementations)]
44#![forbid(unsafe_code)]
45
46#[cfg(doctest)]
48#[doc = include_str!("../README.md")]
49mod readme {}
50pub mod abc;
56pub mod alpha;
58pub mod analysis;
60pub mod articulations;
62pub mod audiosearch;
64pub mod bar;
66pub mod braille;
67pub mod capella;
68pub mod chord;
70pub mod chordsymbol;
72pub mod clef;
74pub mod common;
77pub(crate) mod defaults;
78pub(crate) mod display;
79pub mod duration;
81pub mod dynamics;
83pub mod environment;
86pub mod error;
88pub mod expressions;
90pub mod features;
92
93pub mod figuredbass;
95#[doc = include_str!("guide.md")]
96pub mod guide {}
97pub mod humdrum;
99pub mod instrument;
101
102pub mod interval;
104pub mod key;
106pub mod layout;
108pub mod lily;
110pub mod makenotation;
113pub mod mei;
115pub mod metadata;
117pub mod meter;
119pub mod midi;
122pub mod musedata;
123pub mod musescore;
124#[cfg(feature = "musicxml")]
127pub mod musicxml;
128pub mod notation;
130pub mod note;
132pub mod noteworthy;
133pub mod omr;
134pub mod percussion;
136pub mod pitch;
138pub mod polyrhythm;
140pub mod repeat;
142pub mod rest;
144pub mod roman;
146pub mod romantext;
148pub mod scale;
150pub mod search;
152pub mod serial;
154pub mod sieve;
155pub mod spanner;
157pub(crate) mod statistics;
158pub(crate) mod stepname;
159pub mod stream;
162pub mod style;
164pub mod tablature;
166pub mod tempo;
168pub mod text;
170pub mod tinynotation;
172pub mod tree;
175pub mod tuningsystem;
177pub mod variant;
178pub mod voiceleading;
180pub mod volpiano;
181pub mod volume;
182mod xml;
183pub use abc::{
187 abc_chord, abc_duration, abc_note, abc_rest, from_abc, from_abc_number,
188 pitch_name_from_abc_note, pitch_names_from_abc_chord, to_abc,
189};
190pub use analysis::{
191 KeyEstimate, KeyProfile, estimate_key_from_chords, estimate_key_from_chords_with,
192 estimate_key_from_pitches, estimate_key_from_pitches_with,
193};
194pub use analysis::{tonal_certainty, tonal_certainty_from_scores};
195pub use articulations::{Articulation, ArticulationKind};
196pub use bar::{Barline, BarlineType, Ending, RepeatDirection};
197pub use chord::{
198 Chord, ChordResolutionSuggestion, ChordTableAddress, GuitarFingering, GuitarStringFingering,
199 GuitarTuning, GuitarTuningString, IntoNotes, KnownChordType, TriadQuality,
200 format_vector_string,
201};
202pub use chordsymbol::{
203 ChordAlteration, ChordQuality, ChordStepModification, ChordStepModificationType, ChordSymbol,
204 Music21ChordType, chord_symbol_figure_from_chord, chord_symbol_from_chord,
205 known_chord_symbol_types, realize_chord_symbol_durations,
206};
207pub use clef::{Clef, ClefKind};
208pub use defaults::{FloatType, FractionType, IntegerType, Octave, UnsignedIntegerType};
209pub use duration::{
210 Duration, DurationTuple, DurationType, Grace, Tuplet, TupletBracket, TupletShow, TupletType,
211 quarter_length_to_closest_type,
212};
213pub use dynamics::Dynamic;
214pub use error::{Error, Result};
215pub use instrument::{Instrument, SearchLanguage, ensemble_name_by_size};
216pub use interval::{
217 ChromaticInterval, DiatonicInterval, GenericInterval, Interval, IntervalDirection, Specifier,
218 absolute_higher_pitch, absolute_lower_pitch, convert_diatonic_number_to_step, convert_generic,
219 convert_semitone_to_specifier_generic, convert_semitone_to_specifier_generic_microtone,
220 intervals_to_diatonic, notes_to_chromatic, notes_to_generic, parse_specifier,
221 staff_distance_to_generic_number, written_higher_pitch, written_lower_pitch,
222};
223pub use key::{Key, KeySignature, convert_key_string_to_music21_key_string};
224pub use metadata::{Metadata, MetadataContent, MetadataValue};
225pub use meter::{BeamedNote, BeatDivision, MeterTerminal, OffsetAlign, TimeSignature};
226pub use midi::{DEFAULT_TICKS_PER_QUARTER, MidiNote, from_midi, to_midi};
227pub use notation::{
228 Beam, BeamDirection, BeamType, Beams, Justification, Lyric, NoteSize, Notehead, Placement,
229 StemDirection, Syllabic, Tie, TieStyle, TieType,
230};
231pub use note::{IntoNote, Note};
232pub use percussion::{PercussionChord, PercussionNote, Unpitched};
233pub use pitch::{
234 Accidental, AccidentalAttribute, AccidentalDisplayOptions, AccidentalSpecifier,
235 CHROMATIC_PITCH_CLASS_NAMES, Microtone, MicrotoneSpecifier, Pitch, PitchClass,
236 PitchClassSpecifier, PitchName, PitchOptions, convert_pitch_class_to_str, dissonance_score,
237 pitch_class_name, simplify_multiple_enharmonics,
238};
239pub use polyrhythm::{Polyrhythm, PolyrhythmAnalysis, PolyrhythmEvent, PolyrhythmRatioTone};
240pub use repeat::{RepeatExpression, RepeatExpressionKind};
241pub use rest::{FullMeasure, Rest};
242pub use roman::roman_numeral_from_chord;
243pub use roman::{
244 ImpliedQuality, Minor67Default, NumeralAlone, RomanNumeral, analyze_chord,
245 analyze_chord_with_root, identify_as_tonic_or_dominant, roman_inversion_name,
246};
247pub use scale::{
248 BluesForm, DegreeComparison, Scale, ScaleType, Simplification, SolfegVariant, StepScale,
249 WeightedHexatonicBlues,
250};
251pub use serial::{
252 HISTORICAL_ROWS, HistoricalRow, IndexedTransformation, LinkClassification, ToneRow,
253 Transformation, TransformationConvention, TwelveToneMatrix, historical_row_by_name,
254 row_to_matrix,
255};
256pub use sieve::Sieve;
257pub use spanner::{
258 Glissando, LineEnd, LineEnds, MultiRest, OctaveShift, Pedal, PedalForm, PedalObject,
259 PedalObjectKind, PedalType, SlideType, Spanner, SpannerKind,
260};
261pub use stream::{BarTogether, StaffGroup, Stream, StreamElement, StreamEvent, StreamKind};
262pub use tempo::{
263 DEFAULT_TEMPO_VALUES, MetricModulation, MetronomeMark, ModulationSide, TempoText,
264 convert_tempo_by_referent, interpolate_elements,
265};
266pub use tuningsystem::{
267 ALL_TUNING_SYSTEMS, COMMON_EQUAL_TEMPERAMENTS, COMMON_TWELVE_TONE_TUNING_SYSTEMS,
268 EqualDivision, HISTORICAL_TEMPERAMENTS, Monzo, Mos, MosScale, OCTAVE_CENTS, Ratio,
269 TRITAVE_CENTS, Temperament, TuningSystem, Val, moment_of_symmetry_sizes,
270 scala::{ScalaArchive, ScalaDegree, ScalaScale},
271};
272pub use voiceleading::{
273 MotionType, QuartetOptions, VoiceLeadingQuartet, iterate_all_voice_leading_quartets,
274 verticality_at,
275};
276pub use volume::{DynamicContext, Volume, realize_volume};
277
278#[deprecated(
280 since = "0.15.0",
281 note = "use `from_midi` for a score, or `midi::read_midi_bytes` for bare note events"
282)]
283pub fn read_midi_bytes(bytes: &[u8]) -> Result<Vec<MidiNote>> {
284 midi::read_midi_bytes(bytes)
285}
286
287#[deprecated(
289 since = "0.15.0",
290 note = "use `from_midi` for a score, or `midi::read_midi_bytes_with_tempo` for bare note events"
291)]
292pub fn read_midi_bytes_with_tempo(bytes: &[u8]) -> Result<(Vec<MidiNote>, Option<FloatType>)> {
293 midi::read_midi_bytes_with_tempo(bytes)
294}
295
296#[deprecated(
298 since = "0.15.0",
299 note = "use `to_midi` for a score, or `midi::write_midi_bytes` for bare note events"
300)]
301pub fn write_midi_bytes(notes: &[MidiNote], tempo_bpm: FloatType) -> Result<Vec<u8>> {
302 midi::write_midi_bytes(notes, tempo_bpm)
303}
304
305#[deprecated(
307 since = "0.15.0",
308 note = "use `to_midi` for a score, or `midi::midi_notes_from_stream` for bare note events"
309)]
310pub fn midi_notes_from_stream(stream: &Stream) -> Result<Vec<MidiNote>> {
311 midi::midi_notes_from_stream(stream)
312}
313
314#[deprecated(
316 since = "0.15.0",
317 note = "use `from_midi` for a score, or `midi::stream_from_midi_notes` for bare note events"
318)]
319pub fn stream_from_midi_notes(notes: &[MidiNote]) -> Result<Stream> {
320 midi::stream_from_midi_notes(notes)
321}