Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed rayon and microfft dependencies #18

Merged
merged 1 commit into from Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@
debug/
target/
testaudio/
build_release.sh

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
17 changes: 11 additions & 6 deletions Cargo.toml
Expand Up @@ -12,18 +12,23 @@ keywords = ["cli"]
categories = ["command-line-utilities"]

[dependencies]
# Rendering stuff
bevy = "0.13.0"
bevy_egui = "0.25.0"
bincode = "1.3.3"
clap = { version = "4.5.0", features = ["derive"] }
microfft = "0.5.1"
rayon = "1.9.0"

# Audio playback and FFT computation
rodio = "0.17.3"
spectrum-analyzer = "1.5.0"

# CLI argument parsing
clap = { version = "4.5.0", features = ["derive"] }

# Utilities
serde = { version = "1.0.197", features = ["derive"] }
dirs = "5.0.1"
serde_yaml = "0.9.32"
spectrum-analyzer = "1.5.0"
bincode = "1.3.3"
stopwatch = "0.0.7"
dirs = "5.0.1"

[profile.release]
strip = true
Expand Down
5 changes: 2 additions & 3 deletions src/fft.rs
@@ -1,5 +1,4 @@
use bincode::{deserialize, serialize};
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use rodio::{source::Source, Decoder, OutputStream};
use serde::{Deserialize, Serialize};
use spectrum_analyzer::scaling::divide_by_N_sqrt;
Expand Down Expand Up @@ -71,7 +70,7 @@ pub fn intensity_normalize_fft(mut fft: FFT, bounds: &[f32], scaling_factor: &[f
}
x
};
fft.fft = fft.fft.into_par_iter().map(|x| rescale(x)).collect();
fft.fft = fft.fft.into_iter().map(|x| rescale(x)).collect();
fft
}

Expand All @@ -85,7 +84,7 @@ pub fn frequency_normalize_fft(mut fft: FFT, scaling_factor: &[f32]) -> FFT {
}
x
};
fft.fft = fft.fft.into_par_iter().map(|x| rescale(x)).collect();
fft.fft = fft.fft.into_iter().map(|x| rescale(x)).collect();
fft
}

Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Expand Up @@ -15,7 +15,6 @@ use systems::update_view_settings::*;

use bevy::prelude::*;
use bevy_egui::EguiPlugin;
use rayon::iter::{IntoParallelRefMutIterator, ParallelIterator};
use rodio::{Decoder, OutputStream};
use std::ffi::OsString;
use std::fs::File;
Expand Down Expand Up @@ -117,7 +116,7 @@ fn compute_and_preprocess_fft(fp: &PathBuf, args: &FFTArgs) -> Vec<Vec<f32>> {
}

fft_vec
.par_iter_mut()
.iter_mut()
.for_each(|x| space_interpolate(x, args.smoothness));
if args.debug {
println!("Interpolated in {:?}", now.elapsed());
Expand Down