From 706f673e2ff4567fc42fb3eb588978247f760593 Mon Sep 17 00:00:00 2001 From: mcartwright Date: Sat, 31 Oct 2015 14:39:51 -0500 Subject: [PATCH] Initial commit of old files --- in_progress/mbc.areaGen~/Info.plist | 24 + in_progress/mbc.areaGen~/mbc.areaGen~.c | 153 ++ .../mbc.areaGen~.xcodeproj/project.pbxproj | 333 +++ in_progress/mbc.areaScale~/Info.plist | 24 + in_progress/mbc.areaScale~/mbc.areaScale~.c | 157 ++ .../mbc.areaScale~.xcodeproj/project.pbxproj | 333 +++ in_progress/mbc.areaSwap~/Info.plist | 24 + in_progress/mbc.areaSwap~/mbc.areaSwap~.c | 203 ++ .../mbc.areaSwap~.xcodeproj/project.pbxproj | 333 +++ in_progress/mbc.coeffConv~/Info.plist | 24 + in_progress/mbc.coeffConv~/coeffConv~.c | 556 +++++ .../coeffConv~.xcodeproj/project.pbxproj | 333 +++ misc/README | 8 + misc/bundlePackage | 12 + .../mbc.allpole~.mxo/Contents/Info.plist | 26 + .../Contents/MacOS/mbc.allpole~ | Bin 0 -> 18856 bytes sdk-build/mbc.allpole~.mxo/Contents/PkgInfo | 1 + sdk-build/mbc.blit~.mxo/Contents/Info.plist | 26 + .../mbc.blit~.mxo/Contents/MacOS/mbc.blit~ | Bin 0 -> 18680 bytes sdk-build/mbc.blit~.mxo/Contents/PkgInfo | 1 + .../mbc.coeffDisp~.mxo/Contents/Info.plist | 26 + .../Contents/MacOS/mbc.coeffDisp~ | Bin 0 -> 18284 bytes sdk-build/mbc.coeffDisp~.mxo/Contents/PkgInfo | 1 + .../mbc.errfilt~.mxo/Contents/Info.plist | 26 + .../Contents/MacOS/mbc.errfilt~ | Bin 0 -> 14148 bytes sdk-build/mbc.errfilt~.mxo/Contents/PkgInfo | 1 + sdk-build/mbc.lpc~.mxo/Contents/Info.plist | 26 + .../mbc.lpc~.mxo/Contents/MacOS/mbc.lpc~ | Bin 0 -> 22708 bytes sdk-build/mbc.lpc~.mxo/Contents/PkgInfo | 1 + sdk-build/mbc.pitch~.mxo/Contents/Info.plist | 26 + .../mbc.pitch~.mxo/Contents/MacOS/mbc.pitch~ | Bin 0 -> 18424 bytes sdk-build/mbc.pitch~.mxo/Contents/PkgInfo | 1 + src/Info.plist | 28 + src/lpcToolkitDemo.maxpat | 2002 +++++++++++++++++ src/maxmspsdk.xcconfig | 46 + src/mbc.allpole~/mbc.allpole~.c | 1032 +++++++++ src/mbc.allpole~/mbc.allpole~.maxhelp | 642 ++++++ .../mbc.allpole~.xcodeproj/project.pbxproj | 222 ++ src/mbc.blit~/mbc.blit~.c | 421 ++++ src/mbc.blit~/mbc.blit~.maxhelp | 683 ++++++ .../mbc.blit~.xcodeproj/project.pbxproj | 218 ++ src/mbc.coeffDisp~/mbc.coeffDisp~.c | 286 +++ src/mbc.coeffDisp~/mbc.coeffDisp~.maxhelp | 548 +++++ .../mbc.coeffDisp~.xcodeproj/project.pbxproj | 218 ++ src/mbc.errfilt~/errfilt~.c | 234 ++ src/mbc.errfilt~/mbc.errfilt~.maxhelp | 541 +++++ .../mbc.errfilt~.xcodeproj/project.pbxproj | 222 ++ src/mbc.lpc~/mbc.lpc~.c | 491 ++++ src/mbc.lpc~/mbc.lpc~.maxhelp | 576 +++++ .../mbc.lpc~.xcodeproj/project.pbxproj | 222 ++ src/mbc.pitch~/mbc.pitch~.c | 406 ++++ src/mbc.pitch~/mbc.pitch~.maxhelp | 602 +++++ .../mbc.pitch~.xcodeproj/project.pbxproj | 222 ++ 53 files changed, 12541 insertions(+) create mode 100644 in_progress/mbc.areaGen~/Info.plist create mode 100644 in_progress/mbc.areaGen~/mbc.areaGen~.c create mode 100644 in_progress/mbc.areaGen~/mbc.areaGen~.xcodeproj/project.pbxproj create mode 100644 in_progress/mbc.areaScale~/Info.plist create mode 100644 in_progress/mbc.areaScale~/mbc.areaScale~.c create mode 100644 in_progress/mbc.areaScale~/mbc.areaScale~.xcodeproj/project.pbxproj create mode 100644 in_progress/mbc.areaSwap~/Info.plist create mode 100644 in_progress/mbc.areaSwap~/mbc.areaSwap~.c create mode 100644 in_progress/mbc.areaSwap~/mbc.areaSwap~.xcodeproj/project.pbxproj create mode 100644 in_progress/mbc.coeffConv~/Info.plist create mode 100644 in_progress/mbc.coeffConv~/coeffConv~.c create mode 100644 in_progress/mbc.coeffConv~/coeffConv~.xcodeproj/project.pbxproj create mode 100644 misc/README create mode 100755 misc/bundlePackage create mode 100644 sdk-build/mbc.allpole~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.allpole~.mxo/Contents/MacOS/mbc.allpole~ create mode 100644 sdk-build/mbc.allpole~.mxo/Contents/PkgInfo create mode 100644 sdk-build/mbc.blit~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.blit~.mxo/Contents/MacOS/mbc.blit~ create mode 100644 sdk-build/mbc.blit~.mxo/Contents/PkgInfo create mode 100644 sdk-build/mbc.coeffDisp~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.coeffDisp~.mxo/Contents/MacOS/mbc.coeffDisp~ create mode 100644 sdk-build/mbc.coeffDisp~.mxo/Contents/PkgInfo create mode 100644 sdk-build/mbc.errfilt~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.errfilt~.mxo/Contents/MacOS/mbc.errfilt~ create mode 100644 sdk-build/mbc.errfilt~.mxo/Contents/PkgInfo create mode 100644 sdk-build/mbc.lpc~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.lpc~.mxo/Contents/MacOS/mbc.lpc~ create mode 100644 sdk-build/mbc.lpc~.mxo/Contents/PkgInfo create mode 100644 sdk-build/mbc.pitch~.mxo/Contents/Info.plist create mode 100755 sdk-build/mbc.pitch~.mxo/Contents/MacOS/mbc.pitch~ create mode 100644 sdk-build/mbc.pitch~.mxo/Contents/PkgInfo create mode 100644 src/Info.plist create mode 100644 src/lpcToolkitDemo.maxpat create mode 100644 src/maxmspsdk.xcconfig create mode 100755 src/mbc.allpole~/mbc.allpole~.c create mode 100644 src/mbc.allpole~/mbc.allpole~.maxhelp create mode 100755 src/mbc.allpole~/mbc.allpole~.xcodeproj/project.pbxproj create mode 100755 src/mbc.blit~/mbc.blit~.c create mode 100644 src/mbc.blit~/mbc.blit~.maxhelp create mode 100755 src/mbc.blit~/mbc.blit~.xcodeproj/project.pbxproj create mode 100755 src/mbc.coeffDisp~/mbc.coeffDisp~.c create mode 100644 src/mbc.coeffDisp~/mbc.coeffDisp~.maxhelp create mode 100755 src/mbc.coeffDisp~/mbc.coeffDisp~.xcodeproj/project.pbxproj create mode 100755 src/mbc.errfilt~/errfilt~.c create mode 100644 src/mbc.errfilt~/mbc.errfilt~.maxhelp create mode 100755 src/mbc.errfilt~/mbc.errfilt~.xcodeproj/project.pbxproj create mode 100755 src/mbc.lpc~/mbc.lpc~.c create mode 100644 src/mbc.lpc~/mbc.lpc~.maxhelp create mode 100755 src/mbc.lpc~/mbc.lpc~.xcodeproj/project.pbxproj create mode 100755 src/mbc.pitch~/mbc.pitch~.c create mode 100644 src/mbc.pitch~/mbc.pitch~.maxhelp create mode 100755 src/mbc.pitch~/mbc.pitch~.xcodeproj/project.pbxproj diff --git a/in_progress/mbc.areaGen~/Info.plist b/in_progress/mbc.areaGen~/Info.plist new file mode 100644 index 0000000..ee27194 --- /dev/null +++ b/in_progress/mbc.areaGen~/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.areaGen~ + CFBundleIconFile + + CFBundleIdentifier + com.brozier.areaGen~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + iLaX + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/in_progress/mbc.areaGen~/mbc.areaGen~.c b/in_progress/mbc.areaGen~/mbc.areaGen~.c new file mode 100644 index 0000000..9ded1a4 --- /dev/null +++ b/in_progress/mbc.areaGen~/mbc.areaGen~.c @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------------- +Filename: mbc.areaGen~.c +Project: LPC Toolkit +Author: Mark Cartwright +Created: 5/30/07 +Updated: 5/30/07 +Description: Generation of area coefficients for an allpole vocal tract model from + an input list. +-------------------------------------------------------------------------------------*/ + +#include "ext.h" +#include "z_dsp.h" + +void *areaGen_class; + +typedef struct _areaGen +{ + t_pxobject a_obj; //object + t_float* a_areas; //area of area coefficients + t_float* a_areaBuff; //input buffer for area coefficients + int a_order; //filter order + int a_outIdx; //out index + int a_buffFull; //buffFull flag +} t_areaGen; + +t_int *areaGen_perform(t_int *w); +void areaGen_dsp(t_areaGen *x, t_signal **sp, short *count); +void areaGen_list(t_areaGen *x, t_symbol *msg, short argc, t_atom *argv); +void areaGen_assist(t_areaGen *x, void *b, long m, long a, char *s); +void areaGen_init(t_areaGen *x); +void areaGen_free(t_areaGen *x); +void *areaGen_new(long order); + +void main(void) +{ + setup((t_messlist **)&areaGen_class, (method)areaGen_new, (method)areaGen_free, (short)sizeof(t_areaGen), 0L, A_DEFLONG, 0); + dsp_initclass(); + addmess((method)areaGen_dsp, "dsp", A_CANT, 0); + addmess((method)areaGen_list, "list", A_GIMME, 0); + addmess((method)areaGen_assist,"assist",A_CANT,0); +} + +t_int *areaGen_perform(t_int *w) +{ + t_areaGen *x = (t_areaGen *)(w[1]); + t_float *areaOut = (t_float *)(w[2]); + t_float *coeffIdxOut = (t_float *)(w[3]); + int n = (int)(w[4]); + int outidx = x->a_outIdx; + int order = x->a_order; + int buffFull = x->a_buffFull; + int i; + + while(n--) { + if (outidx < order) { + *areaOut = x->a_areas[outidx]; + *coeffIdxOut = (t_float)(outidx+1); + outidx++; + areaOut++; + coeffIdxOut++; + } else if(buffFull) { + for(i=0;ia_areas[i] = x->a_areaBuff[i]; + } + outidx = 0; + buffFull = 0; + + *areaOut = 0.0; + *coeffIdxOut = 0.0; + areaOut++; + coeffIdxOut++; + } else { + *areaOut = 0.0; + *coeffIdxOut = 0.0; + areaOut++; + coeffIdxOut++; + } + + } + + x->a_buffFull = buffFull; + x->a_outIdx = outidx; + + return (w+5); +} + +void areaGen_list(t_areaGen *x, t_symbol *msg, short argc, t_atom *argv) { + + int i; + if (argc == x->a_order) { + int min = (argc > x->a_order) ? x->a_order : argc; //use the minimum of the two to avoid any pointer erors + t_float* areaBuff = x->a_areaBuff; + + for (i = 0; i < min; i++) { + *areaBuff = atom_getfloatarg(i,argc,argv); + areaBuff++; + } + x->a_buffFull = 1; + } else { + error("mbc.areaGen~: number of items in the input list must equal to the specified order"); + } + +} + +void areaGen_dsp(t_areaGen *x, t_signal **sp, short *count) +{ + x->a_buffFull = 1; + dsp_add(areaGen_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); +} + +void areaGen_assist(t_areaGen *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + sprintf(s,"(list) Area Coefficients"); + } + else { + switch(a) { + case 0: sprintf(s,"(signal) Area Coefficients"); break; + case 1: sprintf(s,"(signal) Coefficient Index"); break; + } + } +} + +void areaGen_init(t_areaGen *x) +{ + x->a_outIdx = x->a_order + 1; + x->a_areas = (t_float *) sysmem_newptrclear( x->a_order * sizeof(t_float)); + x->a_areaBuff = (t_float *) sysmem_newptrclear( x->a_order * sizeof(t_float)); +} + +void areaGen_free(t_areaGen *x) +{ + dsp_free((t_pxobject *) x); + + sysmem_freeptr(x->a_areas); + sysmem_freeptr(x->a_areaBuff); +} + +void *areaGen_new(long order) +{ + t_areaGen *x = (t_areaGen *)newobject(areaGen_class); + dsp_setup((t_pxobject *)x,0); //0 signal objects + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + + x->a_order = (int)order; + areaGen_init(x); + + return (x); +} + + + diff --git a/in_progress/mbc.areaGen~/mbc.areaGen~.xcodeproj/project.pbxproj b/in_progress/mbc.areaGen~/mbc.areaGen~.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7782a4f --- /dev/null +++ b/in_progress/mbc.areaGen~/mbc.areaGen~.xcodeproj/project.pbxproj @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5B62020919440900A62EB9 /* MaxAPI.framework */; }; + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */; }; + 8D01CCCC0486CAD60068D4B7 /* mbc.areaGen~.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B2FE8417CDC02AAC07 /* mbc.areaGen~.c */; settings = {ATTRIBUTES = (); }; }; + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 08FB77B2FE8417CDC02AAC07 /* mbc.areaGen~.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "mbc.areaGen~.c"; sourceTree = ""; }; + 0F5B62020919440900A62EB9 /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = /Library/Frameworks/MaxAPI.framework; sourceTree = ""; }; + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = /Library/Frameworks/MaxAudioAPI.framework; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* mbc.areaGen~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.areaGen~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */, + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */, + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* plus~ */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = "plus~"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */, + 0F5B62020919440900A62EB9 /* MaxAPI.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 08FB77B2FE8417CDC02AAC07 /* mbc.areaGen~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* mbc.areaGen~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* mbc.areaGen~ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaGen~" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mbc.areaGen~"; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = MSPExternal; + productReference = 8D01CCD20486CAD60068D4B7 /* mbc.areaGen~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaGen~" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* plus~ */; + projectDirPath = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* mbc.areaGen~ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCC0486CAD60068D4B7 /* mbc.areaGen~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0FFBC541097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DEPLOYMENT_LOCATION = YES; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaGen~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = YES; + }; + name = Development; + }; + 0FFBC542097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaGen~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 0FFBC543097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaGen~"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + }; + name = Default; + }; + 0FFBC545097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Development; + }; + 0FFBC546097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Deployment; + }; + 0FFBC547097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Default; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaGen~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC541097463A900D78707 /* Development */, + 0FFBC542097463A900D78707 /* Deployment */, + 0FFBC543097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaGen~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC545097463A900D78707 /* Development */, + 0FFBC546097463A900D78707 /* Deployment */, + 0FFBC547097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/in_progress/mbc.areaScale~/Info.plist b/in_progress/mbc.areaScale~/Info.plist new file mode 100644 index 0000000..2f9c5d9 --- /dev/null +++ b/in_progress/mbc.areaScale~/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.areaScale~ + CFBundleIconFile + + CFBundleIdentifier + com.brozier.areaScale~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + iLaX + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/in_progress/mbc.areaScale~/mbc.areaScale~.c b/in_progress/mbc.areaScale~/mbc.areaScale~.c new file mode 100644 index 0000000..3fe67e1 --- /dev/null +++ b/in_progress/mbc.areaScale~/mbc.areaScale~.c @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------------- +Filename: mbc.areaScale~.c +Project: LPC Toolkit +Author: Mark Cartwright +Created: 7/23/07 +Updated: 7/23/07 +Description: Scale area coefficients by an array of weights +-------------------------------------------------------------------------------------*/ + +#include "ext.h" +#include "z_dsp.h" + +#define MAX_ORDER 200 + +void *areaScale_class; + +typedef struct _areaScale +{ + t_pxobject a_obj; + t_float* a_mults; + int a_order; +} t_areaScale; + +t_int *areaScale_perform(t_int *w); +void areaScale_list(t_areaScale *x, t_symbol *msg, short argc, t_atom *argv); +void areaScale_order(t_areaScale *x, long order); +void areaScale_init(t_areaScale *x); +void areaScale_free(t_areaScale *x); +void areaScale_dsp(t_areaScale *x, t_signal **sp, short *count); +void areaScale_assist(t_areaScale *x, void *b, long m, long a, char *s); +void *areaScale_new(long order); + +void main(void) +{ + setup((t_messlist **)&areaScale_class, (method)areaScale_new, (method)areaScale_free, (short)sizeof(t_areaScale), 0L, A_DEFLONG, 0); + dsp_initclass(); + addmess((method)areaScale_order, "order", A_LONG, 0); + addmess((method)areaScale_dsp, "dsp", A_CANT, 0); + addmess((method)areaScale_list, "list", A_GIMME, 0); + addmess((method)areaScale_assist,"assist",A_CANT,0); +} + +t_int *areaScale_perform(t_int *w) +{ + t_float *areaIn = (t_float *)(w[1]); + t_float *areaIdxIn = (t_float *)(w[2]); + t_areaScale *x = (t_areaScale *)(w[3]); + t_float *areaOut = (t_float *)(w[4]); + t_float *areaIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + t_float* mults = x->a_mults; + t_float in, out, mult; + + if (x->a_obj.z_disabled) + goto out; + + while (n--) { + if ((int)(*areaIdxIn) > 0) { + in = *areaIn; + mult = mults[(int)(*areaIdxIn)]; + out = in * mult; + *areaOut = *areaIn * mults[(int)(*areaIdxIn)]; + *areaIdxOut = *areaIdxIn; + } else { + *areaOut = 0.0; + *areaIdxOut = 0.0; + } + + areaIn++; + areaIdxIn++; + areaOut++; + areaIdxOut++; + } + +out: + return (w+7); +} + +void areaScale_list(t_areaScale *x, t_symbol *msg, short argc, t_atom *argv) { + + int i; + if (argc == x->a_order) { + int min = (argc > x->a_order) ? x->a_order : argc; //use the minimum of the two to avoid any pointer erors + t_float* mults = x->a_mults; + + for (i = 0; i < min; i++) { + *mults = atom_getfloatarg(i,argc,argv); + mults++; + } + } else { + error("mbc.areaScale~: number of items in the input list must equal the specified order"); + } + + int min = (argc > x->a_order) ? x->a_order : argc; //use the minimum of the two to avoid any pointer erors + /*for (i=0; i < min; i++) { + cpost("\nmults(%d) = %f",i+1,x->a_mults[i]); + }*/ + +} + +void areaScale_order(t_areaScale *x, long order) { + x->a_order = order; +} + +void areaScale_dsp(t_areaScale *x, t_signal **sp, short *count) +{ + dsp_add(areaScale_perform, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); +} + +void areaScale_assist(t_areaScale *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) Areas"); break; + case 1: sprintf(s,"(signal) Coeff Index"); break; + } + } + else { + switch (a) { + case 0: sprintf(s,"(signal) Scaled Areas"); break; + case 1: sprintf(s,"(signal) Coeff Index"); break; + } + } +} + +void areaScale_init(t_areaScale *x) { + int i; + + x->a_mults = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + + for (i=0; i < x->a_order; i++) { + x->a_mults[i] = 1.0; + } +} + +void areaScale_free(t_areaScale *x) { + dsp_free((t_pxobject *) x); + freebytes(x->a_mults, MAX_ORDER * sizeof(t_float)); +} + +void *areaScale_new(long order) +{ + t_areaScale *x = (t_areaScale *)newobject(areaScale_class); + dsp_setup((t_pxobject *)x,2); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + x->a_obj.z_misc |= Z_NO_INPLACE; + + x->a_order = order; + + areaScale_init(x); + + return (x); +} + + + diff --git a/in_progress/mbc.areaScale~/mbc.areaScale~.xcodeproj/project.pbxproj b/in_progress/mbc.areaScale~/mbc.areaScale~.xcodeproj/project.pbxproj new file mode 100644 index 0000000..8a6302e --- /dev/null +++ b/in_progress/mbc.areaScale~/mbc.areaScale~.xcodeproj/project.pbxproj @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5B62020919440900A62EB9 /* MaxAPI.framework */; }; + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */; }; + 8D01CCCC0486CAD60068D4B7 /* mbc.areaScale~.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B2FE8417CDC02AAC07 /* mbc.areaScale~.c */; settings = {ATTRIBUTES = (); }; }; + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 08FB77B2FE8417CDC02AAC07 /* mbc.areaScale~.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "mbc.areaScale~.c"; sourceTree = ""; }; + 0F5B62020919440900A62EB9 /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = /Library/Frameworks/MaxAPI.framework; sourceTree = ""; }; + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = /Library/Frameworks/MaxAudioAPI.framework; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* mbc.areaScale~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.areaScale~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */, + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */, + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* plus~ */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = "plus~"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */, + 0F5B62020919440900A62EB9 /* MaxAPI.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 08FB77B2FE8417CDC02AAC07 /* mbc.areaScale~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* mbc.areaScale~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* mbc.areaScale~ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaScale~" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mbc.areaScale~"; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = MSPExternal; + productReference = 8D01CCD20486CAD60068D4B7 /* mbc.areaScale~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaScale~" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* plus~ */; + projectDirPath = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* mbc.areaScale~ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCC0486CAD60068D4B7 /* mbc.areaScale~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0FFBC541097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DEPLOYMENT_LOCATION = YES; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaScale~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = YES; + }; + name = Development; + }; + 0FFBC542097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaScale~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 0FFBC543097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaScale~"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + }; + name = Default; + }; + 0FFBC545097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Development; + }; + 0FFBC546097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Deployment; + }; + 0FFBC547097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Default; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaScale~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC541097463A900D78707 /* Development */, + 0FFBC542097463A900D78707 /* Deployment */, + 0FFBC543097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaScale~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC545097463A900D78707 /* Development */, + 0FFBC546097463A900D78707 /* Deployment */, + 0FFBC547097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/in_progress/mbc.areaSwap~/Info.plist b/in_progress/mbc.areaSwap~/Info.plist new file mode 100644 index 0000000..77f4bac --- /dev/null +++ b/in_progress/mbc.areaSwap~/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.areaSwap~ + CFBundleIconFile + + CFBundleIdentifier + com.brozier.areaSwap~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + iLaX + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/in_progress/mbc.areaSwap~/mbc.areaSwap~.c b/in_progress/mbc.areaSwap~/mbc.areaSwap~.c new file mode 100644 index 0000000..374ddbf --- /dev/null +++ b/in_progress/mbc.areaSwap~/mbc.areaSwap~.c @@ -0,0 +1,203 @@ +/*---------------------------------------------------------------------------------- +Filename: mbc.areaSwap~.c +Project: LPC Toolkit +Author: Mark Cartwright +Created: 7/23/07 +Updated: 7/23/07 +Description: Swap area coefficients by an array of weights +-------------------------------------------------------------------------------------*/ + +#include "ext.h" +#include "z_dsp.h" + +#define MAX_ORDER 200 + +void *areaSwap_class; + +typedef struct _areaSwap +{ + t_pxobject a_obj; + int* a_pos; + t_float* a_areaInBuff; + t_float* a_areaOutBuff; + int a_order; + int a_out_idx; +} t_areaSwap; + +t_int *areaSwap_perform(t_int *w); +void areaSwap_list(t_areaSwap *x, t_symbol *msg, short argc, t_atom *argv); +void areaSwap_order(t_areaSwap *x, long order); +void areaSwap_init(t_areaSwap *x); +void areaSwap_free(t_areaSwap *x); +void areaSwap_dsp(t_areaSwap *x, t_signal **sp, short *count); +void areaSwap_assist(t_areaSwap *x, void *b, long m, long a, char *s); +void *areaSwap_new(long order); + +void main(void) +{ + setup((t_messlist **)&areaSwap_class, (method)areaSwap_new, (method)areaSwap_free, (short)sizeof(t_areaSwap), 0L, A_DEFLONG, 0); + dsp_initclass(); + addmess((method)areaSwap_order, "order", A_LONG, 0); + addmess((method)areaSwap_dsp, "dsp", A_CANT, 0); + addmess((method)areaSwap_list, "list", A_GIMME, 0); + addmess((method)areaSwap_assist,"assist",A_CANT,0); +} + +t_int *areaSwap_perform(t_int *w) +{ + t_float *areaIn = (t_float *)(w[1]); + t_float *areaIdxIn = (t_float *)(w[2]); + t_areaSwap *x = (t_areaSwap *)(w[3]); + t_float *areaOut = (t_float *)(w[4]); + t_float *areaIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + + int order = x->a_order; + int out_idx = 0; //x->a_out_idx; + int in_idx = 0; + int i; + int* pos = x->a_pos; + + if (x->a_obj.z_disabled) + goto out; + + while (n--) { + if (x->a_out_idx < order) { + areaOut[out_idx] = x->a_areaOutBuff[x->a_out_idx]; + areaIdxOut[out_idx] = x->a_out_idx + 1; + cpost("\nareaOut[%d] = %f",out_idx,areaOut[out_idx]); + x->a_out_idx++; + } else { + areaOut[out_idx] = 0.0; + areaIdxOut[out_idx] = 0.0; + } + if ((int)(areaIdxIn[in_idx]) > 0) { + x->a_areaInBuff[(int)(areaIdxIn[in_idx])-1] = areaIn[in_idx]; + if ((int)(areaIdxIn[in_idx]) == order) { + + for (i=0; i < order; i++) { + x->a_areaOutBuff[pos[i] - 1] = x->a_areaInBuff[i]; + //cpost("\npos[%d] = %d",i,pos[i]); + } + + x->a_out_idx = 0; + n++; //to make up for last decrement + while (n--) { + if (x->a_out_idx < order) { + areaOut[out_idx] = x->a_areaOutBuff[x->a_out_idx]; + areaIdxOut[out_idx] = x->a_out_idx + 1; + cpost("\nareaOut[%d] = %f",out_idx,areaOut[out_idx]); + x->a_out_idx++; + } else { + areaOut[out_idx] = 0.0; + areaIdxOut[out_idx] = 0.0; + } + if ((int)(areaIdxIn[in_idx]) > 0) { + x->a_areaInBuff[(int)(areaIdxIn[in_idx])-1] = areaIn[in_idx]; + } + in_idx++; + out_idx++; + } + break; + } + } + in_idx++; + out_idx++; + } + +out: + return (w+7); +} + +void areaSwap_list(t_areaSwap *x, t_symbol *msg, short argc, t_atom *argv) { + + int i, pos_in; + if (argc == x->a_order) { + int min = (argc > x->a_order) ? x->a_order : argc; //use the minimum of the two to avoid any pointer erors + int* pos = x->a_pos; + int order = x->a_order; + + for (i = 0; i < min; i++) { + pos_in = atom_getintarg(i,argc,argv); + if (pos_in > 0 && pos_in <= order) { + *pos = atom_getintarg(i,argc,argv); + } else { + error("mbc.areaSwap~: position input is out of bounds for the given order."); + *pos = i+1; + } + pos++; + } + } else { + error("mbc.areaSwap~: number of items in the input list must equal the specified order"); + } + + int min = (argc > x->a_order) ? x->a_order : argc; //use the minimum of the two to avoid any pointer erors + for (i=0; i < min; i++) { + cpost("\npos(%d) = %d",i,x->a_pos[i]); + } + +} + +void areaSwap_order(t_areaSwap *x, long order) { + x->a_order = order; +} + +void areaSwap_dsp(t_areaSwap *x, t_signal **sp, short *count) +{ + dsp_add(areaSwap_perform, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); +} + +void areaSwap_assist(t_areaSwap *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) Areas"); break; + case 1: sprintf(s,"(signal) Coeff Index"); break; + } + } + else { + switch (a) { + case 0: sprintf(s,"(signal) Swapd Areas"); break; + case 1: sprintf(s,"(signal) Coeff Index"); break; + } + } +} + +void areaSwap_init(t_areaSwap *x) { + int i; + + x->a_pos = (int *) getbytes( MAX_ORDER * sizeof(int)); + x->a_areaInBuff = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + x->a_areaOutBuff = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + + for (i=0; i < x->a_order; i++) { + x->a_pos[i] = i+1; + x->a_areaInBuff[i] = 0.0; + x->a_areaOutBuff[i] = 0.0; + } +} + +void areaSwap_free(t_areaSwap *x) { + dsp_free((t_pxobject *) x); + freebytes(x->a_pos, MAX_ORDER * sizeof(int)); + freebytes(x->a_areaInBuff, MAX_ORDER * sizeof(t_float)); + freebytes(x->a_areaOutBuff, MAX_ORDER * sizeof(t_float)); +} + +void *areaSwap_new(long order) +{ + t_areaSwap *x = (t_areaSwap *)newobject(areaSwap_class); + dsp_setup((t_pxobject *)x,2); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + x->a_obj.z_misc |= Z_NO_INPLACE; + + x->a_order = order; + + areaSwap_init(x); + + return (x); +} + + + diff --git a/in_progress/mbc.areaSwap~/mbc.areaSwap~.xcodeproj/project.pbxproj b/in_progress/mbc.areaSwap~/mbc.areaSwap~.xcodeproj/project.pbxproj new file mode 100644 index 0000000..9dc7445 --- /dev/null +++ b/in_progress/mbc.areaSwap~/mbc.areaSwap~.xcodeproj/project.pbxproj @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5B62020919440900A62EB9 /* MaxAPI.framework */; }; + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */; }; + 8D01CCCC0486CAD60068D4B7 /* mbc.areaSwap~.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B2FE8417CDC02AAC07 /* mbc.areaSwap~.c */; settings = {ATTRIBUTES = (); }; }; + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 08FB77B2FE8417CDC02AAC07 /* mbc.areaSwap~.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "mbc.areaSwap~.c"; sourceTree = ""; }; + 0F5B62020919440900A62EB9 /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = /Library/Frameworks/MaxAPI.framework; sourceTree = ""; }; + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = /Library/Frameworks/MaxAudioAPI.framework; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* mbc.areaSwap~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.areaSwap~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */, + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */, + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* plus~ */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = "plus~"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */, + 0F5B62020919440900A62EB9 /* MaxAPI.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 08FB77B2FE8417CDC02AAC07 /* mbc.areaSwap~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* mbc.areaSwap~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* mbc.areaSwap~ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaSwap~" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mbc.areaSwap~"; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = MSPExternal; + productReference = 8D01CCD20486CAD60068D4B7 /* mbc.areaSwap~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaSwap~" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* plus~ */; + projectDirPath = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* mbc.areaSwap~ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCC0486CAD60068D4B7 /* mbc.areaSwap~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0FFBC541097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DEPLOYMENT_LOCATION = YES; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaSwap~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = YES; + }; + name = Development; + }; + 0FFBC542097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaSwap~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 0FFBC543097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.areaSwap~"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + }; + name = Default; + }; + 0FFBC545097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Development; + }; + 0FFBC546097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Deployment; + }; + 0FFBC547097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Default; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.areaSwap~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC541097463A900D78707 /* Development */, + 0FFBC542097463A900D78707 /* Deployment */, + 0FFBC543097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "mbc.areaSwap~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC545097463A900D78707 /* Development */, + 0FFBC546097463A900D78707 /* Deployment */, + 0FFBC547097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/in_progress/mbc.coeffConv~/Info.plist b/in_progress/mbc.coeffConv~/Info.plist new file mode 100644 index 0000000..28d21f8 --- /dev/null +++ b/in_progress/mbc.coeffConv~/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.coeffConv~ + CFBundleIconFile + + CFBundleIdentifier + com.brozier.coeffConv~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + iLaX + CFBundleSignature + ???? + CFBundleVersion + 1.0 + CSResourcesFileMapped + + + diff --git a/in_progress/mbc.coeffConv~/coeffConv~.c b/in_progress/mbc.coeffConv~/coeffConv~.c new file mode 100644 index 0000000..0605e76 --- /dev/null +++ b/in_progress/mbc.coeffConv~/coeffConv~.c @@ -0,0 +1,556 @@ +#include "ext.h" +#include "z_dsp.h" + +#define MAX_ORDER 200 + +void *coeffConv_class; + +typedef struct _coeffConv +{ + t_pxobject c_obj; + t_float* c_a; //filer coefficients + t_float* c_inBuff; //filter coeff input buffer + t_float* c_Ar; //tube areas + double **c_A; //for parcor to coeff conversion + double *c_K; //parcor coefficients + long c_order; + int c_sCoeffType; //type of source coefficients: CT_PARCOR,CT_FILTER,CT_AREA + int c_tCoeffType; //type of destiation coefficients: CT_PARCOR,CT_FILTER,CT_AREA + int c_out_idx; //current outframe buffer index +} t_coeffConv; + +enum coeffTypes { + CT_PARCOR, + CT_FILTER, + CT_AREA +}; + +t_int *coeffConv_perf_f2a(t_int *w); +t_int *coeffConv_perf_f2p(t_int *w); +t_int *coeffConv_perf_p2a(t_int *w); +t_int *coeffConv_perf_p2f(t_int *w); +t_int *coeffConv_perf_a2f(t_int *w); +t_int *coeffConv_perf_a2p(t_int *w); +void coeffConv_order(t_coeffConv *x, int order); +void coeffConv_init(t_coeffConv *x); +void coeffConv_free(t_coeffConv *x); +void coeffConv_clear(t_coeffConv *x); +void coeffConv_dsp(t_coeffConv *x, t_signal **sp, short *count); +void coeffConv_assist(t_coeffConv *x, void *b, long m, long a, char *s); +void *coeffConv_new(t_symbol *s, int argc, t_atom *argv); + +void main(void) +{ + setup((t_messlist **)&coeffConv_class, (method)coeffConv_new, (method)coeffConv_free, (short)sizeof(t_coeffConv), 0L, A_GIMME, 0); + dsp_initclass(); + addmess((method)coeffConv_dsp, "dsp", A_CANT, 0); + addmess((method)coeffConv_order,"order",A_DEFLONG,0); + addmess((method)coeffConv_assist,"assist",A_CANT,0); +} + +t_int *coeffConv_perf_f2a(t_int *w) { +} + +t_int *coeffConv_perf_f2p(t_int *w) { +} + +t_int *coeffConv_perf_p2a(t_int *w) +{ + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_coeffConv *x = (t_coeffConv *)(w[3]); + t_float *coeffOut = (t_float *)(w[4]); + t_float *coeffIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + int order = x->c_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[6]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_Ar[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->c_K[i+1] = x->c_inBuff[i]; + } + + x->c_Ar[0] = 1.0; + for (i = 1; i < order; i++) { // droping a coefficient or not? this is the way that vtoa does it... + x->c_Ar[i] = x->c_Ar[i-1]*(1 - x->c_K[i])/(1 + x->c_K[i]); + } + + x->c_out_idx = 0; + n++; //to make up for last decrement + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_Ar[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + } + in_idx++; + out_idx++; + } + break; + } + } + in_idx++; + out_idx++; + } + + return (w+7); +} + + +t_int *coeffConv_perf_p2f(t_int *w) +{ + + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_coeffConv *x = (t_coeffConv *)(w[3]); + t_float *coeffOut = (t_float *)(w[4]); + t_float *coeffIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + int order = x->c_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[6]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_a[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0; + coeffIdxOut[out_idx] = 0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->c_K[i+1] = x->c_inBuff[i]; + } + + //solve for filter coefficients + for (i = 1; i <= order; i++) { + x->c_A[i][i] = x->c_K[i]; + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->c_A[j][i] = x->c_A[j][i1] - x->c_K[i] * x->c_A[ji][i1]; + } + } + } + + for (j = 1; j <=order; j++) { + x->c_a[j-1] = x->c_A[j][order]; + } + x->c_out_idx = 0; + n++; //to make up for last decrement + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_a[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + } + in_idx++; + out_idx++; + } + break; + } + } + in_idx++; + out_idx++; + } + + return (w+7); +} + +t_int *coeffConv_perf_a2f(t_int *w) +{ + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_coeffConv *x = (t_coeffConv *)(w[3]); + t_float *coeffOut = (t_float *)(w[4]); + t_float *coeffIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + int order = x->c_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[6]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_a[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->c_Ar[i+1] = x->c_inBuff[i]; + } + + //solve for filter coefficients from area coefficients + for (i = 1; i <= order; i++) { + //convert from area coefficients to reflection coefficients (remember reflection coefficients are -PARCOR); + if (i != order) + x->c_K[i] = -(x->c_Ar[i+1] - x->c_Ar[i])/(x->c_Ar[i+1] + x->c_Ar[i]); + else + x->c_K[i] = -0.7; //no losses at lips NOTE: need to make this changeable + + x->c_A[i][i] = x->c_K[i]; + + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->c_A[j][i] = x->c_A[j][i1] - x->c_K[i] * x->c_A[ji][i1]; + } + } + } + + for (j = 1; j <=order; j++) { + x->c_a[j-1] = x->c_A[j][order]; + } + x->c_out_idx = 0; + n++; //to make up for last decrement + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_a[x->c_out_idx]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + } + in_idx++; + out_idx++; + } + break; + } + } + in_idx++; + out_idx++; + } + + return (w+7); +} + +t_int *coeffConv_perf_a2p(t_int *w) +{ + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_coeffConv *x = (t_coeffConv *)(w[3]); + t_float *coeffOut = (t_float *)(w[4]); + t_float *coeffIdxOut = (t_float *)(w[5]); + int n = (int)(w[6]); + int order = x->c_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[6]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_K[x->c_out_idx+1]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->c_Ar[i+1] = x->c_inBuff[i]; + } + + //solve for filter coefficients from area coefficients + for (i = 1; i <= order; i++) { + //convert from area coefficients to reflection coefficients (remember reflection coefficients are -PARCOR); + if (i != order) + x->c_K[i] = -(x->c_Ar[i+1] - x->c_Ar[i])/(x->c_Ar[i+1] + x->c_Ar[i]); + else + x->c_K[i] = -0.7; //no losses at lips NOTE: need to make this changeable + } + + x->c_out_idx = 0; + n++; //to make up for last decrement + while (n--) { + if (x->c_out_idx < order) { + coeffOut[out_idx] = x->c_K[x->c_out_idx + 1]; + coeffIdxOut[out_idx] = x->c_out_idx + 1; + x->c_out_idx++; + } else { + coeffOut[out_idx] = 0.0; + coeffIdxOut[out_idx] = 0.0; + } + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_inBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + } + in_idx++; + out_idx++; + } + break; + } + } + in_idx++; + out_idx++; + } + + return (w+7); +} + + +void coeffConv_init(t_coeffConv *x) { + int i; + + x->c_a = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + x->c_inBuff = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + x->c_Ar = (t_float *) getbytes( (MAX_ORDER + 1) * sizeof(t_float)); + x->c_K = (double *) getbytes( (MAX_ORDER + 1) * sizeof(double)); + x->c_A = (double **) getbytes( (MAX_ORDER + 1) * sizeof(double*)); + for(i=0; ic_A[i] = (double *)getbytes( (MAX_ORDER + 1) * sizeof(double)); + } + coeffConv_clear(x); +} + +void coeffConv_free(t_coeffConv *x) { + int i; + + dsp_free((t_pxobject *) x); + freebytes(x->c_a, MAX_ORDER * sizeof(t_float)); + freebytes(x->c_inBuff, MAX_ORDER * sizeof(t_float)); + freebytes(x->c_Ar, (MAX_ORDER + 1) * sizeof(t_float)); + freebytes(x->c_K, (MAX_ORDER + 1) * sizeof(double)); + for(i=0; ic_A[i], (MAX_ORDER + 1) * sizeof(double)); + } + freebytes(x->c_A, MAX_ORDER * sizeof(double*)); + +} + +void coeffConv_clear(t_coeffConv *x) { + int i, j; + for(i = 0; i < MAX_ORDER; i++) { + x->c_a[i] = 0.0; + x->c_inBuff[i] = 0.0; + for (j = 0; j < (MAX_ORDER+1); j++) { + x->c_A[i][j] = 0.0; + } + } + + for(i = 0; i < (MAX_ORDER+1); i++) { + x->c_Ar[i] = 0.0; + x->c_K[i] = 0.0; + } + x->c_out_idx = 0; +} + +void coeffConv_dsp(t_coeffConv *x, t_signal **sp, short *count) +{ + //NOTE: need to specify parcor, filter, or area perform string !!!!!! + switch(x->c_sCoeffType) { + case CT_FILTER: + switch (x->c_tCoeffType) { + case CT_PARCOR: + dsp_add(coeffConv_perf_f2p, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + case CT_AREA: + dsp_add(coeffConv_perf_f2a, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + default: + error("mbc.coeffConv~: no target coefficient type selected"); + break; + } + break; + + case CT_PARCOR: + switch (x->c_tCoeffType) { + case CT_FILTER: + dsp_add(coeffConv_perf_p2f, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + case CT_AREA: + dsp_add(coeffConv_perf_p2a, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + default: + error("mbc.coeffConv~: no target coefficient type selected"); + break; + } + break; + + case CT_AREA: + switch (x->c_tCoeffType) { + case CT_FILTER: + dsp_add(coeffConv_perf_a2f, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + case CT_PARCOR: + dsp_add(coeffConv_perf_a2p, 6, sp[0]->s_vec, sp[1]->s_vec, x, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); + break; + + default: + error("mbc.coeffConv~: no target coefficient type selected"); + break; + } + break; + + default: + error("mbc.coeffConv~: no coefficient type selected"); + break; + } + coeffConv_clear(x); +} + +void coeffConv_order(t_coeffConv *x, int order) { + if (order < 1) { + error("mbc.coeffConv~: mbc.coeffConv~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.coeffConv~: max order is 199"); + order = 199; + } + + int i = x->c_order; + x->c_order = order; + for ( i = i+1; i < order; i++) { + x->c_a[i] = 0.0; + x->c_inBuff[i] = 0.0; + x->c_Ar[i] = 0.0; + } +} + +void coeffConv_assist(t_coeffConv *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) In Coefficients"); break; + case 1: sprintf(s,"(signal) In Coeff Index "); break; + } + } + else { + switch (a) { + case 0: sprintf(s,"(signal) Out Coefficients"); break; + case 1: sprintf(s,"(signal) Out Coeff Index "); break; + } + } +} + +void *coeffConv_new(t_symbol *s, int argc, t_atom *argv) +{ + t_coeffConv *x = (t_coeffConv *)newobject(coeffConv_class); + dsp_setup((t_pxobject *)x,2); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + x->c_obj.z_misc |= Z_NO_INPLACE; + + //get arguments out of gimme list + int order = atom_getintarg(0,argc,argv); + t_symbol* sCoeffType = atom_getsymarg(1,argc,argv); + t_symbol* tCoeffType = atom_getsymarg(2,argc,argv); + + //order bounds + if (order < 1) { + error("mbc.coeffConv~: mbc.coeffConv~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.coeffConv~: max order is 199"); + order = 199; + } + + //select in coeff type + if (sCoeffType == gensym("parcor")) { + x->c_sCoeffType = CT_PARCOR; + } else if (sCoeffType == gensym("filter")) { + x->c_sCoeffType = CT_FILTER; + } else if (sCoeffType == gensym("area")) { + x->c_sCoeffType = CT_AREA; + } else { + post("mbc.coeffConv~: no source coefficient type selected. using default 'parcor' type"); + x->c_sCoeffType = CT_PARCOR; + } + + //select out coeff type + if (tCoeffType == gensym("parcor")) { + x->c_tCoeffType = CT_PARCOR; + } else if (tCoeffType == gensym("filter")) { + x->c_tCoeffType = CT_FILTER; + } else if (tCoeffType == gensym("area")) { + x->c_tCoeffType = CT_AREA; + } else { + post("mbc.coeffConv~: no target coefficient type selected. using default 'area' type"); + x->c_tCoeffType = CT_PARCOR; + } + + //assign locals to globals and init + x->c_order = order; + coeffConv_init(x); + + return (x); +} + + + diff --git a/in_progress/mbc.coeffConv~/coeffConv~.xcodeproj/project.pbxproj b/in_progress/mbc.coeffConv~/coeffConv~.xcodeproj/project.pbxproj new file mode 100644 index 0000000..68de917 --- /dev/null +++ b/in_progress/mbc.coeffConv~/coeffConv~.xcodeproj/project.pbxproj @@ -0,0 +1,333 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { + +/* Begin PBXBuildFile section */ + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5B62020919440900A62EB9 /* MaxAPI.framework */; }; + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */; }; + 8D01CCCC0486CAD60068D4B7 /* coeffConv~.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB77B2FE8417CDC02AAC07 /* coeffConv~.c */; settings = {ATTRIBUTES = (); }; }; + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; + 08FB77B2FE8417CDC02AAC07 /* coeffConv~.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "coeffConv~.c"; sourceTree = ""; }; + 0F5B62020919440900A62EB9 /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = /Library/Frameworks/MaxAPI.framework; sourceTree = ""; }; + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = /Library/Frameworks/MaxAudioAPI.framework; sourceTree = ""; }; + 8D01CCD20486CAD60068D4B7 /* mbc.coeffConv~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.coeffConv~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */, + 0F5B62030919440900A62EB9 /* MaxAPI.framework in Frameworks */, + 0FF3254009473DCC00B01934 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* plus~ */ = { + isa = PBXGroup; + children = ( + 08FB77ADFE841716C02AAC07 /* Source */, + 089C167CFE841241C02AAC07 /* Resources */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = "plus~"; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 0FF3253F09473DCC00B01934 /* MaxAudioAPI.framework */, + 0F5B62020919440900A62EB9 /* MaxAPI.framework */, + 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 089C167CFE841241C02AAC07 /* Resources */ = { + isa = PBXGroup; + children = ( + ); + name = Resources; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 08FB77B2FE8417CDC02AAC07 /* coeffConv~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D01CCD20486CAD60068D4B7 /* mbc.coeffConv~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8D01CCC70486CAD60068D4B7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 8D01CCC60486CAD60068D4B7 /* mbc.coeffConv~ */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.coeffConv~" */; + buildPhases = ( + 8D01CCC70486CAD60068D4B7 /* Headers */, + 8D01CCC90486CAD60068D4B7 /* Resources */, + 8D01CCCB0486CAD60068D4B7 /* Sources */, + 8D01CCCD0486CAD60068D4B7 /* Frameworks */, + 8D01CCCF0486CAD60068D4B7 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "mbc.coeffConv~"; + productInstallPath = "$(HOME)/Library/Bundles"; + productName = MSPExternal; + productReference = 8D01CCD20486CAD60068D4B7 /* mbc.coeffConv~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "coeffConv~" */; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* plus~ */; + projectDirPath = ""; + targets = ( + 8D01CCC60486CAD60068D4B7 /* mbc.coeffConv~ */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D01CCC90486CAD60068D4B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 8D01CCCF0486CAD60068D4B7 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D01CCCB0486CAD60068D4B7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8D01CCCC0486CAD60068D4B7 /* coeffConv~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0FFBC541097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + DEBUGGING_SYMBOLS = YES; + DEPLOYMENT_LOCATION = YES; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OPTIMIZATION_CFLAGS = "-O0"; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.coeffConv~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = YES; + }; + name = Development; + }; + 0FFBC542097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.coeffConv~"; + SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 0FFBC543097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEPLOYMENT_LOCATION = NO; + DSTROOT = "$(PROJECT_DIR)"; + FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; + GCC_ENABLE_TRIGRAPHS = NO; + GCC_GENERATE_DEBUGGING_SYMBOLS = NO; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "../../c74support/max-includes/macho-prefix.h"; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO; + GCC_WARN_UNKNOWN_PRAGMAS = NO; + GENERATE_PKGINFO_FILE = YES; + HEADER_SEARCH_PATHS = ( + "../../c74support/max-includes", + "../../c74support/msp-includes", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "/../../../sysbuild/$(CONFIGURATION)/Cycling '74/externals"; + LIBRARY_SEARCH_PATHS = ""; + LIBRARY_STYLE = Bundle; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + OTHER_REZFLAGS = ""; + PRODUCT_NAME = "mbc.coeffConv~"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = mxo; + }; + name = Default; + }; + 0FFBC545097463A900D78707 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Development; + }; + 0FFBC546097463A900D78707 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Deployment; + }; + 0FFBC547097463A900D78707 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_ALTIVEC_EXTENSIONS = YES; + }; + name = Default; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0FFBC540097463A900D78707 /* Build configuration list for PBXNativeTarget "mbc.coeffConv~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC541097463A900D78707 /* Development */, + 0FFBC542097463A900D78707 /* Deployment */, + 0FFBC543097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 0FFBC544097463A900D78707 /* Build configuration list for PBXProject "coeffConv~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0FFBC545097463A900D78707 /* Development */, + 0FFBC546097463A900D78707 /* Deployment */, + 0FFBC547097463A900D78707 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/misc/README b/misc/README new file mode 100644 index 0000000..4bb3578 --- /dev/null +++ b/misc/README @@ -0,0 +1,8 @@ +This a collection of Max/MSP objects for performing linear prediction coding. + +Please copy the contents of the lpctoolkit-help folder into the msp-help folder in your Cycling74 directory, and the lpctoolkit-externals files into the msp-externals folder in your Cycling74 directory. + +For more information please visit http://markcartwright.com/projects/lpc-toolkit + +Mark Cartwright +mcartwright@gmail.com diff --git a/misc/bundlePackage b/misc/bundlePackage new file mode 100755 index 0000000..332f29b --- /dev/null +++ b/misc/bundlePackage @@ -0,0 +1,12 @@ +#!/bin/bash + +rm -rf lpcoolkit + +mkdir -p lpctoolkit/lpctoolkit-externals +mkdir -p lpctoolkit/lpctoolkit-help + +find ../sdk-build/* -name '*.mxo' -exec cp -r {} ./lpctoolkit/lpctoolkit-externals/. \; +find ../src/* -name '*.maxhelp' -exec cp -r {} ./lpctoolkit/lpctoolkit-help/. \; +cp -r ../src/lpcToolkitDemo.maxpat ./lpctoolkit/lpctoolkit-help/. +cp README ./lpctoolkit/. + diff --git a/sdk-build/mbc.allpole~.mxo/Contents/Info.plist b/sdk-build/mbc.allpole~.mxo/Contents/Info.plist new file mode 100644 index 0000000..1f88d18 --- /dev/null +++ b/sdk-build/mbc.allpole~.mxo/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.allpole~ + CFBundleIdentifier + com.mcartwright.mbc.allpole~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.allpole~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.allpole~.mxo/Contents/MacOS/mbc.allpole~ b/sdk-build/mbc.allpole~.mxo/Contents/MacOS/mbc.allpole~ new file mode 100755 index 0000000000000000000000000000000000000000..aab695dd1e044b84df4d7c1c4f8c2bcfb8f267e7 GIT binary patch literal 18856 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 literal 0 HcmV?d00001 diff --git a/sdk-build/mbc.allpole~.mxo/Contents/PkgInfo b/sdk-build/mbc.allpole~.mxo/Contents/PkgInfo new file mode 100644 index 0000000..0febb6e --- /dev/null +++ b/sdk-build/mbc.allpole~.mxo/Contents/PkgInfo @@ -0,0 +1 @@ +iLaXmax2 \ No newline at end of file diff --git a/sdk-build/mbc.blit~.mxo/Contents/Info.plist b/sdk-build/mbc.blit~.mxo/Contents/Info.plist new file mode 100644 index 0000000..e409e73 --- /dev/null +++ b/sdk-build/mbc.blit~.mxo/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.blit~ + CFBundleIdentifier + com.mcartwright.mbc.blit~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.blit~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.blit~.mxo/Contents/MacOS/mbc.blit~ b/sdk-build/mbc.blit~.mxo/Contents/MacOS/mbc.blit~ new file mode 100755 index 0000000000000000000000000000000000000000..a885a61ed35dd5743fac112220b5e2150fbc0eed GIT binary patch literal 18680 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 QUxlx^isppnGlj7~0jy5lBme*a literal 0 HcmV?d00001 diff --git a/sdk-build/mbc.blit~.mxo/Contents/PkgInfo b/sdk-build/mbc.blit~.mxo/Contents/PkgInfo new file mode 100644 index 0000000..0febb6e --- /dev/null +++ b/sdk-build/mbc.blit~.mxo/Contents/PkgInfo @@ -0,0 +1 @@ +iLaXmax2 \ No newline at end of file diff --git a/sdk-build/mbc.coeffDisp~.mxo/Contents/Info.plist b/sdk-build/mbc.coeffDisp~.mxo/Contents/Info.plist new file mode 100644 index 0000000..f79f07a --- /dev/null +++ b/sdk-build/mbc.coeffDisp~.mxo/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.coeffDisp~ + CFBundleIdentifier + com.mcartwright.mbc.coeffDisp~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.coeffDisp~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.coeffDisp~.mxo/Contents/MacOS/mbc.coeffDisp~ b/sdk-build/mbc.coeffDisp~.mxo/Contents/MacOS/mbc.coeffDisp~ new file mode 100755 index 0000000000000000000000000000000000000000..a0121ad6716d0fd30a9ba1b26062ead701f33062 GIT binary patch literal 18284 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 ZJ5#4KwKC?Lr{b2}+M3=S+302aKLH(0@SXqw literal 0 HcmV?d00001 diff --git a/sdk-build/mbc.coeffDisp~.mxo/Contents/PkgInfo b/sdk-build/mbc.coeffDisp~.mxo/Contents/PkgInfo new file mode 100644 index 0000000..0febb6e --- /dev/null +++ b/sdk-build/mbc.coeffDisp~.mxo/Contents/PkgInfo @@ -0,0 +1 @@ +iLaXmax2 \ No newline at end of file diff --git a/sdk-build/mbc.errfilt~.mxo/Contents/Info.plist b/sdk-build/mbc.errfilt~.mxo/Contents/Info.plist new file mode 100644 index 0000000..3694465 --- /dev/null +++ b/sdk-build/mbc.errfilt~.mxo/Contents/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.errfilt~ + CFBundleIdentifier + com.mcartwright.mbc.errfilt~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.errfilt~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.errfilt~.mxo/Contents/MacOS/mbc.errfilt~ b/sdk-build/mbc.errfilt~.mxo/Contents/MacOS/mbc.errfilt~ new file mode 100755 index 0000000000000000000000000000000000000000..7e5966c3b508e599700a9d46cf3a2e7d4fea4ad2 GIT binary patch literal 14148 zcmeHOZEPGz86Gtp;qM53l37$SRh)d$Meq4 z`1bsPP$VRfcBI*P=AGw#=bd-n-Mh1AfA`Mc-n)e{whlFj`hL_G)-!ezZ5!$UE}Ax^ z9vni)Tf(A)mh_>*0z#x|wmxBt4w~iqBkyDEvzUz9_9l%C%*d{$r7XK>xc{?f~S}%Jq|; zw@@4dJdXW+Lw%kRilL{LY}&ty>nt=TJ3maBqD7=bG81KnQ&%T8aTxX-CrvrjfVxq6Hz! zYWjR`rKv+aq}Ec=v?HZlL9-LdtWLt^Hew26hajictB2Uqw(;Diwii{?_6+XZt@aPf z6>Nc!{72gl$H{l%%5pD27i#=#Z*B{nIr93)Pu=>k^2U*iv_6veLT@ixWjkXLZ2axS zMWwP;RFdsLy%TkGmU-TGb=F?TxSqo5R$qfV1`GeorB2Qr zY@GeUt&CM>p2xK@=gKNG&+*=H`OO2)we4JZxayoDVz}x&OD(JQN9f5!Z5Q2^Xgld+ z25nf#Lv&k|ha$mpewvs`H7J3hi9snH36@KUL?^l?tyRhpWz4Rw%eG^{-U;9u$Ok-{QKvi349> zLa%(DhOq2%XQY0T50As63abn+mcu`R6U>?2e)!j~AjXd)$niRf4p-Emb1qOpcrJ1n zBzTF#5W&kFh6(_nX%M}kQA!`#{KGFlSR4k9}i%hQm;`Q|m`@MAf@ zsxCIziK)dJyy!SJjt~h4gO%Z6MGcjAZs!8ru$}G=>r92%@efv=9S9mN>V;0a<#=K& z+;?IsM3$yERGk?y{Ir-#B0`B1>UUxB+J=NzF4 zJQM-(Y^cNnxYKzL4~aM zVnJn>k*&o-_)@6UV&TDjp_Hk`I&F6Kt84HdGj;GY86yS0q33PlTWsM_MO|rJl9fS_ z^J#tJ)mSH6h^|I$@ne60yy{#eTaaRqlr}?1(@>JG7t=KGRkfxD>FGsD8k9*oD8}D# z$9a+tkC$c47$(TjOwdmD?jl_g2 zR}4$p`p`ow<|tXVViok1k(pG;M_A-`lx}+rD%O};%BEq)PK_z{m@Wp*4EHWuNKGq= zJjSueL^fM6v-?|zr1@3a5J?@=m*Y5PLZ40COgdP;ci zxgaV@Y223BhVTF zI`@q;1%Z%g!=mjJZI@^_idGRVokO6rzf^vSj>PW*XJGO6d(Q76P7f~AI12PM4k$zf zCV2!k4M2DwE)o;}$}NmNEBJ(oL;Nyik}omwkKV@EcLkrYItTG{!6!^M$san8O?V$J5)+@Fp%8q+lArYOB_=+dvG}9l6PEmG4_{*9(>aZ| z1fQ_v|HZ?XnD}&-;~#=gSn{9r@FgZbo&Q*mLnE|bgeCuqhfnw}a1`th72?nyQo&U0 zK7ny6kKF-G?|SqITmbGPjF$560B{F5w3ZZM*rdNp6@~l?_UMGb6rWQ9(^|eGFzx$G z0@EJ-OkncACNS;A?**p3`m4Z{pVxugSR1@Riz_fKgN0qp<@b8<$2^?v9{D34Oz+M} zn{f{w@!%sKJnq5Ic<^Z#!%N1V_uv;@%>De42ZJ_42cvP+mOYC4DbyHhAL>rj$58uG zRn%RmpGHNA4d60}`We*SsC!Tqyz!75(~_lpI;(4AdV-Ew(Q7H1WtWm#60gSKB^?Z8 z3m9iGmQnKl=*HR}_)b(c1 z$Q!n|hhtYBZeBmu9CS~0E!lz78N4N=XEF>v8hNI1C$vO5ozv|xGc5&}-JQi9=Qdqf z)JJjVj1~_LDe}oo^vTKOq^(<9A7t97p0_4*)Y?ljGkHW$*&2>|nJK23B|EFz8aHiC zS~)$(Efj2+5`B#E?s)%!xMqzb1mn3ey8M+7X zdYE3sp*AtRpU1&^Aa53PiEPx^*85=75mWArOa$+qNm*+Kq_QoUBaR3zZThktXi2Q) QIoX + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.lpc~ + CFBundleIdentifier + com.mcartwright.mbc.lpc~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.lpc~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.lpc~.mxo/Contents/MacOS/mbc.lpc~ b/sdk-build/mbc.lpc~.mxo/Contents/MacOS/mbc.lpc~ new file mode 100755 index 0000000000000000000000000000000000000000..f8bc60132254e23d3ed30ecbafd0940efbbed273 GIT binary patch literal 22708 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 + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + mbc.pitch~ + CFBundleIdentifier + com.mcartwright.mbc.pitch~ + CFBundleInfoDictionaryVersion + 6.0 + CFBundleLongVersionString + mbc.pitch~ 5.1.1, Copyright 2010 Mark Cartwright + CFBundlePackageType + iLaX + CFBundleShortVersionString + 5.1.1 + CFBundleSignature + max2 + CFBundleVersion + 5.1.1 + CSResourcesFileMapped + + + diff --git a/sdk-build/mbc.pitch~.mxo/Contents/MacOS/mbc.pitch~ b/sdk-build/mbc.pitch~.mxo/Contents/MacOS/mbc.pitch~ new file mode 100755 index 0000000000000000000000000000000000000000..48ba7f966ce7387ad2b6e1d7151b14be6fddb9cf GIT binary patch literal 18424 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 literal 0 HcmV?d00001 diff --git a/sdk-build/mbc.pitch~.mxo/Contents/PkgInfo b/sdk-build/mbc.pitch~.mxo/Contents/PkgInfo new file mode 100644 index 0000000..0febb6e --- /dev/null +++ b/sdk-build/mbc.pitch~.mxo/Contents/PkgInfo @@ -0,0 +1 @@ +iLaXmax2 \ No newline at end of file diff --git a/src/Info.plist b/src/Info.plist new file mode 100644 index 0000000..3c37968 --- /dev/null +++ b/src/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${PRODUCT_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.mcartwright.${PRODUCT_NAME} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + iLaX + CFBundleSignature + max2 + CFBundleVersion + ${PRODUCT_VERSION} + CFBundleShortVersionString + ${PRODUCT_VERSION} + CFBundleLongVersionString + ${PRODUCT_NAME} ${PRODUCT_VERSION}, Copyright 2010 Mark Cartwright + CSResourcesFileMapped + + + diff --git a/src/lpcToolkitDemo.maxpat b/src/lpcToolkitDemo.maxpat new file mode 100644 index 0000000..0cd29d1 --- /dev/null +++ b/src/lpcToolkitDemo.maxpat @@ -0,0 +1,2002 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 335.0, 44.0, 758.0, 652.0 ], + "bglocked" : 0, + "defrect" : [ 335.0, 44.0, 758.0, 652.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 1, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 5.0, 5.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-58", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 625.0, 465.0, 53.0, 20.0 ], + "text" : "bitsafe~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 1280.0, 170.0, 34.0, 20.0 ], + "text" : "/ 12." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-16", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 1230.0, 170.0, 50.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 300.0, 40.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-5", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 435.0, 180.0, 79.0, 20.0 ], + "text" : "loadmess 40" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-80", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 10.0, 65.0, 150.0, 62.0 ], + "presentation" : 1, + "presentation_linecount" : 4, + "presentation_rect" : [ 425.0, 75.0, 150.0, 62.0 ], + "text" : "This is an LPC example that resynthesizes the input using a band-limited impulse train." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-78", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 455.0, 50.0, 150.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 10.0, 120.0, 92.0, 20.0 ], + "text" : "Soundfile Input:" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 14.0, + "id" : "obj-69", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 550.0, 15.0, 183.0, 23.0 ], + "presentation" : 1, + "presentation_rect" : [ 10.0, 65.0, 183.0, 23.0 ], + "text" : "Input Parameters:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-66", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 90.0, 165.0, 150.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 95.0, 200.0, 50.0, 20.0 ], + "text" : "Preset:" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 14.0, + "id" : "obj-61", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 15.0, 320.0, 185.0, 23.0 ], + "presentation" : 1, + "presentation_rect" : [ 15.0, 415.0, 185.0, 23.0 ], + "text" : "Output:" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 14.0, + "id" : "obj-28", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1065.0, 0.0, 183.0, 39.0 ], + "presentation" : 1, + "presentation_linecount" : 2, + "presentation_rect" : [ 10.0, 150.0, 183.0, 39.0 ], + "text" : "Analysis/Synthesis Parameters:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-23", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1175.0, 775.0, 150.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 100.0, 360.0, 62.0, 20.0 ], + "text" : "Listen:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "maxclass" : "textbutton", + "mode" : 1, + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "patching_rect" : [ 550.0, 50.0, 100.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 205.0, 120.0, 100.0, 20.0 ], + "text" : "play", + "texton" : "stop" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "textbutton", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "", "", "int" ], + "patching_rect" : [ 655.0, 50.0, 100.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 105.0, 120.0, 100.0, 20.0 ], + "text" : "choose input file" + } + + } +, { + "box" : { + "id" : "obj-3", + "maxclass" : "slider", + "min" : 1.0, + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 515.0, 180.0, 190.0, 18.0 ], + "presentation" : 1, + "presentation_rect" : [ 190.0, 240.0, 192.0, 20.0 ], + "size" : 100.0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-77", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 465.0, 85.0, 150.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 65.0, 95.0, 44.0, 20.0 ], + "text" : "Input:" + } + + } +, { + "box" : { + "id" : "obj-75", + "maxclass" : "preset", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "preset", "int", "preset", "int" ], + "patching_rect" : [ 915.0, 50.0, 100.0, 40.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 190.0, 100.0, 40.0 ], + "preset_data" : [ { + "number" : 1, + "data" : [ 5, "obj-72", "slider", "float", 60.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 1, 5, "obj-3", "slider", "float", 39.0 ] + } +, { + "number" : 2, + "data" : [ 5, "obj-72", "slider", "float", 60.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 3, 5, "obj-3", "slider", "float", 39.0 ] + } +, { + "number" : 3, + "data" : [ 5, "obj-72", "slider", "float", 60.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 2, 5, "obj-3", "slider", "float", 39.0 ] + } +, { + "number" : 4, + "data" : [ 5, "obj-72", "slider", "float", 60.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 39.0 ] + } +, { + "number" : 5, + "data" : [ 5, "obj-72", "slider", "float", 99.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 39.0 ] + } +, { + "number" : 6, + "data" : [ 5, "obj-72", "slider", "float", 99.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 92.0 ] + } +, { + "number" : 7, + "data" : [ 5, "obj-72", "slider", "float", 0.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 92.0 ] + } +, { + "number" : 8, + "data" : [ 5, "obj-72", "slider", "float", 0.0, 5, "obj-64", "slider", "float", 240.0, 5, "obj-9", "slider", "float", 249.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 58.0 ] + } +, { + "number" : 9, + "data" : [ 5, "obj-72", "slider", "float", 0.0, 5, "obj-64", "slider", "float", 121.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 78.0 ] + } +, { + "number" : 10, + "data" : [ 5, "obj-72", "slider", "float", 49.0, 5, "obj-64", "slider", "float", 121.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 78.0 ] + } +, { + "number" : 11, + "data" : [ 5, "obj-72", "slider", "float", 61.0, 5, "obj-64", "slider", "float", 0.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 57.0 ] + } +, { + "number" : 12, + "data" : [ 5, "obj-72", "slider", "float", 49.0, 5, "obj-64", "slider", "float", 0.0, 5, "obj-9", "slider", "float", 387.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 57.0 ] + } +, { + "number" : 13, + "data" : [ 5, "obj-72", "slider", "float", 13.0, 5, "obj-64", "slider", "float", 480.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 7.0 ] + } +, { + "number" : 14, + "data" : [ 5, "obj-72", "slider", "float", 13.0, 5, "obj-64", "slider", "float", 0.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 7.0 ] + } +, { + "number" : 15, + "data" : [ 5, "obj-72", "slider", "float", 76.0, 5, "obj-64", "slider", "float", 0.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 7.0 ] + } +, { + "number" : 16, + "data" : [ 5, "obj-72", "slider", "float", 76.0, 5, "obj-64", "slider", "float", 362.0, 5, "obj-9", "slider", "float", 261.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 3.0 ] + } +, { + "number" : 17, + "data" : [ 5, "obj-72", "slider", "float", 48.0, 5, "obj-64", "slider", "float", 480.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 57.0 ] + } +, { + "number" : 18, + "data" : [ 5, "obj-72", "slider", "float", 48.0, 5, "obj-64", "slider", "float", 362.0, 5, "obj-9", "slider", "float", 5.0, 5, "obj-22", "umenu", "int", 4, 5, "obj-3", "slider", "float", 57.0 ] + } + ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-74", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 215.0, 79.0, 20.0 ], + "text" : "loadmess 60" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-73", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 1190.0, 285.0, 41.0, 20.0 ], + "text" : "/ 100." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-71", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1085.0, 245.0, 102.0, 34.0 ], + "presentation" : 1, + "presentation_rect" : [ 25.0, 330.0, 119.0, 20.0 ], + "text" : "Unvoiced Threshold:" + } + + } +, { + "box" : { + "id" : "obj-72", + "maxclass" : "slider", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 240.0, 192.0, 38.0 ], + "presentation" : 1, + "presentation_rect" : [ 190.0, 330.0, 192.0, 20.0 ], + "size" : 100.0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-70", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 100.0, 85.0, 20.0 ], + "text" : "loadmess 240" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-68", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 195.0, 97.0, 20.0 ], + "text" : "expr pow(2\\,$f1)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-67", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 1190.0, 170.0, 34.0, 20.0 ], + "text" : "/ 10." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-63", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1085.0, 130.0, 102.0, 34.0 ], + "presentation" : 1, + "presentation_rect" : [ 15.0, 300.0, 134.0, 20.0 ], + "text" : "Pitch Shift (semitones):" + } + + } +, { + "box" : { + "id" : "obj-64", + "maxclass" : "slider", + "min" : -240.0, + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 125.0, 192.0, 38.0 ], + "presentation" : 1, + "presentation_rect" : [ 190.0, 300.0, 192.0, 20.0 ], + "size" : 481.0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-62", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 1125.0, 475.0, 50.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 330.0, 40.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-60", + "items" : [ "none", ",", "sound", "file", ",", "adc" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "patching_rect" : [ 505.0, 85.0, 100.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 105.0, 95.0, 100.0, 20.0 ], + "types" : [ ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-59", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 5.0, 535.0, 150.0, 34.0 ], + "presentation" : 1, + "presentation_rect" : [ 335.0, 440.0, 234.0, 20.0 ], + "text" : "LPC filter coefficient frequency response:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-57", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 10.0, 450.0, 62.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 14.0, 438.0, 62.0, 20.0 ], + "text" : "spectrum:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 690.0, 585.0, 43.0, 20.0 ], + "text" : "sig~ 1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 585.0, 620.0, 125.0, 20.0 ], + "text" : "mbc.allpole~ 40 10. 1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 585.0, 510.0, 97.0, 20.0 ], + "text" : "mbc.errfilt~ 40 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "items" : [ "none", ",", "original", ",", "residual", "(error)", ",", "reconstructed", "(inverse", "filtered)", ",", "blit", "resynthesized" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "patching_rect" : [ 920.0, 620.0, 100.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 360.0, 230.0, 20.0 ], + "types" : [ ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 5, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 730.0, 685.0, 73.0, 20.0 ], + "text" : "selector~ 4" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-20", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 435.0, 205.0, 76.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 75.0, 240.0, 76.0, 20.0 ], + "text" : "LPC Order:" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 1085.0, 70.0, 102.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 50.0, 275.0, 102.0, 20.0 ], + "text" : "Pitch Glide (ms):" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "slider", + "mult" : 2.0, + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 60.0, 192.0, 38.0 ], + "presentation" : 1, + "presentation_rect" : [ 190.0, 270.0, 192.0, 20.0 ], + "size" : 500.0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 295.0, 20.0, 130.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 610.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 295.0, 0.0, 137.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 610.0, 0.0, 137.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 13.0, 12.0, 201.0, 34.0 ], + "presentation" : 1, + "presentation_rect" : [ 13.0, 12.0, 201.0, 34.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-4", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ -5.0, 0.0, 440.0, 60.0 ], + "presentation" : 1, + "presentation_rect" : [ -5.0, 0.0, 755.0, 60.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "id" : "obj-15", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 730.0, 795.0, 45.0, 45.0 ], + "presentation" : 1, + "presentation_rect" : [ 665.0, 565.0, 65.0, 65.0 ] + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "gain~", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "int" ], + "patching_rect" : [ 730.0, 715.0, 46.0, 69.0 ], + "presentation" : 1, + "presentation_rect" : [ 665.0, 460.0, 65.0, 104.0 ] + } + + } +, { + "box" : { + "id" : "obj-12", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 630.0, 75.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 655.0, 75.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 640.0, 105.0, 49.0, 20.0 ], + "save" : [ "#N", "sfplay~", "", 1, 120960, 0, "", ";" ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 690.0, 105.0, 47.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "id" : "obj-2", + "maxclass" : "meter~", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 600.0, 155.0, 80.0, 13.0 ], + "presentation" : 1, + "presentation_rect" : [ 205.0, 95.0, 100.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 1190.0, 35.0, 72.0, 20.0 ], + "text" : "loadmess 5" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 585.0, 130.0, 126.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-30", + "maxclass" : "number", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 1220.0, 355.0, 37.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 270.0, 40.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-31", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 1200.0, 330.0, 39.0, 20.0 ], + "text" : "t f b" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-32", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 2, + "outlettype" : [ "float", "float" ], + "patching_rect" : [ 907.0, 301.0, 93.0, 20.0 ], + "text" : "split 60. 800." + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-33", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 1240.0, 385.0, 40.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-34", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1201.0, 409.0, 58.0, 20.0 ], + "text" : "*~ 1." + } + + } +, { + "box" : { + "id" : "obj-35", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 1062.0, 556.0, 15.0, 15.0 ] + } + + } +, { + "box" : { + "id" : "obj-36", + "maxclass" : "button", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "bang" ], + "patching_rect" : [ 1036.0, 556.0, 15.0, 15.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-37", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "bang", "bang" ], + "patching_rect" : [ 1036.0, 533.0, 45.0, 20.0 ], + "text" : "edge~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-38", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1149.0, 432.0, 52.0, 20.0 ], + "text" : "*~ 0.1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-39", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1029.0, 432.0, 36.0, 20.0 ], + "text" : "sig~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-40", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1184.0, 533.0, 59.0, 20.0 ], + "text" : "==~ 0." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-41", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1097.0, 505.0, 50.0, 20.0 ], + "text" : "<~ 0.6" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-42", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1166.0, 556.0, 32.0, 20.0 ], + "text" : "*~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-43", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1097.0, 556.0, 37.0, 20.0 ], + "text" : "*~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-44", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1149.0, 410.0, 50.0, 20.0 ], + "text" : "noise~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-45", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 1201.0, 383.0, 39.0, 20.0 ], + "text" : "line~" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-46", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "float" ], + "patching_rect" : [ 907.0, 266.0, 140.0, 20.0 ], + "text" : "mbc.pitch~ 30 60 0.2" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fgcolor" : [ 0.878431, 0.878431, 0.878431, 1.0 ], + "id" : "obj-47", + "markercolor" : [ 0.721569, 0.721569, 0.721569, 1.0 ], + "maxclass" : "spectroscope~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 71.0, 432.0, 300.0, 100.0 ], + "peakcolor" : [ 0.952941, 0.8, 0.8, 1.0 ], + "presentation" : 1, + "presentation_rect" : [ 15.0, 460.0, 318.0, 171.0 ], + "rounded" : 0, + "sonomedcolor" : [ 0.0, 0.74902, 0.498039, 1.0 ], + "sonomedhicolor" : [ 1.0, 0.74902, 0.0, 1.0 ], + "sonomedlocolor" : [ 0.498039, 0.0, 0.498039, 1.0 ] + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-48", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1166.0, 504.0, 95.0, 20.0 ], + "text" : "mbc.blit~ 100" + } + + } +, { + "box" : { + "bgcolor" : [ 0.819608, 0.819608, 0.819608, 1.0 ], + "bwidthcolor" : [ 0.298039, 0.423529, 0.67451, 1.0 ], + "fgcolor" : [ 0.666667, 0.666667, 0.666667, 1.0 ], + "fontsize" : 12.0, + "hbwidthcolor" : [ 0.823529, 0.290196, 0.211765, 1.0 ], + "hcurvecolor" : [ 1.0, 0.086275, 0.086275, 1.0 ], + "id" : "obj-49", + "logfreq" : 0, + "markercolor" : [ 0.509804, 0.509804, 0.509804, 1.0 ], + "maxclass" : "filtergraph~", + "nfilters" : 1, + "numinlets" : 8, + "numoutlets" : 7, + "outlettype" : [ "list", "float", "float", "float", "float", "list", "int" ], + "patching_rect" : [ 70.0, 533.0, 491.0, 265.0 ], + "presentation" : 1, + "presentation_rect" : [ 335.0, 460.0, 330.0, 170.0 ], + "setfilter" : [ 0, 0, 1, 0, 0, 40.0, 1.0, 2.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 70.0, 387.0, 119.0, 20.0 ], + "text" : "prepend highorder" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "list" ], + "patching_rect" : [ 70.0, 363.0, 158.0, 20.0 ], + "text" : "mbc.coeffDisp~ 40 filter" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-52", + "maxclass" : "number", + "maximum" : 199, + "minimum" : 1, + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 512.0, 203.0, 37.0, 20.0 ], + "presentation" : 1, + "presentation_rect" : [ 150.0, 240.0, 40.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-53", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 512.0, 224.0, 64.0, 18.0 ], + "text" : "order $1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-54", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 730.0, 620.0, 125.0, 20.0 ], + "text" : "mbc.allpole~ 40 10. 1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal" ], + "patching_rect" : [ 585.0, 260.0, 124.0, 20.0 ], + "text" : "mbc.lpc~ 40 100 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-56", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 1097.0, 595.0, 52.0, 20.0 ], + "text" : "*~ 1." + } + + } +, { + "box" : { + "bgcolor" : [ 0.678431, 0.819608, 0.819608, 1.0 ], + "id" : "obj-81", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 870.0, 0.0, 557.0, 707.0 ], + "presentation" : 1, + "presentation_rect" : [ 5.0, 145.0, 385.0, 260.0 ], + "rounded" : 20 + } + + } +, { + "box" : { + "bgcolor" : [ 0.917647, 0.937255, 0.670588, 1.0 ], + "id" : "obj-82", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 435.0, 0.0, 428.0, 173.0 ], + "presentation" : 1, + "presentation_rect" : [ 5.0, 60.0, 385.0, 85.0 ], + "rounded" : 20 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ 521.5, 519.0, 573.0, 519.0, 573.0, 606.0, 594.5, 606.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "hidden" : 0, + "midpoints" : [ 521.5, 495.0, 594.5, 495.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 2 ], + "hidden" : 0, + "midpoints" : [ 699.5, 495.0, 672.5, 495.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-22", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-75", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-72", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-75", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-64", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-75", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-75", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-72", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-74", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-62", 0 ], + "hidden" : 0, + "midpoints" : [ 1199.5, 315.0, 1134.5, 315.0 ], + "source" : [ "obj-73", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-73", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-72", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-64", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-70", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-33", 0 ], + "hidden" : 0, + "midpoints" : [ 1199.5, 252.0, 1257.0, 252.0, 1257.0, 315.0, 1249.5, 315.0 ], + "source" : [ "obj-68", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-62", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-60", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 4 ], + "hidden" : 0, + "midpoints" : [ 739.5, 672.0, 793.5, 672.0 ], + "source" : [ "obj-54", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 3 ], + "hidden" : 0, + "midpoints" : [ 594.5, 672.0, 780.0, 672.0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 2 ], + "hidden" : 0, + "midpoints" : [ 594.5, 606.0, 571.0, 606.0, 571.0, 672.0, 766.5, 672.0 ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 2 ], + "hidden" : 0, + "midpoints" : [ 699.5, 570.0, 665.166687, 570.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 1 ], + "hidden" : 0, + "midpoints" : [ 673.25, 495.0, 693.0, 495.0, 693.0, 570.0, 629.833313, 570.0 ], + "source" : [ "obj-55", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 3 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-27", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-25", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 0 ], + "hidden" : 0, + "midpoints" : [ 594.5, 282.0, 594.5, 282.0 ], + "source" : [ "obj-55", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "hidden" : 0, + "midpoints" : [ 594.5, 246.0, 571.0, 246.0, 571.0, 672.0, 753.0, 672.0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "hidden" : 0, + "midpoints" : [ 929.5, 672.0, 739.5, 672.0 ], + "source" : [ "obj-22", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "hidden" : 0, + "midpoints" : [ 1199.5, 99.0, 1176.0, 99.0, 1176.0, 117.0, 1071.0, 117.0, 1071.0, 285.0, 1229.5, 285.0 ], + "source" : [ "obj-9", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-45", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-48", 0 ], + "hidden" : 0, + "midpoints" : [ 1210.5, 491.0, 1175.5, 491.0 ], + "source" : [ "obj-34", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-34", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-30", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-30", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-31", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-40", 0 ], + "hidden" : 0, + "midpoints" : [ 1106.5, 524.0, 1193.5, 524.0 ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-40", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-42", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-48", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-45", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-31", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-31", 0 ], + "hidden" : 0, + "midpoints" : [ 916.5, 323.0, 1209.5, 323.0 ], + "source" : [ "obj-32", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 1 ], + "hidden" : 0, + "midpoints" : [ 1158.5, 542.0, 1124.5, 542.0 ], + "source" : [ "obj-38", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-44", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-56", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-43", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-56", 0 ], + "hidden" : 0, + "midpoints" : [ 1175.5, 580.0, 1106.5, 580.0 ], + "source" : [ "obj-42", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-43", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-41", 0 ], + "hidden" : 0, + "midpoints" : [ 1038.5, 460.0, 1106.5, 460.0 ], + "source" : [ "obj-39", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-35", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-37", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-36", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-37", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-37", 0 ], + "hidden" : 0, + "midpoints" : [ 1106.5, 527.0, 1045.5, 527.0 ], + "source" : [ "obj-41", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-39", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-46", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-46", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ 521.5, 243.0, 594.5, 243.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 2 ], + "hidden" : 0, + "midpoints" : [ 620.75, 348.0, 218.5, 348.0 ], + "source" : [ "obj-55", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 1 ], + "hidden" : 0, + "midpoints" : [ 699.5, 348.0, 149.0, 348.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-49", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 647.0, 348.0, 79.5, 348.0 ], + "source" : [ "obj-55", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 521.5, 348.0, 79.5, 348.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-46", 0 ], + "hidden" : 0, + "midpoints" : [ 594.5, 174.0, 916.5, 174.0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "hidden" : 0, + "midpoints" : [ 594.5, 156.0, 238.0, 156.0, 238.0, 417.0, 80.5, 417.0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-12", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 0 ], + "hidden" : 0, + "midpoints" : [ 521.5, 426.0, 739.5, 426.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 0 ], + "hidden" : 0, + "midpoints" : [ 1106.5, 616.0, 739.5, 616.0 ], + "source" : [ "obj-56", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 1 ], + "hidden" : 0, + "midpoints" : [ 673.25, 495.0, 774.833313, 495.0 ], + "source" : [ "obj-55", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 2 ], + "hidden" : 0, + "midpoints" : [ 699.5, 570.0, 810.166687, 570.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-54", 3 ], + "hidden" : 0, + "midpoints" : [ 620.75, 495.0, 845.5, 495.0 ], + "source" : [ "obj-55", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-52", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-10", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-12", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-11", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-75", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-67", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-64", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-67", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-68", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-25", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-58", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-58", 0 ], + "hidden" : 0, + "midpoints" : [ 647.0, 372.0, 634.5, 372.0 ], + "source" : [ "obj-55", 2 ] + } + + } + ] + } + +} diff --git a/src/maxmspsdk.xcconfig b/src/maxmspsdk.xcconfig new file mode 100644 index 0000000..259893a --- /dev/null +++ b/src/maxmspsdk.xcconfig @@ -0,0 +1,46 @@ +// Xcode target configuration settings for the Max 5 SDK +// Used as the basis for Xcode projects to build Max externals. +// +// Changes to the settings in this file will be applied to all SDK examples +// To change settings for only one of the examples, override the settings using +// Xcode's target inspector. +// +// by Timothy Place +// Copyright © 2008, Cycling '74 + + +// Name & Version +PRODUCT_NAME = $(PROJECT_NAME) +PRODUCT_VERSION = 5.1.1 + + +// Paths +C74SUPPORT = $(SRCROOT)/../../c74support +HEADER_SEARCH_PATHS = /Developer/Headers/FlatCarbon "$(C74SUPPORT)/max-includes" "$(C74SUPPORT)/msp-includes" "$(C74SUPPORT)/jit-includes" +FRAMEWORK_SEARCH_PATHS = "$(C74SUPPORT)/max-includes" "$(C74SUPPORT)/msp-includes" "$(C74SUPPORT)/jit-includes" +DSTROOT = $(SRCROOT)/../../sdk-build +// (This next path is relative to DSTROOT) +INSTALL_PATH = / + + +// Special Files +GCC_PREFIX_HEADER = $(C74SUPPORT)/max-includes/macho-prefix.pch +INFOPLIST_FILE = $(SRCROOT)/../Info.plist + + +// Per architecture and deployment settings +SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk + +GCC_VERSION = 4.0 +// The above line can be specialized as follows provided you are using Xcode 3 or higher +// GCC_VERSION[arch=i386] = 4.0 +// GCC_VERSION[arch=ppc] = 4.0 + +MACOSX_DEPLOYMENT_TARGET = 10.4 + + +// Static Configuration (don't change these) +WRAPPER_EXTENSION = mxo; +WARNING_CFLAGS = -Wmost -Wno-four-char-constants -Wno-unknown-pragmas +DEPLOYMENT_LOCATION = YES +GENERATE_PKGINFO_FILE = YES diff --git a/src/mbc.allpole~/mbc.allpole~.c b/src/mbc.allpole~/mbc.allpole~.c new file mode 100755 index 0000000..d3f2e1d --- /dev/null +++ b/src/mbc.allpole~/mbc.allpole~.c @@ -0,0 +1,1032 @@ +/** + @file + mbc.allpole~ - an MSP object shell + mark cartwright - mcartwright@gmail.com + + @ingroup lpcToolkit +*/ + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects +#include + +#define MAX_ORDER 200 +#define DEFAULT_INTERP 1.0 +#define DEFAULT_DEEMPH 0 +#define t_floatarg double +#define t_mbcfloat double +#define MBC_VDSP + +////////////////////////// object struct +typedef struct _allpole +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + t_mbcfloat* a_a; //filer coefficients + t_mbcfloat* a_aBuff; //filter coeff input buffer + t_mbcfloat* a_y; //filter memory + t_mbcfloat* a_tempVec; //temporary buff for vector math + float a_a1; //deemph coeff + float a_y1; //deemph filter memory + t_mbcfloat* a_Ar; //tube areas + t_mbcfloat** a_A; //for parcor to coeff conversion + t_mbcfloat* a_K; //parcor coefficients + t_mbcfloat* a_interpCoeff; //interpolated coefficients + t_mbcfloat* a_interpInc; //interpolation increment + t_mbcfloat a_G; + float a_interp; //interpolation time in ms + long a_order; + long a_deemph; + int a_coeffType; //type of coeffecients: CT_PARCOR,CT_FILTER,CT_AREA + float a_fs; //sampling rate + int a_vsize; //vector size +} t_allpole; + +enum coeffTypes +{ + CT_PARCOR, + CT_FILTER, + CT_AREA +}; + +///////////////////////// function prototypes +//// standard set +void *allpole_new(t_symbol *s, long argc, t_atom *argv); +void allpole_free(t_allpole *x); +void allpole_assist(t_allpole *x, void *b, long m, long a, char *s); + +void allpole_float(t_allpole *x, double f); + +void allpole_dsp(t_allpole *x, t_signal **sp, short *count); +//t_int *allpole_perf_filter(t_int *w); +//t_int *allpole_perf_area(t_int *w); +t_int *allpole_perf_parcor(t_int *w); +t_int *allpole_perf_parcorI(t_int *w); +//t_int *allpole_perf_filterI(t_int *w); +//t_int *allpole_perf_areaI(t_int *w); +void allpole_interp(t_allpole *x, t_floatarg interp); +void allpole_order(t_allpole *x, int order); +void allpole_deemph(t_allpole *x, int deemph); +void allpole_init(t_allpole *x); +void allpole_free(t_allpole *x); +void allpole_clear(t_allpole *x); +inline void allpole_highOrdFilter(t_allpole* x, int N, int order, t_float* in, t_float* out); +inline void allpole_solveForFiltCoefs(t_allpole* x, int order); +inline void allpole_deemphFilter(t_allpole *x, int N, float* vec); + +//////////////////////// global class pointer variable +void *allpole_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&allpole_class, (method)allpole_new, (method)dsp_free, (short)sizeof(t_allpole), 0L, A_GIMME, 0); + // addfloat((method)allpole_float); + // you need this + // addmess((method)allpole_dsp, "dsp", A_CANT, 0); + // addmess((method)allpole_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.allpole~", (method)allpole_new, (method)allpole_free, (long)sizeof(t_allpole), 0L, A_GIMME, 0); + + class_addmethod(c, (method)allpole_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)allpole_interp,"interp",A_DEFFLOAT,0); + class_addmethod(c, (method)allpole_order,"order",A_DEFLONG,0); + class_addmethod(c, (method)allpole_clear,"clear",0); + class_addmethod(c, (method)allpole_deemph,"deemph",A_DEFLONG,0); + class_addmethod(c, (method)allpole_assist,"assist",A_CANT,0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + allpole_class = c; + + return 0; +} + +//perform for FILTER COEFFICIENTS, INTERPOLATION OFF +/*t_int *allpole_perf_filter(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int n = (int)(w[7]); + int order = x->a_order; + int i, in_idx = 0, out_idx = 0; + float val = 0.0; + float sum = 0.0; + + while(n--) { + if(IS_NAN_FLOAT(G_n[in_idx])) G_n[in_idx] = 0.0; + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[7]); + + //deemphasis? + if (x->a_deemph) { + while (n--) { + in[in_idx] = in[in_idx] + x->a_a1*x->a_y1; + x->a_y1 = in[in_idx]; + + in_idx++; + } + in_idx = 0; + n = (int)(w[7]); + } + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->a_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->a_a[i] = x->a_aBuff[i]; + } + x->a_G = (float)(G_n[in_idx]); + } + } + in_idx++; + } + + n = (int)(w[7]); + + while (n--) { + vDSP_vmul(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val = x->a_G * in[out_idx] + sum; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + out[out_idx] = val; + out_idx++; + } + + return (w+8); +}*/ + +//perform for PARCOR COEFFICIENTS, INTERPOLATION OFF +t_int *allpole_perf_parcor(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int N = (int)(w[7]); + int order = x->a_order; + int i, n; + + for (n=0; n < N; n++) + { + if(IS_NAN_FLOAT(G_n[n])) G_n[n] = 0.0; + if(IS_NAN_FLOAT(coeffIn[n])) coeffIn[n] = 0.0; + } + + //look at coefficient index, if not zeros, buffer in coefficients + for (n=0; n < N; n++) + { + if ((int)(coeffIdxIn[n]) > 0) + { + x->a_aBuff[(int)(coeffIdxIn[n])-1] = (t_mbcfloat)coeffIn[n]; + if ((int)(coeffIdxIn[n]) == order) + { + for(i = 0; i < order; i++) + { + x->a_K[i+1] = x->a_aBuff[i]; + } + x->a_G = (t_mbcfloat)(G_n[n]); + + allpole_solveForFiltCoefs(x, order); + } + } + } + + allpole_highOrdFilter(x, N, order, in, out); + + //deemphasis? + if (x->a_deemph) + { + allpole_deemphFilter(x, N, out); + } + + return (w+8); +} + +t_int *allpole_perf_parcorI(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int N = (int)(w[7]); + int order = x->a_order; + int i, n; + float interpDiv; //interpolation denominator + + for (n=0; n < N; n++) + { + if(IS_NAN_FLOAT(G_n[n])) G_n[n] = 0.0; + if(IS_NAN_FLOAT(coeffIn[n])) coeffIn[n] = 0.0; + } + + //look at coefficient index, if not zeros, buffer in coefficients + for (n=0; n < N; n++) + { + if ((int)(coeffIdxIn[n]) > 0) + { + x->a_aBuff[(int)(coeffIdxIn[n])-1] = (t_mbcfloat)coeffIn[n]; + if ((int)(coeffIdxIn[n]) == order) + { + interpDiv = x->a_interp * 0.001 * x->a_fs / x->a_vsize; + for(i = 0; i < order; i++) + { + x->a_K[i+1] = x->a_aBuff[i]; + //determine interpolation parameters + x->a_interpInc[i+1] = (x->a_K[i+1] - x->a_interpCoeff[i+1]) / interpDiv; + } + + x->a_G = (t_mbcfloat)(G_n[n]); + } + } + } + + //interpolate coefficients + for (i=1; i <= order; i++) + { + if (fabs(x->a_interpCoeff[i] - x->a_K[i]) > fabs(x->a_interpInc[i])) + { + x->a_interpCoeff[i] += x->a_interpInc[i]; + } + else + { + x->a_interpCoeff[i] = x->a_K[i]; + } + } + + allpole_solveForFiltCoefs(x, order); + + allpole_highOrdFilter(x, N, order, in, out); + + //deemphasis? + if (x->a_deemph) + { + allpole_deemphFilter(x, N, out); + } + + + return (w+8); +} + +/* +t_int *allpole_perf_parcor(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int N = (int)(w[7]); + int order = x->a_order; + int in_idx = 0; + int out_idx = 0; + float val = 0.0; + float sum = 0.0; + int n, i, j, i1, ji; + + for (n=N; n!= 0; n--) + { + if(IS_NAN_FLOAT(G_n[in_idx])) G_n[in_idx] = 0.0; + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + // reset in_idx + in_idx = 0; + + //deemphasis? + if (x->a_deemph) + { + for (n=N; n!=0; n--) + { + in[in_idx] = in[in_idx] + x->a_a1*x->a_y1; + x->a_y1 = in[in_idx]; + + in_idx++; + } + + // reset in_idx + in_idx = 0; + } + + //look at coefficient index, if not zeros, buffer in coefficients + for (n=N; n!=0; n--) + { + if ((int)(coeffIdxIn[in_idx]) > 0) + { + x->a_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) + { + for(i = 0; i < order; i++) + { + x->a_K[i+1] = x->a_aBuff[i]; + } + x->a_G = (float)(G_n[in_idx]); + + //solve for filter coefficients + for (i = 1; i <= order; i++) + { + x->a_A[i][i] = x->a_K[i]; + i1 = i - 1; + if (i1 >= 1) + { + for (j = 1; j <=i1; j++) + { + ji = i - j; + x->a_A[j][i] = x->a_A[j][i1] - x->a_K[i] * x->a_A[ji][i1]; + } + } + } + + for (j = 1; j <=order; j++) + { + x->a_a[j-1] = x->a_A[j][order]; + } + } + } + + in_idx++; + } + + for (n=N; n!=0; n--) + { + vDSP_vmul(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val = x->a_G * in[out_idx] + sum; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + out[out_idx] = (float)val; + out_idx++; + } + + return (w+8); +}*/ + +/*t_int *allpole_perf_area(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int n = (int)(w[7]); + int order = x->a_order; + //int orderp1 = order + 1; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + float val = 0.0; + float sum = 0.0; + float r; + + while(n--) { + if(IS_NAN_FLOAT(G_n[in_idx])) G_n[in_idx] = 0.0; + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[7]); + + //deemphasis? + if (x->a_deemph) { + while (n--) { + in[in_idx] = in[in_idx] + x->a_a1*x->a_y1; + x->a_y1 = in[in_idx]; + + in_idx++; + } + in_idx = 0; + n = (int)(w[7]); + } + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->a_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->a_Ar[i+1] = x->a_aBuff[i]; + //cpost("\nAr(%d) = %f;",i+1,x->a_Ar[i+1]); + } + //x->a_G = (float)(G_n[in_idx]); + x->a_G = 1.0; //using G from atov right now instead of input signal (recursively calculated below) + + //solve for filter coefficients from area coefficients + for (i = 1; i <= order; i++) { + //convert from area coefficients to reflection coefficients (remember reflection coefficients are -PARCOR); + if (i != order) + x->a_K[i] = -(x->a_Ar[i+1] - x->a_Ar[i])/(x->a_Ar[i+1] + x->a_Ar[i]); + else + x->a_K[i] = -0.7; //no losses at lips NOTE: need to make this changeable + + x->a_A[i][i] = x->a_K[i]; + x->a_G = x->a_G * (1.0 + -x->a_K[i]); + + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->a_A[j][i] = x->a_A[j][i1] - x->a_K[i] * x->a_A[ji][i1]; + } + } + } + + for (j = 1; j <=order; j++) { + x->a_a[j-1] = x->a_A[j][order]; + } + } + } + in_idx++; + } + + n = (int)(w[7]); + + while (n--) { + vDSP_vmul(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val = x->a_G * in[out_idx] + sum; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + out[out_idx] = (float)val; + out_idx++; + } + + return (w+8); +}*/ + +/*t_int *allpole_perf_filterI(t_int *w) { +}*/ + +/*t_int *allpole_perf_parcorI(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int n = (int)(w[7]); + int order = x->a_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + float val = 0.0; + float sum = 0.0; + float interpDiv; //interpolation denominator + + while(n--) { + if(IS_NAN_FLOAT(G_n[in_idx])) G_n[in_idx] = 0.0; + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[7]); + + //deemphasis? + if (x->a_deemph) { + while (n--) { + in[in_idx] = in[in_idx] + x->a_a1*x->a_y1; + x->a_y1 = in[in_idx]; + + in_idx++; + } + in_idx = 0; + n = (int)(w[7]); + } + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->a_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + interpDiv = x->a_interp * 0.001 * x->a_fs / x->a_vsize; + for(i = 0; i < order; i++) { + x->a_K[i+1] = x->a_aBuff[i]; + //determine interpolation parameters + x->a_interpInc[i+1] = (x->a_K[i+1] - x->a_interpCoeff[i+1]) / interpDiv; + } + x->a_G = (float)(G_n[in_idx]); + } + } + in_idx++; + } + + //interpolate coefficients + for (i=1; i <= order; i++) { + if (fabs(x->a_interpCoeff[i] - x->a_K[i]) > fabs(x->a_interpInc[i])) { + x->a_interpCoeff[i] += x->a_interpInc[i]; + } else { + x->a_interpCoeff[i] = x->a_K[i]; + } + } + + //solve for filter coefficients + for (i = 1; i <= order; i++) { + x->a_A[i][i] = x->a_interpCoeff[i]; + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->a_A[j][i] = x->a_A[j][i1] - x->a_interpCoeff[i] * x->a_A[ji][i1]; + } + } + } + for (j = 1; j <=order; j++) { + x->a_a[j-1] = x->a_A[j][order]; + } + + //perform filtering + n = (int)(w[7]); + + while (n--) { + vDSP_vmul(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val = x->a_G * in[out_idx] + sum; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + out[out_idx] = (float)val; + out_idx++; + } + + return (w+8); +}*/ + +/*t_int *allpole_perf_areaI(t_int *w) { + + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_float *G_n = (t_float *)(w[4]); + t_allpole *x = (t_allpole *)(w[5]); + t_float *out = (t_float *)(w[6]); + int n = (int)(w[7]); + int order = x->a_order; + int i, j, i1, ji, in_idx = 0, out_idx = 0; + float val = 0.0; + float sum = 0.0; + float interpDiv; //interpolation denominator + + while(n--) { + if(IS_NAN_FLOAT(G_n[in_idx])) G_n[in_idx] = 0.0; + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[7]); + + //deemphasis? + if (x->a_deemph) { + while (n--) { + in[in_idx] = in[in_idx] + x->a_a1*x->a_y1; + x->a_y1 = in[in_idx]; + + in_idx++; + } + in_idx = 0; + n = (int)(w[7]); + } + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->a_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + interpDiv = x->a_interp * 0.001 * x->a_fs / x->a_vsize; + for(i = 0; i < order; i++) { + x->a_Ar[i+1] = x->a_aBuff[i]; + //determine interpolation parameters + x->a_interpInc[i+1] = (x->a_Ar[i+1] - x->a_interpCoeff[i+1]) / interpDiv; + } + } + } + in_idx++; + } + + //interpolate coefficients + for (i=1; i <= order; i++) { + if (fabs(x->a_interpCoeff[i] - x->a_Ar[i]) > fabs(x->a_interpInc[i])) { + x->a_interpCoeff[i] += x->a_interpInc[i]; + } else { + x->a_interpCoeff[i] = x->a_Ar[i]; + } + //cpost("\ninterp[%d] = %f\tAr[%d]=%f\tinc[%d]=%f",i,x->a_interpCoeff[i],i,x->a_Ar[i],i,x->a_interpInc[i]); + } + + x->a_G = 1.0; //recursively calculated G + + //solve for filter coefficients + for (i = 1; i <= order; i++) { + if (i != order) + x->a_K[i] = -(x->a_interpCoeff[i+1] - x->a_interpCoeff[i])/(x->a_interpCoeff[i+1] + x->a_interpCoeff[i]); + else + x->a_K[i] = -0.7; //no losses at lips NOTE: need to make this changeable + + x->a_A[i][i] = x->a_K[i]; + x->a_G = x->a_G * (1.0 + -x->a_K[i]); + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->a_A[j][i] = x->a_A[j][i1] - x->a_K[i] * x->a_A[ji][i1]; + } + } + } + for (j = 1; j <=order; j++) { + x->a_a[j-1] = x->a_A[j][order]; + } + + //perform filtering + n = (int)(w[7]); + + while (n--) { + vDSP_vmul(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val = x->a_G * in[out_idx] + sum; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + out[out_idx] = (float)val; + out_idx++; + } + + return (w+8); +}*/ + +void allpole_init(t_allpole *x) { + int i; + + x->a_a = (t_mbcfloat *) getbytes16( MAX_ORDER * sizeof(t_mbcfloat)); + x->a_aBuff = (t_mbcfloat *) getbytes( MAX_ORDER * sizeof(t_mbcfloat)); + x->a_y = (t_mbcfloat *) getbytes16( MAX_ORDER * sizeof(t_mbcfloat)); + x->a_tempVec = (t_mbcfloat *) getbytes16( MAX_ORDER * sizeof(t_mbcfloat)); + x->a_Ar = (t_mbcfloat *) getbytes( MAX_ORDER * sizeof(t_mbcfloat)); + x->a_K = (t_mbcfloat *) getbytes( (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + x->a_interpCoeff = (t_mbcfloat *) getbytes( (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + x->a_interpInc = (t_mbcfloat *) getbytes( (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + x->a_A = (t_mbcfloat **) getbytes( (MAX_ORDER + 1) * sizeof(t_mbcfloat*)); + for(i=0; ia_A[i] = (t_mbcfloat *)getbytes( (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + } + //allpole_clear(x); + + x->a_a1 = 0.98; +} + +void allpole_free(t_allpole *x) { + int i; + + dsp_free((t_pxobject *) x); + freebytes16((char *)x->a_a, MAX_ORDER * sizeof(t_mbcfloat)); + freebytes(x->a_aBuff, MAX_ORDER * sizeof(t_mbcfloat)); + freebytes16((char *)x->a_y, MAX_ORDER * sizeof(t_mbcfloat)); + freebytes16((char *)x->a_tempVec, MAX_ORDER * sizeof(t_mbcfloat)); + freebytes(x->a_Ar, MAX_ORDER * sizeof(t_mbcfloat)); + freebytes(x->a_K, (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + freebytes(x->a_interpCoeff, (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + freebytes(x->a_interpInc, (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + for(i=0; ia_A[i], (MAX_ORDER + 1) * sizeof(t_mbcfloat)); + } + freebytes(x->a_A, MAX_ORDER * sizeof(t_mbcfloat*)); +} + +void allpole_clear(t_allpole *x) { + + int i, j; + for(i = 0; i < MAX_ORDER; i++) { + x->a_a[i] = 0.0; + x->a_aBuff[i] = 0.0; + x->a_y[i] = 0.0; + x->a_Ar[i] = 0.0; + x->a_tempVec[i] = 0.0; + for (j = 0; j < (MAX_ORDER+1); j++) { + x->a_A[i][j] = 0.0; + } + } + + for(i = 0; i < (MAX_ORDER+1); i++) { + x->a_K[i] = 0.0; + x->a_interpCoeff[i] = 0.0; + x->a_interpInc[i] = 0.0; + } + + x->a_G = 0.0; + x->a_y1 = 0.0; +} + +// this function is called when the DAC is enabled, and "registers" a function +// for the signal chain. in this case, "allpole_perform" +void allpole_dsp(t_allpole *x, t_signal **sp, short *count) +{ + //NOTE: need to specify parcor, filter, or area perform string !!!!!! + x->a_fs = sp[0]->s_sr; + x->a_vsize = sp[0]->s_n; + + allpole_clear(x); + + if (x->a_interp > 0.0) { + switch (x->a_coeffType) { + case CT_FILTER: + //dsp_add(allpole_perf_filterI, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + //break; + + case CT_PARCOR: + dsp_add(allpole_perf_parcorI, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + break; + + case CT_AREA: + //dsp_add(allpole_perf_areaI, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + //break; + + default: + error("mbc.allpole~: no coefficient type selected"); + break; + } + } else { + switch (x->a_coeffType) { + case CT_FILTER: + //dsp_add(allpole_perf_filter, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + //break; + + case CT_PARCOR: + dsp_add(allpole_perf_parcor, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + break; + + case CT_AREA: + //dsp_add(allpole_perf_area, 7, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, x, sp[4]->s_vec, sp[0]->s_n); + //break; + + default: + error("mbc.allpole~: no coefficient type selected"); + break; + } + } +} + +void allpole_interp(t_allpole *x, t_floatarg interp) { + + x->a_interp = (float)interp; + int i; + int order = x->a_order; + float interpDiv; + + switch (x->a_coeffType) { + case CT_FILTER: + error("mbc.allpole~: interpolation is inactive with coefficient type: filter"); + break; + + case CT_PARCOR: + interpDiv = x->a_interp * 0.001 * x->a_fs / x->a_vsize; + for(i = 0; i < order; i++) { + x->a_interpInc[i+1] = (x->a_K[i+1] - x->a_interpCoeff[i+1]) / interpDiv; + } + break; + + case CT_AREA: + interpDiv = x->a_interp * 0.001 * x->a_fs / x->a_vsize; + for(i = 0; i < order; i++) { + x->a_interpInc[i+1] = (x->a_Ar[i+1] - x->a_interpCoeff[i+1]) / interpDiv; + } + break; + + default: + break; + } +} + +void allpole_order(t_allpole *x, int order) { + if (order < 1) { + error("mbc.allpole~: mbc.allpole~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.allpole~: max order is 199"); + order = 199; + } + + int i = x->a_order; + x->a_order = order; + for ( i = i+1; i < order; i++) { + x->a_a[i] = 0.0; + x->a_aBuff[i] = 0.0; + x->a_y[i] = 0.0; + x->a_Ar[i] = 0.0; + } +} + +void allpole_deemph(t_allpole *x, int deemph) { + x->a_deemph = deemph; +} + +void allpole_assist(t_allpole *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) Filter Input"); break; + case 1: sprintf(s,"(signal) PARCOR Coefficients"); break; + case 2: sprintf(s,"(signal) Coeff Index"); break; + case 3: sprintf(s,"(signal) Filter Gain"); break; + } + } + else { + sprintf(s,"(signal) Filter Output"); + } +} + +void *allpole_new(t_symbol *s, long argc, t_atom *argv) +{ + t_allpole *x = NULL; + + if (argc < 1) + { + error("mbc.allpole~: must specify filter order (this should match mbc.lpc~ and mbc.errfilt~)"); + return NULL; + } + + if (x = (t_allpole *)object_alloc(allpole_class)) { + dsp_setup((t_pxobject *)x, 1); // MSP inlets: arg is # of inlets and is REQUIRED! + // use 0 if you don't need inlets + + dsp_setup((t_pxobject *)x,4); + outlet_new(x, "signal"); + + //get arguments out of gimme list + int order; + float interp = DEFAULT_INTERP; + int deemph = DEFAULT_DEEMPH; + //t_symbol* coeffType = atom_getsymarg(3,argc,argv); + + switch (argc) + { + case 0: + break; + + case 1: + order = atom_getintarg(0,argc,argv); + break; + + case 2: + order = atom_getintarg(0,argc,argv); + interp = atom_getfloatarg(1,argc,argv); + break; + + case 3: + order = atom_getintarg(0,argc,argv); + interp = atom_getfloatarg(1,argc,argv); + deemph = atom_getintarg(2,argc,argv); + break; + + default: + order = atom_getintarg(0,argc,argv); + interp = atom_getfloatarg(1,argc,argv); + deemph = atom_getintarg(2,argc,argv); + error("mbc.allpole~: too many arguments"); + } + + //order bounds + if (order < 1) { + error("mbc.allpole~: mbc.allpole~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.allpole~: max order is 199"); + order = 199; + } + + //parse filter coeff type +#if 0 + if (coeffType == gensym("parcor")) { + x->a_coeffType = CT_PARCOR; + } else if (coeffType == gensym("filter")) { + x->a_coeffType = CT_FILTER; + } else if (coeffType == gensym("area")) { + x->a_coeffType = CT_AREA; + } else { + //error("mbc.allpole~: coefficient must be specified as 'parcor', 'filter', or 'area'"); + x->a_coeffType = CT_FILTER; + } +#else + // FORCE TO PARCOR FOR NOW (FOR SIMPLICITY) + x->a_coeffType = CT_PARCOR; +#endif + + //assign locals to globals and init + x->a_order = order; + x->a_interp = interp; + x->a_deemph = deemph; + allpole_init(x); + } + return (x); +} +inline void allpole_deemphFilter(t_allpole *x, int N, float* vec) +{ + int n; + + float a1 = x->a_a1; + float y1 = x->a_y1; + + for (n=N; n!=0; n--) + { + *vec = *vec + (a1 * y1); + y1 = *vec++; + } + + x->a_y1 = y1; +} + +inline void allpole_solveForFiltCoefs(t_allpole* x, int order) +{ + int i, i1, ji, j; + + for (i = 1; i <= order; i++) + { + x->a_A[i][i] = x->a_K[i]; + i1 = i - 1; + + if (i1 >= 1) + { + for (j = 1; j <=i1; j++) + { + ji = i - j; + x->a_A[j][i] = x->a_A[j][i1] - x->a_K[i] * x->a_A[ji][i1]; + } + } + } + + for (j = 1; j <=order; j++) + { + x->a_a[j-1] = x->a_A[j][order]; + } +} + +#if defined(MBC_VDSP) +inline void allpole_highOrdFilter(t_allpole* x, int N, int order, t_float* in, t_float* out) +{ + int n, i; + t_mbcfloat val; + + for (n=N; n!=0; n--) + { + vDSP_vmulD(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sveD(x->a_tempVec,1,&val,order); + val = x->a_G * (t_mbcfloat)(*(in++)) + val; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + *(out++) = (float)val; + } +} +#else +inline void allpole_highOrdFilter(t_allpole* x, int N, int order, t_float* in, t_float* out) +{ + int n, i; + t_mbcfloat val; + + for (n=N; n!=0; n--) + { + val = 0; + t_mbcfoat* pA = x->a_a; + t_mbcfloat* pY = x->a_y; + + for (i=0; i < order; i++) + { + val += *pY * + } + vDSP_vmulD(x->a_a,1,x->a_y,1,x->a_tempVec,1,order); + vDSP_sveD(x->a_tempVec,1,&val,order); + val = x->a_G * (t_mbcfloat)(*(in++)) + val; + for (i=order-1; i>0; i--) x->a_y[i] = x->a_y[i-1]; + x->a_y[0] = val; + + *(out++) = (float)val; + } +} +#endif // MBC_VDSP diff --git a/src/mbc.allpole~/mbc.allpole~.maxhelp b/src/mbc.allpole~/mbc.allpole~.maxhelp new file mode 100644 index 0000000..0b941a6 --- /dev/null +++ b/src/mbc.allpole~/mbc.allpole~.maxhelp @@ -0,0 +1,642 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 487.0, 98.0, 474.0, 608.0 ], + "bglocked" : 0, + "defrect" : [ 487.0, 98.0, 474.0, 608.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 570.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "linecount" : 10, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 380.0, 156.0, 144.0 ], + "text" : "Here we are filtering the signal and then performing the inverse to fully recover the original signal. Since we are not using a synthetic input (we are using the FIR filtered source as the input), we simply use a unit signal for the filter gain." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-15", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 233.0, 341.0, 46.0, 20.0 ], + "text" : "sig~ 1." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "maxclass" : "newobj", + "numinlets" : 4, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 380.0, 162.0, 20.0 ], + "text" : "mbc.allpole~ 40 10. 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 250.0, 240.0, 186.0, 34.0 ], + "text" : "Third argument: demphasis off/on (0/1) (default is off)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 140.0, 280.0, 53.0, 20.0 ], + "text" : "bitsafe~" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "gain~", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "int" ], + "patching_rect" : [ 90.0, 440.0, 61.0, 80.0 ] + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 135.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 160.0, 85.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 145.0, 115.0, 49.0, 20.0 ], + "save" : [ "#N", "sfplay~", "", 1, 120960, 0, "", ";" ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 60.0, 72.0, 20.0 ], + "text" : "loadmess 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 195.0, 115.0, 47.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 115.0, 32.5, 20.0 ], + "text" : "+ 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "meter~", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 105.0, 175.0, 80.0, 13.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 145.0, 126.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "color" : [ 0.827451, 0.827451, 0.827451, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 320.0, 118.0, 20.0 ], + "text" : "mbc.errfilt~ 40 1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-52", + "maxclass" : "number", + "maximum" : 199, + "minimum" : 1, + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 17.0, 163.0, 37.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-53", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 17.0, 184.0, 64.0, 18.0 ], + "text" : "order $1" + } + + } +, { + "box" : { + "color" : [ 0.827451, 0.827451, 0.827451, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal" ], + "patching_rect" : [ 90.0, 250.0, 124.0, 20.0 ], + "text" : "mbc.lpc~ 40 100 1" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 90.0, 540.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 30.0, 540.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 20.0, 530.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 0.0, 157.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.allpole~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 250.0, 180.0, 162.0, 48.0 ], + "text" : "Second argument: interpolation time (ms) (default is 0.)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 250.0, 150.0, 163.0, 20.0 ], + "text" : "First agument: filter order" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 250.0, 60.0, 208.0, 75.0 ], + "text" : "This object performs basic a basic IIR filtering of the input based on the LPC coefficients. This is to be used to \"impose\" the spectrum of the analyzed source onto a new signal." + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 460.0, 60.0 ], + "rounded" : 0 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-55", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 203.0, 99.5, 203.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 306.0, 99.5, 306.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 2 ], + "hidden" : 0, + "midpoints" : [ 204.5, 312.0, 198.5, 312.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-55", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-21", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "hidden" : 0, + "midpoints" : [ 99.5, 342.0, 99.5, 342.0 ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 2 ], + "hidden" : 0, + "midpoints" : [ 204.5, 306.0, 219.0, 306.0, 219.0, 366.0, 194.833328, 366.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 1 ], + "hidden" : 0, + "midpoints" : [ 178.25, 276.0, 204.0, 276.0, 204.0, 306.0, 219.0, 306.0, 219.0, 366.0, 147.166672, 366.0 ], + "source" : [ "obj-55", 3 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 3 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-15", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-21", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 366.0, 99.5, 366.0 ], + "source" : [ "obj-53", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.allpole~/mbc.allpole~.xcodeproj/project.pbxproj b/src/mbc.allpole~/mbc.allpole~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..2ec195e --- /dev/null +++ b/src/mbc.allpole~/mbc.allpole~.xcodeproj/project.pbxproj @@ -0,0 +1,222 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* mbc.allpole~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* mbc.allpole~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; + 7799690912700DB800554666 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7799690812700DB800554666 /* Accelerate.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* mbc.allpole~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mbc.allpole~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.allpole~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.allpole~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; + 7799690812700DB800554666 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + 7799690912700DB800554666 /* Accelerate.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + 7799690812700DB800554666 /* Accelerate.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* mbc.allpole~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.allpole~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.allpole~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.allpole~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* mbc.allpole~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.allpole~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/src/mbc.blit~/mbc.blit~.c b/src/mbc.blit~/mbc.blit~.c new file mode 100755 index 0000000..c6b2ef5 --- /dev/null +++ b/src/mbc.blit~/mbc.blit~.c @@ -0,0 +1,421 @@ +/*---------------------------------------------------------------------------------- +Filename: mbc.blit~.c +Project: LPC Toolkit +Author: Mark Cartwright +Created: 5/15/07 +Updated: 10/21/10 +Description: band-limited impulse train generator external object for Max/MSP. + Uses the Sum of Windowed Sinc (SWS) method for blit generation. See + http://ccrma.stanford.edu/~stilti/papers/TimStilsonPhDThesis2006.pdf +-------------------------------------------------------------------------------------*/ + + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects + +#define DEFAULT_PINC 440 +#define DEFAULT_P 64; +#define DEFAULT_ZCS 1024; +#define DEFAULT_BANDLIMIT 1; + +typedef struct _pulse +{ + int active; + float phase; +} t_pulse; + +////////////////////////// object struct +typedef struct _blit +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + float b_pinc; // == frequency + double b_phase; // global phase + t_float* b_sincTable; // wavetable + t_pulse* b_pulse; // array of pulses + double b_fs; // sampling rate + int b_zcs; // samples per zero crossin in sinc table + int b_P; // P in sinc calc... number of zero crossings + long b_length; // table length + int b_bandlimit; // bandlimiting on/off +} t_blit; + +///////////////////////// function prototypes +//// standard set +void *blit_new(t_symbol *s, long argc, t_atom *argv); +void blit_free(t_blit *x); +void blit_assist(t_blit *x, void *b, long m, long a, char *s); + +void blit_dsp(t_blit *x, t_signal **sp, short *count); +t_int *blit_sigperf(t_int *w); //signal frequency input - bandlimited +t_int *blit_fltperf(t_int *w); //float frequency input - bandlimited +t_int *blit_sigperf_a(t_int *w); //signal frequency input - aliased +t_int *blit_fltperf_a(t_int *w); //float frequency input - aliased +void blit_float(t_blit *x, double f); +void blit_int(t_blit *x, long n); +void blit_sincGen(t_blit *x); +void blit_winGen(double *win, long N); +//////////////////////// global class pointer variable +void *blit_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&blit_class, (method)blit_new, (method)dsp_free, (short)sizeof(t_blit), 0L, A_GIMME, 0); + // addfloat((method)blit_float); + // you need this + // addmess((method)blit_dsp, "dsp", A_CANT, 0); + // addmess((method)blit_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.blit~", (method)blit_new, (method)blit_free, (long)sizeof(t_blit), 0L, A_GIMME, 0); + + class_addmethod(c, (method)blit_float, "float", A_FLOAT, 0); + class_addmethod(c, (method)blit_int, "int", A_LONG, 0); + class_addmethod(c, (method)blit_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)blit_assist, "assist", A_CANT, 0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + blit_class = c; + + return 0; +} + +t_int *blit_sigperf(t_int *w) { + int i; + + t_float *pinc = (t_float *)(w[1]); + t_blit *x = (t_blit *)(w[2]); + t_float *out = (t_float *)(w[3]); + int n = (int)(w[4]); + float thresh = x->b_fs; + double phase = x->b_phase; + float phasen1 = phase; + long length = x->b_length; + int zcs = x->b_zcs; + float offset, step, idx, eta; + int P = x->b_P; + int PO2 = P / 2; + + while (n--) { + phase += *pinc; + if (phase >= thresh) { + offset = 1.0 - ((thresh - phasen1)/(phase - phasen1)); + for (i = 0; i < PO2; i++) { + if (!(x->b_pulse[i].active)) { + x->b_pulse[i].active = 1; + x->b_pulse[i].phase = offset; + break; + } + } + phase -= thresh; + } + phasen1 = phase; + + //render active pulses + *out = 0.0; + for (i = 0; i < PO2; i++) { + if (x->b_pulse[i].active) { + step = x->b_pulse[i].phase; + idx = step * zcs; + eta = idx - floor(idx); + idx = floor(idx); + *out += (float)(((1.0 - eta) * x->b_sincTable[(long)(idx)] + eta * x->b_sincTable[((long)(idx + 1.0)) % length]) * 0.89); //linear interpolation, the 0.89 is a scaling factor to keep peak below 1 (and therefore no aliasing... good up to 20k + step += 1.0; + if (step > (float)(P-1)) { + x->b_pulse[i].active = 0; + x->b_pulse[i].phase = 0.0; + } else { + x->b_pulse[i].phase = step; + } + } + } + out++; + pinc++; + } + + x->b_phase = phase; + + return (w+5); +} + + +t_int *blit_fltperf(t_int *w) { + int i; + + t_blit *x = (t_blit *)(w[1]); + t_float *out = (t_float *)(w[2]); + int n = (int)(w[3]); + float thresh = x->b_fs; + double phase = x->b_phase; + float phasen1 = phase; + float pinc = x->b_pinc; + long length = x->b_length; + int zcs = x->b_zcs; + float offset, step, idx, eta; + int P = x->b_P; + int PO2 = P / 2; + + while (n--) { + phase += pinc; + if (phase >= thresh) { + //find sub-sample offset + offset = 1.0 - ((thresh - phasen1)/(phase - phasen1)); + for (i = 0; i < PO2; i++) { + if (!(x->b_pulse[i].active)) { + x->b_pulse[i].active = 1; + x->b_pulse[i].phase = offset; + break; + } + } + phase -= thresh; + } + phasen1 = phase; + + //render active pulses + *out = 0.0; + for (i = 0; i < PO2; i++) { + if (x->b_pulse[i].active) { + step = x->b_pulse[i].phase; + idx = step * zcs; + eta = idx - floor(idx); + idx = floor(idx); + *out += (float)(((1.0 - eta) * x->b_sincTable[(long)(idx)] + eta * x->b_sincTable[((long)(idx + 1.0)) % length]) * 0.89); //linear interpolation, the 0.89 is a scaling factor to keep peak below 1 (and therefore no aliasing... good up to 20k + step += 1.0; + if (step > (float)(P-1)) { + x->b_pulse[i].active = 0; + x->b_pulse[i].phase = 0.0; + } else { + x->b_pulse[i].phase = step; + } + } + } + out++; + } + + x->b_phase = phase; + + return (w+4); +} + +t_int *blit_sigperf_a(t_int *w) { + t_float *pinc = (t_float *)(w[1]); + t_blit *x = (t_blit *)(w[2]); + t_float *out = (t_float *)(w[3]); + int n = (int)(w[4]); + float thresh = x->b_fs; + double phase = x->b_phase; + + while (n--) { + phase += *pinc; + if (phase >= thresh) { + *out = 1.0; + phase -= thresh; + } else { + *out = 0.0; + } + + out++; + pinc++; + } + + x->b_phase = phase; + + return (w+5); +} + + +t_int *blit_fltperf_a(t_int *w) { + t_blit *x = (t_blit *)(w[1]); + t_float *out = (t_float *)(w[2]); + int n = (int)(w[3]); + float thresh = x->b_fs; + double phase = x->b_phase; + float pinc = x->b_pinc; + + while (n--) { + phase += pinc; + if (phase >= thresh) { + *out = 1.0; + phase -= thresh; + } else { + *out = 0.0; + } + + out++; + } + + x->b_phase = phase; + + return (w+4); +} + +void blit_sincGen(t_blit *x) { + int i; + double P = (double) x->b_P; + double zcs = (double) x->b_zcs; + double M = 2*floor(P/2) + 1; + long length = x->b_length; + double win[length]; + t_float* pSincTable = x->b_sincTable; + double* pWin = win; + + //generate blackman-harris window + blit_winGen(win,length); + + //since this equation makes a zerophase window, we need to split it into 2 to make it causal again + //first half + for (i = (floor(length/2) + 1); i <= length; i++) { + *pSincTable = sin(PI*(i/zcs)*(M/P))/(P*sin(PI*(i/zcs)/P)) * (*pWin); + pSincTable++; + pWin++; + } + //second half + for (i = 1; i < (floor(length/2) + 1); i++) { + *pSincTable = sin(PI*(i/zcs)*(M/P))/(P*sin(PI*(i/zcs)/P)) * (*pWin); + pSincTable++; + pWin++; + } +} + +void blit_winGen(double *win, long N) { + //this function generates a blackman harris window (low resolution/high dynamic range) + int i; + double a0,a1,a2,a3; + + a0 = 0.3635819; + a1 = 0.4891775; + a2 = 0.1365995; + a3 = 0.0106411; + + for (i = 0; i < N; i++) { + win[i] = a0 - a1*cos((2*PI*i)/(N-1)) + a2*cos((4*PI*i)/(N-1)) - a3*cos((6*PI*i)/(N-1)); + } +} + +void blit_dsp(t_blit *x, t_signal **sp, short *count) +{ + x->b_fs = sys_getsr(); + x->b_phase = 0; + + if (count[0]) { // perform signal based frequency update + if (x->b_bandlimit) + dsp_add(blit_sigperf, 4, sp[0]->s_vec, x, sp[1]->s_vec, sp[0]->s_n); + else + dsp_add(blit_sigperf_a, 4, sp[0]->s_vec, x, sp[1]->s_vec, sp[0]->s_n); + } else { //perform interrupt based frequency update + if (x->b_bandlimit) + dsp_add(blit_fltperf, 3, x, sp[1]->s_vec, sp[1]->s_n); + else + dsp_add(blit_fltperf_a, 3, x, sp[1]->s_vec, sp[1]->s_n); + } + +} + +void blit_float(t_blit *x, double f) +{ + x->b_pinc = (float)f; +} + +void blit_int(t_blit *x, long n) +{ + blit_float(x,(double)n); +} + +void blit_assist(t_blit *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + sprintf(s,"(signal/float) Frequency"); + } else { + sprintf(s,"(signal) bandlimited impulse train"); + } +} + +void blit_init(t_blit* x) { + int i; + + for(i = 0; i < (x->b_P / 2); i++) { + x->b_pulse[i].active = 0; + x->b_pulse[i].phase = 0.0; + } + + x->b_phase = 0.0; +} + +void blit_free(t_blit* x) { + dsp_free((t_pxobject *) x); + sysmem_freeptr(x->b_sincTable); + freebytes(x->b_pulse, (x->b_P / 2) * sizeof(t_pulse)); +} + +void *blit_new(t_symbol *s, long argc, t_atom *argv) +{ + t_blit *x = NULL; + + if (x = (t_blit *)object_alloc(blit_class)) { + dsp_setup((t_pxobject *)x,1); + outlet_new((t_pxobject *)x, "signal"); + + x->b_pinc = DEFAULT_PINC; + x->b_P = DEFAULT_P; + x->b_zcs = DEFAULT_ZCS; + x->b_bandlimit = DEFAULT_BANDLIMIT; + //get arguments out of gimme list + switch(argc) { + case 0: + break; + + case 1: + x->b_pinc = atom_getfloatarg(0,argc,argv); + break; + + case 2: + x->b_pinc = atom_getfloatarg(0,argc,argv); + x->b_P = atom_getintarg(1,argc,argv); + break; + + case 3: + x->b_pinc = atom_getfloatarg(0,argc,argv); + x->b_P = atom_getintarg(1,argc,argv); + x->b_zcs = atom_getintarg(2,argc,argv); + break; + + case 4: + x->b_pinc = atom_getfloatarg(0,argc,argv); + x->b_P = atom_getintarg(1,argc,argv); + x->b_zcs = atom_getintarg(2,argc,argv); + x->b_bandlimit = atom_getintarg(3,argc,argv); + break; + + default: + x->b_pinc = atom_getfloatarg(0,argc,argv); + x->b_P = atom_getintarg(1,argc,argv); + x->b_zcs = atom_getintarg(2,argc,argv); + x->b_bandlimit = atom_getintarg(3,argc,argv); + error("mbc.blit~: too many arguments"); + break; + } + + if ((int)(pow(2.0,round(log2((double)x->b_P)))) != x->b_P) { + error("mbc.blit~: P argument must be a power of 2"); + x->b_P = pow(2.0,floor(log2(x->b_P))); + } + + x->b_length = (long)(x->b_P * x->b_zcs - 1); + x->b_sincTable = (t_float *) sysmem_newptrclear(x->b_length * sizeof(t_float)); + x->b_pulse = (t_pulse *) getbytes( (x->b_P / 2) * sizeof(t_pulse)); + blit_init(x); + blit_sincGen(x); + } + return (x); +} diff --git a/src/mbc.blit~/mbc.blit~.maxhelp b/src/mbc.blit~/mbc.blit~.maxhelp new file mode 100644 index 0000000..e7b2ba0 --- /dev/null +++ b/src/mbc.blit~/mbc.blit~.maxhelp @@ -0,0 +1,683 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 118.0, 44.0, 479.0, 559.0 ], + "bglocked" : 0, + "defrect" : [ 118.0, 44.0, 479.0, 559.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 520.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-33", + "maxclass" : "number~", + "mode" : 1, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 236.0, 218.0, 56.0, 20.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "bgcolor" : [ 0.529412, 0.529412, 0.529412, 1.0 ], + "bufsize" : 32, + "calccount" : 32, + "id" : "obj-29", + "maxclass" : "scope~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 140.0, 350.0, 100.0, 50.0 ], + "rounded" : 0, + "trigger" : 1 + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fgcolor" : [ 0.878431, 0.878431, 0.878431, 1.0 ], + "id" : "obj-32", + "markercolor" : [ 0.721569, 0.721569, 0.721569, 1.0 ], + "maxclass" : "spectroscope~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 140.0, 410.0, 174.0, 65.0 ], + "peakcolor" : [ 0.952941, 0.8, 0.8, 1.0 ], + "rounded" : 0, + "sonomedcolor" : [ 0.0, 0.74902, 0.498039, 1.0 ], + "sonomedhicolor" : [ 1.0, 0.74902, 0.0, 1.0 ], + "sonomedlocolor" : [ 0.498039, 0.0, 0.498039, 1.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-36", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 155.0, 187.0, 36.0, 18.0 ], + "text" : "down" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-37", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 130.0, 187.0, 21.0, 18.0 ], + "text" : "up" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-38", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patcher" : { + "fileversion" : 1, + "rect" : [ 216.0, 180.0, 275.0, 225.0 ], + "bglocked" : 0, + "defrect" : [ 216.0, 180.0, 275.0, 225.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 10.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 15.0, 15.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 26.0, 143.666672, 74.0, 20.0 ], + "text" : "pow~ 22000" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-2", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 173.333328, 84.666664, 32.5, 18.0 ], + "text" : "stop" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 4, + "outlettype" : [ "bang", "bang", "bang", "" ], + "patching_rect" : [ 26.0, 59.0, 240.0, 20.0 ], + "text" : "select up down stop" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-4", + "maxclass" : "inlet", + "numinlets" : 0, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 26.0, 26.0, 25.0, 25.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-5", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 99.666664, 84.666664, 69.0, 18.0 ], + "text" : "0.53 10000" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-6", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 26.0, 84.666664, 56.0, 18.0 ], + "text" : "1. 10000" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 26.0, 118.666664, 61.0, 20.0 ], + "text" : "line~ 0.53" + } + + } +, { + "box" : { + "comment" : "", + "id" : "obj-8", + "maxclass" : "outlet", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 26.0, 176.0, 25.0, 25.0 ] + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-1", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ 182.833328, 108.0, 35.5, 108.0 ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ 109.166664, 108.0, 35.5, 108.0 ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-7", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-4", 0 ] + } + + } + ] + } +, + "patching_rect" : [ 130.0, 218.0, 72.0, 20.0 ], + "saved_object_attributes" : { + "default_fontsize" : 10.0, + "globalpatchername" : "", + "fontface" : 0, + "fontsize" : 10.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "fontname" : "Arial" + } +, + "text" : "p movement" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 11.595187, + "id" : "obj-49", + "maxclass" : "number~", + "mode" : 2, + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "float" ], + "patching_rect" : [ 50.0, 280.0, 72.0, 20.0 ], + "sig" : 0.0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-16", + "linecount" : 4, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 330.0, 166.0, 62.0 ], + "text" : "Fourth Argument: bandlimit off/on (0/1) - Turning this off, will make it unbandlimited. (Default is 1)" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 80.0, 490.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 80.0, 460.0, 54.0, 20.0 ], + "text" : "*~ 0.2" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 20.0, 490.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 10.0, 480.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 0.0, 157.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.blit~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 240.0, 162.0, 75.0 ], + "text" : "Third Argument: samples per sinc zero crossing. A higher value means results in less aliasing. 1024 is the default" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 180.0, 162.0, 48.0 ], + "text" : "Second argument: number of zero crossings of sinc function table (default 64)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-23", + "items" : [ "no", "input", ",", "sweep", ",", "freq" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "patching_rect" : [ 24.0, 218.0, 93.0, 20.0 ], + "types" : [ ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 24.0, 253.0, 231.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 24.0, 310.0, 139.0, 20.0 ], + "text" : "mbc.blit~ 440 64 1024 1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 150.0, 163.0, 20.0 ], + "text" : "First agument: Frequency" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 10.0, 60.0, 430.0, 75.0 ], + "text" : "This is a bandlimited impulse train generator using Time Stilson's Sum of Windowed Sincs (SWS) method. This creates a very efficient bandlimited impulse generator that does have a tiny bit of aliasing in the upper register, but is inaudible. For more information see: http://ccrma.stanford.edu/~stilti/papers/TimStilsonPhDThesis2006.pdf" + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 430.0, 50.0 ], + "rounded" : 0 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ 33.5, 447.0, 89.5, 447.0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ 33.5, 345.0, 149.5, 345.0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-32", 0 ], + "hidden" : 0, + "midpoints" : [ 33.5, 405.0, 149.5, 405.0 ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-33", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-38", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-49", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "hidden" : 0, + "midpoints" : [ 139.5, 201.0, 139.5, 201.0 ], + "source" : [ "obj-37", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-38", 0 ], + "hidden" : 0, + "midpoints" : [ 164.5, 206.0, 139.5, 206.0 ], + "source" : [ "obj-36", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-8", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.blit~/mbc.blit~.xcodeproj/project.pbxproj b/src/mbc.blit~/mbc.blit~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..958ab2d --- /dev/null +++ b/src/mbc.blit~/mbc.blit~.xcodeproj/project.pbxproj @@ -0,0 +1,218 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* mbc.blit~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* mbc.blit~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* mbc.blit~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mbc.blit~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.blit~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.blit~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* mbc.blit~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.blit~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.blit~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.blit~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* mbc.blit~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.blit~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/src/mbc.coeffDisp~/mbc.coeffDisp~.c b/src/mbc.coeffDisp~/mbc.coeffDisp~.c new file mode 100755 index 0000000..d0c44d5 --- /dev/null +++ b/src/mbc.coeffDisp~/mbc.coeffDisp~.c @@ -0,0 +1,286 @@ +/** + @file + mbc.coeffDisp~ - an MSP object shell + mark cartwright - mcartwright@gmail.com + + @ingroup lpcToolkit +*/ + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects + +#define MAX_ORDER 200 + +////////////////////////// object struct +typedef struct _coeffDisp +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + t_atom* c_a; //filer coefficients + t_float* c_aBuff; //filter coeff input buffer + long c_order; + int c_coeffType;//type of coeffecients: CT_FILTER,CT_AREA + int c_outMax; + void* c_out; +} t_coeffDisp; + +enum coeffTypes { + CT_FILTER, + CT_AREA +}; + +///////////////////////// function prototypes +//// standard set +void *coeffDisp_new(t_symbol *s, long argc, t_atom *argv); +void coeffDisp_free(t_coeffDisp *x); +void coeffDisp_assist(t_coeffDisp *x, void *b, long m, long a, char *s); + +void coeffDisp_dsp(t_coeffDisp *x, t_signal **sp, short *count); +t_int *coeffDisp_perf_filter(t_int *w); +t_int *coeffDisp_perf_area(t_int *w); +void coeffDisp_order(t_coeffDisp *x, int order); +void coeffDisp_init(t_coeffDisp *x); +void coeffDisp_clear(t_coeffDisp *x); +//////////////////////// global class pointer variable +void *coeffDisp_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&coeffDisp_class, (method)coeffDisp_new, (method)dsp_free, (short)sizeof(t_coeffDisp), 0L, A_GIMME, 0); + // addfloat((method)coeffDisp_float); + // you need this + // addmess((method)coeffDisp_dsp, "dsp", A_CANT, 0); + // addmess((method)coeffDisp_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.coeffDisp~", (method)coeffDisp_new, (method)coeffDisp_free, (long)sizeof(t_coeffDisp), 0L, A_GIMME, 0); + + class_addmethod(c, (method)coeffDisp_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)coeffDisp_assist, "assist", A_CANT, 0); + class_addmethod(c, (method)coeffDisp_order, "order", A_DEFLONG,0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + coeffDisp_class = c; + + return 0; +} + +t_int *coeffDisp_perf_filter(t_int *w) +{ + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_float *G = (t_float *)(w[3]); + t_coeffDisp *x = (t_coeffDisp *)(w[4]); + int n = (int)(w[5]); + int order = x->c_order; + int outMax = x->c_outMax; + int i, in_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[5]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + (x->c_a[0]).a_type = A_FLOAT; + (x->c_a[0]).a_w.w_float = G[in_idx]; + (x->c_a[outMax+1]).a_type = A_FLOAT; + (x->c_a[outMax+1]).a_w.w_float = 1.0; + for (i = 1; i < outMax; i++) { + (x->c_a[i]).a_type = A_FLOAT; + (x->c_a[i]).a_w.w_float = 0.0; + (x->c_a[i+outMax+1]).a_type = A_FLOAT; + (x->c_a[i+outMax+1]).a_w.w_float = -x->c_aBuff[i-1]; + } + outlet_list(x->c_out,0L,((outMax+1)*2),x->c_a); + } + } + in_idx++; + } + + return (w+6); +} + +t_int *coeffDisp_perf_area(t_int *w) //TODO: complete correctly (right now it's the same as coeff) +{ + t_float *coeffIn = (t_float *)(w[1]); + t_float *coeffIdxIn = (t_float *)(w[2]); + t_coeffDisp *x = (t_coeffDisp *)(w[3]); + int n = (int)(w[4]); + int order = x->c_order; + int i, in_idx = 0; + + while(n--) { + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[4]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->c_aBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for (i = 0; i < order; i++) { + (x->c_a[i]).a_type = A_FLOAT; + (x->c_a[i]).a_w.w_float = x->c_aBuff[i]; + } + outlet_list(x->c_out,0L,order,x->c_a); + } + } + in_idx++; + } + + return (w+5); +} + +void coeffDisp_init(t_coeffDisp *x) { + x->c_a = (t_atom *) getbytes( MAX_ORDER * 2 * sizeof(t_atom)); + x->c_aBuff = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + coeffDisp_clear(x); +} + +void coeffDisp_free(t_coeffDisp *x) { + dsp_free((t_pxobject *) x); + freebytes(x->c_a, MAX_ORDER * 2 * sizeof(t_atom)); + freebytes(x->c_aBuff, MAX_ORDER * sizeof(t_float)); +} + +void coeffDisp_clear(t_coeffDisp *x) { + int i; + for(i = 0; i < MAX_ORDER; i++) { + x->c_aBuff[i] = 0.0; + } + for (i = 0; i < ((x->c_outMax + 1)*2); i++) { + (x->c_a[i]).a_type = A_FLOAT; + (x->c_a[i]).a_w.w_float = 0.0; + } +} + +void coeffDisp_dsp(t_coeffDisp *x, t_signal **sp, short *count) +{ + switch (x->c_coeffType) { + case CT_FILTER: + dsp_add(coeffDisp_perf_filter, 5, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, x, sp[0]->s_n); + break; + + case CT_AREA: + dsp_add(coeffDisp_perf_area, 4, sp[0]->s_vec, sp[1]->s_vec, x, sp[0]->s_n); + break; + + default: + error("mbc.coeffDisp~: no coefficient type selected"); + } + + coeffDisp_clear(x); +} + +void coeffDisp_order(t_coeffDisp *x, int order) { + if (order < 1) { + error("mbc.coeffDisp~: mbc.coeffDisp~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.coeffDisp~: max order is 199"); + order = 199; + } + + x->c_outMax = order; + if (order > 48) { + //error("mbc.coeffDisp~: the maximum filter order than Max/MSP's filtergraph object can handle is 48. Therefore, only the first 48 coefficients will be shown"); + x->c_outMax = 48; + } + + int i = x->c_order; + x->c_order = order; + for ( i = i+1; i < order; i++) { + x->c_aBuff[i] = 0.0; + } + + for (i = 0; i < ((x->c_outMax + 1)*2); i++) { + (x->c_a[i]).a_type = A_FLOAT; + (x->c_a[i]).a_w.w_float = 0.0; + } +} + +void coeffDisp_assist(t_coeffDisp *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) Coefficients"); break; + case 1: sprintf(s,"(signal) Coeff Index"); break; + case 2: sprintf(s,"(signal) Filter Gain"); break; + } + } + else { + sprintf(s,"(list) Formatted Coefficient Output"); + } +} + +void *coeffDisp_new(t_symbol *s, long argc, t_atom *argv) +{ + t_coeffDisp *x = NULL; + + if (argc < 1) + { + error("mbc.coeffDisp~: must specify filter order (this should match mbc.lpc~)"); + return NULL; + } + + if (x = (t_coeffDisp *)object_alloc(coeffDisp_class)) { + dsp_setup((t_pxobject *)x,3); + x->c_out = listout(x); + + //get arguments out of gimme list + int order = atom_getintarg(0,argc,argv); + t_symbol* coeffType = atom_getsymarg(1,argc,argv); + + //order bounds + if (order < 1) { + error("mbc.coeffDisp~: mbc.coeffDisp~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.coeffDisp~: max order is 199"); + order = 199; + } + + x->c_outMax = order; + if (order > 48) { + error("mbc.coeffDisp~: the maximum filter order than Max/MSP's filtergraph object can handle is 48. Therefore, only the first 48 coefficients will be shown"); + x->c_outMax = 48; + } + + //parse filter coeff type + if (coeffType == gensym("filter")) { + x->c_coeffType = CT_FILTER; + } else if (coeffType == gensym("area")) { + x->c_coeffType = CT_AREA; + } else { + x->c_coeffType = CT_FILTER; + } + + //assign locals to globals and init + x->c_order = order; + coeffDisp_init(x); + } + return (x); +} diff --git a/src/mbc.coeffDisp~/mbc.coeffDisp~.maxhelp b/src/mbc.coeffDisp~/mbc.coeffDisp~.maxhelp new file mode 100644 index 0000000..74a4fcb --- /dev/null +++ b/src/mbc.coeffDisp~/mbc.coeffDisp~.maxhelp @@ -0,0 +1,548 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 118.0, 44.0, 456.0, 717.0 ], + "bglocked" : 0, + "defrect" : [ 118.0, 44.0, 456.0, 717.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 320.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 135.0, 155.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 160.0, 155.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 145.0, 185.0, 49.0, 20.0 ], + "save" : [ "#N", "sfplay~", "", 1, 120960, 0, "", ";" ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 130.0, 72.0, 20.0 ], + "text" : "loadmess 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 195.0, 185.0, 47.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 155.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 185.0, 32.5, 20.0 ], + "text" : "+ 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "meter~", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 105.0, 245.0, 80.0, 13.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 215.0, 126.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fgcolor" : [ 0.878431, 0.878431, 0.878431, 1.0 ], + "id" : "obj-47", + "markercolor" : [ 0.721569, 0.721569, 0.721569, 1.0 ], + "maxclass" : "spectroscope~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 91.0, 459.0, 300.0, 100.0 ], + "peakcolor" : [ 0.952941, 0.8, 0.8, 1.0 ], + "rounded" : 0, + "sonomedcolor" : [ 0.0, 0.74902, 0.498039, 1.0 ], + "sonomedhicolor" : [ 1.0, 0.74902, 0.0, 1.0 ], + "sonomedlocolor" : [ 0.498039, 0.0, 0.498039, 1.0 ] + } + + } +, { + "box" : { + "bgcolor" : [ 0.819608, 0.819608, 0.819608, 1.0 ], + "bwidthcolor" : [ 0.298039, 0.423529, 0.67451, 1.0 ], + "fgcolor" : [ 0.666667, 0.666667, 0.666667, 1.0 ], + "fontsize" : 12.0, + "hbwidthcolor" : [ 0.823529, 0.290196, 0.211765, 1.0 ], + "hcurvecolor" : [ 1.0, 0.086275, 0.086275, 1.0 ], + "id" : "obj-49", + "logfreq" : 0, + "markercolor" : [ 0.509804, 0.509804, 0.509804, 1.0 ], + "maxclass" : "filtergraph~", + "nfilters" : 1, + "numinlets" : 8, + "numoutlets" : 7, + "outlettype" : [ "list", "float", "float", "float", "float", "list", "int" ], + "patching_rect" : [ 90.0, 560.0, 301.0, 142.0 ], + "setfilter" : [ 0, 0, 1, 0, 0, 40.0, 1.0, 2.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 414.0, 119.0, 20.0 ], + "text" : "prepend highorder" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "list" ], + "patching_rect" : [ 90.0, 390.0, 110.0, 20.0 ], + "text" : "mbc.coeffDisp~ 40" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-52", + "maxclass" : "number", + "maximum" : 199, + "minimum" : 1, + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 17.0, 233.0, 37.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-53", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 17.0, 254.0, 64.0, 18.0 ], + "text" : "order $1" + } + + } +, { + "box" : { + "color" : [ 0.827451, 0.827451, 0.827451, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal" ], + "patching_rect" : [ 90.0, 320.0, 124.0, 20.0 ], + "text" : "mbc.lpc~ 40 100 1" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 330.0, 370.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 370.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 360.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 0.0, 137.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.coeffDisp~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "linecount" : 6, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 170.0, 167.0, 89.0 ], + "text" : "First agument: filter order.\n**NOTE**: The filtergraph object can only take 48 coefficients, therefore orders higher than 48 will be truncated." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 60.0, 442.0, 34.0 ], + "text" : "This object formats the coefficient signal from the mbc.lpc~ object so that it can be displayed using the filtergraph~ object." + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 440.0, 60.0 ], + "rounded" : 0 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-51", 2 ], + "hidden" : 0, + "midpoints" : [ 125.75, 376.0, 190.5, 376.0 ], + "source" : [ "obj-55", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 1 ], + "hidden" : 0, + "midpoints" : [ 204.5, 376.0, 145.0, 376.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 152.0, 376.0, 99.5, 376.0 ], + "source" : [ "obj-55", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 376.0, 99.5, 376.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "hidden" : 0, + "midpoints" : [ 99.5, 277.0, 77.0, 277.0, 77.0, 445.0, 100.5, 445.0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-49", 0 ], + "hidden" : 0, + "midpoints" : [ 99.5, 445.0, 77.0, 445.0, 77.0, 556.0, 99.5, 556.0 ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 273.0, 99.5, 273.0 ], + "source" : [ "obj-53", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.coeffDisp~/mbc.coeffDisp~.xcodeproj/project.pbxproj b/src/mbc.coeffDisp~/mbc.coeffDisp~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..a650fc9 --- /dev/null +++ b/src/mbc.coeffDisp~/mbc.coeffDisp~.xcodeproj/project.pbxproj @@ -0,0 +1,218 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* mbc.coeffDisp~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* mbc.coeffDisp~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* mbc.coeffDisp~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mbc.coeffDisp~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.coeffDisp~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.coeffDisp~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* mbc.coeffDisp~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.coeffDisp~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.coeffDisp~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.coeffDisp~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* mbc.coeffDisp~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.coeffDisp~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/src/mbc.errfilt~/errfilt~.c b/src/mbc.errfilt~/errfilt~.c new file mode 100755 index 0000000..82a4eff --- /dev/null +++ b/src/mbc.errfilt~/errfilt~.c @@ -0,0 +1,234 @@ +/** + @file + errfilt - an FIR filter for mbc.lpc~ + mark cartwright - mcartwright@gmail.com + + @ingroup lpcToolkit +*/ + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects +#include + +#define MAX_ORDER 200 + +////////////////////////// object struct +typedef struct _errfilt +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + t_float* a_b; //filer coefficients + t_float* a_bBuff; //filter coeff input buffer + t_float* a_x; //filter memory + t_float* a_A; //tube areas + t_float* a_tempVec; //holds temporary values for vector math + float a_interp; + int a_order; +} t_errfilt; + +///////////////////////// function prototypes +//// standard set +void *errfilt_new(int order, float interp); +void errfilt_free(t_errfilt *x); +void errfilt_assist(t_errfilt *x, void *b, long m, long a, char *s); + +void errfilt_dsp(t_errfilt *x, t_signal **sp, short *count); +void errfilt_interp(t_errfilt *x, float interp); +void errfilt_order(t_errfilt *x, int order); +void errfilt_init(t_errfilt *x); +void errfilt_clear(t_errfilt *x); +t_int *errfilt_perf_coeff(t_int *w); +//////////////////////// global class pointer variable +void *errfilt_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&errfilt_class, (method)errfilt_new, (method)dsp_free, (short)sizeof(t_errfilt), 0L, A_GIMME, 0); + // addfloat((method)errfilt_float); + // you need this + // addmess((method)errfilt_dsp, "dsp", A_CANT, 0); + // addmess((method)errfilt_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.errfilt~", (method)errfilt_new, (method)errfilt_free, (long)sizeof(t_errfilt), 0L, A_DEFLONG, A_DEFFLOAT, 0); + + class_addmethod(c, (method)errfilt_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)errfilt_interp,"interp",A_DEFFLOAT,0); + class_addmethod(c, (method)errfilt_order,"order",A_LONG,0); + class_addmethod(c, (method)errfilt_assist,"assist",A_CANT,0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + errfilt_class = c; + + return 0; +} + +t_int *errfilt_perf_coeff(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *coeffIn = (t_float *)(w[2]); + t_float *coeffIdxIn = (t_float *)(w[3]); + t_errfilt *x = (t_errfilt *)(w[4]); + t_float *out = (t_float *)(w[5]); + int n = (int)(w[6]); + int order = x->a_order; + int i, in_idx = 0, out_idx = 0; + t_float val = 0.0; + float sum = 0.0; + + while(n--) { + //get rid of NANs + if(IS_NAN_FLOAT(coeffIn[in_idx])) coeffIn[in_idx] = 0.0; + in_idx++; + } + + in_idx = 0; + n = (int)(w[6]); + + //look at coefficient index, if not zeros, buffer in coefficients + while (n--) { + if ((int)(coeffIdxIn[in_idx]) > 0) { + x->a_bBuff[(int)(coeffIdxIn[in_idx])-1] = coeffIn[in_idx]; + if ((int)(coeffIdxIn[in_idx]) == order) { + for(i = 0; i < order; i++) { + x->a_b[i] = x->a_bBuff[i]; + } + } + } + in_idx++; + } + + n = (int)(w[6]); + + while (n--) { + val = in[out_idx]; + vDSP_vmul(x->a_b,1,x->a_x,1,x->a_tempVec,1,order); + vDSP_sve(x->a_tempVec,1,&sum,order); + val -= sum; + //for (i=0; i < order; i++) val -= x->a_b[i] * x->a_x[i]; + for (i=order-1; i>0; i--) x->a_x[i] = x->a_x[i-1]; + x->a_x[0] = in[out_idx]; + + out[out_idx] = (float)val; + out_idx++; + } + + return (w+7); +} + + +void errfilt_init(t_errfilt *x) { + x->a_b = (t_float *) getbytes16( MAX_ORDER * sizeof(t_float)); + x->a_bBuff = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + x->a_x = (t_float *) getbytes16( MAX_ORDER * sizeof(t_float)); + x->a_A = (t_float *) getbytes( MAX_ORDER * sizeof(t_float)); + x->a_tempVec = (t_float *) getbytes16( MAX_ORDER * sizeof(t_float)); + errfilt_clear(x); +} + +void errfilt_clear(t_errfilt *x) { + int i; + for(i = 0; i < MAX_ORDER; i++) { + x->a_b[i] = 0.0; + x->a_bBuff[i] = 0.0; + x->a_x[i] = 0.0; + x->a_A[i] = 0.0; + x->a_tempVec[i] = 0.0; + } +} + +void errfilt_interp(t_errfilt *x, float interp) { + x->a_interp = interp; +} + +void errfilt_order(t_errfilt *x, int order) { + if (order < 1) { + error("mbc.errfilt~: mbc.errfilt~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.errfilt~: max order is 199"); + order = 199; + } + + x->a_order = order; + errfilt_clear(x); +} + +// this function is called when the DAC is enabled, and "registers" a function +// for the signal chain. in this case, "errfilt_perform" +void errfilt_dsp(t_errfilt *x, t_signal **sp, short *count) +{ + // dsp_add + // 1: (t_perfroutine p) perform method + // 2: (long argc) number of args to your perform method + // 3...: argc additional arguments, all must be sizeof(pointer) or long + // these can be whatever, so you might want to include your object pointer in there + // so that you have access to the info, if you need it. + + dsp_add(errfilt_perf_coeff, 6, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, x, sp[3]->s_vec, sp[0]->s_n); +} + +void errfilt_assist(t_errfilt *x, void *b, long m, long a, char *s) +{ + if (m==ASSIST_INLET) { + switch (a) { + case 0: sprintf(s,"(signal) Filter Input"); break; + case 1: sprintf(s,"(signal) Coefficients"); break; + case 2: sprintf(s,"(signal) Coeff Index"); break; + } + } + else { + sprintf(s,"(signal) Filter Output"); + } +} + +void errfilt_free(t_errfilt *x) { + dsp_free((t_pxobject *) x); + freebytes16((char *)x->a_b, MAX_ORDER * sizeof(t_float)); + freebytes(x->a_bBuff, MAX_ORDER * sizeof(t_float)); + freebytes16((char *)x->a_x, MAX_ORDER * sizeof(t_float)); + freebytes(x->a_A, MAX_ORDER * sizeof(t_float)); + freebytes16((char *)x->a_tempVec, MAX_ORDER * sizeof(t_float)); +} + +void *errfilt_new(int order, float interp) +{ + t_errfilt *x = NULL; + + if (order == 0) + { + error("mbc.errfilt~: must specify filter order (this should match the order of mbc.lpc~ and mbc.allpole~)"); + return NULL; + } + + if (x = (t_errfilt *)object_alloc(errfilt_class)) + { + dsp_setup((t_pxobject *)x,3); + outlet_new(x, "signal"); + + if (order < 1) { + error("mbc.errfilt~: mbc.errfilt~ needs a positive integer value for order"); + order = 1; + } else if (order > 199) { + error("mbc.errfilt~: max order is 199"); + order = 199; + } + + x->a_order = order; + x->a_interp = interp; + errfilt_init(x); + } + + return (x); +} diff --git a/src/mbc.errfilt~/mbc.errfilt~.maxhelp b/src/mbc.errfilt~/mbc.errfilt~.maxhelp new file mode 100644 index 0000000..bb7e545 --- /dev/null +++ b/src/mbc.errfilt~/mbc.errfilt~.maxhelp @@ -0,0 +1,541 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 306.0, 92.0, 468.0, 513.0 ], + "bglocked" : 0, + "defrect" : [ 306.0, 92.0, 468.0, 513.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 480.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-16", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 140.0, 280.0, 53.0, 20.0 ], + "text" : "bitsafe~" + } + + } +, { + "box" : { + "id" : "obj-13", + "maxclass" : "gain~", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "int" ], + "patching_rect" : [ 90.0, 350.0, 61.0, 80.0 ] + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 135.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 160.0, 85.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 145.0, 115.0, 49.0, 20.0 ], + "save" : [ "#N", "sfplay~", "", 1, 120960, 0, "", ";" ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 60.0, 72.0, 20.0 ], + "text" : "loadmess 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 195.0, 115.0, 47.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 115.0, 32.5, 20.0 ], + "text" : "+ 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "meter~", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 105.0, 175.0, 80.0, 13.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 145.0, 126.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 320.0, 122.0, 20.0 ], + "text" : "mbc.errfilt~ 40 1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-52", + "maxclass" : "number", + "maximum" : 199, + "minimum" : 1, + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 17.0, 163.0, 37.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-53", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 17.0, 184.0, 64.0, 18.0 ], + "text" : "order $1" + } + + } +, { + "box" : { + "color" : [ 0.694118, 0.694118, 0.694118, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal" ], + "patching_rect" : [ 90.0, 250.0, 124.0, 20.0 ], + "text" : "mbc.lpc~ 40 100 1" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 90.0, 450.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 30.0, 450.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 20.0, 440.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 300.0, 0.0, 157.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.errfilt~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 290.0, 162.0, 48.0 ], + "text" : "Second argument: interpolation off/on (0/1) (default is off)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 260.0, 163.0, 20.0 ], + "text" : "First agument: filter order" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 8, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 250.0, 60.0, 198.0, 117.0 ], + "text" : "This object performs basic a basic FIR filtering of the input based on the LPC coefficients. This is to be used on the input signal to \"whiten\" the signal (i.e. remove the spectral envelope). The resulting signal is the signal estimation error of the linear predictive analysis." + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 460.0, 60.0 ], + "rounded" : 0 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-51", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-16", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-16", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-55", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-13", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-13", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-55", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 306.0, 99.5, 306.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 203.0, 99.5, 203.0 ], + "source" : [ "obj-53", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.errfilt~/mbc.errfilt~.xcodeproj/project.pbxproj b/src/mbc.errfilt~/mbc.errfilt~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..8e49d3f --- /dev/null +++ b/src/mbc.errfilt~/mbc.errfilt~.xcodeproj/project.pbxproj @@ -0,0 +1,222 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* errfilt~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* errfilt~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; + 77CD4C2E127000B700AA9073 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 77CD4C2D127000B700AA9073 /* Accelerate.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* errfilt~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "errfilt~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.errfilt~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.errfilt~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; + 77CD4C2D127000B700AA9073 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + 77CD4C2E127000B700AA9073 /* Accelerate.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + 77CD4C2D127000B700AA9073 /* Accelerate.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* errfilt~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.errfilt~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.errfilt~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.errfilt~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* errfilt~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.errfilt~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/src/mbc.lpc~/mbc.lpc~.c b/src/mbc.lpc~/mbc.lpc~.c new file mode 100755 index 0000000..1da46d5 --- /dev/null +++ b/src/mbc.lpc~/mbc.lpc~.c @@ -0,0 +1,491 @@ +/** + @file + mbc.lpc~ - an MSP object shell + mark cartwright - mcartwright@gmail.com + + @ingroup lpcToolkit +*/ + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects +#include +#include + +#define MAX_ORDER 200 +#define NLOG2(x) (ceil(log2(x))) +#define POW2(x) (1 << x); +#define DEFAULT_FS 44100 +#define DEFAULT_FRAMERATE 100 +#define DEFAULT_V_SIZE 64 + +////////////////////////// object struct +typedef struct _lpc +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + t_float* l_frame_buff; //input frame buffer + t_float* l_winframe_buff; //windowed input frame buffer + t_float* l_outCoeff_buff; //coefficient signal + t_float* l_outParcor_buff; //PARCOR coeffs + t_float* l_outError_buff; //error signal + t_float* l_win; //analysis window + t_float* l_R; + double* l_W; + double* l_E; + double* l_K; + double l_G; + double** l_A; + double l_x1; //last samples of pre-emphasis filter + float l_b1; //pre-emph coefficient + int l_order; //predictor order + int l_order_max; //max order according to fs = order * frame_rate + int l_preemph; //pre-epmhasis filter on/off + int l_frame_rate; //analysis frame rate + int l_frame_size; //analysis frame size, where fs = frame_rate * frame_size * 2 + int l_hop_size; //hop_size = frame_size * 2 (b/c of overlap) + int l_inframe_idx; //current inframe buffer index + int l_outframe_idx; //current outframe buffer index + long l_v_size; //vector size + float l_fs; //sampling rate + int l_maxnfft; //fft length + int l_log2nfft; //log2(fft length) + FFTSetup l_fftsetup; //FFTSetup for vDSP FFT functions + DSPSplitComplex l_fftSplitTemp; //temp split complex vector structure +} t_lpc; + +///////////////////////// function prototypes +//// standard set +void *lpc_new(long order, long framerate, long preemph); +void lpc_free(t_lpc *x); +void lpc_assist(t_lpc *x, void *b, long m, long a, char *s); + +void lpc_dsp(t_lpc *x, t_signal **sp, short *count); +t_int *lpc_perform(t_int *w); + +void lpc_order(t_lpc *x, int n); +void lpc_preemph(t_lpc *x, int n); +void lpc_init(t_lpc *x); +void lpc_hanning(t_lpc *x); +void lpc_hamming(t_lpc *x); +void lpc_bartlett(t_lpc *x); + +//////////////////////// global class pointer variable +void *lpc_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&lpc_class, (method)lpc_new, (method)dsp_free, (short)sizeof(t_lpc), 0L, A_GIMME, 0); + // addfloat((method)lpc_float); + // you need this + // addmess((method)lpc_dsp, "dsp", A_CANT, 0); + // addmess((method)lpc_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.lpc~", (method)lpc_new, (method)lpc_free, (long)sizeof(t_lpc), 0L, A_DEFLONG, A_DEFLONG, A_DEFLONG, 0); //arglist: order, framerate, preemph + + class_addmethod(c, (method)lpc_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)lpc_order,"order",A_DEFLONG,0); + class_addmethod(c, (method)lpc_preemph,"preemph",A_DEFLONG,0); + class_addmethod(c, (method)lpc_assist,"assist",A_CANT,0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + lpc_class = c; + + return 0; +} + +t_int *lpc_perform(t_int *w) +{ + t_lpc *x = (t_lpc *) (w[1]); + t_float *in = (t_float *)(w[2]); + t_float *out_error = (t_float *)(w[3]); + t_float *out_gain = (t_float *)(w[4]); + t_float *out_coeff = (t_float *)(w[5]); + t_float *out_parcor = (t_float *)(w[6]); + t_float *out_index = (t_float *)(w[7]); + int n = (int)(w[8]); + int p = x->l_order; + int length = x->l_frame_size; + int log2nfft = NLOG2(length+p+1); + int nfft = POW2(log2nfft); + int nfftO2 = nfft/2; + float recipn = 1.0/nfft; + int inframeidx = x->l_inframe_idx; + int outframeidx = x->l_outframe_idx; + + int i, j, i1, ji; + int in_idx = 0, out_idx = 0; + double val; + float scale; + + if (x->l_preemph) + { + while (n--) + { + val = in[in_idx]; + in[in_idx] = val + x->l_b1 * x->l_x1; + x->l_x1 = val; + in_idx++; + } + n = (int)(w[8]); + in_idx = 0; + } + + while (n--) + { + if (inframeidx < length) { + //copy input into frame buff + x->l_frame_buff[inframeidx] = in[in_idx]; + + out_gain[out_idx] = x->l_G; + out_error[out_idx] = x->l_outError_buff[outframeidx]; //for now + if (outframeidx < x->l_order) { + out_coeff[out_idx] = x->l_outCoeff_buff[outframeidx]; + out_parcor[out_idx] = x->l_outParcor_buff[outframeidx]; + out_index[out_idx] = outframeidx + 1; + } else { + out_coeff[out_idx] = 0.0; + out_parcor[out_idx] = 0.0; + out_index[out_idx] = 0; + } + + inframeidx++; + in_idx++; + outframeidx++; + out_idx++; + } else { + //perform durbin-levinson - for right now, just count to the order--------------- + //clear memory, is this necessary? + for (i=0; i < p+1; i++){ + x->l_R[i] = 0.0; + x->l_W[i] = 0.0; + x->l_E[i] = 0.0; + x->l_K[i] = 0.0; + } + for(i=0; i<=p; i++) { + for(j=0; j < p; j++) x->l_A[i][j] = 0.0; + } + //window frame buff + vDSP_vmul(x->l_frame_buff, 1, x->l_win, 1, x->l_winframe_buff, 1, length); + #ifdef DEBUG + for(i=0;il_winframe_buff[i]); + #endif + + //create r from auto correlation + if ((2*nfft*log2(nfft)+nfft) > length*p) { //NOTE: change this to update only when order is changed! + //time domain method + for(i=0; i < p+1; i++) vDSP_dotpr(x->l_winframe_buff,1,x->l_winframe_buff+i,1,x->l_R+i,length-i); + } else { + //frequency domain method + // zero pad + vDSP_vclr(x->l_winframe_buff+length,1,nfft-length); + //convert to split complex vector + vDSP_ctoz( ( DSPComplex * ) x->l_winframe_buff, 2, &x->l_fftSplitTemp, 1, nfftO2); + //perform forward in place fft + vDSP_fft_zrip(x->l_fftsetup, &x->l_fftSplitTemp, 1, log2nfft, FFT_FORWARD); + //scaling + scale = 0.5; + vDSP_vsmul(x->l_fftSplitTemp.realp,1,&scale,x->l_fftSplitTemp.realp,1,nfftO2); + vDSP_vsmul(x->l_fftSplitTemp.imagp,1,&scale,x->l_fftSplitTemp.imagp,1,nfftO2); + //compute PSD + vDSP_zvmags(&x->l_fftSplitTemp,1,x->l_fftSplitTemp.realp,1,nfftO2); + //clear imaginary part + vDSP_vclr(x->l_fftSplitTemp.imagp,1,nfftO2); + //perform inverse in place fft + vDSP_fft_zrip(x->l_fftsetup, &x->l_fftSplitTemp, 1, log2nfft, FFT_INVERSE); + //scaling + vDSP_vsmul(x->l_fftSplitTemp.realp,1,&recipn,x->l_fftSplitTemp.realp,1,nfftO2); + vDSP_vsmul(x->l_fftSplitTemp.imagp,1,&recipn,x->l_fftSplitTemp.imagp,1,nfftO2); + //convert back to real number vector + vDSP_ztoc(&x->l_fftSplitTemp, 1, (DSPComplex *)x->l_R, 2, nfftO2); + } + + + /*for(i=0; i < p+1; i++) { + x->l_R[i] = 0.0; + for(j=0; j < length - i; j++) { + x->l_R[i] += x->l_winframe_buff[j] * x->l_winframe_buff[i+j]; + //x->l_R[i] += x->l_win[j] * x->l_win[i+j]; + } + }*/ + #ifdef DEBUG + for(i=0;i< p+1; i++) cpost("\nR(%d) = %f;",i+1,x->l_R[i]); + #endif + + x->l_W[0] = x->l_R[1]; + x->l_E[0] = x->l_R[0]; + + for (i = 1; i <= p; i++) { + x->l_K[i] = x->l_W[i-1] / x->l_E[i-1]; + + x->l_A[i][i] = x->l_K[i]; + i1 = i - 1; + if (i1 >= 1) { + for (j = 1; j <=i1; j++) { + ji = i - j; + x->l_A[j][i] = x->l_A[j][i1] - x->l_K[i] * x->l_A[ji][i1]; + } + } + + x->l_E[i] = x->l_E[i-1] * (1.0 - x->l_K[i] * x->l_K[i]); + + if (i != p) { + x->l_W[i] = x->l_R[i+1]; + for (j = 1; j <= i; j++) { + x->l_W[i] -= x->l_A[j][i] * x->l_R[i-j+1]; + } + } + } + + x->l_G = sqrt(x->l_E[p]); + for (i=0; i < p; i++) { + x->l_outCoeff_buff[i] = (float)(x->l_A[i+1][p]); + x->l_outParcor_buff[i] = (float)(x->l_K[i+1]); + #ifdef DEBUG + //cpost("\nParcor(%d) = %g;",i+1,x->l_K[i+1]); + //cpost("\nCoeff(%d) = %g;",i+1,x->l_A[i+1][p]); + #endif + } + + //-------------------------------------------------------------------------------- + + //copy right side to left side, move delayed input to output + for (i=0; i < x->l_hop_size; i++) { + x->l_outError_buff[i] = x->l_frame_buff[i]; + x->l_frame_buff[i] = x->l_frame_buff[i + x->l_hop_size]; + } + + inframeidx = x->l_hop_size; + outframeidx = 0; + n++; //to avoid skipping a sample (since we already decremented + while (n--) { + x->l_frame_buff[inframeidx] = in[in_idx]; + + out_gain[out_idx] = (float)(x->l_G); + out_error[out_idx] = x->l_outError_buff[outframeidx]; //for now + if (outframeidx < x->l_order) { + out_coeff[out_idx] = x->l_outCoeff_buff[outframeidx]; + out_parcor[out_idx] = x->l_outParcor_buff[outframeidx]; + out_index[out_idx] = (float)(outframeidx + 1); + } else { + out_coeff[out_idx] = 0.0; + out_parcor[out_idx] = 0.0; + out_index[out_idx] = 0; + } + + inframeidx++; + in_idx++; + outframeidx++; + out_idx++; + } + break; + } + } + + x->l_inframe_idx = inframeidx; + x->l_outframe_idx = outframeidx; + + return (w+9); +} + +void lpc_dsp(t_lpc *x, t_signal **sp, short *count) +{ + if (sp[0]->s_n != x->l_v_size || sp[0]->s_sr != x->l_fs) { + x->l_v_size = sp[0]->s_n; + x->l_fs = sp[0]->s_sr; + lpc_init(x); + } + + dsp_add(lpc_perform, 8, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[4]->s_vec, sp[5]->s_vec, sp[0]->s_n); +} + +void lpc_assist(t_lpc *x, void *b, long msg, long arg, char *dst) +{ + if (msg==ASSIST_INLET) { + switch (arg) { + case 0: sprintf(dst,"(signal) LPC Input"); break; + } + } + else { + switch (arg) { + case 0: sprintf(dst,"(signal) Error Signal"); break; + case 1: sprintf(dst,"(signal) Filter Gain"); break; + case 2: sprintf(dst,"(signal) Filter Coefficients"); break; + case 3: sprintf(dst,"(signal) PARCOR Coefficients"); break; + case 4: sprintf(dst,"(signal) Coefficient Index"); break; + } + } +} + +void lpc_free(t_lpc *x) { + int i; + + dsp_free((t_pxobject *) x); + sysmem_freeptr(x->l_frame_buff); + sysmem_freeptr(x->l_winframe_buff); + sysmem_freeptr(x->l_outCoeff_buff); + sysmem_freeptr(x->l_outError_buff); + sysmem_freeptr(x->l_outParcor_buff); + sysmem_freeptr(x->l_win); + sysmem_freeptr(x->l_R); + sysmem_freeptr(x->l_W); + sysmem_freeptr(x->l_E); + sysmem_freeptr(x->l_K); + for(i=0; il_A[i]); + } + sysmem_freeptr(x->l_A); + sysmem_freeptr(x->l_fftSplitTemp.realp); + sysmem_freeptr(x->l_fftSplitTemp.imagp); + vDSP_destroy_fftsetup(x->l_fftsetup); +} + +void lpc_preemph(t_lpc *x, int n) { + x->l_preemph = n; +} + +void lpc_order(t_lpc *x, int n) { + if (x->l_order_max < n) { + error("mbc.lpc~: framerate * order must be less than or equal to sampling rate. At the current setting maxorder is %d. For a higher order, lower the framerate.", x->l_order_max); + x->l_order = x->l_order_max; + } else { + x->l_order = n; + } + //lpc_init(x) ? +} + +void lpc_init(t_lpc *x) { + int i; + + if (x->l_fs < x->l_frame_rate * x->l_order) { + x->l_frame_rate = (long)(x->l_fs / x->l_order); + error("mbc.lpc~: framerate * order must be less than or equal to sampling rate. framerate has been changed to %d", x->l_frame_rate); + } + + x->l_hop_size = (int)(x->l_fs / x->l_frame_rate); + + if (x->l_v_size > x->l_hop_size) { + error("mbc.lpc~: warning: frame_size is less than vector size. this may cause errors, please reduce the frame rate or increase the vector size"); + } + + x->l_order_max = x->l_fs / x->l_frame_rate; + x->l_frame_size = x->l_hop_size * 2; + x->l_inframe_idx = x->l_hop_size; + x->l_outframe_idx = 0; + x->l_log2nfft = (int) NLOG2(x->l_frame_size+MAX_ORDER+1); + x->l_maxnfft = POW2(x->l_log2nfft); + + //allocate memory + x->l_frame_buff = (t_float *) sysmem_newptrclear( x->l_frame_size * sizeof(t_float)); + x->l_winframe_buff = (t_float *) sysmem_newptrclear( x->l_maxnfft * sizeof(t_float)); + x->l_outCoeff_buff = (t_float *) sysmem_newptrclear(MAX_ORDER * sizeof(t_float)); + x->l_outParcor_buff = (t_float *) sysmem_newptrclear(MAX_ORDER * sizeof(t_float)); + x->l_outError_buff = (t_float *) sysmem_newptrclear( x->l_hop_size * sizeof(t_float)); + x->l_win = (t_float *) sysmem_newptrclear( x->l_frame_size * sizeof(t_float)); + x->l_R = (t_float *) sysmem_newptrclear( x->l_maxnfft * sizeof(t_float)); + x->l_W = (double *) sysmem_newptrclear( (MAX_ORDER + 1) * sizeof(double)); + x->l_E = (double *) sysmem_newptrclear( (MAX_ORDER + 1) * sizeof(double)); + x->l_K = (double *) sysmem_newptrclear( (MAX_ORDER + 1) * sizeof(double)); + x->l_A = (double **) sysmem_newptrclear( (MAX_ORDER + 1) * sizeof(double*)); + for(i=0; il_A[i] = (double *)sysmem_newptrclear( (MAX_ORDER + 1) * sizeof(double)); + } + x->l_fftSplitTemp.realp = (float *)sysmem_newptrclear( (x->l_maxnfft / 2) * sizeof(float)); + x->l_fftSplitTemp.imagp = (float *)sysmem_newptrclear( (x->l_maxnfft / 2) * sizeof(float)); + + x->l_x1 = 0; + x->l_G = 0.0; + + x->l_b1 = -0.98; + + //calculate window + lpc_hamming(x); + //create FFTsetups + x->l_fftsetup = vDSP_create_fftsetup(x->l_log2nfft,FFT_RADIX2); + if (!x->l_fftsetup) error("mbc.lpc~: not enough available memory"); + +} + +void lpc_hanning(t_lpc *x) { + int N = x->l_frame_size; + int n; + + for (n=0; nl_win[n] = 0.5 * (1.0 - cos((TWOPI*(n+1))/(N+1))); + } +} + +void lpc_hamming(t_lpc *x) { + int N = x->l_frame_size; + int n; + + for (n=0; nl_win[n] = (0.54 - 0.46*cos((TWOPI*n)/(N-1))); + } +} + +void lpc_bartlett(t_lpc *x) { + int N = x->l_frame_size; + int n; + + for (n=0; nl_win[n] = 2.0/(N - 1) * ((N-1)/2 - fabs(n - (N-1)/2.0)); + } +} + +void *lpc_new(long order, long framerate, long preemph) +{ + t_lpc *x = NULL; + + if (order == 0) + { + error("mbc.lpc~: must specify the lpc order"); + return NULL; + } + + if (framerate == 0) + { + framerate = DEFAULT_FRAMERATE; + } + + if (x = (t_lpc *)object_alloc(lpc_class)) { + dsp_setup((t_pxobject *)x,1); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + outlet_new((t_pxobject *)x, "signal"); + + // from arguments: + x->l_frame_rate = framerate; + x->l_order = order; + x->l_preemph = preemph; + + // system variables (note: these need to be checked again in lpc_dsp since they may differ if in a poly~ for instance) + x->l_fs = sys_getsr(); + if (x->l_fs == 0) + { + x->l_fs = DEFAULT_FS; + } + + x->l_v_size = sys_getblksize(); + if (x->l_v_size == 0) + { + x->l_v_size = DEFAULT_V_SIZE; + } + + lpc_init(x); + } + return (x); +} diff --git a/src/mbc.lpc~/mbc.lpc~.maxhelp b/src/mbc.lpc~/mbc.lpc~.maxhelp new file mode 100644 index 0000000..30c3981 --- /dev/null +++ b/src/mbc.lpc~/mbc.lpc~.maxhelp @@ -0,0 +1,576 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 118.0, 44.0, 891.0, 731.0 ], + "bglocked" : 0, + "defrect" : [ 118.0, 44.0, 891.0, 731.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-14", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 440.0, 680.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "id" : "obj-1", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 135.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 160.0, 85.0, 37.0, 18.0 ], + "text" : "open" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 2, + "outlettype" : [ "signal", "bang" ], + "patching_rect" : [ 145.0, 115.0, 49.0, 20.0 ], + "save" : [ "#N", "sfplay~", "", 1, 120960, 0, "", ";" ], + "text" : "sfplay~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-7", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 60.0, 72.0, 20.0 ], + "text" : "loadmess 0" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 195.0, 115.0, 47.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "id" : "obj-5", + "maxclass" : "toggle", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 85.0, 20.0, 20.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-3", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "int" ], + "patching_rect" : [ 90.0, 115.0, 32.5, 20.0 ], + "text" : "+ 1" + } + + } +, { + "box" : { + "id" : "obj-4", + "maxclass" : "meter~", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "float" ], + "patching_rect" : [ 105.0, 175.0, 80.0, 13.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 90.0, 145.0, 126.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "bordercolor" : [ 0.0, 0.0, 0.0, 1.0 ], + "fgcolor" : [ 0.878431, 0.878431, 0.878431, 1.0 ], + "id" : "obj-47", + "markercolor" : [ 0.721569, 0.721569, 0.721569, 1.0 ], + "maxclass" : "spectroscope~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 91.0, 389.0, 300.0, 100.0 ], + "peakcolor" : [ 0.952941, 0.8, 0.8, 1.0 ], + "rounded" : 0, + "sonomedcolor" : [ 0.0, 0.74902, 0.498039, 1.0 ], + "sonomedhicolor" : [ 1.0, 0.74902, 0.0, 1.0 ], + "sonomedlocolor" : [ 0.498039, 0.0, 0.498039, 1.0 ] + } + + } +, { + "box" : { + "bgcolor" : [ 0.819608, 0.819608, 0.819608, 1.0 ], + "bwidthcolor" : [ 0.298039, 0.423529, 0.67451, 1.0 ], + "fgcolor" : [ 0.666667, 0.666667, 0.666667, 1.0 ], + "fontsize" : 12.0, + "hbwidthcolor" : [ 0.823529, 0.290196, 0.211765, 1.0 ], + "hcurvecolor" : [ 1.0, 0.086275, 0.086275, 1.0 ], + "id" : "obj-49", + "logfreq" : 0, + "markercolor" : [ 0.509804, 0.509804, 0.509804, 1.0 ], + "maxclass" : "filtergraph~", + "nfilters" : 1, + "numinlets" : 8, + "numoutlets" : 7, + "outlettype" : [ "list", "float", "float", "float", "float", "list", "int" ], + "patching_rect" : [ 90.0, 490.0, 301.0, 142.0 ], + "setfilter" : [ 0, 0, 1, 0, 0, 40.0, 1.0, 2.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-50", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 90.0, 344.0, 119.0, 20.0 ], + "text" : "prepend highorder" + } + + } +, { + "box" : { + "color" : [ 0.827451, 0.827451, 0.827451, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-51", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "list" ], + "patching_rect" : [ 90.0, 320.0, 158.0, 20.0 ], + "text" : "mbc.coeffDisp~ 40 filter" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-52", + "maxclass" : "number", + "maximum" : 199, + "minimum" : 1, + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "int", "bang" ], + "patching_rect" : [ 17.0, 163.0, 37.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-53", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 17.0, 184.0, 64.0, 18.0 ], + "text" : "order $1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-55", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 5, + "outlettype" : [ "signal", "signal", "signal", "signal", "signal" ], + "patching_rect" : [ 90.0, 250.0, 124.0, 20.0 ], + "text" : "mbc.lpc~ 40 100 1" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 160.0, 660.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 100.0, 660.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 90.0, 650.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 710.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 710.0, 0.0, 157.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.lpc~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 180.0, 162.0, 48.0 ], + "text" : "Third Argument: preemphasis off/on (0/1) (default 1)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 140.0, 168.0, 34.0 ], + "text" : "Second argument: framerate (default 100)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 260.0, 100.0, 163.0, 34.0 ], + "text" : "First agument: LPC Order (default 40)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 9, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 430.0, 60.0, 442.0, 131.0 ], + "text" : "This object performs basic linear prediction analysis, the first stage of linear prediction coding (LPC). LPC is essentially a way to do source/filter separation. In speech, it works on the premise that the vocal tract can be considered a slowly-time varying filter in which an excitation (glottal pulse and noise) is fed to produce speech. Using linear prediction we can estimate the vocal tract filter coefficients. The error signal between the estimated and the actual speech can be considered the excitation signal (the source). The voice can be resynthesized by running the error signal through the inverse prediction filter or by running a synthesized excitation signal through the inverse filter." + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 870.0, 60.0 ], + "rounded" : 0 + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 203.0, 99.5, 203.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-53", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-52", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 2 ], + "hidden" : 0, + "midpoints" : [ 125.75, 306.0, 238.5, 306.0 ], + "source" : [ "obj-55", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 1 ], + "hidden" : 0, + "midpoints" : [ 204.5, 306.0, 169.0, 306.0 ], + "source" : [ "obj-55", 4 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-49", 0 ], + "hidden" : 0, + "midpoints" : [ 99.5, 375.0, 77.0, 375.0, 77.0, 486.0, 99.5, 486.0 ], + "source" : [ "obj-50", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-50", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-51", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 152.0, 306.0, 99.5, 306.0 ], + "source" : [ "obj-55", 2 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-51", 0 ], + "hidden" : 0, + "midpoints" : [ 26.5, 306.0, 99.5, 306.0 ], + "source" : [ "obj-53", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-55", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-47", 0 ], + "hidden" : 0, + "midpoints" : [ 99.5, 207.0, 77.0, 207.0, 77.0, 375.0, 100.5, 375.0 ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-29", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-29", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-10", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-2", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.lpc~/mbc.lpc~.xcodeproj/project.pbxproj b/src/mbc.lpc~/mbc.lpc~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..9c2ac4c --- /dev/null +++ b/src/mbc.lpc~/mbc.lpc~.xcodeproj/project.pbxproj @@ -0,0 +1,222 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* mbc.lpc~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* mbc.lpc~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; + 7799693D1270197600554666 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7799693C1270197600554666 /* Accelerate.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* mbc.lpc~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mbc.lpc~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.lpc~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.lpc~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; + 7799693C1270197600554666 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + 7799693D1270197600554666 /* Accelerate.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + 7799693C1270197600554666 /* Accelerate.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* mbc.lpc~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.lpc~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.lpc~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.lpc~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* mbc.lpc~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.lpc~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +} diff --git a/src/mbc.pitch~/mbc.pitch~.c b/src/mbc.pitch~/mbc.pitch~.c new file mode 100755 index 0000000..0c949eb --- /dev/null +++ b/src/mbc.pitch~/mbc.pitch~.c @@ -0,0 +1,406 @@ +/*---------------------------------------------------------------------------------- +Filename: mbc.pitch~.c +Project: LPC Toolkit +Author: Mark Cartwright +Created: 5/22/07 +Updated: 10/21/10 +Description: fundamental frequency estimator external object for Max/MSP. + Algorithm based of of IRCAM's Yin algorithm and McLeod's Tartini + algorithm. See + http://www.ircam.fr/pcm/cheveign/pss/2002_JASA_YIN.pdf + and http://csweb.otago.ac.nz/tartini/papers/A_Smarter_Way_to_Find_Pitch.pdf +-------------------------------------------------------------------------------------*/ + +#include "ext.h" // standard Max include, always required (except in Jitter) +#include "ext_obex.h" // required for new style objects +#include "z_dsp.h" // required for MSP objects +#include +#include + +#define NLOG2(x) (ceil(log2(x))) +#define POW2(x) (1 << x); + +#define DEFAULT_FRAME_RATE 30 +#define DEFAULT_MINFREQ 60.0 +#define DEFAULT_THRESH 0.1 +#define DEFAULT_FS 44100 +#define DEFAULT_V_SIZE 64 + +////////////////////////// object struct +typedef struct _pitch +{ + t_pxobject ob; // the object itself (t_pxobject in MSP) + t_float* p_padframe_buff; //padded input frame buffer + t_float* p_R; //autocorrelation part + t_float* p_D; //difference function + t_float* p_Dp; //cumulative mean normalized difference function + t_float* p_M; //the M in D = M - 2*R + t_float* p_tempVec; //temporary storage for vector math + float p_frame_rate; //analysis frame rate + int p_frame_size; //analysis frame size, where fs = frame_rate * frame_size * 2 + int p_hop_size; //hop_size = frame_size * 2 (b/c of overlap) + int p_inframe_idx; //current inframe buffer index + int p_hop_idx; //hop index + long p_v_size; //vector size + float p_fs; //sampling rate + int p_maxnfft; //fft length + int p_log2nfft; //log2(fft length) + float p_thresh; //detection threshold + float p_minfreq; //minimum detectable frequency + int p_overlap; //samples of overlap (frame_size - hop_size) + FFTSetup p_fftsetup; //FFTSetup for vDSP FFT functions + DSPSplitComplex p_fftSplitTemp; //temp split complex vector structure + float p_freq; //estimated fundamental frequency + float p_min; //minimum at frequency location + float p_clarity; //clarity measure (~0-1... 1.0 for tonal) from Tartini + void* p_freqOut; //freq outlet + void* p_clarityOut; //clarity outlet +} t_pitch; + +///////////////////////// function prototypes +//// standard set +void *pitch_new(t_symbol *s, long argc, t_atom *argv); +void pitch_free(t_pitch *x); +void pitch_assist(t_pitch *x, void *b, long m, long a, char *s); + +void pitch_dsp(t_pitch *x, t_signal **sp, short *count); +t_int *pitch_perform(t_int *w); +void pitch_init(t_pitch *x); +void pitch_thresh(t_pitch *x, double thresh); +void pitch_frame_rate(t_pitch *x, double thresh); + +//////////////////////// global class pointer variable +void *pitch_class; + + +int main(void) +{ + // object initialization, note the use of dsp_free for the freemethod, which is required + // unless you need to free allocated memory, in which case you should call dsp_free from + // your custom free function. + + // OLD METHOD + // setup((t_messlist **)&pitch_class, (method)pitch_new, (method)dsp_free, (short)sizeof(t_pitch), 0L, A_GIMME, 0); + // addfloat((method)pitch_float); + // you need this + // addmess((method)pitch_dsp, "dsp", A_CANT, 0); + // addmess((method)pitch_assist, "assist", A_CANT, 0); + // you need this + // dsp_initclass(); + + // NEW METHOD + t_class *c; + + c = class_new("mbc.pitch~", (method)pitch_new, (method)pitch_free, (long)sizeof(t_pitch), 0L, A_GIMME, 0); + + class_addmethod(c, (method)pitch_dsp, "dsp", A_CANT, 0); + class_addmethod(c, (method)pitch_assist, "assist", A_CANT, 0); + class_addmethod(c, (method)pitch_thresh, "thresh", A_FLOAT,0); + class_addmethod(c, (method)pitch_frame_rate, "frame_rate",A_FLOAT,0); + + class_dspinit(c); // new style object version of dsp_initclass(); + class_register(CLASS_BOX, c); // register class as a box class + pitch_class = c; + + return 0; +} + +t_int *pitch_perform(t_int *w) { + t_float *in = (t_float *)(w[1]); + t_pitch *x = (t_pitch *) (w[2]); + int n = (int)(w[3]); + int length = x->p_frame_size; + int hop_size = x->p_hop_size; + int log2nfft = NLOG2(2*length); + int nfft = POW2(log2nfft); + int nfftO2 = nfft/2; + float recipn = 1.0/nfft; + int inframeidx = x->p_inframe_idx; + int hopidx = x->p_hop_idx; + float thresh = x->p_thresh; + int overlap = x->p_overlap; + float fs = x->p_fs; + int i,j; + float a,b,c,p,na,nb,nc,np; + int in_idx = 0; + float scale,sum; + + while (n--) { + if (hopidx < hop_size) { + hopidx++; + in_idx++; + } else { + if (inframeidx < length) { + //copy input into frame buff + x->p_padframe_buff[inframeidx] = in[in_idx]; + + inframeidx++; + in_idx++; + } else { + //Step 1. Calculate Difference Function-------------------------------------------- + //1A) Autocorrelation via FFT------------------------------------------------------ + + // zero pad + vDSP_vclr(x->p_padframe_buff+length,1,nfft-length); + //conver to split complex vector + vDSP_ctoz( ( DSPComplex * ) x->p_padframe_buff, 2, &x->p_fftSplitTemp, 1, nfftO2); + //perform forward in place fft + vDSP_fft_zrip(x->p_fftsetup, &x->p_fftSplitTemp, 1, log2nfft, FFT_FORWARD); + //scaling + scale = 0.5; + vDSP_vsmul(x->p_fftSplitTemp.realp,1,&scale,x->p_fftSplitTemp.realp,1,nfftO2); + vDSP_vsmul(x->p_fftSplitTemp.imagp,1,&scale,x->p_fftSplitTemp.imagp,1,nfftO2); + //compute PSD + vDSP_zvmags(&x->p_fftSplitTemp,1,x->p_fftSplitTemp.realp,1,nfftO2); + //clear imaginary part + vDSP_vclr(x->p_fftSplitTemp.imagp,1,nfftO2); + //perform inverse in place fft + vDSP_fft_zrip(x->p_fftsetup, &x->p_fftSplitTemp, 1, log2nfft, FFT_INVERSE); + //scaling + vDSP_vsmul(x->p_fftSplitTemp.realp,1,&recipn,x->p_fftSplitTemp.realp,1,nfftO2); + vDSP_vsmul(x->p_fftSplitTemp.imagp,1,&recipn,x->p_fftSplitTemp.imagp,1,nfftO2); + //convert back to real number vector + vDSP_ztoc(&x->p_fftSplitTemp, 1, (DSPComplex *)x->p_R, 2, nfftO2); + + //1B) Calculate M via recursion------------------------------------------------------ + x->p_M[0] = 2*x->p_R[0]; + for (i=1;ip_M[i] = x->p_M[i-1] - (x->p_padframe_buff[length-i] * x->p_padframe_buff[length-i] + x->p_padframe_buff[i-1] * x->p_padframe_buff[i-1]); + } + + //1C) Calculate D via M and R (D=M-2*R)---------------------------------------------- + //vDSP_vsub(x->p_M,1,x->p_R,1,x->p_D,1,length); + //vDSP_vsub(x->p_D,1,x->p_R,1,x->p_D,1,length); + for (i=0;ip_D[i] = x->p_M[i] - x->p_R[i] - x->p_R[i]; + } + + //Step 2. - Calculate cumulative mean norm difference function + //dp = d/runningaverage(d) + /*a = 1.0; + b = 1.0; + vDSP_vramp(&a,&b,x->p_tempVec,1,length); + vDSP_vavlin(x->p_D,1,x->p_tempVec,x->p_Dp,1,length); + vDSP_vdiv(x->p_D,1,x->p_Dp,1,x->p_Dp,1,length); + x->p_Dp[0] = 1.0;*/ + for (i=1;ip_D[j]; + } + sum = sum/i; + x->p_Dp[i] = x->p_D[i]/sum; + } + x->p_Dp[0] = 1.0; + + //Step 3. find first (smallest) tau that is a local minimum below threshold----------- + for (i=1;ip_Dp[i] < thresh) { + if(x->p_Dp[i-1] > x->p_Dp[i]) { + if(x->p_Dp[i] < x->p_Dp[i+1]) { + //Step 4. - perform parabolic interpolation--------------------------- + a=x->p_Dp[i-1]; + b=x->p_Dp[i]; + c=x->p_Dp[i+1]; + p = 0.5*(c - a)/(2*b - a - c); + x->p_freq = fs/(i+p); + //x->p_min = b - 0.25*(a - c)*p; + + //NOTE: I probably don't need to do interpolation on this part... + na=2*x->p_R[i-1]/x->p_M[i-1]; + nb=2*x->p_R[i]/x->p_M[i]; + nc=2*x->p_R[i+1]/x->p_M[i+1]; + np = 0.5*(nc - na)/(2*nb - na - nc); + x->p_clarity = nb - 0.25*(na - nc)*np; + //x->p_clarity = nb; + + outlet_float(x->p_freqOut,x->p_freq); + outlet_float(x->p_clarityOut,x->p_clarity); + break; + } + } + } + } + + //copy right side to left side, move delayed input to output, this only works for 50% OL, change if we want more + if (overlap > 0) { + for (i=0; i < overlap; i++) { + x->p_padframe_buff[i] = x->p_padframe_buff[i + x->p_hop_size]; + } + inframeidx = overlap; + } else { + inframeidx = 0; + } + //hopidx = 0; + hopidx = length; + + n++; //to avoid skipping a sample (since we already decremented + while (n--) { + if (hopidx < hop_size) { + hopidx++; + in_idx++; + } else { + //copy input into frame buff + x->p_padframe_buff[inframeidx] = in[in_idx]; + + inframeidx++; + in_idx++; + } + } + break; + } + } + } + + x->p_inframe_idx = inframeidx; + x->p_hop_idx = hopidx; + + return (w+4); +} + +void pitch_dsp(t_pitch *x, t_signal **sp, short *count) +{ + if (sp[0]->s_n != x->p_v_size || sp[0]->s_sr != x->p_fs) { + x->p_v_size = sp[0]->s_n; + x->p_fs = sp[0]->s_sr; + pitch_init(x); + } + + dsp_add(pitch_perform, 3, sp[0]->s_vec, x, sp[0]->s_n); +} + +void pitch_assist(t_pitch *x, void *b, long msg, long arg, char *dst) +{ + if (msg==ASSIST_INLET) { + switch (arg) { + case 0: sprintf(dst,"(signal) Input"); break; + } + } + else { + switch (arg) { + case 0: sprintf(dst,"(Float) Detected Fundamental Frequency"); break; + case 1: sprintf(dst,"(Float) Clarity"); break; + } + } +} + +void pitch_thresh(t_pitch *x, double thresh) { + x->p_thresh = (float)thresh; + post("\nnew thresh = %f",x->p_thresh); +} + +void pitch_frame_rate(t_pitch *x, double frame_rate) { + x->p_frame_rate = (float)frame_rate; + + x->p_hop_size = (int) ceil(x->p_fs/frame_rate); + + if (x->p_v_size > x->p_hop_size) { + error("mbc.pitch~: warning: frame_size is less than vector size. this may cause errors, please reduce the frame rate or increase the vector size"); + } + + x->p_overlap = x->p_frame_size - x->p_hop_size; + if (x->p_hop_idx > x->p_hop_size) x->p_hop_idx = 0; + post("\nnew fr = %f",x->p_frame_rate); +} + +void pitch_free(t_pitch *x) { + dsp_free((t_pxobject *) x); + + sysmem_freeptr(x->p_padframe_buff); + sysmem_freeptr(x->p_R); + sysmem_freeptr(x->p_D); + sysmem_freeptr(x->p_Dp); + sysmem_freeptr(x->p_M); + sysmem_freeptr(x->p_tempVec); + sysmem_freeptr(x->p_fftSplitTemp.realp); + sysmem_freeptr(x->p_fftSplitTemp.imagp); + vDSP_destroy_fftsetup(x->p_fftsetup); +} + +void pitch_init(t_pitch *x) { + float fs = x->p_fs; + + x->p_frame_size = (int) ceil(fs/x->p_minfreq); + x->p_hop_size = (int) ceil(fs/x->p_frame_rate); + + if (x->p_v_size > x->p_hop_size) { + error("mbc.pitch~: warning: frame_size is less than vector size. this may cause errors, please reduce the frame rate or increase the vector size"); + } + + x->p_overlap = x->p_frame_size - x->p_hop_size; + x->p_inframe_idx = (x->p_overlap > 0) ? x->p_overlap : 0; + x->p_hop_idx = 0; + x->p_log2nfft = (int) NLOG2(2 * x->p_frame_size); + x->p_maxnfft = POW2(x->p_log2nfft); + + //allocate memory + x->p_padframe_buff = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_R = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_D = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_Dp = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_M = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_tempVec = (t_float *) sysmem_newptrclear( x->p_maxnfft * sizeof(t_float)); + x->p_fftSplitTemp.realp = (float *)sysmem_newptrclear( (x->p_maxnfft / 2) * sizeof(float)); + x->p_fftSplitTemp.imagp = (float *)sysmem_newptrclear( (x->p_maxnfft / 2) * sizeof(float)); + + //create FFTsetups + x->p_fftsetup = vDSP_create_fftsetup(x->p_log2nfft,FFT_RADIX2); + if (!x->p_fftsetup) error("mbc.pitch~: not enough available memory"); +} + +void *pitch_new(t_symbol *s, long argc, t_atom *argv) +{ + t_pitch *x = NULL; + + if (x = (t_pitch *)object_alloc(pitch_class)) { + dsp_setup((t_pxobject *)x,1); + x->p_clarityOut = floatout(x); + x->p_freqOut = floatout(x); + + // defaults: + x->p_frame_rate = DEFAULT_FRAME_RATE; + x->p_minfreq = DEFAULT_MINFREQ; + x->p_thresh = DEFAULT_THRESH; + + // from arguments: + switch(argc) { + case 0: + break; + + case 1: + x->p_frame_rate = atom_getfloatarg(0,argc,argv); + break; + + case 2: + x->p_frame_rate = atom_getfloatarg(0,argc,argv); + x->p_minfreq = atom_getfloatarg(1,argc,argv); + break; + + case 3: + x->p_frame_rate = atom_getfloatarg(0,argc,argv); + x->p_minfreq = atom_getfloatarg(1,argc,argv); + x->p_thresh = atom_getfloatarg(2,argc,argv); + break; + + default: + break; + } + + + // system variables (note: these need to be checked again in pitch_dsp since they may differ if in a poly~ for instance) + x->p_fs = sys_getsr(); + if (x->p_fs == 0) + { + x->p_fs = DEFAULT_FS; + } + + x->p_v_size = sys_getblksize(); + if (x->p_v_size == 0) + { + x->p_v_size = DEFAULT_V_SIZE; + } + + pitch_init(x); + } + return (x); +} diff --git a/src/mbc.pitch~/mbc.pitch~.maxhelp b/src/mbc.pitch~/mbc.pitch~.maxhelp new file mode 100644 index 0000000..da04a27 --- /dev/null +++ b/src/mbc.pitch~/mbc.pitch~.maxhelp @@ -0,0 +1,602 @@ +{ + "patcher" : { + "fileversion" : 1, + "rect" : [ 242.0, 81.0, 464.0, 491.0 ], + "bglocked" : 0, + "defrect" : [ 242.0, 81.0, 464.0, 491.0 ], + "openrect" : [ 0.0, 0.0, 0.0, 0.0 ], + "openinpresentation" : 0, + "default_fontsize" : 12.0, + "default_fontface" : 0, + "default_fontname" : "Arial", + "gridonopen" : 0, + "gridsize" : [ 10.0, 10.0 ], + "gridsnaponopen" : 0, + "toolbarvisible" : 1, + "boxanimatetime" : 200, + "imprint" : 0, + "boxes" : [ { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-10", + "maxclass" : "newobj", + "numinlets" : 0, + "numoutlets" : 0, + "patching_rect" : [ 350.0, 450.0, 93.0, 20.0 ], + "text" : "lpcToolkitDemo" + } + + } +, { + "box" : { + "id" : "obj-9", + "maxclass" : "ezdac~", + "numinlets" : 2, + "numoutlets" : 0, + "patching_rect" : [ 130.0, 420.0, 45.0, 45.0 ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "hidden" : 1, + "id" : "obj-1", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 122.0, 196.0, 92.0, 20.0 ], + "text" : "loadmess 0.1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "hidden" : 1, + "id" : "obj-2", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 43.0, 196.0, 88.0, 20.0 ], + "text" : "loadmess 30" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-3", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 122.0, 219.0, 43.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-4", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 122.0, 248.0, 72.0, 18.0 ], + "text" : "thresh $1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-5", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 43.0, 220.0, 43.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-6", + "maxclass" : "message", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "" ], + "patching_rect" : [ 43.0, 249.0, 102.0, 18.0 ], + "text" : "frame_rate $1" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-7", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 133.0, 127.0, 43.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-8", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 130.0, 390.0, 54.0, 20.0 ], + "text" : "*~ 0.2" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-11", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 70.0, 420.0, 50.0, 34.0 ], + "text" : "start audio" + } + + } +, { + "box" : { + "bgcolor" : [ 1.0, 1.0, 1.0, 1.0 ], + "border" : 2, + "bordercolor" : [ 0.392157, 0.792157, 0.117647, 1.0 ], + "id" : "obj-12", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 60.0, 410.0, 124.0, 64.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-13", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 189.0, 330.0, 64.0, 20.0 ], + "text" : ": clarity" + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-14", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 141.0, 329.0, 43.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ], + "id" : "obj-15", + "maxclass" : "flonum", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "bang" ], + "patching_rect" : [ 24.0, 304.0, 43.0, 20.0 ], + "triscale" : 0.9 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-17", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 20.0, 130.0, 20.0 ], + "text" : "markcartwright.com" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-18", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 270.0, 0.0, 157.0, 20.0 ], + "text" : "by m. brozier cartwright" + } + + } +, { + "box" : { + "fontname" : "Arial Bold", + "fontsize" : 24.0, + "id" : "obj-19", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 18.0, 12.0, 201.0, 34.0 ], + "text" : "mbc.pitch~" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-20", + "linecount" : 3, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 211.0, 421.0, 134.0, 48.0 ], + "text" : "Outlet 2 is a clarity measurement from 0.-1." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-21", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 262.0, 337.0, 162.0, 34.0 ], + "text" : "Third Argument: detection threshold" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-22", + "linecount" : 5, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 262.0, 262.0, 162.0, 75.0 ], + "text" : "Second argument: minimum detectable frequency (Hz) (over estimate... since it actually tends to be a bit higher than this)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-23", + "items" : [ "no", "input", ",", "phasor", ",", "adc" ], + "maxclass" : "umenu", + "numinlets" : 1, + "numoutlets" : 3, + "outlettype" : [ "int", "", "" ], + "patching_rect" : [ 24.0, 148.0, 93.0, 20.0 ], + "types" : [ ] + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-24", + "maxclass" : "newobj", + "numinlets" : 3, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 24.0, 173.0, 240.0, 20.0 ], + "text" : "selector~ 2" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-25", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 250.0, 150.0, 54.0, 20.0 ], + "text" : "adc~ 1" + } + + } +, { + "box" : { + "color" : [ 0.478431, 0.709804, 0.317647, 1.0 ], + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-26", + "maxclass" : "newobj", + "numinlets" : 1, + "numoutlets" : 2, + "outlettype" : [ "float", "float" ], + "patching_rect" : [ 24.0, 279.0, 137.0, 20.0 ], + "text" : "mbc.pitch~ 30 60 0.1" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-27", + "maxclass" : "newobj", + "numinlets" : 2, + "numoutlets" : 1, + "outlettype" : [ "signal" ], + "patching_rect" : [ 133.0, 148.0, 94.0, 20.0 ], + "text" : "phasor~ 220." + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-28", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 262.0, 225.0, 111.0, 34.0 ], + "text" : "First agument: frame_rate (fps)" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-29", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 212.0, 388.0, 131.0, 34.0 ], + "text" : "Outlet 1 is the fundamental" + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-30", + "linecount" : 2, + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 10.0, 60.0, 380.0, 34.0 ], + "text" : "mbc.pitch~ is a time-domain based fundamental frequency estimator based off of IRCAM's Yin algorithm and the Tartini Project" + } + + } +, { + "box" : { + "bgcolor" : [ 0.584314, 0.917647, 0.180392, 1.0 ], + "id" : "obj-31", + "maxclass" : "panel", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 0.0, 0.0, 430.0, 50.0 ], + "rounded" : 0 + } + + } +, { + "box" : { + "fontname" : "Arial", + "fontsize" : 12.0, + "id" : "obj-32", + "maxclass" : "comment", + "numinlets" : 1, + "numoutlets" : 0, + "patching_rect" : [ 61.0, 305.0, 132.0, 20.0 ], + "text" : ": fundamental (Hz)" + } + + } + ], + "lines" : [ { + "patchline" : { + "destination" : [ "obj-9", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-9", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-8", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-23", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-6", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-26", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-4", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-15", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-26", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-5", 0 ], + "hidden" : 1, + "midpoints" : [ ], + "source" : [ "obj-2", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-6", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-5", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-27", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-7", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 1 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-27", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-14", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-26", 1 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-3", 0 ], + "hidden" : 1, + "midpoints" : [ ], + "source" : [ "obj-1", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-4", 0 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-3", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-8", 0 ], + "hidden" : 0, + "midpoints" : [ 33.5, 217.0, 14.0, 217.0, 14.0, 358.0, 139.5, 358.0 ], + "source" : [ "obj-24", 0 ] + } + + } +, { + "patchline" : { + "destination" : [ "obj-24", 2 ], + "hidden" : 0, + "midpoints" : [ ], + "source" : [ "obj-25", 0 ] + } + + } + ] + } + +} diff --git a/src/mbc.pitch~/mbc.pitch~.xcodeproj/project.pbxproj b/src/mbc.pitch~/mbc.pitch~.xcodeproj/project.pbxproj new file mode 100755 index 0000000..9844f9d --- /dev/null +++ b/src/mbc.pitch~/mbc.pitch~.xcodeproj/project.pbxproj @@ -0,0 +1,222 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 44; + objects = { + +/* Begin PBXBuildFile section */ + 22CF119B0EE9A8250054F513 /* mbc.pitch~.c in Sources */ = {isa = PBXBuildFile; fileRef = 22CF119A0EE9A8250054F513 /* mbc.pitch~.c */; }; + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */; }; + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 54266BCE05E6E9780000000C /* MaxAPI.framework */; }; + 779969F0127023D400554666 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 779969EF127023D400554666 /* Accelerate.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = maxmspsdk.xcconfig; path = ../maxmspsdk.xcconfig; sourceTree = SOURCE_ROOT; }; + 22CF119A0EE9A8250054F513 /* mbc.pitch~.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mbc.pitch~.c"; sourceTree = ""; }; + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = "../../c74support/msp-includes/MaxAudioAPI.framework"; sourceTree = SOURCE_ROOT; }; + 2FBBEAE508F335360078DB84 /* mbc.pitch~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "mbc.pitch~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; + 54266BCE05E6E9780000000C /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = "../../c74support/max-includes/MaxAPI.framework"; sourceTree = SOURCE_ROOT; }; + 779969EF127023D400554666 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2FBBEADC08F335360078DB84 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2FBBEADE08F335360078DB84 /* MaxAPI.framework in Frameworks */, + 22CF119E0EE9A82E0054F513 /* MaxAudioAPI.framework in Frameworks */, + 779969F0127023D400554666 /* Accelerate.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 089C166AFE841209C02AAC07 /* iterator */ = { + isa = PBXGroup; + children = ( + 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */, + 08FB77ADFE841716C02AAC07 /* Source */, + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */, + 19C28FB4FE9D528D11CA2CBB /* Products */, + ); + name = iterator; + sourceTree = ""; + }; + 089C1671FE841209C02AAC07 /* External Frameworks and Libraries */ = { + isa = PBXGroup; + children = ( + 54266BCE05E6E9780000000C /* MaxAPI.framework */, + 22CF119D0EE9A82E0054F513 /* MaxAudioAPI.framework */, + 779969EF127023D400554666 /* Accelerate.framework */, + ); + name = "External Frameworks and Libraries"; + sourceTree = ""; + }; + 08FB77ADFE841716C02AAC07 /* Source */ = { + isa = PBXGroup; + children = ( + 22CF119A0EE9A8250054F513 /* mbc.pitch~.c */, + ); + name = Source; + sourceTree = ""; + }; + 19C28FB4FE9D528D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 2FBBEAE508F335360078DB84 /* mbc.pitch~.mxo */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2FBBEAD708F335360078DB84 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2FBBEAD608F335360078DB84 /* max-external */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */; + buildPhases = ( + 2FBBEAD708F335360078DB84 /* Headers */, + 2FBBEAD808F335360078DB84 /* Resources */, + 2FBBEADA08F335360078DB84 /* Sources */, + 2FBBEADC08F335360078DB84 /* Frameworks */, + 2FBBEADF08F335360078DB84 /* Rez */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "max-external"; + productName = iterator; + productReference = 2FBBEAE508F335360078DB84 /* mbc.pitch~.mxo */; + productType = "com.apple.product-type.bundle"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.pitch~" */; + compatibilityVersion = "Xcode 3.0"; + hasScannedForEncodings = 1; + mainGroup = 089C166AFE841209C02AAC07 /* iterator */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2FBBEAD608F335360078DB84 /* max-external */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 2FBBEAD808F335360078DB84 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXRezBuildPhase section */ + 2FBBEADF08F335360078DB84 /* Rez */ = { + isa = PBXRezBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXRezBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 2FBBEADA08F335360078DB84 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22CF119B0EE9A8250054F513 /* mbc.pitch~.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2FBBEAD008F335010078DB84 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Development; + }; + 2FBBEAD108F335010078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Deployment; + }; + 2FBBEAE108F335360078DB84 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + GCC_OPTIMIZATION_LEVEL = 0; + }; + name = Development; + }; + 2FBBEAE208F335360078DB84 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 22CF10220EE984600054F513 /* maxmspsdk.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + ); + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/../../c74support/msp-includes\"", + ); + }; + name = Deployment; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2FBBEACF08F335010078DB84 /* Build configuration list for PBXProject "mbc.pitch~" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAD008F335010078DB84 /* Development */, + 2FBBEAD108F335010078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; + 2FBBEAE008F335360078DB84 /* Build configuration list for PBXNativeTarget "max-external" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2FBBEAE108F335360078DB84 /* Development */, + 2FBBEAE208F335360078DB84 /* Deployment */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Development; + }; +/* End XCConfigurationList section */ + }; + rootObject = 089C1669FE841209C02AAC07 /* Project object */; +}