Skip to content

Commit

Permalink
Merge pull request #3 from sezanzeb/remove-comments
Browse files Browse the repository at this point in the history
Removing comments from sfz notes
  • Loading branch information
davem2 committed May 10, 2023
2 parents 542339e + 16ecee2 commit 51c5ad7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sfz2bitwig.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,12 @@ def _read_riff_chunk(fid):
+ ((loops,) if readloops else ()) \
+ ((pitch,) if readpitch else ())

def remove_comment(self, line):
return re.sub(r"//.*?$", "", line)

def sfz_note_to_midi_key(self, sfz_note):
sfz_note = self.remove_comment(sfz_note).strip()

SFZ_NOTE_LETTER_OFFSET = {'a': 9, 'b': 11, 'c': 0, 'd': 2, 'e': 4, 'f': 5, 'g': 7}
letter = sfz_note[0].lower()
if letter not in SFZ_NOTE_LETTER_OFFSET.keys():
Expand Down

0 comments on commit 51c5ad7

Please sign in to comment.