Trigger_instrument_note_on does not work during pattern playback

problem.

i am trying to get this to happen:

  1. playback is on.
  2. editmode is on.
  3. use a script to trigger_instrument_note_on.

i am not able to hear the sound.
the problem is, that, if playing is Off, then it most definitely triggers.

so is this a case of documentation falling apart, where it should have said “note: only works during playing=false, or what is going on?

@taktik

during the pattern playback, yes, there are notes in the pattern data. but there is also a lot of silence, which is when i try to trigger the sample. im just trying to replicate the impulsetracker/screamtracker3 behaviour, which is: 1. even if playback is on 2. and you are editing the pattern 3. entering a note to the pattern data will 4. trigger the instrument.

so you dont have to wait until the playhead hits that note, to hear the note.

Could you please tell us how exactly to replicate this - what exactly is the problem with existing notes while playback?

I’ve quickly given this a test, but it seems to work as expected.

1 Like

see below for better more accurate response

renoise.song():trigger_instrument_note_on(2, 1, 66, 1.0)

the above single line will work if:

  • `playing=false` = works.
  • playing=true, editmode=false = works

it will not work if playing=true, editmode=true`.

so the big ask is:

if editmode=true can this triggering be made to work.

Hi Taktik,

Thanks for confirming trigger_instrument_note_on(1, 1, 48, 1.0) works during playback. Following up with a sharper repro — the API actually silences under a very specific combined state:

Repro (clean, in the Scripting Terminal — no tool involved):

renoise.song():trigger_instrument_note_on(2, 1, 48, 1.0)

(Instrument 2 has a sample mapped at C-4; track 1 is a sequencer track.)

Transport state Edit mode Result
Stopped Off ✓ plays
Stopped On ✓ plays
Playing Off ✓ plays
Playing On ✗ silent

Only the last combination silences the call. Either condition alone is fine — it’s specifically playback ON + edit mode ON together that drops the audio.

This is the exact state the “Trigger Sample on Pattern Input During Record” feature needs to work in, because that’s record mode by definition: you’re playing the song, edit mode is on so notes get recorded, and we want the user to hear what they’re typing into the pattern.

Two questions:

  1. Is this intentional — some kind of input-routing arbitration where, with edit mode on, Renoise routes preview audio elsewhere or suppresses it to avoid double-triggers from external MIDI?
  2. If intentional, is there a way to opt out from a tool, or a different API we should use for previewing notes during record-while-playing?

If it’s a bug, happy to send a minimal repro project. The feature is at paketti/PakettiTriggerOnInput.lua at master · esaruoho/paketti · GitHub

Thanks!
— Esa (Paketti)

1 Like

ok, one more clarification.

this is the setup:

renoise.song().transport.playing=true
renoise.song().transport.edit_mode=true
renoise.app().window.active_middle_frame=1
renoise.song():trigger_instrument_note_on(2, 1, 66, 1.0)

so one needs to be on the pattern editor. if one is in sample editor, surprise surprise, the instrument does get triggered.

not if on the pattern editor.