From dacf7b607b9d0fda8b9a38b58dc97ce77b9ce3e9 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 19 Jun 2007 14:34:11 +0000 Subject: use branch hints added xcode 2.4 project fixed one-shot loop bang updated copyrights svn path=/trunk/; revision=7786 --- externals/grill/xsample/source/groove.cpp | 12 +- externals/grill/xsample/source/inter.h | 6 +- externals/grill/xsample/source/main.cpp | 4 +- externals/grill/xsample/source/main.h | 11 +- externals/grill/xsample/source/play.cpp | 4 +- externals/grill/xsample/source/record.cpp | 4 +- externals/grill/xsample/xsample.vcproj | 1 + .../xsample/xsample.xcodeproj/project.pbxproj | 529 +++++++++++++++++++++ 8 files changed, 557 insertions(+), 14 deletions(-) create mode 100644 externals/grill/xsample/xsample.xcodeproj/project.pbxproj diff --git a/externals/grill/xsample/source/groove.cpp b/externals/grill/xsample/source/groove.cpp index fd899275..c989156e 100644 --- a/externals/grill/xsample/source/groove.cpp +++ b/externals/grill/xsample/source/groove.cpp @@ -1,7 +1,7 @@ /* xsample - extended sample objects for Max/MSP and pd (pure data) -Copyright (c) 2001-2006 Thomas Grill (gr@grrrr.org) +Copyright (c) 2001-2007 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. */ @@ -322,7 +322,10 @@ void xgroove::s_pos_once(int n,t_sample *const *invecs,t_sample *const *outvecs) else s_pos_off(n,invecs,outvecs); - if(UNLIKELY(lpbang)) ToOutBang(outchns+3); + if(UNLIKELY(lpbang)) { + doplay = false; + ToOutBang(outchns+3); + } } void xgroove::s_pos_loop(int n,t_sample *const *invecs,t_sample *const *outvecs) @@ -361,6 +364,9 @@ void xgroove::s_pos_loop(int n,t_sample *const *invecs,t_sample *const *outvecs) } } else { + /////////////////////////////////// + // Most of the time is spent in here + /////////////////////////////////// for(int i = 0; i < n; ++i) { const t_sample spd = speed[i]; // must be first because the vector is reused for output! @@ -756,7 +762,7 @@ bool xgroove::do_xzone() void xgroove::m_help() { post("%s - part of xsample objects, version " XSAMPLE_VERSION,thisName()); - post("(C) Thomas Grill, 2001-2006"); + post("(C) Thomas Grill, 2001-2007"); #if FLEXT_SYS == FLEXT_SYS_MAX post("Arguments: %s [channels=1] [buffer]",thisName()); #else diff --git a/externals/grill/xsample/source/inter.h b/externals/grill/xsample/source/inter.h index 5ee87b90..f8a0881b 100755 --- a/externals/grill/xsample/source/inter.h +++ b/externals/grill/xsample/source/inter.h @@ -206,7 +206,7 @@ TMPLDEF void xinter::st_play4(const t_sample *bdt,const int smin,const int smax, if(OCHNS == 1) { t_sample *sig0 = sig[0]; for(int i = 0; i < n; ++i) { - float o = *(pos++); + float o = pos[i]; register long oint = CASTINT(o); register t_sample fa,fb,fc,fd; const float frac = o-oint; @@ -289,13 +289,13 @@ looped1: } } - const float f1 = 0.5f*(frac-1.0f); + const float f1 = frac*0.5f-0.5f; const float f3 = frac*3.0f-1.0f; const float amdf = (fa-fd)*frac; const float cmb = fc-fb; const float bma = fb-fa; - *(sig0++) = fb + frac*( cmb - f1 * ( amdf+bma+cmb*f3 ) ); + sig0[i] = fb + frac*( cmb - f1 * ( amdf+bma+cmb*f3 ) ); } } else { diff --git a/externals/grill/xsample/source/main.cpp b/externals/grill/xsample/source/main.cpp index 7c8bd9d2..025352a3 100644 --- a/externals/grill/xsample/source/main.cpp +++ b/externals/grill/xsample/source/main.cpp @@ -1,7 +1,7 @@ /* xsample - extended sample objects for Max/MSP and pd (pure data) -Copyright (c) 2001-2006 Thomas Grill (gr@grrrr.org) +Copyright (c) 2001-2007 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. */ @@ -16,7 +16,7 @@ static void xsample_main() flext::post("xsample objects, version " XSAMPLE_VERSION); flext::post(""); flext::post(" xrecord~, xplay~, xgroove~ "); - flext::post(" (C)2001-2006 Thomas Grill "); + flext::post(" (C)2001-2007 Thomas Grill "); #ifdef FLEXT_DEBUG flext::post(""); flext::post("DEBUG BUILD - " __DATE__ " " __TIME__); diff --git a/externals/grill/xsample/source/main.h b/externals/grill/xsample/source/main.h index ec2218d3..8cf39d7d 100644 --- a/externals/grill/xsample/source/main.h +++ b/externals/grill/xsample/source/main.h @@ -86,8 +86,15 @@ extern "C++" { } #endif -#if FLEXT_CPU == FLEXT_CPU_INTEL && defined(__GNUC__) -template inline I CASTINT(F o) { return lrintf(o); } +#if 0 // FLEXT_CPU == FLEXT_CPU_PPC && defined(__GNUC__) +#include +template +inline I CASTINT( F f ) +{ + int i; + __stfiwx(__fctiwz(f),0,&i); + return i; +} #elif FLEXT_CPU == FLEXT_CPU_INTEL && defined(_MSC_VER) template inline I CASTINT(F x) { diff --git a/externals/grill/xsample/source/play.cpp b/externals/grill/xsample/source/play.cpp index f3fdaab1..0f6fec5e 100644 --- a/externals/grill/xsample/source/play.cpp +++ b/externals/grill/xsample/source/play.cpp @@ -1,7 +1,7 @@ /* xsample - extended sample objects for Max/MSP and pd (pure data) -Copyright (c) 2001-2006 Thomas Grill (gr@grrrr.org) +Copyright (c) 2001-2007 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. */ @@ -117,7 +117,7 @@ void xplay::m_help() #ifdef FLEXT_DEBUG post("compiled on " __DATE__ " " __TIME__); #endif - post("(C) Thomas Grill, 2001-2006"); + post("(C) Thomas Grill, 2001-2007"); #if FLEXT_SYS == FLEXT_SYS_MAX post("Arguments: %s [channels=1] [buffer]",thisName()); #else diff --git a/externals/grill/xsample/source/record.cpp b/externals/grill/xsample/source/record.cpp index b8c8a9b0..07c94b45 100644 --- a/externals/grill/xsample/source/record.cpp +++ b/externals/grill/xsample/source/record.cpp @@ -1,7 +1,7 @@ /* xsample - extended sample objects for Max/MSP and pd (pure data) -Copyright (c) 2001-2006 Thomas Grill (gr@grrrr.org) +Copyright (c) 2001-2007 Thomas Grill (gr@grrrr.org) For information on usage and redistribution, and for a DISCLAIMER OF ALL WARRANTIES, see the file, "license.txt," in this distribution. */ @@ -452,7 +452,7 @@ void xrecord::m_help() #ifdef FLEXT_DEBUG post("compiled on " __DATE__ " " __TIME__); #endif - post("(C) Thomas Grill, 2001-2006"); + post("(C) Thomas Grill, 2001-2007"); #if FLEXT_SYS == FLEXT_SYS_MAX post("Arguments: %s [channels=1] [buffer]",thisName()); #else diff --git a/externals/grill/xsample/xsample.vcproj b/externals/grill/xsample/xsample.vcproj index 112dfc21..e978ee7e 100644 --- a/externals/grill/xsample/xsample.vcproj +++ b/externals/grill/xsample/xsample.vcproj @@ -3,6 +3,7 @@ ProjectType="Visual C++" Version="7.10" Name="xsample" + ProjectGUID="{7A2856E0-6DC1-4CD7-8A05-E6BA1DF8CA22}" Keyword="Win32Proj">