Skip to content

Commit

Permalink
removing comments from sfz notes
Browse files Browse the repository at this point in the history
  • Loading branch information
sezanzeb committed Apr 7, 2023
1 parent 542339e commit 16ecee2
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 16ecee2

Please sign in to comment.