| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
It is not perfect! Use it for experimental purposes. It is Work-In-Progress (WIP)!
Call number=midiParse(string midiData, table midiResult) E2 function. Here is a simple E2 code to demonstrate how you would use midiparser E2 extension:
@name midiparser example
local MidiData = "..." # Replace "..." with the actual MIDI data (plain contents of a '.mid' file).
local MidiResultTable = table() # Tell parser to store the result of MIDI data into a table.
if (midiParse(MidiData, MidiResultTable))
{
# Successfully parsed. We print out the resulting table:
printTable(MidiResultTable)
}
else
{
# Self-explanatory. MIDI data wasn't parsed because an error occured in parser (check your MIDI is valid and supported format).
print("An error occurred while parsing MIDI string, please check the input MIDI data is valid/supported!")
}Challenge for you: Make use of E2 file extension (use file* E2 functions), and then implement a chat-command to hook it up with midiParse, so you can parse .mid files from your computer via chat-command. Also, due security reasons, there is no midiParseFile E2 function.
{
format = 1,
timebase = 96,
tracks = {
{
messages = {
{
time = 0,
type = "meta",
meta = "Time Signature",
signature = { 4, 2, 24, 8 }
},
{
time = 0,
type = "meta",
meta = "End of Track"
}
}
},
{
messages = {
{
time = 0,
type = "meta",
meta = "Set Tempo",
tempo = 468375
},
{
time = 0,
type = "meta",
meta = "End of Track"
}
}
},
{
name = "TrackName",
messages = {
{
time = 0,
type = "meta",
meta = "Track Name",
text = "TrackName"
},
{
time = 0,
type = "on",
channel = 0,
number = 48,
velocity = 100
},
{
time = 96,
type = "off",
channel = 0,
number = 48,
velocity = 64
},
{
time = 0,
type = "meta",
meta = "End of Track"
}
}
}
}
}Sorry, there is no wiki nor docs...
Visit the Contributor Guidelines for more details. All contributors are expected to follow our Code of Conduct.
If you think you have found a bug or have a feature/enhancement request for Expression 2 MIDI parser extension, use our issue tracker.
Before opening a new issue, please be kind and search to see if your problem has already been reported. Try to be as detailed as possible in your issue reports.
When creating an issue, clearly explain
Also include any other information you think is relevant to reproduce the problem.
Expression 2 MIDI parser extension repository/code is freely distributed under the MIT license. See LICENSE for more details.
CaptainPRICE for developing Expression 2 MIDI parser extension.
GLua-midi-parser: GLua MIDI Parser Library.
| Back | FazBrowse Home | New Git URL |