January 2018
Beginner to intermediate
548 pages
12h 11m
English
In this recipe, we will create a small electronic piano in the Notebook. We will synthesize sinusoidal sounds with NumPy instead of using recorded tones.
>>> import numpy as np
import matplotlib.pyplot as plt
from IPython.display import (
Audio, display, clear_output)
from ipywidgets import widgets
from functools import partial
%matplotlib inline>>> rate = 16000.
duration = .25
t = np.linspace(
0., duration, int(rate * duration))>>> def synth(f): x = np.sin(f * 2. * np.pi ...
Read now
Unlock full access