From baaccfaa07503231960a566ff24ba2af0f496042 Mon Sep 17 00:00:00 2001 From: axelberndt Date: Tue, 9 Nov 2021 13:05:14 +0100 Subject: [PATCH] v0.8.28 - Minor fix in method `meico.supplementary.RandomNumberProvider.getValue(int index)` to ensure that only non-negative index values are processed. --- history.md | 4 ++++ src/meico/Meico.java | 2 +- src/meico/supplementary/RandomNumberProvider.java | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/history.md b/history.md index 82cf5552..b92a5c47 100644 --- a/history.md +++ b/history.md @@ -1,6 +1,10 @@ ### Version History +#### v0.8.28 +- Minor fix in method `meico.supplementary.RandomNumberProvider.getValue(int index)` to ensure that only non-negative index values are processed. + + #### v0.8.27 - A little optimization in method `meico.audio.Audio.convertSpectrogramToImage()`. In addition, this method has been extended with a new argument `normalize` to give applications the possibility to decide whether the spectrogram values should or should not be normalized for rendering. - Internal Verovio update to v3.7.0-dev-e93a13d. diff --git a/src/meico/Meico.java b/src/meico/Meico.java index 1f6954b6..0be65fb4 100644 --- a/src/meico/Meico.java +++ b/src/meico/Meico.java @@ -5,7 +5,7 @@ * @author Axel Berndt */ public class Meico { - public static final String version = "0.8.27"; + public static final String version = "0.8.28"; public static void main(String[] args) { System.out.println("meico v" + Meico.version); diff --git a/src/meico/supplementary/RandomNumberProvider.java b/src/meico/supplementary/RandomNumberProvider.java index 848cb4a3..88383d7e 100644 --- a/src/meico/supplementary/RandomNumberProvider.java +++ b/src/meico/supplementary/RandomNumberProvider.java @@ -260,6 +260,8 @@ else if (value < lowerLimit) * @return */ public double getValue(int index) { + index = Math.max(0, index); // ensure a positive index value + if (this.distributionType == RandomNumberProvider.DISTRIBUTION_LIST) // if distribution is based on predefined list return this.series.get(index % this.series.size()); // read the list value and repeat the list if the index exeeds its length