1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Core MIDI data model and in-memory I/O for the SIM music stack.
//!
//! This crate defines the protocol-agnostic MIDI types shared across the
//! constellation: tick-based timing ([`TickTime`]), the bounded integer
//! domains used by MIDI bytes ([`U7`], [`U14`], [`Channel`]), the event model
//! ([`MidiEvent`], [`MidiPayload`], [`ChannelMessage`], [`MetaEvent`],
//! [`SysExEvent`]), and the streaming [`MidiSource`]/[`MidiSink`] traits with
//! in-memory implementations. It also provides the [`NoteEchoPlayer`]
//! transform, controller-number constants, tempo conversions, and the
//! host-registered [`MidiIoLib`] that exposes the in-memory cards to a running
//! SIM [`Cx`](sim_kernel::Cx).
//!
//! Higher layers (Standard MIDI File, SysEx, live transports) build on this
//! model rather than redefining it.
//!
//! # Examples
//!
//! ```
//! use sim_lib_midi_core::{Channel, ChannelMessage, U7};
//!
//! let note = ChannelMessage::NoteOn {
//! ch: Channel::new(0).unwrap(),
//! key: U7(60),
//! vel: U7(100),
//! };
//! assert!(matches!(note, ChannelMessage::NoteOn { .. }));
//! ```
//!
//! ```
//! use sim_lib_midi_core::TickTime;
//!
//! // 480 ticks at 480 tpq is exactly one quarter note.
//! let one_quarter = TickTime::new(480, 480).unwrap();
//! assert_eq!(one_quarter.as_f64_quarters(), 1.0);
//! // Rebasing to a coarser resolution is exact here.
//! assert_eq!(one_quarter.rebase(96).unwrap().ticks, 96);
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;