get a static sf2 to bake in and its so cute

This commit is contained in:
Bel LaPointe
2026-03-10 12:05:18 -06:00
parent fbfb216a64
commit 0f36241687
3 changed files with 31 additions and 33 deletions

View File

@@ -1 +0,0 @@
/usr/share/soundfonts/FatBoy.sf2

View File

@@ -8,7 +8,7 @@ use tinyaudio::prelude::*;
fn main() { fn main() {
// Load the SoundFont. // Load the SoundFont.
let mut sf2 = File::open("FatBoy.sf2").unwrap(); let mut sf2 = File::open("super_small_font.sf2").unwrap();
let sound_font = Arc::new(SoundFont::new(&mut sf2).unwrap()); let sound_font = Arc::new(SoundFont::new(&mut sf2).unwrap());
// Setup the audio output. // Setup the audio output.
@@ -23,7 +23,7 @@ fn main() {
let mut synthesizer = Synthesizer::new(&sound_font, &settings).unwrap(); let mut synthesizer = Synthesizer::new(&sound_font, &settings).unwrap();
// Play some notes (middle C, E, G). // 16 channels actually // 60=c 64=e 67=g //up to 128velocity though dont go below 50 tbh // 12 notes per octave // Play some notes (middle C, E, G). // 16 channels actually // 60=c 64=e 67=g //up to 128velocity though dont go below 50 tbh // 12 notes per octave
synthesizer.note_on(0, 64+12, 127); synthesizer.note_on(0, 64 + 12, 127);
//synthesizer.render(&mut left[..], &mut right[..]); // puts in a state of rendering the first loop of these notes //synthesizer.render(&mut left[..], &mut right[..]); // puts in a state of rendering the first loop of these notes
// The recycled output buffer per-loop, could be in lamba but that'd be wasteful // The recycled output buffer per-loop, could be in lamba but that'd be wasteful
@@ -44,4 +44,3 @@ fn main() {
// Let it ride // Let it ride
std::thread::sleep(std::time::Duration::from_secs(2)); std::thread::sleep(std::time::Duration::from_secs(2));
} }

BIN
super_small_font.sf2 Normal file

Binary file not shown.