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
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: |
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
""" | |
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 |
OlderNewer