mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2025-11-30 00:03:33 +00:00
make organya sound more like in original game
This commit is contained in:
parent
8603086694
commit
63bfce689d
Binary file not shown.
|
|
@ -103,7 +103,7 @@ impl SoundManager {
|
|||
}
|
||||
|
||||
pub fn play_sfx(&mut self, id: u8) {
|
||||
self.tx.send(PlaybackMessage::PlaySample(id));
|
||||
let _ = self.tx.send(PlaybackMessage::PlaySample(id));
|
||||
}
|
||||
|
||||
pub fn play_song(&mut self, song_id: usize, constants: &EngineConstants, ctx: &mut Context) -> GameResult {
|
||||
|
|
@ -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 * 15 / 1000;
|
||||
let buf_size = sample_rate as usize * 10 / 1000;
|
||||
let mut bgm_buf = vec![0x8080; buf_size];
|
||||
let mut pxt_buf = vec![0x8000; buf_size];
|
||||
let mut bgm_index = 0;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ use crate::sound::organya::Song as Organya;
|
|||
use crate::sound::stuff::*;
|
||||
use crate::sound::wav::*;
|
||||
use crate::sound::wave_bank::SoundBank;
|
||||
use num_traits::real::Real;
|
||||
|
||||
pub struct PlaybackEngine {
|
||||
song: Organya,
|
||||
|
|
@ -73,7 +72,7 @@ impl PlaybackEngine {
|
|||
}
|
||||
}
|
||||
|
||||
for (idx, (track, buf)) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()).enumerate() {
|
||||
for (idx, (_track, buf)) in song.tracks[8..].iter().zip(buffers[128..].iter_mut()).enumerate() {
|
||||
*buf =
|
||||
MaybeUninit::new(
|
||||
RenderBuffer::new(
|
||||
|
|
@ -145,8 +144,8 @@ impl PlaybackEngine {
|
|||
}
|
||||
}
|
||||
|
||||
for (inst, buf) in song.tracks[8..].iter().zip(self.track_buffers[128..].iter_mut()) {
|
||||
*buf = RenderBuffer::new(samples.samples[inst.inst.inst as usize].clone());
|
||||
for (idx, (_track, buf)) in song.tracks[8..].iter().zip(self.track_buffers[128..].iter_mut()).enumerate() {
|
||||
*buf = RenderBuffer::new(samples.samples[idx].clone());
|
||||
}
|
||||
|
||||
self.song = song;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
pub const FRQ_TBL: [i16; 12] = [
|
||||
261,278,294,311,329,349,371,391,414,440,466,494
|
||||
262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494
|
||||
];
|
||||
|
||||
pub const PAN_TBL: [i16; 13] = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue