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
import argbind | |
from typing import List | |
@argbind.bind() | |
def train(epochs : int = 50): | |
"""Run training. | |
Parameters | |
---------- | |
epochs : int, optional |
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
# Example of binding function keyword arguments to an | |
# ArgumentParser, then using scopes to initialize function | |
# with different arguments. | |
# | |
# Example output: | |
# ❯ python example.py --autoclip.percentile=100 --train/autoclip.percentile=1 --val/autoclip.percentile=5 | |
# Before scoping | |
# ARGS={} | |
# Called autoclip with percentile=10.0 | |
# |
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
#!/usr/bin/env python | |
""" | |
Script to wait for an open GPU, then to run the job. Use with | |
`tsp` (task-spooler) for a common workflow, by queuing a job | |
that looks for a GPU and then runs the actual job. | |
Make this executable: chmod +x allocate.py | |
This stacks jobs on a single GPU if memory is available and the |
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
# to install requirements | |
# conda install -c conda-forge sox ffmpeg | |
# OR | |
# brew install sox | |
# brew install ffmpeg | |
# OR | |
# sudo apt-get install sox | |
# sudo apt-get install ffmpeg | |
# THEN | |
# pip install scaper |
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
import sys | |
sys.path.insert(0, '.') | |
from multiprocessing import cpu_count | |
import os | |
from utils import parallel_process | |
from scaper import Scaper, generate_from_jams | |
import librosa | |
import numpy as np | |
from tqdm import tqdm |
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
import scaper | |
import os | |
import sox | |
import numpy as np | |
import logging | |
import warnings | |
import random | |
import jams | |
import librosa | |
import itertools |
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
"""Helper functions for working with audio files in NumPy.""" | |
import numpy as np | |
import contextlib | |
def pcm2float(sig, dtype='float64'): | |
"""Convert PCM signal to floating point with a range from -1 to 1. | |
Use dtype='float32' for single precision. |
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
"""Helper functions for working with audio files in NumPy.""" | |
import numpy as np | |
import contextlib | |
def pcm2float(sig, dtype='float64'): | |
"""Convert PCM signal to floating point with a range from -1 to 1. | |
Use dtype='float32' for single precision. |
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
reverb_words = keys(wordDict['reverb']) | |
word_parameters = {} | |
function get_parameters() {return {'g': rev.g, 'd': rev.d, 'm': rev.m, 'f': rev.f, 'E': rev.E, 'wetdry': rev.wetdry}} | |
function save_word(index) {console.log(reverb_words[index]); changetoword(reverb_words[index], 'reverb', -1); word_parameters[reverb_words[index]] = get_parameters();} | |
current_index = 0; | |
function increment_word() {save_word(current_index); current_index++}; | |
interval_thing = setInterval(increment_word, 1000); | |
eq_words = keys(wordDict['eq']) | |
function save_word_eq(index) {console.log(eq_words[index]); changetoword(eq_words[index], 'eq', -1);} |