Resetting MidiPlayer
-
What is the best way to reset a MidiPlayer module via scripting?
currently I am using a button to trigger an inline function to set the file to "" but it seems to have problems:
-
it works but the player and the overlay panel do not update to show it is empty.
-
after i use it once in the exported plugin it no longer lets me drag in new midi files
heres the code im using for it:
inline function onButton1Control(component, value) { if (value) MIDIPlayer1.setFile("", true, false); }; Content.getComponent("Button1").setControlCallback(onButton1Control);
-
-
@Adam_G The second bool should be set to
true
as well so the empty sequence is selected.
Though I don't know if this will fix the dragging issue... -
@ustk that worked for both! thanks so much
now if i can just figure out why the new midi doesnt show visibly until i press play..
-
@Adam_G Do you mean the note overlay? I think you'll need to provide a snippet example because everything works fine here, the overlay updates as soon as I set an empty file or a sequence...
-
@ustk yes, I have a paint routine painting the midi notes onto a panel and a draggable filter panel connected to the midi player that is over the panel.
i will try to put a snippet together today
-
@Adam_G So you probably have to call
myMidiNotePanel.repaint()
and orgetNoteRetangleList()
but it's hard to say without seeing a bit of code... -