Skip to content

Instantly share code, notes, and snippets.

@naotokui
naotokui / General-MIDI-GM-drum-names.json
Created Jan 6, 2020
General MIDI Drum Names and MIDI Note mapping
View General-MIDI-GM-drum-names.json
{
35: "Acoustic Bass Drum",
36: "Bass Drum 1",
37: "Side Stick",
38: "Acoustic Snare",
39: "Hand Clap",
40: "Electric Snare",
41: "Low Floor Tom",
42: "Closed Hi Hat",
43: "High Floor Tom",
@naotokui
naotokui / phase_reconstruction_test.ipynb
Created Nov 1, 2018
Spectrogram Phase Reconstruction Test - Comparison between LWS and GriffinLim
View phase_reconstruction_test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View audio_classification_spectrogram.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@naotokui
naotokui / export_mp3.py
Created Jan 14, 2018
export mp3 in python using ffmpeg
View export_mp3.py
from subprocess import call
import shutil
def export_as_mp3(export_path, y, sr, bitrate='192k'):
tmp_input_path = "/tmp/___mp3___.wav"
tmp_output_path = "/tmp/___mp3___.mp3"
librosa.output.write_wav(tmp_input_path, y, sr)
call(["ffmpeg", "-i", tmp_input_path, "-b:a", str(bitrate), tmp_output_path])
shutil.move(tmp_output_path, export_path)
@naotokui
naotokui / face_emotion_keras2.ipynb
Last active Dec 10, 2018
Face -> Emotion recognition
View face_emotion_keras2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@naotokui
naotokui / surfspots.json
Last active Aug 23, 2020
location info of 5980 surf spots around the world
View surfspots.json
[
{
"lng" : "4.1428327560425",
"lat" : "52.01150069904",
"country" : "Netherlands",
"name" : "'s-Gravenzande"
},
{
"lng" : "3.3628463745118",
"lat" : "51.370923071145",
@naotokui
naotokui / GAN-and-trainable.py
Last active Jun 2, 2021
How model.trainable = False works in keras (GAN model)
View GAN-and-trainable.py
# coding: utf8
## based on this article: http://qiita.com/mokemokechicken/items/937a82cfdc31e9a6ca12
import numpy as np
from keras.models import Sequential
from keras.engine.topology import Input, Container
from keras.engine.training import Model
from keras.layers.core import Dense
@naotokui
naotokui / GAN-808_keras.ipynb
Created Jul 14, 2017
GAN-based drumloop generation (work in progress)
View GAN-808_keras.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@naotokui
naotokui / lakh_clean_midi_genres.json
Last active Jul 13, 2017
Genre info for songs in clean_midi folder of Lakh MIDI dataset (source: Gracenote API). See http://colinraffel.com/projects/lmd/
View lakh_clean_midi_genres.json
[
{
"title" : "Amish Paradise",
"artist" : "\"Weird Al\" Yankovic",
"genres" : [
"Other",
"Comedy",
"Comedy"
]
},