Skip to content

Commit

Permalink
Merge pull request #18 from gursi26/removed-dependencies
Browse files Browse the repository at this point in the history
removed rayon and microfft dependencies
  • Loading branch information
gursi26 committed Mar 18, 2024
2 parents dc4d78f + 228364b commit f6f2b99
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
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

0 comments on commit f6f2b99

Please sign in to comment.