away with notes just beats now
This commit is contained in:
@@ -3,6 +3,7 @@ use itertools::Itertools;
|
||||
mod flags;
|
||||
mod syn;
|
||||
mod tone;
|
||||
mod seq;
|
||||
|
||||
fn main() {
|
||||
let flags = flags::Flags::new();
|
||||
@@ -14,15 +15,15 @@ fn main() {
|
||||
);
|
||||
syn.tone_on(0, tone::new("c+5"));
|
||||
|
||||
play(syn, flags.sample_rate, flags.bpm, flags.smallest_note);
|
||||
play(syn, flags.sample_rate, flags.bpm);
|
||||
}
|
||||
|
||||
fn play(mut s: syn::Syn, sample_rate: usize, bpm: usize, smallest_note: usize) {
|
||||
let samples_per_smallest_note = sample_rate / bpm * 60 / smallest_note;
|
||||
fn play(mut s: syn::Syn, sample_rate: usize, bpm: usize) {
|
||||
let samples_per_beat = sample_rate / bpm * 60;
|
||||
let params = tinyaudio::prelude::OutputDeviceParameters {
|
||||
channels_count: 2,
|
||||
sample_rate: sample_rate,
|
||||
channel_sample_count: samples_per_smallest_note,
|
||||
channel_sample_count: samples_per_beat,
|
||||
};
|
||||
|
||||
let sample_count = (params.channel_sample_count) as usize;
|
||||
|
||||
Reference in New Issue
Block a user