From 60a21bbd79a2036c1b7ad82f34f88162a79a0f86 Mon Sep 17 00:00:00 2001 From: rnentjes Date: Thu, 26 Dec 2024 14:23:16 +0100 Subject: [PATCH] Update dependencies and refine MIDI handling. Upgraded various dependencies, including `vst-ui-base` to 1.2.0 and build configurations to include `mavenLocal`. Refined MIDI handling by removing redundant logging to improve performance and clarity. Adjusted knob component value ranges for better user experience. --- .../nl/astraeus/vst/chip/ChipProcessor.kt | 3 -- build.gradle.kts | 4 +- common.gradle.kts | 1 + .../nl/astraeus/vst/chip/view/MainView.kt | 41 +++++++++---------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/chip/ChipProcessor.kt b/audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/chip/ChipProcessor.kt index 19d57f2..5e4f515 100644 --- a/audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/chip/ChipProcessor.kt +++ b/audio-worklet/src/jsMain/kotlin/nl/astraeus/vst/chip/ChipProcessor.kt @@ -217,7 +217,6 @@ class VstChipProcessor : AudioWorkletProcessor() { is ByteArray -> { val message1 = TimedMidiMessage(data) - console.log("Message as bytearray: ", message1.timeToPlay, data) midiMessageBuffer.add(message1) playBuffer() } @@ -249,7 +248,6 @@ class VstChipProcessor : AudioWorkletProcessor() { (midiMessageBuffer.nextTimestamp() ?: 0.0) < currentTime ) { val midi = midiMessageBuffer.read() - console.log("Message", currentTime, midi) playMidi(midi.midi) } } @@ -258,7 +256,6 @@ class VstChipProcessor : AudioWorkletProcessor() { var index = 0 while (index < bytes.size && bytes[index].toUByte() > 0u) { - console.log("playMidi", bytes, index, bytes[index + 0], bytes[index + 1], bytes[index + 2]) val buffer = bytes.getBlob(index, 3) playMidiFromBuffer(buffer) index += 3 diff --git a/build.gradle.kts b/build.gradle.kts index 8d8bc94..f6f7b19 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -57,8 +57,7 @@ kotlin { dependencies { //base implementation("nl.astraeus:kotlin-css-generator:1.0.10") - implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0") - implementation("nl.astraeus:vst-ui-base:1.1.2") + implementation("nl.astraeus:vst-ui-base:1.2.0") implementation("nl.astraeus:midi-arrays:0.3.2") } } @@ -81,6 +80,7 @@ kotlin { val jvmMain by getting { dependencies { //base + implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0") implementation("io.undertow:undertow-core:2.3.14.Final") implementation("io.undertow:undertow-websockets-jsr:2.3.14.Final") diff --git a/common.gradle.kts b/common.gradle.kts index ad47d71..fc75351 100644 --- a/common.gradle.kts +++ b/common.gradle.kts @@ -10,5 +10,6 @@ allprojects { url = uri("https://gitea.astraeus.nl:8443/api/packages/rnentjes/maven") } mavenCentral() + mavenLocal() } } diff --git a/src/jsMain/kotlin/nl/astraeus/vst/chip/view/MainView.kt b/src/jsMain/kotlin/nl/astraeus/vst/chip/view/MainView.kt index 0b24f79..bf72574 100644 --- a/src/jsMain/kotlin/nl/astraeus/vst/chip/view/MainView.kt +++ b/src/jsMain/kotlin/nl/astraeus/vst/chip/view/MainView.kt @@ -96,7 +96,6 @@ object WaveformView: Komponent() { } } } - } object MainView : Komponent(), CssName { @@ -249,7 +248,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.volume, label = "Volume", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -275,7 +274,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.fmModFreq, label = "FM Freq", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -288,7 +287,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.fmModAmp, label = "FM Ampl", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -301,7 +300,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.amModFreq, label = "AM Freq", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -314,7 +313,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.amModAmp, label = "AM Ampl", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -327,7 +326,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.feedback, label = "Feedback", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -340,7 +339,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.delay, label = "Delay", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -353,7 +352,7 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.delayDepth, label = "Delay depth", - minValue = 0.005, + minValue = 0.0, maxValue = 1.0, step = 5.0 / 127.0, width = 100, @@ -368,26 +367,26 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.attack, label = "Attack", - minValue = 0.005, - maxValue = 1.0, - step = 5.0 / 127.0, + minValue = 0.0, + maxValue = 5.0, + step = 25.0 / 127.0, width = 100, height = 120, ) { value -> - VstChipWorklet.attack = value + VstChipWorklet.attack = value / 5.0 } ) include( ExpKnobComponent( value = VstChipWorklet.decay, label = "Decay", - minValue = 0.005, - maxValue = 1.0, - step = 5.0 / 127.0, + minValue = 0.0, + maxValue = 5.0, + step = 25.0 / 127.0, width = 100, height = 120, ) { value -> - VstChipWorklet.decay = value + VstChipWorklet.decay = value / 5.0 } ) include( @@ -407,13 +406,13 @@ object MainView : Komponent(), CssName { ExpKnobComponent( value = VstChipWorklet.release, label = "Release", - minValue = 0.005, - maxValue = 1.0, - step = 5.0 / 127.0, + minValue = 0.0, + maxValue = 5.0, + step = 25.0 / 127.0, width = 100, height = 120, ) { value -> - VstChipWorklet.release = value + VstChipWorklet.release = value / 5.0 } ) }