This file contains hidden or 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
# Source https://askubuntu.com/a/668329/646308 | |
killall pulseaudio | |
rm -r ~/.config/pulse/* | |
rm -r ~/.pulse* | |
# IF NOT WORK: MAY BE A DAW IS TAKING OVER THE CONTROL OF THE OUTPUT | |
# INSTALL pavucontrol-module-jack. Check the link below | |
# SOURCE: https://askubuntu.com/a/681079/646308 ###################### | |
# FINAL RESORT: WORKED WITH REAPER + SCARLETTE 2i2 + UBUNTU 20.04 |
This file contains hidden or 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
# edit ~/.inputrc | |
# want vi to be the default editor for readline | |
set editing-mode vi | |
# vi settings | |
$if mode=vi | |
# normal mode | |
set keymap vi-command | |
"j": previous-history |
This file contains hidden or 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
/* | |
Copyright @ nguyenvanhieu.vn | |
Thằng code java này vẫn giữ được lower/upper case | |
Code này ngon hơn, check đúng trường hợp cần thêm dấu thì mới thêm | |
Tuy nhiên code python ở dưới không check nhưng vẫn chưa thấy bugs nào hết :v | |
*/ | |
package utils; | |
import java.util.*; |
This file contains hidden or 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
from __future__ import division | |
from numpy.fft import rfft | |
from numpy import argmax, mean, diff, log, nonzero | |
from scipy.signal import blackmanharris, correlate | |
from time import time | |
import sys | |
try: | |
import soundfile as sf | |
except ImportError: | |
from scikits.audiolab import flacread |
This file contains hidden or 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
#WINE with error (OLE error 80040154) | |
wget http://winetricks.org/winetricks | |
chmod +x winetricks | |
winetricks -v vcrun6 winetricks -v msxml4 |
This file contains hidden or 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
nnoremap <S-Left> :action EditorLeftWithSelection<CR> | |
nnoremap <S-Right> :action EditorRightWithSelection<CR> | |
nnoremap <S-Up> :action EditorUpWithSelection<CR> | |
nnoremap <S-Down> :action EditorDownWithSelection<CR> | |
inoremap <S-Left> <C-O>:action EditorLeftWithSelection<CR> | |
inoremap <S-Right> <C-O>:action EditorRightWithSelection<CR> | |
inoremap <S-Up> <C-O>:action EditorUpWithSelection<CR> | |
inoremap <S-Down> <C-O>:action EditorDownWithSelection<CR> |
This file contains hidden or 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
# copy a list of file (from file_id_list) from src to dest | |
cat file_id_list | awk '{system("cp " $1 " <dest_dir")}' | |
# total time of audio file within a directory | |
soxi -D *.wav | awk '{sum+=$1} END {print sum}' | |
This file contains hidden or 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
# This function is used to reduce memory of a pandas dataframe | |
# The idea is cast the numeric type to another more memory-effective type | |
# For ex: Features "age" should only need type='np.int8' | |
# Source: https://www.kaggle.com/gemartin/load-data-reduce-memory-usage | |
def reduce_mem_usage(df): | |
""" iterate through all the columns of a dataframe and modify the data type | |
to reduce memory usage. | |
""" | |
start_mem = df.memory_usage().sum() / 1024**2 | |
print('Memory usage of dataframe is {:.2f} MB'.format(start_mem)) |
This file contains hidden or 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 | |
# coding: utf-8 | |
""" This work is licensed under a Creative Commons Attribution 3.0 Unported License. | |
Frank Zalkow, 2012-2013 """ | |
# Source: http://www.frank-zalkow.de/en/code-snippets/create-audio-spectrograms-with-python.html?ckattempt=1&i=1 | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import scipy.io.wavfile as wav |
This file contains hidden or 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
from google.colab import drive | |
drive.mount('/content/drive') | |
!rm *.json | |
from google.colab import files | |
files.upload() # upload kaggle.json | |
!pip install kaggle | |
!mkdir -p ~/.kaggle |
NewerOlder