Layer sostenuto off + playNote with duration > 0 can cause hanging notes

Steps to reproduce:

  • Create a new program

  • Add 2 layers with a synth zone in each

  • Turn the layer sostenuto off for each layer

    sostenuto off

  • Add a script module and paste this code:

local layers = this.parent:findLayers()

function onNote(e)
	playNote(e.note, e.velocity, 1000, layers[1])
	playNote(e.note, e.velocity, 1000, layers[2])

function onRelease(e)
	-- eat the release
  • Play a short note (shorter than 1 second)

Result: One note stops after 1 second, the other keeps playing indefinitely.

Expected result: both notes should stop after 1 second.

It seems to work as expected if layer sostenuto is on or the notes are different.
(Or if you keep the key pressed longer than 1 second)

function onNote(e)
	playNote(e.note, e.velocity, 1000, layers[1])
	playNote(e.note + 12, e.velocity, 1000, layers[2])

Hanging note.vstpreset (4.8 KB)

playNote with -1 ignores key release if onRelease function is present - Virtual instruments / HALion - Steinberg Forums

1 Like