Skip to content

Instantly share code, notes, and snippets.

@gazzar
Created February 11, 2022 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gazzar/c2710fa9ec35735a03da38de6567db16 to your computer and use it in GitHub Desktop.
Save gazzar/c2710fa9ec35735a03da38de6567db16 to your computer and use it in GitHub Desktop.
Converts the filenames written by MPC Beats' Auto Sampler to ones recognised by the modwave Sample Builder
'''
Converts the filenames written by MPC Beats' Auto Sampler to ones recognised by the
modwave Sample Builder. Copy this file to where the samples are and run it there
python flat_to_sharp.py
OR
python -m flat_to_sharp.main
Gary Ruben 2022-01-22
'''
import glob
import os
import pathlib
def main():
cd = pathlib.Path(__file__).parent.resolve()
os.chdir(cd)
files = glob.glob('*.wav')
print(files)
for f in files:
new_f = f.replace('Ab', 'G#').replace('Bb', 'A#').replace('Db', 'C#').replace('Eb', 'D#').replace('Gb', 'F#')
os.rename(f, new_f)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment