diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-21 22:25:37 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-21 22:25:37 -0500 |
| commit | 654277d89471010f57794b8022385d2a99a15a14 (patch) | |
| tree | c10f98cfae20517c23007b941214a4c5f34bfd51 /graphics/src/audio/data.rs | |
| parent | dungeon: add chest usage/textures (diff) | |
| download | DungeonCrawl-654277d89471010f57794b8022385d2a99a15a14.tar.gz DungeonCrawl-654277d89471010f57794b8022385d2a99a15a14.tar.bz2 DungeonCrawl-654277d89471010f57794b8022385d2a99a15a14.zip | |
audio: create orchestration system
Diffstat (limited to 'graphics/src/audio/data.rs')
| -rw-r--r-- | graphics/src/audio/data.rs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/graphics/src/audio/data.rs b/graphics/src/audio/data.rs new file mode 100644 index 0000000..8cbdf45 --- /dev/null +++ b/graphics/src/audio/data.rs @@ -0,0 +1,65 @@ +use crate::audio::{parse, program::Program}; + +const MELODY: &str = r#" +; setup +a v100 d50 + +%define notes +a p$1 v100 - a v0 - +a p$1 v100 - a v0 - +a pd4 v100 -- a v0 -- +a pa4 v100 -- a v0 -- -- +a pg3s v100 - a v0 - -- +a pg3 v100 - a v0 - -- +a pf3 v100 --- a v0 - +a pd3 v100 - a v0 - +a pf3 v100 - a v0 - +a pg3 v100 - a v0 - +%end + +notes d3 +notes c3 +notes b3 +notes b3f + +notes d3 +notes c3 +notes b3 +notes b3f +"#; + +const BASE: &str = r#" +-128 + +; setup +b v100 d50 + +%define notes +b p$1 v100 -- b v0 -- +b p$1 v100 -- b v0 -- +b p$1 v100 - b v0 - +b p$1 v100 - b v0 - -- +b p$2 v100 - b v0 - -- +b p$2 v100 - b v0 - -- +b p$2 v100 - b v0 - +b p$2 v100 - b v0 - +b p$2 v100 -- b v0 -- +%end + +notes d2 d2 +notes c2 c2 +notes b2 b2 +notes b2 c2 +"#; + +pub struct Data { + pub test: Program, +} +impl Data { + pub fn load() -> parse::Result<Self> { + let melody = Program::parse(MELODY, true)?; + let base = Program::parse(BASE, true)?; + let test = melody.merge(base); + Ok(Self { test }) + } +} |