Skip to content

Instantly share code, notes, and snippets.

View joaoreboucas1's full-sized avatar

João Victor Rebouças joaoreboucas1

View GitHub Profile
@joaoreboucas1
joaoreboucas1 / treshold.py
Last active March 10, 2024 15:08
Marcus' idea of dividing a sample via treshold value and maximizing the difference of means
import sys
import numpy as np
from numpy.typing import NDArray
import matplotlib.pyplot as plt
# Number of samples to draw
N = 200_000
# Distribution parameters
@joaoreboucas1
joaoreboucas1 / hello.py
Created October 1, 2023 15:05
Rainbow Hello! Prints different colored "Hello"s in the terminal
class ansi:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
PINK = '\x1b[38;5;207m'
@joaoreboucas1
joaoreboucas1 / sync.py
Last active May 31, 2024 19:43
Command-line tool in Python that synchronizes a funk beat into a song (must be .wav format)
from math import floor
from pathlib import Path
import sys
import os
import numpy as np
import librosa
import librosa.beat
import soundfile as sf
def synchronize(file_path_1, file_path_2, output_path="mashup.wav", second_iteration=False):