pub enum MidiDataError {
Show 19 variants
OutOfRange,
NotAByte,
Unterminated,
TooLarge,
Negative(i128),
NotInList(i128),
NotChannelVoice(u8),
DataTooLarge {
message: u8,
byte: u8,
},
UnknownEventType(u8),
MissingParameters,
IncorrectData,
UnwrittenType,
NotATrack,
NotAFile(Vec<u8>),
BadHeaderLength,
UnreadFormat(u64),
TicksPerFrame(u64),
UnwrittenDivision,
BadChannel(i64),
}Expand description
What goes wrong with MIDI’s bytes, in music21’s words.
Variants§
OutOfRange
The bytes ran out where more were needed: Python’s IndexError.
NotAByte
A byte value outside a byte: Python’s ValueError from bytes.
Unterminated
No end was found to a variable-length number.
TooLarge
A variable-length number past what 64 bits hold.
Negative(i128)
A negative number, which has no variable-length form.
NotInList(i128)
A number past a byte, to be written as one.
NotChannelVoice(u8)
A status nibble that is no channel message.
DataTooLarge
A program change or channel pressure past 127; the message is the status nibble’s.
UnknownEventType(u8)
A status byte that starts no event music21 reads.
MissingParameters
A channel message written without both its parameters.
IncorrectData
A channel message’s data neither a byte nor bytes.
UnwrittenType
An event of no type that is written.
NotATrack
A track chunk without its tag.
NotAFile(Vec<u8>)
Bytes that do not start with FILE_HEADER; the first twenty.
BadHeaderLength
A file header of other than six bytes.
UnreadFormat(u64)
A file of format 2, whose tracks are separate pieces.
TicksPerFrame(u64)
SMPTE time of a frame rate MIDI does not have.
UnwrittenDivision
Ticks to a quarter note too many for the header to hold.
BadChannel(i64)
A channel other than 1 to 16.
Trait Implementations§
Source§impl Clone for MidiDataError
impl Clone for MidiDataError
Source§impl Debug for MidiDataError
impl Debug for MidiDataError
Source§impl Display for MidiDataError
impl Display for MidiDataError
impl Eq for MidiDataError
Source§impl Error for MidiDataError
impl Error for MidiDataError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for MidiDataError
impl PartialEq for MidiDataError
impl StructuralPartialEq for MidiDataError
Auto Trait Implementations§
impl Forget for MidiDataError
impl Freeze for MidiDataError
impl Move for MidiDataError
impl RefUnwindSafe for MidiDataError
impl Send for MidiDataError
impl Sync for MidiDataError
impl Unpin for MidiDataError
impl UnsafeUnpin for MidiDataError
impl UnwindSafe for MidiDataError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more