diff --git a/src/builtin/organya-wavetable-doukutsu.bin b/src/builtin/organya-wavetable-doukutsu.bin new file mode 100644 index 0000000..4ab3a9f Binary files /dev/null and b/src/builtin/organya-wavetable-doukutsu.bin differ diff --git a/src/builtin/pixtone.pcm b/src/builtin/organya-wavetable-org.bin similarity index 100% rename from src/builtin/pixtone.pcm rename to src/builtin/organya-wavetable-org.bin diff --git a/src/builtin_fs.rs b/src/builtin_fs.rs index 11df145..23fe7d1 100644 --- a/src/builtin_fs.rs +++ b/src/builtin_fs.rs @@ -110,7 +110,7 @@ impl BuiltinFS { FSNode::File("builtin_font.fnt", include_bytes!("builtin/builtin_font.fnt")), FSNode::File("builtin_font_0.png", include_bytes!("builtin/builtin_font_0.png")), FSNode::File("builtin_font_1.png", include_bytes!("builtin/builtin_font_1.png")), - FSNode::File("pixtone.pcm", include_bytes!("builtin/pixtone.pcm")), + FSNode::File("organya-wavetable-doukutsu.bin", include_bytes!("builtin/organya-wavetable-doukutsu.bin")), FSNode::File("touch.png", include_bytes!("builtin/touch.png")), FSNode::Directory("shaders", vec![ FSNode::File("basic_150.vert.glsl", include_bytes!("builtin/shaders/basic_150.vert.glsl")), diff --git a/src/sound/mod.rs b/src/sound/mod.rs index e4cb4e1..efdb5c2 100644 --- a/src/sound/mod.rs +++ b/src/sound/mod.rs @@ -83,7 +83,7 @@ impl SoundManager { let device = host.default_output_device().ok_or_else(|| AudioError(str!("Error initializing audio device.")))?; let config = device.default_output_config()?; - let bnk = wave_bank::SoundBank::load_from(filesystem::open(ctx, "/builtin/pixtone.pcm")?)?; + let bnk = wave_bank::SoundBank::load_from(filesystem::open(ctx, "/builtin/organya-wavetable-doukutsu.bin")?)?; std::thread::spawn(move || { if let Err(err) = match config.sample_format() { @@ -197,7 +197,7 @@ fn run(rx: Receiver, bank: SoundBank, org_engine.set_sample_rate(sample_rate as usize); org_engine.loops = usize::MAX; - let buf_size = sample_rate as usize * 30 / 1000; + let buf_size = sample_rate as usize * 15 / 1000; let mut bgm_buf = vec![0x8080; buf_size]; let mut pxt_buf = vec![0x8000; buf_size]; let mut bgm_index = 0; diff --git a/src/sound/playback.rs b/src/sound/playback.rs index 8a3e056..d9a9c8a 100644 --- a/src/sound/playback.rs +++ b/src/sound/playback.rs @@ -73,12 +73,13 @@ impl PlaybackEngine { } } - for (inst, buf) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()) { + for (idx, (track, buf)) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()).enumerate() { *buf = MaybeUninit::new( RenderBuffer::new( // FIXME: *frustrated screaming* - samples.samples[inst.inst.inst as usize].clone() + //samples.samples[track.inst.inst as usize].clone() + samples.samples[idx].clone() ) ); }