Waveform/dutyCycle
This commit is contained in:
@@ -3,6 +3,8 @@ package nl.astraeus.vst.chip.midi
|
||||
import kotlinx.browser.window
|
||||
import nl.astraeus.vst.chip.audio.VstChipWorklet
|
||||
import nl.astraeus.vst.chip.view.MainView
|
||||
import org.khronos.webgl.Uint8Array
|
||||
import org.khronos.webgl.get
|
||||
|
||||
external class MIDIInput {
|
||||
val connection: String
|
||||
@@ -77,7 +79,13 @@ object Midi {
|
||||
}
|
||||
|
||||
currentInput?.onmidimessage = { message ->
|
||||
console.log("Midi message:", message)
|
||||
val data = message.data as Uint8Array
|
||||
val hex = StringBuilder()
|
||||
for (index in 0 until data.length) {
|
||||
hex.append(data[index].toString(16))
|
||||
hex.append(" ")
|
||||
}
|
||||
console.log("Midi message:", hex)
|
||||
VstChipWorklet.postMessage(
|
||||
message.data
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user