Merge pull request #12 from Polochon-street/change-docs

Change some docs
This commit is contained in:
Polochon-street 2021-06-08 21:59:32 +02:00
commit 3236baacc6
6 changed files with 16 additions and 26 deletions

View file

@ -1,5 +1,8 @@
# Changelog # Changelog
## bliss 0.2.5
* Updates to docs
## bliss 0.2.4 ## bliss 0.2.4
* Make `Analysis::to_vec()` public. * Make `Analysis::to_vec()` public.

2
Cargo.lock generated
View file

@ -75,7 +75,7 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]] [[package]]
name = "bliss-audio" name = "bliss-audio"
version = "0.2.4" version = "0.2.5"
dependencies = [ dependencies = [
"bliss-audio-aubio-rs", "bliss-audio-aubio-rs",
"crossbeam", "crossbeam",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "bliss-audio" name = "bliss-audio"
version = "0.2.4" version = "0.2.5"
authors = ["Polochon-street <polochonstreet@gmx.fr>"] authors = ["Polochon-street <polochonstreet@gmx.fr>"]
edition = "2018" edition = "2018"
license = "GPL-3.0-only" license = "GPL-3.0-only"

View file

@ -21,9 +21,6 @@ used by C-bliss, since it uses
different, more accurate values, based on different, more accurate values, based on
[actual literature](https://lelele.io/thesis.pdf). It is also faster. [actual literature](https://lelele.io/thesis.pdf). It is also faster.
Note 2: The `bliss-rs` crate is outdated. You should use `bliss-audio`
(this crate) instead.
## Examples ## Examples
For simple analysis / distance computing, a look at `examples/distance.rs` and For simple analysis / distance computing, a look at `examples/distance.rs` and
`examples/analyse.rs`. `examples/analyse.rs`.
@ -32,20 +29,20 @@ Ready to use examples:
### Compute the distance between two songs ### Compute the distance between two songs
``` ```
use bliss_audio::Song; use bliss_audio::{BlissError, Song};
fn main() { fn main() -> Result<(), BlissError> {
let song1 = Song::new("/path/to/song1"); let song1 = Song::new("/path/to/song1")?;
let song2 = Song::new("/path/to/song2"); let song2 = Song::new("/path/to/song2")?;
println!("Distance between song1 and song2 is {}", song1.distance(song2)); println!("Distance between song1 and song2 is {}", song1.distance(&song2));
Ok(())
} }
``` ```
### Make a playlist from a song ### Make a playlist from a song
``` ```
use bliss_rs::{BlissError, Song}; use bliss_audio::{BlissError, Song};
use ndarray::{arr1, Array};
use noisy_float::prelude::n32; use noisy_float::prelude::n32;
fn main() -> Result<(), BlissError> { fn main() -> Result<(), BlissError> {
@ -56,18 +53,9 @@ fn main() -> Result<(), BlissError> {
.collect::<Result<Vec<Song>, BlissError>>()?; .collect::<Result<Vec<Song>, BlissError>>()?;
// Assuming there is a first song // Assuming there is a first song
let analysis_first_song = arr1(&songs[0].analysis); let first_song = songs.first().unwrap().to_owned();
// Identity matrix used to compute the distance. songs.sort_by_cached_key(|song| n32(first_song.distance(&song)));
// Note that it can be changed to alter feature ponderation, which
// may yield to better playlists (subjectively).
let m = Array::eye(analysis_first_song.len());
songs.sort_by_cached_key(|song| {
n32((arr1(&song.analysis) - &analysis_first_song)
.dot(&m)
.dot(&(arr1(&song.analysis) - &analysis_first_song)))
});
println!( println!(
"Playlist is: {:?}", "Playlist is: {:?}",
songs songs

View file

@ -38,7 +38,6 @@
//! ### Make a playlist from a song //! ### Make a playlist from a song
//! ```no_run //! ```no_run
//! use bliss_audio::{BlissError, Song}; //! use bliss_audio::{BlissError, Song};
//! use ndarray::{arr1, Array};
//! use noisy_float::prelude::n32; //! use noisy_float::prelude::n32;
//! //!
//! fn main() -> Result<(), BlissError> { //! fn main() -> Result<(), BlissError> {

View file

@ -19,7 +19,7 @@ use noisy_float::prelude::*;
* It indicates the (subjective) "speed" of a music piece. The higher the BPM, * It indicates the (subjective) "speed" of a music piece. The higher the BPM,
* the "quicker" the song will feel. * the "quicker" the song will feel.
* *
* It uses `WPhase`, a phase-deviation onset detection function to perform * It uses `SpecFlux`, a phase-deviation onset detection function to perform
* onset detection; it proved to be the best for finding out the BPM of a panel * onset detection; it proved to be the best for finding out the BPM of a panel
* of songs I had, but it could very well be replaced by something better in the * of songs I had, but it could very well be replaced by something better in the
* future. * future.