summaryrefslogtreecommitdiff
path: root/examples/residual.py
diff options
context:
space:
mode:
authorJohn Glover <glover.john@gmail.com>2011-06-24 18:17:23 +0100
committerJohn Glover <glover.john@gmail.com>2011-06-24 18:17:23 +0100
commit416bd737074a287ea47106c73ea6bcfde40a75a8 (patch)
tree74562303d4f4f2f2e010f7e13cba41dc4852b50c /examples/residual.py
parentd26519464dcbf8c3682348167c29454961facefe (diff)
downloadsimpl-416bd737074a287ea47106c73ea6bcfde40a75a8.tar.gz
simpl-416bd737074a287ea47106c73ea6bcfde40a75a8.tar.bz2
simpl-416bd737074a287ea47106c73ea6bcfde40a75a8.zip
Change to using distutils.
Currently only builds the simplsndobj module
Diffstat (limited to 'examples/residual.py')
-rw-r--r--examples/residual.py48
1 files changed, 0 insertions, 48 deletions
diff --git a/examples/residual.py b/examples/residual.py
deleted file mode 100644
index 305bd3e..0000000
--- a/examples/residual.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright (c) 2009 John Glover, National University of Ireland, Maynooth
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import simpl
-import numpy as np
-from scipy.io.wavfile import read, write
-
-input_file = '../tests/audio/flute.wav'
-output_file = 'residual.wav'
-
-audio_data = read(input_file)
-audio = np.asarray(audio_data[1]) / 32768.0
-sampling_rate = audio_data[0]
-hop_size = 512
-num_frames = len(audio) / hop_size
-num_samples = len(audio)
-max_peaks = 10
-max_partials = 10
-
-pd = simpl.SMSPeakDetection()
-pd.max_peaks = max_peaks
-pd.hop_size = hop_size
-peaks = pd.find_peaks(audio)
-pt = simpl.SMSPartialTracking()
-pt.max_partials = max_partials
-partials = pt.find_partials(peaks)
-synth = simpl.SMSSynthesis()
-synth.hop_size = hop_size
-synth.max_partials = max_partials
-synth_audio = synth.synth(partials)
-r = simpl.SMSResidual()
-r.hop_size = hop_size
-audio_out = r.synth(synth_audio, audio)
-audio_out = np.asarray(audio_out * 32768, np.int16)
-write(output_file, 44100, audio_out)