From e9832e13b729c644684e3af4ed6fdf337a476961 Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Mon, 20 Jan 2020 16:29:03 -0600 Subject: [PATCH 1/2] Made mono and newmethod versions executable. --- paulstretch_mono.py | 1 + paulstretch_newmethod.py | 0 2 files changed, 1 insertion(+) mode change 100644 => 100755 paulstretch_mono.py mode change 100644 => 100755 paulstretch_newmethod.py diff --git a/paulstretch_mono.py b/paulstretch_mono.py old mode 100644 new mode 100755 index 3f6236a..c0e6f03 --- a/paulstretch_mono.py +++ b/paulstretch_mono.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # # Paul's Extreme Sound Stretch (Paulstretch) - Python version # diff --git a/paulstretch_newmethod.py b/paulstretch_newmethod.py old mode 100644 new mode 100755 From c10bf49a0e40efb80e6db51e4cd0cf099a7ab159 Mon Sep 17 00:00:00 2001 From: Daniel Sissom Date: Mon, 20 Jan 2020 16:38:52 -0600 Subject: [PATCH 2/2] Fixed byteorder parameter passed to numpy ravel in writeframes. Numpy ravel takes a byte order parameter to distinguish between row-major ('C') or column-major ('F') memory layouts. The Fortran style layout seems to be the correct order here. --- paulstretch_newmethod.py | 2 +- paulstretch_stereo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paulstretch_newmethod.py b/paulstretch_newmethod.py index efa6309..b0545c1 100755 --- a/paulstretch_newmethod.py +++ b/paulstretch_newmethod.py @@ -168,7 +168,7 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,onset_level,outfilenam output[output<-1.0]=-1.0 #write the output to wav file - outfile.writeframes(int16(output.ravel(1)*32767.0).tostring()) + outfile.writeframes(int16(output.ravel('F')*32767.0).tostring()) if get_next_buf: start_pos+=displace_pos diff --git a/paulstretch_stereo.py b/paulstretch_stereo.py index df7797c..1480b04 100755 --- a/paulstretch_stereo.py +++ b/paulstretch_stereo.py @@ -120,7 +120,7 @@ def paulstretch(samplerate,smp,stretch,windowsize_seconds,outfilename): output[output<-1.0]=-1.0 #write the output to wav file - outfile.writeframes(int16(output.ravel(1)*32767.0).tostring()) + outfile.writeframes(int16(output.ravel('F')*32767.0).tostring()) start_pos+=displace_pos if start_pos>=nsamples: