From 416bd737074a287ea47106c73ea6bcfde40a75a8 Mon Sep 17 00:00:00 2001 From: John Glover Date: Fri, 24 Jun 2011 18:17:23 +0100 Subject: Change to using distutils. Currently only builds the simplsndobj module --- fx.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 fx.py (limited to 'fx.py') diff --git a/fx.py b/fx.py deleted file mode 100644 index 53f7476..0000000 --- a/fx.py +++ /dev/null @@ -1,36 +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 - -from simpl import Partial -import numpy as np - -def time_stretch(partials, factor): - """Time stretch partials by factor.""" - stretched_partials = [] - step_size = 1.0 / factor - - for partial in partials: - stretched_partial = Partial() - stretched_partial.starting_frame = partial.starting_frame * factor - stretched_partial.partial_id = partial.partial_id - num_steps = int((partial.get_length() - 1) / step_size) - current_step = 0 - for step in range(num_steps): - current_peak = partial.peaks[int(np.floor(current_step))] - stretched_partial.add_peak(current_peak) - current_step += step_size - stretched_partials.append(stretched_partial) - return stretched_partials \ No newline at end of file -- cgit v1.2.3