ym2149_arkos_replayer/lib.rs
1//! Arkos Tracker 3 (AKS) file parser and multi-PSG player
2//!
3//! This crate provides support for loading and playing Arkos Tracker 3 songs (.aks format),
4//! which is an XML-based tracker format supporting multiple PSG chips for expanded polyphony.
5//!
6//! # Features
7//!
8//! - Load AKS (Arkos Tracker 3) XML files
9//! - Multi-PSG support (n chips = nĂ—3 channels)
10//! - Per-PSG frequency configuration (CPC, Atari ST, PlayCity, etc.)
11//! - Instruments with software/hardware envelopes
12//! - Arpeggios and pitch tables
13//! - Pattern-based sequencing with positions
14//! - Subsong support
15//!
16//! # Quick Start
17//!
18//! ```no_run
19//! use ym2149_arkos_replayer::{load_aks, ArkosPlayer};
20//!
21//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
22//! let data = std::fs::read("song.aks")?;
23//! let song = load_aks(&data)?;
24//!
25//! println!("Title: {}", song.metadata.title);
26//! println!("Subsongs: {}", song.subsongs.len());
27//! if !song.subsongs.is_empty() {
28//! println!("PSGs: {}", song.subsongs[0].psgs.len());
29//!
30//! let mut player = ArkosPlayer::new(song, 0)?; // Subsong 0
31//! player.play()?;
32//!
33//! let samples = player.generate_samples(882);
34//! }
35//! # Ok(())
36//! # }
37//! ```
38
39#![warn(missing_docs)]
40
41// Internal modules - not part of public API
42mod channel_player;
43mod effect_context;
44mod effects;
45mod expression;
46mod fixed_point;
47mod psg;
48
49// Re-export internal modules for extended tests (hidden from docs)
50#[cfg(feature = "extended-tests")]
51#[doc(hidden)]
52pub use channel_player::{ChannelFrame, ChannelPlayer, SampleCommand};
53#[cfg(feature = "extended-tests")]
54#[doc(hidden)]
55pub use psg::calculate_period;
56
57// Public modules
58pub mod error;
59pub mod format;
60pub mod parser;
61pub mod player;
62
63// Re-export public API (explicit, no star exports)
64pub use error::{ArkosError, Result};
65pub use format::{
66 AksSong, Arpeggio, Cell, ChannelLink, Effect, Instrument, InstrumentCell, Pattern, PatternCell,
67 PitchTable, Position, PsgConfig, PsgType, SampleInstrument, SongMetadata, SpecialCell,
68 SpecialTrack, Subsong, Track,
69};
70pub use parser::load_aks;
71pub use player::{ArkosMetadata, ArkosPlayer};
72
73// Re-export unified player trait from ym2149-common
74pub use ym2149_common::{ChiptunePlayer, PlaybackMetadata};