Interactive Midi - Midi Parser & Player

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.

1 Like

How do i get instrument name :thinking: i followed the code but idk how to get instrument name from Player.Events.NoteOn

-- 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


Each event sends different type of data.
Like NoteOn sends

Player.Events.NoteOn = function(Instruction)
      print( Instruction.Channel, Instruction.NoteNumber, Instruction.Velocity)
end

Yooo this is really cool! I might try making a Midi predictive model using @Kironte’s Neural Network Library alongside this.

Hi! I’ve tried a lot of MIDIs and every text event is returning a number instead of a string, do you know how I could address this?
image

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?

MIDI… oh man

I remember reading the MIDI Specification for the Open Note Block Editor to fix something on it.

or add this button so it would work with Roblox Sheet without having to use third-party to do MIDI to Roblox

image

 

Why do the Chords for Viva La Vida sound different.

This is great though. The only thing this needs is a way to toggle the channels of a MIDI Track, mid play. Because the Drums channel.

And a way to force adjust the Velocity of a Note. (Volume)
Because onlinesequencer :person_shrugging:

1 Like