tools

various tools I have been using throughout the years
Log | Files | Refs | README | LICENSE

commit 28a50e5d4bb4bb5d99ff603d70122444d9fc58f4
parent bc4fd1a8a329ec53d2b998a6396eb0ae658946ef
Author: mtmn <miro@haravara.org>
Date:   Fri, 10 Apr 2026 10:00:51 +0200

feat: bump cargo deps

Former-commit-id: b4574fbdcc1c23189a298281814cc9be40705b8a
Former-commit-id: 23190ce06373a17ea9c466d36c7a4ee3b5ecca0b
Former-commit-id: ba539f892309944c20eff925d2253a42bd4a1dd7
Diffstat:
Mvirittaa/Cargo.toml | 4++--
Mvirittaa/src/audio_processing.rs | 17++++++++++++++---
2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/virittaa/Cargo.toml b/virittaa/Cargo.toml @@ -6,8 +6,8 @@ edition = "2024" [dependencies] bliss-audio = { version = "0.11.2", features = ["bench"] } bliss-audio-aubio-rs = "0.2.4" -ndarray = "0.16.1" -ndarray-stats = "0.6.0" +ndarray = "0.17.2" +ndarray-stats = "0.7.0" noisy_float = "0.2.0" anyhow = "1.0.45" clap = { version = "4.5.35", features = ["derive"] } diff --git a/virittaa/src/audio_processing.rs b/virittaa/src/audio_processing.rs @@ -2,7 +2,7 @@ use anyhow::Result; use bliss_audio::chroma::bench::{chroma_stft, estimate_tuning}; use bliss_audio::utils::bench::stft; use bliss_audio_aubio_rs::{OnsetMode, Tempo}; -use ndarray::{Array1, Axis}; +use ndarray::Array1; use ndarray_stats::Quantile1dExt; use noisy_float::types::n64; use crate::SAMPLE_RATE; @@ -97,8 +97,19 @@ fn calculate_global_chroma(samples: &[f32]) -> Result<Array1<f64>> { let n_chroma = u32::try_from(CHROMA_BINS)?; let chroma = chroma_stft(SAMPLE_RATE, &mut spectrum, window_size, n_chroma, tuning)?; - - Ok(chroma.sum_axis(Axis(1))) + + // Manually sum along axis 1 to avoid ndarray version conflicts + let shape = chroma.shape(); + let mut result = vec![0.0; shape[0]]; + for i in 0..shape[0] { + let mut sum = 0.0; + for j in 0..shape[1] { + sum += chroma[[i, j]]; + } + result[i] = sum; + } + + Ok(Array1::from_vec(result)) } fn find_best_key(global_chroma: &Array1<f64>) -> (usize, &'static str) {