diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33346a0..4676308 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,11 @@ jobs: tag_name: '${{ steps.getversion.outputs.releaseVersion }}' body: | A stable build of straycat-rs. - ### Changes + ##[${{ steps.getversion.outputs.version }}] - xxxx-xx-xx + + ### Added + + ### Changed ### Fixed diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be6f44..e48f09c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,20 @@ # Changelog + +## [1.0.9] - 2024-07-23 + +### Fixed + - Fixed error with interpreting pitchbends that causes pitch errors around overlap areas. + +## [1.0.8] - 2024-07-23 + +### Changed + - Add checksum hashes for each release by @layetri in https://github.com/UtaUtaUtau/straycat-rs/pull/4 (thank you again!) + +## [1.0.6] - 2024-07-23 + +### Changed + - Add GitHub Actions for CI by @layetri in https://github.com/UtaUtaUtau/straycat-rs/pull/1 (thank you!) + ## [1.0.1] - 2024-07-23 ### Fixed @@ -18,6 +34,9 @@ - Initial release 🎉 +[1.0.9]: https://github.com/UtaUtaUtau/straycat-rs/compare/v1.0.8...v1.0.9 +[1.0.8]: https://github.com/UtaUtaUtau/straycat-rs/compare/v1.0.6...v1.0.8 +[1.0.6]: https://github.com/UtaUtaUtau/straycat-rs/compare/v1.0.1...v1.0.6 [1.0.1]: https://github.com/UtaUtaUtau/straycat-rs/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/UtaUtaUtau/straycat-rs/compare/v1.0.0-alpha...v1.0.0 [1.0.0-alpha]: https://github.com/UtaUtaUtau/straycat-rs/releases/tag/v1.0.0-alpha \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 10703b7..7d8c0b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "straycat-rs" -version = "1.0.8" +version = "1.0.9" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index c05ab75..e69995e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "straycat-rs" -version = "1.0.8" +version = "1.0.9" edition = "2021" [dependencies] diff --git a/README.md b/README.md index af658ac..2b012e1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# straycat-rs +# straycat-rs ![build](https://github.com/UtaUtaUtau/straycat-rs/actions/workflows/build.yml/badge.svg) A Rust port of straycat, a WORLD-based UTAU resampler # How to use diff --git a/src/pitchbend/parser.rs b/src/pitchbend/parser.rs index 9e15839..673795d 100644 --- a/src/pitchbend/parser.rs +++ b/src/pitchbend/parser.rs @@ -52,22 +52,24 @@ pub fn pitch_string_to_midi>(pitch_string: S) -> Result> let mut pitchbend: Vec = Vec::new(); let pitch_rle: Vec<&str> = pitch_string.split("#").collect(); - for i in 0..pitch_rle.len() / 2 { - let pair = &pitch_rle[i * 2..i * 2 + 2]; - let mut stream = to_int12_stream(pair[0])?; - let last_point = stream[stream.len() - 1]; - let rle: usize = pair[1].parse()?; - pitchbend.append(&mut stream); - for _ in 1..rle { - pitchbend.push(last_point); + for chunk in pitch_rle.chunks(2) { + println!("{:?}", chunk); + let mut stream = to_int12_stream(chunk[0])?; + let last_point = if stream.len() > 0 { + let temp = stream[stream.len() - 1]; + pitchbend.append(&mut stream); + Some(temp) + } else { + None + }; + if chunk.len() == 2 { + let rle: usize = chunk[1].parse()?; + for _ in 0..rle { + pitchbend.push(last_point.unwrap_or(0)) + } } } - if pitch_rle.len() % 2 == 1 { - let mut stream = to_int12_stream(pitch_rle[pitch_rle.len() - 1])?; - pitchbend.append(&mut stream); - } - let ref_pitch = pitchbend[0]; let flat_pitch = pitchbend.iter().all(|x| *x == ref_pitch);