mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Minor fixes when trying other tracks
This commit is contained in:
parent
ff5d324356
commit
db75d8b048
|
@ -375,12 +375,14 @@ impl TrackerChannel {
|
|||
PatternEffect::TonePortamento(amount, target) => {
|
||||
channel.volume(self.volume.try_change_base().unwrap());
|
||||
|
||||
if *amount < 1.into() {
|
||||
self.base_speed =
|
||||
(self.base_speed * amount.change_base()).max(target.change_base());
|
||||
} else {
|
||||
self.base_speed =
|
||||
(self.base_speed * amount.change_base()).min(target.change_base());
|
||||
if tick != 0 {
|
||||
if *amount < 1.into() {
|
||||
self.base_speed =
|
||||
(self.base_speed * amount.change_base()).max(target.change_base());
|
||||
} else {
|
||||
self.base_speed =
|
||||
(self.base_speed * amount.change_base()).min(target.change_base());
|
||||
}
|
||||
}
|
||||
|
||||
channel.playback(self.base_speed.change_base());
|
||||
|
|
|
@ -469,7 +469,7 @@ fn note_to_frequency_amega(note: Note, fine_tune: f64, relative_note: i8) -> f64
|
|||
let note = (note as usize)
|
||||
.checked_add_signed(relative_note as isize)
|
||||
.expect("Note gone negative");
|
||||
let pos = (note % 12) * 8 + (fine_tune / 16.0) as usize;
|
||||
let pos = ((note % 12) * 8 + (fine_tune / 16.0) as usize).min(AMEGA_FREQUENCIES.len() - 2);
|
||||
let frac = (fine_tune / 16.0) - (fine_tune / 16.0).floor();
|
||||
|
||||
let period = ((AMEGA_FREQUENCIES[pos] as f64 * (1.0 - frac))
|
||||
|
|
Loading…
Reference in a new issue