pikopiko 0.1.0

MML parser, compiler and chiptune player for games, with diagnostics designed for tools and AI.
Documentation
//! `sfx-hd` の組み込みの音色集([`crate::synth::ToneFile`])。曲では `#include "@sfx-hd/<カテゴリ>"` で読む。
//!
//! 効果音の音源は、楽器の種類(lead・bass)ではなく効果音のカテゴリ(shoot・explosion・hit・pickup・ui・move・powerup)でプリセットを持つので、ファイル名もカテゴリにする。ファイルはクレートの
//! `tones/sfx-hd/` にあり、ここで埋め込む(crates.io のパッケージにも入る)。
//!
//! 約束:
//!
//! - 音色の名前は音色集全体で重ねない(`@sfx-hd/all` で全部読めるように)。
//! - プリセット([`crate::synth::sfx_hd::presets::PRESETS`])は音色集の音色をそのまま並べたもの(ビルドのとき作る)。
//!   音色の正本はこのファイルだけで、プリセットと音色集で同じ名前の中身が違うことはない。
//! - 音色の説明は `locales/synths-sfx-hd-*.ftl` の `synth-sfx-hd-library-<名前>`。
//! - 中身は音の約束になる:変えるとその音色を使う曲の音が変わる(`tests/sfx_hd_determinism.rs` が見張る)。
//!
//! ```
//! let src = "#synth sfx-hd\n#include \"@sfx-hd/pickup\"\nA $hd_coin o4 c4";
//! let (song, diags) = pikopiko::synth::compile(src);
//! assert!(song.is_some() && diags.is_empty(), "{diags:?}");
//! ```

use super::ToneFile;

const fn file(name: &'static str, kind: Option<&'static str>, text: &'static str) -> ToneFile {
    ToneFile { name, kind, text }
}

/// `sfx-hd` の音色集のファイル(一覧に出す順)。一覧はビルドのとき `build.rs` が `tones/sfx-hd/` から作る
/// (プリセットの一覧 [`crate::synth::sfx_hd::presets::PRESETS`] と同じ並びから作り、2 つがずれないようにする)。
pub const FILES: &[ToneFile] = include!(concat!(env!("OUT_DIR"), "/sfx-hd-tone-files.rs"));