-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DataGreed/feature/song-parsing
Feature/song parsing
- Loading branch information
Showing
60 changed files
with
507 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
|
||
if __name__ == '__main__': | ||
|
||
from parsers import patterns | ||
|
||
# todo: remove this and implement tests | ||
p = patterns.PatternParser( | ||
# NOTE: this file was created with firmware 1.3.1 or older version | ||
filename="./reverse-engineering/session 1/project files/datagreed - rebel path tribute 2/patterns/pattern_06.mtp") | ||
parsed_pattern = p.parse() | ||
# print(parsed_pattern.render_as_table()) | ||
from exporters import midi | ||
|
||
midi_exporter = midi.PatternToMidiExporter(pattern=parsed_pattern) | ||
print(midi_exporter.generate_midi()) | ||
midi_exporter.write_midi_file("./test_midi_file.mid") | ||
from parsers import patterns, project | ||
|
||
# # todo: remove this and implement tests | ||
# p = patterns.PatternParser( | ||
# # NOTE: this file was created with firmware 1.3.1 or older version | ||
# filename="./reverse-engineering/session 1/project files/datagreed - rebel path tribute 2/patterns/pattern_06.mtp") | ||
# parsed_pattern = p.parse() | ||
# # print(parsed_pattern.render_as_table()) | ||
# from exporters import midi | ||
# | ||
# midi_exporter = midi.PatternToMidiExporter(pattern=parsed_pattern) | ||
# print(midi_exporter.generate_midi()) | ||
# midi_exporter.write_midi_file("./test_midi_file.mid") | ||
|
||
|
||
project = project.ProjectParser( | ||
filename_or_folder="./reverse-engineering/session 1/project files/datagreed - rebel path tribute 2/" | ||
) | ||
|
||
parsed_project = project.parse() | ||
print("Finished parsing project.") | ||
print(f"BPM: {parsed_project.song.bpm}") | ||
print(f"pattern mapping: {parsed_project.song.pattern_mapping}") | ||
print(f"pattern chain: {parsed_project.song.pattern_chain}") | ||
print(f"song as patterns: {parsed_project.song.get_song_as_patterns()}") | ||
|
||
|
Oops, something went wrong.