mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-12-12 07:35:08 +00:00
Replace Organya wavetable with one based on actual Cave Story samples
This commit is contained in:
parent
a0b396326f
commit
8603086694
BIN
src/builtin/organya-wavetable-doukutsu.bin
Normal file
BIN
src/builtin/organya-wavetable-doukutsu.bin
Normal file
Binary file not shown.
|
@ -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")),
|
||||
|
|
|
@ -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<T>(rx: Receiver<PlaybackMessage>, 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;
|
||||
|
|
|
@ -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()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue