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 time | |
from rtmidi.midiutil import open_midiinput | |
port = 0 | |
midi_in, port_name = open_midiinput(port) | |
last_gestures = [] | |
last_gesture = None | |
while True: |
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
!pip install librosa | |
import glob | |
import os | |
import librosa | |
def closest_sample(note, notes): | |
absolute_difference_function = lambda list_value : abs(list_value - note) | |
return min(notes, key=absolute_difference_function) | |
def detune(audio_file, semitone_steps, output_file): |
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 sounddevice as sd | |
import soundfile as sf | |
import threading | |
import time | |
def find_source(source): | |
devices = sd.query_devices() | |
for i, v in enumerate(list(devices)): | |
if v["name"] == source: | |
return i |
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 curses, os | |
def main(stdscr): | |
# do not wait for input when calling getch | |
stdscr.nodelay(1) | |
while True: | |
# get keyboard input, returns -1 if none available | |
c = stdscr.getch() | |
if c != -1: | |
# print numeric value |
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 | |
import os | |
import argparse | |
import json | |
import re | |
import tensorflow.compat.v1 as tf | |
import numpy as np | |
from train.modeling import GroverModel, GroverConfig, sample |
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 | |
import time | |
import multiprocessing | |
import os | |
def supercollider(): | |
SC_CMD = "rm -f /tmp/foxdot.sc; echo FoxDot.start >> /tmp/foxdot.sc; sclang /tmp/foxdot.sc" | |
proc = multiprocessing.Process(target=lambda : os.system(SC_CMD), args=()) | |
proc.start() | |
return proc |
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 os | |
import sys | |
import time | |
import multiprocessing | |
def supercollider(): | |
SC_CMD = "rm -f /tmp/foxdot.sc; echo FoxDot.start >> /tmp/foxdot.sc; sclang /tmp/foxdot.sc" | |
proc = multiprocessing.Process(target=lambda : os.system(SC_CMD), args=()) | |
proc.start() | |
return proc |
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 os | |
import sys | |
def unir_txts(carpeta_con_los_txts): | |
lista_de_txts = os.listdir(carpeta_con_los_txts) # Esto arma la lista de todos los archivos que estan en ese directorio/carpeta | |
texto_final = "" # Variable donde voy a ir juntando el texto de todos los txts | |
for nombre_del_txt in lista_de_txts: # recorro los archivos uno por una | |
# uno el nombre de la carpeta con el nombre del archivo para armar la ruta exacta donde el txt se ubica |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.