Skip to content

Instantly share code, notes, and snippets.

View iCorv's full-sized avatar

corv iCorv

View GitHub Profile
import os
import pretty_midi
import jams
def jams_to_midi(filepath, q=1):
# q = 1: with pitch bend. q = 0: without pitch bend.
jam = jams.load(filepath)
midi = pretty_midi.PrettyMIDI()
annos = jam.search(namespace='note_midi')
if len(annos) == 0:
@iCorv
iCorv / DFT_ANN.py
Created January 24, 2023 09:10 — forked from endolith/DFT_ANN.py
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import numpy as np
import matplotlib.pyplot as plt
N = 32
batch = 10000