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 mod corpus;
78pub(crate) mod defaults;
79pub(crate) mod display;
80pub mod duration;
82pub mod dynamics;
84pub mod environment;
87pub mod error;
89pub mod expressions;
91pub mod features;
93
94pub mod figuredbass;
96#[doc = include_str!("guide.md")]
97pub mod guide {}
98pub mod graph;
100pub mod humdrum;
102pub mod instrument;
104
105pub mod interval;
107pub mod key;
109pub mod layout;
111pub mod lily;
113pub mod makenotation;
116pub mod mei;
118pub mod metadata;
120pub mod meter;
122pub mod midi;
125pub mod musedata;
126pub mod musescore;
127#[cfg(feature = "musicxml")]
130pub mod musicxml;
131pub mod notation;
133pub mod note;
135pub mod noteworthy;
136pub mod omr;
137pub mod percussion;
139pub mod pitch;
141pub mod polyrhythm;
143pub mod repeat;
145pub mod rest;
147pub mod roman;
149pub mod romantext;
151pub mod scale;
153pub mod search;
155pub mod serial;
157pub mod sieve;
158pub mod sorting;
161pub mod spanner;
163pub(crate) mod statistics;
164pub(crate) mod stepname;
165pub mod stream;
168pub mod style;
170pub mod tablature;
172pub mod tempo;
174pub mod text;
176pub mod tinynotation;
178pub mod tree;
181pub mod tuningsystem;
183pub mod variant;
184pub mod voiceleading;
186pub mod volpiano;
187pub mod volume;
188mod xml;
189pub use abc::{
193 abc_chord, abc_duration, abc_note, abc_rest, from_abc, from_abc_number,
194 pitch_name_from_abc_note, pitch_names_from_abc_chord, to_abc,
195};
196pub use analysis::{
197 KeyEstimate, KeyProfile, estimate_key_from_chords, estimate_key_from_chords_with,
198 estimate_key_from_pitches, estimate_key_from_pitches_with,
199};
200pub use analysis::{tonal_certainty, tonal_certainty_from_scores};
201pub use articulations::{Articulation, ArticulationKind};
202pub use bar::{Barline, BarlineType, BracketPlace, Ending, RepeatDirection};
203pub use chord::{
204 Chord, ChordResolutionSuggestion, ChordTableAddress, GuitarFingering, GuitarStringFingering,
205 GuitarTuning, GuitarTuningString, IntoNotes, KnownChordType, TriadQuality,
206 format_vector_string,
207};
208pub use chordsymbol::{
209 ChordAlteration, ChordQuality, ChordStepModification, ChordStepModificationType, ChordSymbol,
210 Music21ChordType, chord_symbol_figure_from_chord, chord_symbol_from_chord,
211 known_chord_symbol_types, realize_chord_symbol_durations,
212};
213pub use clef::{Clef, ClefKind};
214pub use defaults::{FloatType, FractionType, IntegerType, Octave, UnsignedIntegerType};
215pub use duration::{
216 Duration, DurationTuple, DurationType, Grace, Tuplet, TupletBracket, TupletShow, TupletType,
217 quarter_length_to_closest_type,
218};
219pub use dynamics::Dynamic;
220pub use error::{Error, Result};
221pub use instrument::{Instrument, SearchLanguage, ensemble_name_by_size};
222pub use interval::{
223 ChromaticInterval, DiatonicInterval, GenericInterval, Interval, IntervalDirection, Specifier,
224 absolute_higher_pitch, absolute_lower_pitch, convert_diatonic_number_to_step, convert_generic,
225 convert_semitone_to_specifier_generic, convert_semitone_to_specifier_generic_microtone,
226 intervals_to_diatonic, notes_to_chromatic, notes_to_generic, parse_specifier,
227 staff_distance_to_generic_number, written_higher_pitch, written_lower_pitch,
228};
229pub use key::{Key, KeySignature, convert_key_string_to_music21_key_string};
230pub use metadata::{Metadata, MetadataContent, MetadataValue};
231pub use meter::{BeamedNote, BeatDivision, MeterTerminal, OffsetAlign, TimeSignature};
232pub use midi::{DEFAULT_TICKS_PER_QUARTER, MidiNote, from_midi, to_midi};
233pub use notation::{
234 Beam, BeamDirection, BeamType, Beams, Justification, Lyric, NoteSize, Notehead, Placement,
235 StemDirection, Syllabic, Tie, TieStyle, TieType,
236};
237pub use note::{IntoNote, Note};
238pub use percussion::{PercussionChord, PercussionNote, Unpitched};
239pub use pitch::{
240 Accidental, AccidentalAttribute, AccidentalDisplayOptions, AccidentalSpecifier,
241 CHROMATIC_PITCH_CLASS_NAMES, Microtone, MicrotoneSpecifier, Pitch, PitchClass,
242 PitchClassSpecifier, PitchName, PitchOptions, convert_pitch_class_to_str, dissonance_score,
243 pitch_class_name, simplify_multiple_enharmonics,
244};
245pub use polyrhythm::{Polyrhythm, PolyrhythmAnalysis, PolyrhythmEvent, PolyrhythmRatioTone};
246pub use repeat::{RepeatExpression, RepeatExpressionKind};
247pub use rest::{FullMeasure, Rest};
248pub use roman::roman_numeral_from_chord;
249pub use roman::{
250 ImpliedQuality, Minor67Default, NumeralAlone, RomanNumeral, analyze_chord,
251 analyze_chord_with_root, identify_as_tonic_or_dominant, roman_inversion_name,
252};
253pub use scale::{
254 BluesForm, DegreeComparison, Scale, ScaleType, Simplification, SolfegVariant, StepScale,
255 WeightedHexatonicBlues,
256};
257pub use serial::{
258 HISTORICAL_ROWS, HistoricalRow, IndexedTransformation, LinkClassification, ToneRow,
259 Transformation, TransformationConvention, TwelveToneMatrix, historical_row_by_name,
260 row_to_matrix,
261};
262pub use sieve::Sieve;
263pub use spanner::{
264 Glissando, LineEnd, LineEnds, MultiRest, OctaveShift, Pedal, PedalForm, PedalObject,
265 PedalObjectKind, PedalType, SlideType, Spanner, SpannerKind,
266};
267pub use stream::{BarTogether, StaffGroup, Stream, StreamElement, StreamEvent, StreamKind};
268pub use tempo::{
269 DEFAULT_TEMPO_VALUES, MetricModulation, MetronomeMark, ModulationSide, TempoText,
270 convert_tempo_by_referent, interpolate_elements,
271};
272pub use tuningsystem::{
273 ALL_TUNING_SYSTEMS, COMMON_EQUAL_TEMPERAMENTS, COMMON_TWELVE_TONE_TUNING_SYSTEMS,
274 EqualDivision, HISTORICAL_TEMPERAMENTS, Monzo, Mos, MosScale, OCTAVE_CENTS, Ratio,
275 TRITAVE_CENTS, Temperament, TuningSystem, Val, moment_of_symmetry_sizes,
276 scala::{ScalaArchive, ScalaDegree, ScalaScale},
277};
278pub use voiceleading::{
279 MotionType, QuartetOptions, VoiceLeadingQuartet, iterate_all_voice_leading_quartets,
280 verticality_at,
281};
282pub use volume::{DynamicContext, Volume, realize_volume};
283
284#[deprecated(
286 since = "0.15.0",
287 note = "use `from_midi` for a score, or `midi::read_midi_bytes` for bare note events"
288)]
289pub fn read_midi_bytes(bytes: &[u8]) -> Result<Vec<MidiNote>> {
290 midi::read_midi_bytes(bytes)
291}
292
293#[deprecated(
295 since = "0.15.0",
296 note = "use `from_midi` for a score, or `midi::read_midi_bytes_with_tempo` for bare note events"
297)]
298pub fn read_midi_bytes_with_tempo(bytes: &[u8]) -> Result<(Vec<MidiNote>, Option<FloatType>)> {
299 midi::read_midi_bytes_with_tempo(bytes)
300}
301
302#[deprecated(
304 since = "0.15.0",
305 note = "use `to_midi` for a score, or `midi::write_midi_bytes` for bare note events"
306)]
307pub fn write_midi_bytes(notes: &[MidiNote], tempo_bpm: FloatType) -> Result<Vec<u8>> {
308 midi::write_midi_bytes(notes, tempo_bpm)
309}
310
311#[deprecated(
313 since = "0.15.0",
314 note = "use `to_midi` for a score, or `midi::midi_notes_from_stream` for bare note events"
315)]
316pub fn midi_notes_from_stream(stream: &Stream) -> Result<Vec<MidiNote>> {
317 midi::midi_notes_from_stream(stream)
318}
319
320#[deprecated(
322 since = "0.15.0",
323 note = "use `from_midi` for a score, or `midi::stream_from_midi_notes` for bare note events"
324)]
325pub fn stream_from_midi_notes(notes: &[MidiNote]) -> Result<Stream> {
326 midi::stream_from_midi_notes(notes)
327}