Skip to content

Commit

Permalink
convert a few more
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Dec 17, 2022
1 parent 0d2ed00 commit c83a0b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def analyze(fname):
else:
kick.append(0)
kick = librosa.amplitude_to_db(kick)
with open(fname+".json","w") as f:
with open(fname + ".json", "w") as f:
f.write(json.dumps(list(kick)))

if doplot:
Expand Down Expand Up @@ -112,7 +112,7 @@ def gather2(fname):
return data


for fname in tqdm(list(glob.glob("amenbreak/*.flac"))):
for fname in tqdm(list(glob.glob("amens/*.flac"))):
if "slow" in fname:
continue
analyze(fname)
Expand Down
10 changes: 7 additions & 3 deletions lib/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def convert(filepath):

# part 1
# folders = [
# "Rhythm Lab The Ultimate Amen Breaks Pack/SAMPLED AND REMIXED",
# "Amen Breaks Compilation",
# # "Rhythm Lab The Ultimate Amen Breaks Pack/SAMPLED AND REMIXED",
# # "Amen Breaks Compilation",
# "amens-raw/Compound Audio Presents - 101 Amen Breaks/Amen Loops WAV"
# ]
# files = []
# for folder in folders:
Expand All @@ -65,11 +66,14 @@ def convert(filepath):
# for filepath in files:
# convert(filepath)

# part 2
# # part 2
files = []
for fname in glob.glob("amens/*flac"):
if ".slow." in fname:
continue
if os.path.exists(f"{fname}.slow.flac"):
print("skipping " + fname)
continue
duration = librosa.get_duration(filename=fname)
cmd = f"sox '{fname}' '{fname}.slow.flac' tempo -s 0.125 highpass 30 phaser 0.9 0.85 4 0.23 1.3 -s deemph trim 0 {duration*2}"
ic(cmd)
Expand Down

0 comments on commit c83a0b1

Please sign in to comment.