summaryrefslogtreecommitdiff
path: root/examples
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
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')
-rw-r--r--examples/plotpartials.py37
-rw-r--r--examples/plotpeaks.py35
-rw-r--r--examples/residual.py48
-rw-r--r--examples/resynth.py39
-rw-r--r--examples/timestretch.py43
5 files changed, 0 insertions, 202 deletions
diff --git a/examples/plotpartials.py b/examples/plotpartials.py
deleted file mode 100644
index ef6d7ef..0000000
--- a/examples/plotpartials.py
+++ /dev/null
@@ -1,37 +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 matplotlib.pyplot as plt
-from scipy.io.wavfile import read
-
-input_file = '../tests/audio/flute.wav'
-audio_in_data = read(input_file)
-audio_in = simpl.asarray(audio_in_data[1]) / 32768.0 # values between -1 and 1
-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.SndObjPeakDetection()
-pd.max_peaks = 60
-peaks = pd.find_peaks(audio)
-pt = simpl.MQPartialTracking()
-pt.max_partials = 60
-partials = pt.find_partials(peaks)
-simpl.plot.plot_partials(partials)
-plt.show()
-
diff --git a/examples/plotpeaks.py b/examples/plotpeaks.py
deleted file mode 100644
index e8de386..0000000
--- a/examples/plotpeaks.py
+++ /dev/null
@@ -1,35 +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 matplotlib.pyplot as plt
-from scipy.io.wavfile import read
-
-input_file = '../tests/audio/flute.wav'
-audio_data = read(input_file)
-audio = simpl.asarray(audio_data[1]) / 32768.0 # values between -1 and 1
-sample_rate = audio_data[0]
-
-# take just the first few frames
-audio = audio[0:4096]
-# peak detection using the SndObj library
-pd = simpl.SndObjPeakDetection()
-pd.max_peaks = 20
-peaks = pd.find_peaks(audio)
-# plot peaks using matplotlib
-simpl.plot.plot_peaks(peaks)
-plt.show()
-
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)
diff --git a/examples/resynth.py b/examples/resynth.py
deleted file mode 100644
index 20c4684..0000000
--- a/examples/resynth.py
+++ /dev/null
@@ -1,39 +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 = 'resynth.wav'
-
-audio_data = read(input_file)
-audio = simpl.asarray(audio_data[1]) / 32768.0 # values between -1 and 1
-sample_rate = audio_data[0]
-
-pd = simpl.SMSPeakDetection()
-pd.max_peaks = 40
-pd.hop_size = 512
-peaks = pd.find_peaks(audio)
-pt = simpl.MQPartialTracking()
-pt.max_partials = 20
-partials = pt.find_partials(peaks)
-synth = simpl.SndObjSynthesis()
-audio_out = synth.synth(partials)
-audio_out = np.asarray(audio_out * 32768, np.int16)
-write(output_file, 44100, audio_out)
-
diff --git a/examples/timestretch.py b/examples/timestretch.py
deleted file mode 100644
index af9cfb4..0000000
--- a/examples/timestretch.py
+++ /dev/null
@@ -1,43 +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
-from simpl.fx import time_stretch
-from scipy.io.wavfile import read, write
-import numpy as np
-
-input_file = '../tests/audio/flute.wav'
-output_file = 'flute_2x.wav'
-time_stretch_factor = 2
-
-audio_in_data = read(input_file)
-audio_in = simpl.asarray(audio_in_data[1]) / 32768.0 # values between -1 and 1
-sample_rate = audio_in_data[0]
-
-print "Time stretching", input_file, "by a factor of", time_stretch_factor
-pd = simpl.SndObjPeakDetection()
-pd.max_peaks = 100
-peaks = pd.find_peaks(audio_in)
-pt = simpl.SndObjPartialTracking()
-pt.max_partials = 10
-partials = pt.find_partials(peaks)
-partials = time_stretch(partials, time_stretch_factor)
-sndobj_synth = simpl.SndObjSynthesis()
-audio_out = sndobj_synth.synth(partials)
-audio_out = np.asarray(audio_out * 32768, np.int16)
-print "Writing output to", output_file
-write(output_file, 44100, audio_out)
-