-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nico Chatzi
committed
Nov 21, 2023
1 parent
849fb6a
commit 92d11d3
Showing
29 changed files
with
339 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,3 @@ function resume() end | |
|
||
-- Request to stop the application | ||
function stop() end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
local M = {} | ||
|
||
function M.print_table_or_user_data(t, indent) | ||
indent = indent or 0 | ||
local t_type = type(t) | ||
indent = indent or 0 | ||
local t_type = type(t) | ||
|
||
if t_type == "table" then | ||
for k, v in pairs(t) do | ||
if type(v) == "table" or type(v) == "userdata" then | ||
print(string.rep(" ", indent) .. k .. ":") | ||
M.print_table_or_user_data(v, indent + 1) | ||
else | ||
print(string.rep(" ", indent) .. k .. ": " .. tostring(v)) | ||
end | ||
end | ||
elseif t_type == "userdata" then | ||
local meta = getmetatable(t) | ||
if meta and meta.__tostring then | ||
print(string.rep(" ", indent) .. tostring(t)) | ||
else | ||
print(string.rep(" ", indent) .. "userdata") | ||
end | ||
else | ||
print(string.rep(" ", indent) .. tostring(t)) | ||
end | ||
if t_type == "table" then | ||
for k, v in pairs(t) do | ||
if type(v) == "table" or type(v) == "userdata" then | ||
print(string.rep(" ", indent) .. k .. ":") | ||
M.print_table_or_user_data(v, indent + 1) | ||
else | ||
print(string.rep(" ", indent) .. k .. ": " .. tostring(v)) | ||
end | ||
end | ||
elseif t_type == "userdata" then | ||
local meta = getmetatable(t) | ||
if meta and meta.__tostring then | ||
print(string.rep(" ", indent) .. tostring(t)) | ||
else | ||
print(string.rep(" ", indent) .. "userdata") | ||
end | ||
else | ||
print(string.rep(" ", indent) .. tostring(t)) | ||
end | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
local M = {} | ||
|
||
M.headers = { | ||
sysex_start = 0xF0, | ||
sysex_end = 0xF7, | ||
note_on = 0x90, | ||
note_off = 0x80, | ||
poly_pressure = 0xA0, | ||
controller = 0xB0, | ||
program_change = 0xC0, | ||
channel_pressure = 0xD0, | ||
pitch_bend = 0xE0, | ||
sysex_start = 0xF0, | ||
sysex_end = 0xF7, | ||
note_on = 0x90, | ||
note_off = 0x80, | ||
poly_pressure = 0xA0, | ||
controller = 0xB0, | ||
program_change = 0xC0, | ||
channel_pressure = 0xD0, | ||
pitch_bend = 0xE0, | ||
} | ||
|
||
function M.parse_header(bytes) | ||
for header in M.headers do | ||
if bytes[0] & header ~= 0 then | ||
return header | ||
end | ||
end | ||
for header in M.headers do | ||
if bytes[0] & header ~= 0 then | ||
return header | ||
end | ||
end | ||
|
||
return nil | ||
return nil | ||
end | ||
|
||
return M |
Oops, something went wrong.