I was more-so asking if it could be done so that it is included in the instruction while being parsed, rather than doing it in real-time while it’s being played using a separate NoteOff function.
I’m using custom piano sounds and would like to tween the volume to zero with the duration of the tween being the duration of the note, which, ideally, would be included in the instruction when the NoteOn function is called.
Edit: After some research and some math, I was able to calculate and include the duration of the note in the instructions for the NoteOn event during parse.
-- Get Instrument name when it is parsed and fired
Parser.Events.InstrumentName = function(Instruction)
print(Instruction.Text)
end
-- Get Instrument name whenever the player fires the event
Player.Events.InstrumentName = function(Instruction)
print(Instruction.Text)
end
Could you provide code? I’m not sure what could be causing it at the moment It might be the midi file containing the numbers instead but it should not return a number.
Hi, the code is simply listening to the text events and printing Data.Text.
The issue seems to be cause by the fact that the “LENGTH” data types are all numbers (because of tonumbers), and instead of getting strings I get the max integer possible.
(I have tested the midis on other off-roblox parsers and they get the text data just fine)
I was able to fix this by creating a new “STRING” data type instead of “LENGTH”, which returns the data converted from hex to a string, instead of using tonumber(…, 16).
I’m also working on an audio api midi player, and facing other issues (like it halting for a few seconds, skipping notes, mixing note order, on larger midis but also on short ones, and bad controllerchange parsing), do you have a discord?