diff options
author | John Glover <glover.john@gmail.com> | 2010-11-02 16:11:00 +0000 |
---|---|---|
committer | John Glover <glover.john@gmail.com> | 2010-11-02 16:11:00 +0000 |
commit | f941ad291e1bf249e27ee1a9514e76ddc0ec32fe (patch) | |
tree | 32835700c2d9cc190c65cf340f382b7b9ee5fe9c /examples | |
parent | 08f2885c58cc4ae5e4ecf42aecaa043de2c5bd4c (diff) | |
download | simpl-f941ad291e1bf249e27ee1a9514e76ddc0ec32fe.tar.gz simpl-f941ad291e1bf249e27ee1a9514e76ddc0ec32fe.tar.bz2 simpl-f941ad291e1bf249e27ee1a9514e76ddc0ec32fe.zip |
Added colour to default plots (with heatmap) and some minor code tidying
Diffstat (limited to 'examples')
-rw-r--r-- | examples/plotpartials.py | 12 | ||||
-rw-r--r-- | examples/plotpeaks.py | 5 | ||||
-rw-r--r-- | examples/resynth.py | 1 |
3 files changed, 10 insertions, 8 deletions
diff --git a/examples/plotpartials.py b/examples/plotpartials.py index c16fc1b..ef6d7ef 100644 --- a/examples/plotpartials.py +++ b/examples/plotpartials.py @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import simpl -import simpl.plot +import matplotlib.pyplot as plt from scipy.io.wavfile import read input_file = '../tests/audio/flute.wav' @@ -26,12 +26,12 @@ sample_rate = audio_in_data[0] # take just the first few frames audio = audio_in[0:4096] # Peak detection and partial tracking using SMS -pd = simpl.SMSPeakDetection() -pd.max_peaks = 20 -pd.hop_size = 147 +pd = simpl.SndObjPeakDetection() +pd.max_peaks = 60 peaks = pd.find_peaks(audio) pt = simpl.MQPartialTracking() -pt.max_partials = 20 +pt.max_partials = 60 partials = pt.find_partials(peaks) simpl.plot.plot_partials(partials) -simpl.plot.show() +plt.show() + diff --git a/examples/plotpeaks.py b/examples/plotpeaks.py index 0132ba6..1c5769f 100644 --- a/examples/plotpeaks.py +++ b/examples/plotpeaks.py @@ -15,7 +15,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import simpl -import simpl.plot +import matplotlib.pyplot as plt from scipy.io.wavfile import read input_file = '../tests/audio/flute.wav' @@ -31,4 +31,5 @@ pd.max_peaks = 20 peaks = pd.find_peaks(audio) # plot peaks using matplotlib simpl.plot.plot_peaks(peaks) -simpl.plot.show() +plt.show() + diff --git a/examples/resynth.py b/examples/resynth.py index ae4b6ec..e551720 100644 --- a/examples/resynth.py +++ b/examples/resynth.py @@ -37,3 +37,4 @@ sndobj_synth = simpl.SndObjSynthesis() audio_out = sndobj_synth.synth(partials) audio_out = np.asarray(audio_out * 32768, np.int16) write(output_file, 44100, audio_out) + |