From 21f3213e37ff43511815428234afdbf9eec78983 Mon Sep 17 00:00:00 2001 From: kravohi Date: Thu, 7 Nov 2024 13:28:22 -0700 Subject: [PATCH 1/2] metadata type 33 is not defined metadata type 33 or "Midi Port" acording to this website -> https://mido.readthedocs.io/en/1.1.24/meta_message_types.html <- was not defined in Constants.METADATA_TYPES. Loading a midi file that uses the metadata type 33 causes the program to fail with the error "Table index is nil". Is there a reason why these other types are not defined? --- src/LuaMidi/Constants.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LuaMidi/Constants.lua b/src/LuaMidi/Constants.lua index 70575b6..bac8621 100644 --- a/src/LuaMidi/Constants.lua +++ b/src/LuaMidi/Constants.lua @@ -28,8 +28,10 @@ local Constants = { META_END_OF_TRACK_ID = {0x2F, 0x00}, PROGRAM_CHANGE_STATUS = 0xC0, NOTES = {}, - METADATA_TYPES = {"Text","Copyright","Name","Instrument","Lyric","Marker","Cue Point", - [81] = "Tempo",[88] = "Time Signature",[89] = "Key Signature"} + METADATA_TYPES = { + "Text","Copyright","Name","Instrument","Lyric","Marker","Cue Point", + [33] = "Midi Port", [81] = "Tempo",[88] = "Time Signature",[89] = "Key Signature" + } } local table_notes = { From ab904460f2588a68934a22496d592cfb5284a34a Mon Sep 17 00:00:00 2001 From: kravohi Date: Thu, 7 Nov 2024 13:43:15 -0700 Subject: [PATCH 2/2] Also missing type 84 or "SMPTE Offset" --- src/LuaMidi/Constants.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/LuaMidi/Constants.lua b/src/LuaMidi/Constants.lua index bac8621..0838979 100644 --- a/src/LuaMidi/Constants.lua +++ b/src/LuaMidi/Constants.lua @@ -30,7 +30,8 @@ local Constants = { NOTES = {}, METADATA_TYPES = { "Text","Copyright","Name","Instrument","Lyric","Marker","Cue Point", - [33] = "Midi Port", [81] = "Tempo",[88] = "Time Signature",[89] = "Key Signature" + [33] = "Midi Port", [81] = "Tempo", + [84] = "SMPTE Offset", [88] = "Time Signature",[89] = "Key Signature" } }