Skip to main content

music21_rs/search/
mod.rs

1//! Finding music in streams: music21's `search` package. A
2//! [`StreamSearcher`] and the searches beside it find runs of notes by
3//! name, rhythm or anything else; the translations turn notes into text,
4//! which the approximate searches compare as Python's `difflib` does; and a
5//! [`LyricSearcher`] finds text in a stream's lyrics, and the notes it is
6//! sung to. [`index_score_parts`] cuts each part of a score into
7//! overlapping stretches of that text, and [`score_similarity`] compares
8//! every stretch of some scores with every other. A [`SegmentMatcher`]
9//! finds rows and sets of pitch classes in the notes of a stream, and
10//! labels them there.
11
12mod base;
13pub(crate) mod difflib;
14mod lyrics;
15mod segment;
16mod serial;
17
18pub use base::{
19    Algorithm, Filter, MeasureRhythm, SearchMatch, SearchTerm, Searched, StreamSearcher,
20    Translation, approximate_note_search, approximate_note_search_no_rhythm,
21    approximate_note_search_only_rhythm, approximate_note_search_weighted, iterated,
22    most_common_measure_rhythms, note_name_rhythmic_search, note_name_search, notes_and_rests,
23    recursed, rhythmic_search, similarity, translate_diatonic_stream_to_string,
24    translate_duration_to_bytes, translate_intervals_and_speed, translate_note_tie_to_byte,
25    translate_note_to_byte, translate_note_with_duration_to_bytes, translate_stream_to_string,
26    translate_stream_to_string_no_rhythm, translate_stream_to_string_only_rhythm,
27};
28pub use lyrics::{IndexedLyric, LINE_BREAK, LyricIdentifier, LyricMatch, LyricSearcher};
29pub use segment::{
30    SegmentAt, SegmentSimilarity, Segments, index_score_parts, index_score_parts_with,
31    score_similarity, translate_monophonic_part_to_segments,
32};
33pub use serial::{
34    ContiguousSegment, ContiguousSegmentSearcher, Matching, Repetitions, SegmentMatcher,
35    SegmentNote,
36};