diff --git a/bindings/README b/bindings/README deleted file mode 100644 index 7a56177a..00000000 --- a/bindings/README +++ /dev/null @@ -1,11 +0,0 @@ - -This directory contains the projects that bind FluidSynth to a -language or host application. The following projects are currently -available: - -fluidmax: Provides the fluidsynth~ external object for - Max/MSP. Written by Norbert Schnell. - -fluidsynth_jni: Provides a native interface for the Java - language. Written by Peter Hanappe. - diff --git a/bindings/fluidmax/README.TXT b/bindings/fluidmax/README.TXT deleted file mode 100644 index 04ed422c..00000000 --- a/bindings/fluidmax/README.TXT +++ /dev/null @@ -1,77 +0,0 @@ -****************************************************************** -* -* This is fluidsynth~, -* a derivative for Max/MSP of the Fluid Synth soundfont synthesizer. -* -* Fluid Synth is written by Peter Hanappe et al. -* See http://www.fluidsynth.org/. -* -* Max/MSP integration by Norbert Schnell, IRCAM - Centre Pompidou -* Norbert.Schnell@ircam.fr -* -* Take a look here: -* http://www.ircam.fr/equipes/temps-reel/maxmsp/fluidsynth.html -* -_____________________________________________________________________ -LICENSE - -This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - -See file COPYING.LIB in the CVS root directory for further information on licensing terms. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -_____________________________________________________________________ -SYSTEM REQUIREMENTS - -This version of fluidsynth~ was initially created and tested using Max/MSP 4.3 on Mac 10.3 and should work on all following versions of Max/MSP and Mac OS. - -_____________________________________________________________________ -RELASE NOTES for version 01/2009 (release 13) - - - adapted to current FluidSynth code base (after years without activity) - - no new features or relevant changes! - -_____________________________________________________________________ -RELASE NOTES up to version 10/2005 (release 10, 11 and 12) - - - added micro-tuning methods (to be added to help patch) - - fixed bug restricting argument of tuning-octave message to int (11) - - fixed voice stealing (12) - -_____________________________________________________________________ -RELASE NOTES up to version 09/2004 (release 7 to 9) - - - bug fix: now polyphony and # of midi channel arguments take effect (release 9) - - added message resample permitting to chose resampling interpolation method (release 8) - - added names (= file name without path and postfix) for soundfonts (7) - - fixed bug of crash for "info channels" in case of channel(s) without defined preset - - dropped Mac OS 9 version - - extended help patch - -_____________________________________________________________________ -RELASE NOTES of version 04/2004 (release 6) - - - fixed several bugs of the initial release (especially related to the translation of paths - - introduced names for soundfonts (without path and .sf2 postfix) - - introduced a message "info" in order to query the current state of tuning-octave - -_____________________________________________________________________ -SVN DIRECTORY - -svn repository: https://resonance.org/svn/fluidsynth/trunk/fluidsynth -Max/MSP implementation directory: bindings/fluidmax - -The fluidsynth directory in the fluidmax directory contains only a version.h which is just added for the case that the version.h file in the fluidsynth checkout is not (auto-)"maked" or generated otherwise. - -For now the file fluid_sys.c is not included to the CW project. Instead there is a file called fluidmax_fakefuns.c implementing some necessary functions. - -_____________________________________________________________________ -KNOWN BUGS: - -_____________________________________________________________________ -TODO - - implement log function properly diff --git a/bindings/fluidmax/build/osx-macho/fluidmax.xcodeproj/project.pbxproj b/bindings/fluidmax/build/osx-macho/fluidmax.xcodeproj/project.pbxproj deleted file mode 100644 index c6f9ca6a..00000000 --- a/bindings/fluidmax/build/osx-macho/fluidmax.xcodeproj/project.pbxproj +++ /dev/null @@ -1,339 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { - -/* Begin PBXBuildFile section */ - 3B1863D00B2DACF200083EB3 /* fluidmax_fakefuns.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863CE0B2DACF200083EB3 /* fluidmax_fakefuns.c */; }; - 3B1863D10B2DACF200083EB3 /* fluidmax.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863CF0B2DACF200083EB3 /* fluidmax.c */; }; - 3B1863E20B2DAD7800083EB3 /* fluid_chan.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D30B2DAD7800083EB3 /* fluid_chan.c */; }; - 3B1863E30B2DAD7800083EB3 /* fluid_chorus.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D40B2DAD7800083EB3 /* fluid_chorus.c */; }; - 3B1863E40B2DAD7800083EB3 /* fluid_conv.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D50B2DAD7800083EB3 /* fluid_conv.c */; }; - 3B1863E50B2DAD7800083EB3 /* fluid_defsfont.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D60B2DAD7800083EB3 /* fluid_defsfont.c */; }; - 3B1863E60B2DAD7800083EB3 /* fluid_gen.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D70B2DAD7800083EB3 /* fluid_gen.c */; }; - 3B1863E70B2DAD7800083EB3 /* fluid_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D80B2DAD7800083EB3 /* fluid_hash.c */; }; - 3B1863E80B2DAD7800083EB3 /* fluid_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863D90B2DAD7800083EB3 /* fluid_list.c */; }; - 3B1863E90B2DAD7800083EB3 /* fluid_mod.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863DA0B2DAD7800083EB3 /* fluid_mod.c */; }; - 3B1863EA0B2DAD7800083EB3 /* fluid_ramsfont.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863DB0B2DAD7800083EB3 /* fluid_ramsfont.c */; }; - 3B1863EB0B2DAD7800083EB3 /* fluid_rev.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863DC0B2DAD7800083EB3 /* fluid_rev.c */; }; - 3B1863EC0B2DAD7800083EB3 /* fluid_settings.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863DD0B2DAD7800083EB3 /* fluid_settings.c */; }; - 3B1863EE0B2DAD7800083EB3 /* fluid_synth.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863DF0B2DAD7800083EB3 /* fluid_synth.c */; }; - 3B1863EF0B2DAD7800083EB3 /* fluid_tuning.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863E00B2DAD7800083EB3 /* fluid_tuning.c */; }; - 3B1863F00B2DAD7800083EB3 /* fluid_voice.c in Sources */ = {isa = PBXBuildFile; fileRef = 3B1863E10B2DAD7800083EB3 /* fluid_voice.c */; }; - 3BC6778E0ADB9F2E0064088F /* MaxAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BC6778C0ADB9F2E0064088F /* MaxAPI.framework */; }; - 3BC6778F0ADB9F2E0064088F /* MaxAudioAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BC6778D0ADB9F2E0064088F /* MaxAudioAPI.framework */; }; - 5CA4036E0F1F689D0054E6B0 /* fluid_dsp_float.c in Sources */ = {isa = PBXBuildFile; fileRef = 5CA4036D0F1F689D0054E6B0 /* fluid_dsp_float.c */; }; - 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 = ""; }; - 3B1863CE0B2DACF200083EB3 /* fluidmax_fakefuns.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluidmax_fakefuns.c; path = bindings/fluidmax/fluidmax_fakefuns.c; sourceTree = ""; }; - 3B1863CF0B2DACF200083EB3 /* fluidmax.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluidmax.c; path = bindings/fluidmax/fluidmax.c; sourceTree = ""; }; - 3B1863D30B2DAD7800083EB3 /* fluid_chan.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_chan.c; path = ../../../../src/fluid_chan.c; sourceTree = SOURCE_ROOT; }; - 3B1863D40B2DAD7800083EB3 /* fluid_chorus.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_chorus.c; path = ../../../../src/fluid_chorus.c; sourceTree = SOURCE_ROOT; }; - 3B1863D50B2DAD7800083EB3 /* fluid_conv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_conv.c; path = ../../../../src/fluid_conv.c; sourceTree = SOURCE_ROOT; }; - 3B1863D60B2DAD7800083EB3 /* fluid_defsfont.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_defsfont.c; path = ../../../../src/fluid_defsfont.c; sourceTree = SOURCE_ROOT; }; - 3B1863D70B2DAD7800083EB3 /* fluid_gen.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_gen.c; path = ../../../../src/fluid_gen.c; sourceTree = SOURCE_ROOT; }; - 3B1863D80B2DAD7800083EB3 /* fluid_hash.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_hash.c; path = ../../../../src/fluid_hash.c; sourceTree = SOURCE_ROOT; }; - 3B1863D90B2DAD7800083EB3 /* fluid_list.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_list.c; path = ../../../../src/fluid_list.c; sourceTree = SOURCE_ROOT; }; - 3B1863DA0B2DAD7800083EB3 /* fluid_mod.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_mod.c; path = ../../../../src/fluid_mod.c; sourceTree = SOURCE_ROOT; }; - 3B1863DB0B2DAD7800083EB3 /* fluid_ramsfont.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_ramsfont.c; path = ../../../../src/fluid_ramsfont.c; sourceTree = SOURCE_ROOT; }; - 3B1863DC0B2DAD7800083EB3 /* fluid_rev.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_rev.c; path = ../../../../src/fluid_rev.c; sourceTree = SOURCE_ROOT; }; - 3B1863DD0B2DAD7800083EB3 /* fluid_settings.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_settings.c; path = ../../../../src/fluid_settings.c; sourceTree = SOURCE_ROOT; }; - 3B1863DF0B2DAD7800083EB3 /* fluid_synth.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_synth.c; path = ../../../../src/fluid_synth.c; sourceTree = SOURCE_ROOT; }; - 3B1863E00B2DAD7800083EB3 /* fluid_tuning.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_tuning.c; path = ../../../../src/fluid_tuning.c; sourceTree = SOURCE_ROOT; }; - 3B1863E10B2DAD7800083EB3 /* fluid_voice.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = fluid_voice.c; path = ../../../../src/fluid_voice.c; sourceTree = SOURCE_ROOT; }; - 3BC6778C0ADB9F2E0064088F /* MaxAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAPI.framework; path = /Library/Frameworks/MaxAPI.framework; sourceTree = ""; }; - 3BC6778D0ADB9F2E0064088F /* MaxAudioAPI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MaxAudioAPI.framework; path = /Library/Frameworks/MaxAudioAPI.framework; sourceTree = ""; }; - 5CA4036D0F1F689D0054E6B0 /* fluid_dsp_float.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fluid_dsp_float.c; sourceTree = ""; }; - 8D01CCD20486CAD60068D4B7 /* fluidsynth~.mxo */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "fluidsynth~.mxo"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D01CCCD0486CAD60068D4B7 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 8D01CCCE0486CAD60068D4B7 /* Carbon.framework in Frameworks */, - 3BC6778E0ADB9F2E0064088F /* MaxAPI.framework in Frameworks */, - 3BC6778F0ADB9F2E0064088F /* MaxAudioAPI.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 089C166AFE841209C02AAC07 /* yin */ = { - isa = PBXGroup; - children = ( - 08FB77ADFE841716C02AAC07 /* Sources */, - 089C1671FE841209C02AAC07 /* Frameworks */, - 19C28FB4FE9D528D11CA2CBB /* Products */, - ); - name = yin; - sourceTree = ""; - }; - 089C1671FE841209C02AAC07 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 3BC6778C0ADB9F2E0064088F /* MaxAPI.framework */, - 3BC6778D0ADB9F2E0064088F /* MaxAudioAPI.framework */, - 08EA7FFBFE8413EDC02AAC07 /* Carbon.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 08FB77ADFE841716C02AAC07 /* Sources */ = { - isa = PBXGroup; - children = ( - 3B1863D20B2DACFC00083EB3 /* fluidsynth */, - 3B1863CE0B2DACF200083EB3 /* fluidmax_fakefuns.c */, - 3B1863CF0B2DACF200083EB3 /* fluidmax.c */, - ); - name = Sources; - path = ../../../..; - sourceTree = SOURCE_ROOT; - }; - 19C28FB4FE9D528D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D01CCD20486CAD60068D4B7 /* fluidsynth~.mxo */, - ); - name = Products; - sourceTree = ""; - }; - 3B1863D20B2DACFC00083EB3 /* fluidsynth */ = { - isa = PBXGroup; - children = ( - 3B1863D30B2DAD7800083EB3 /* fluid_chan.c */, - 3B1863D40B2DAD7800083EB3 /* fluid_chorus.c */, - 3B1863D50B2DAD7800083EB3 /* fluid_conv.c */, - 3B1863D60B2DAD7800083EB3 /* fluid_defsfont.c */, - 3B1863D70B2DAD7800083EB3 /* fluid_gen.c */, - 3B1863D80B2DAD7800083EB3 /* fluid_hash.c */, - 3B1863D90B2DAD7800083EB3 /* fluid_list.c */, - 3B1863DA0B2DAD7800083EB3 /* fluid_mod.c */, - 3B1863DB0B2DAD7800083EB3 /* fluid_ramsfont.c */, - 3B1863DC0B2DAD7800083EB3 /* fluid_rev.c */, - 3B1863DD0B2DAD7800083EB3 /* fluid_settings.c */, - 3B1863DF0B2DAD7800083EB3 /* fluid_synth.c */, - 3B1863E00B2DAD7800083EB3 /* fluid_tuning.c */, - 3B1863E10B2DAD7800083EB3 /* fluid_voice.c */, - 5CA4036D0F1F689D0054E6B0 /* fluid_dsp_float.c */, - ); - name = fluidsynth; - path = src; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D01CCC60486CAD60068D4B7 /* fluidsynth~ */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4FADC23308B4156C00ABE55E /* Build configuration list for PBXNativeTarget "fluidsynth~" */; - buildPhases = ( - 8D01CCCB0486CAD60068D4B7 /* Sources */, - 8D01CCCD0486CAD60068D4B7 /* Frameworks */, - 3BC677940ADB9F6C0064088F /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "fluidsynth~"; - productInstallPath = "$(HOME)/Library/Bundles"; - productName = yin; - productReference = 8D01CCD20486CAD60068D4B7 /* fluidsynth~.mxo */; - productType = "com.apple.product-type.bundle"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 089C1669FE841209C02AAC07 /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 4FADC23708B4156C00ABE55E /* Build configuration list for PBXProject "fluidmax" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 089C166AFE841209C02AAC07 /* yin */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 8D01CCC60486CAD60068D4B7 /* fluidsynth~ */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3BC677940ADB9F6C0064088F /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "NAME=$WRAPPER_NAME\nDEST=$PROJECT_DIR/$EXTERNALS_DIR\nORIG=$TARGET_BUILD_DIR/$NAME\nPROD=$DEST/$NAME\n\n# set bundle bit for mxo's (on some installations, they show up as directories)\n/Developer/Tools/SetFile -a B $ORIG\n\nif test -d \"$PROD\"; then\n\trm -f -r \"$PROD\"\nfi\ncp -R $ORIG $DEST\n\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D01CCCB0486CAD60068D4B7 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3B1863D00B2DACF200083EB3 /* fluidmax_fakefuns.c in Sources */, - 3B1863D10B2DACF200083EB3 /* fluidmax.c in Sources */, - 3B1863E20B2DAD7800083EB3 /* fluid_chan.c in Sources */, - 3B1863E30B2DAD7800083EB3 /* fluid_chorus.c in Sources */, - 3B1863E40B2DAD7800083EB3 /* fluid_conv.c in Sources */, - 3B1863E50B2DAD7800083EB3 /* fluid_defsfont.c in Sources */, - 3B1863E60B2DAD7800083EB3 /* fluid_gen.c in Sources */, - 3B1863E70B2DAD7800083EB3 /* fluid_hash.c in Sources */, - 3B1863E80B2DAD7800083EB3 /* fluid_list.c in Sources */, - 3B1863E90B2DAD7800083EB3 /* fluid_mod.c in Sources */, - 3B1863EA0B2DAD7800083EB3 /* fluid_ramsfont.c in Sources */, - 3B1863EB0B2DAD7800083EB3 /* fluid_rev.c in Sources */, - 3B1863EC0B2DAD7800083EB3 /* fluid_settings.c in Sources */, - 3B1863EE0B2DAD7800083EB3 /* fluid_synth.c in Sources */, - 3B1863EF0B2DAD7800083EB3 /* fluid_tuning.c in Sources */, - 3B1863F00B2DAD7800083EB3 /* fluid_voice.c in Sources */, - 5CA4036E0F1F689D0054E6B0 /* fluid_dsp_float.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 4FADC23408B4156C00ABE55E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - /System/Library/Frameworks, - /Library/Frameworks, - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "/Library/Frameworks/MaxAPI.framework/Versions/A/Headers/macho-prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = FLUIDMAX; - HEADER_SEARCH_PATHS = ( - ../.., - ../../../../src, - ../../../../include/, - /Library/Frameworks/MaxAPI.framework/Versions/A/Headers, - /Library/Frameworks/MaxAudioAPI.framework/Versions/A/Headers, - ); - INFOPLIST_FILE = maxternal.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - PRODUCT_NAME = "fluidsynth~"; - WRAPPER_EXTENSION = mxo; - }; - name = Debug; - }; - 4FADC23508B4156C00ABE55E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - FRAMEWORK_SEARCH_PATHS = ( - /System/Library/Frameworks, - /Library/Frameworks, - ); - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "/Library/Frameworks/MaxAPI.framework/Versions/A/Headers/macho-prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = FLUIDMAX; - HEADER_SEARCH_PATHS = ( - ../.., - ../../../../src, - ../../../../include/, - /Library/Frameworks/MaxAPI.framework/Versions/A/Headers, - /Library/Frameworks/MaxAudioAPI.framework/Versions/A/Headers, - ); - INFOPLIST_FILE = maxternal.plist; - INSTALL_PATH = "$(HOME)/Library/Bundles"; - PRODUCT_NAME = "fluidsynth~"; - WRAPPER_EXTENSION = mxo; - }; - name = Release; - }; - 4FADC23808B4156C00ABE55E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - EXTERNALS_DIR = ../..; - FRAMEWORK_SEARCH_PATHS = ( - /System/Library/Frameworks, - /Library/Frameworks, - ); - GCC_PREPROCESSOR_DEFINITIONS = ( - HAVE_STRING_H, - HAVE_STDLIB_H, - HAVE_STDIO_H, - HAVE_MATH_H, - HAVE_STDARG_H, - WORDS_BIGENDIAN, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Debug; - }; - 4FADC23908B4156C00ABE55E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - EXTERNALS_DIR = ../..; - FRAMEWORK_SEARCH_PATHS = ( - /System/Library/Frameworks, - /Library/Frameworks, - ); - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - PREBINDING = NO; - SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 4FADC23308B4156C00ABE55E /* Build configuration list for PBXNativeTarget "fluidsynth~" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4FADC23408B4156C00ABE55E /* Debug */, - 4FADC23508B4156C00ABE55E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4FADC23708B4156C00ABE55E /* Build configuration list for PBXProject "fluidmax" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4FADC23808B4156C00ABE55E /* Debug */, - 4FADC23908B4156C00ABE55E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 089C1669FE841209C02AAC07 /* Project object */; -} diff --git a/bindings/fluidmax/build/osx-macho/maxternal.plist b/bindings/fluidmax/build/osx-macho/maxternal.plist deleted file mode 100644 index 704e31f3..00000000 --- a/bindings/fluidmax/build/osx-macho/maxternal.plist +++ /dev/null @@ -1,10 +0,0 @@ - - - - - CFBundleExecutable - $(PRODUCT_NAME) - CFBundlePackageType - iLaX - - diff --git a/bindings/fluidmax/build/winxp-vs8/fluidsynth.def b/bindings/fluidmax/build/winxp-vs8/fluidsynth.def deleted file mode 100644 index fdd689b2..00000000 --- a/bindings/fluidmax/build/winxp-vs8/fluidsynth.def +++ /dev/null @@ -1,6 +0,0 @@ -;fluidsynth.def - -LIBRARY fluidsynth~.mxe -EXPORTS - - main diff --git a/bindings/fluidmax/build/winxp-vs8/fluidsynth.sln b/bindings/fluidmax/build/winxp-vs8/fluidsynth.sln deleted file mode 100644 index 825c983f..00000000 --- a/bindings/fluidmax/build/winxp-vs8/fluidsynth.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fluidsynth", "fluidsynth.vcproj", "{73069FC3-D989-47DB-B15F-625703EED4DA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {73069FC3-D989-47DB-B15F-625703EED4DA}.Debug|Win32.ActiveCfg = Debug|Win32 - {73069FC3-D989-47DB-B15F-625703EED4DA}.Debug|Win32.Build.0 = Debug|Win32 - {73069FC3-D989-47DB-B15F-625703EED4DA}.Release|Win32.ActiveCfg = Release|Win32 - {73069FC3-D989-47DB-B15F-625703EED4DA}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/bindings/fluidmax/build/winxp-vs8/fluidsynth.suo b/bindings/fluidmax/build/winxp-vs8/fluidsynth.suo deleted file mode 100644 index f4f4b4d8..00000000 Binary files a/bindings/fluidmax/build/winxp-vs8/fluidsynth.suo and /dev/null differ diff --git a/bindings/fluidmax/build/winxp-vs8/fluidsynth.vcproj b/bindings/fluidmax/build/winxp-vs8/fluidsynth.vcproj deleted file mode 100644 index 8a592ae9..00000000 --- a/bindings/fluidmax/build/winxp-vs8/fluidsynth.vcproj +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bindings/fluidmax/config_maxmsp.h b/bindings/fluidmax/config_maxmsp.h deleted file mode 100644 index 106dac7e..00000000 --- a/bindings/fluidmax/config_maxmsp.h +++ /dev/null @@ -1,12 +0,0 @@ -#define HAVE_STRING_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_MATH_H 1 -#define HAVE_STDARG_H 1 - -#if defined(__POWERPC__) -#define WORDS_BIGENDIAN 1 -#endif - -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 diff --git a/bindings/fluidmax/fluidmax.c b/bindings/fluidmax/fluidmax.c deleted file mode 100644 index 5980c45d..00000000 --- a/bindings/fluidmax/fluidmax.c +++ /dev/null @@ -1,1853 +0,0 @@ -/*************************************************************************************** - * - * fluidsynth~ - * - * Fluid Synth soundfont synthesizer for Max/MSP. - * - * Fluid Synth is written by Peter Hanappe et al. - * see http://www.fluidsynth.org/ - * - * Max/MSP integration by Norbert Schnell ATR IRCAM - Centre Pompidou - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * See file COPYING.LIB for further informations on licensing terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA. - * - */ - -/************************************************************************ - * - * versions: - * (14): adapted to latest code base - * (13): ??? - * (12): fixed voice stealing - * (11): fixed arguments of fluidmax_tuning_octave() (third has to be float) - * (10): added micro-tuning methods - * (9): bug fix: now polyphony and # of midi channel arguments take effect - * (8): added message resample permitting to chose resampling interpolation method - * (7): added names for soundfonts (== file name without path and postfix) - * (6): added message 'info' - * (5): fixed bogus path translation at file loading - * - */ -#define FLUIDMAX_VERSION "01/2009 (14)" - -#include "ftmax.h" -#include "fluidsynth.h" -#include "fluid_synth.h" -#include "fluid_sfont.h" -#include "fluid_chan.h" -#include "fluidsynth/version.h" - -typedef struct -{ - ftmax_dsp_object_t obj; - - fluid_synth_t *synth; - fluid_settings_t *settings; - int reverb; - int chorus; - int mute; - void *outlet; -} fluidmax_t; - -static t_messlist *fluidmax_class; - -static ftmax_symbol_t sym_on = NULL; -static ftmax_symbol_t sym_off = NULL; -static ftmax_symbol_t sym_undefined = NULL; -static ftmax_symbol_t sym_gain = NULL; -static ftmax_symbol_t sym_channels = NULL; -static ftmax_symbol_t sym_channel = NULL; -static ftmax_symbol_t sym_soundfonts = NULL; -static ftmax_symbol_t sym_soundfont = NULL; -static ftmax_symbol_t sym_presets = NULL; -static ftmax_symbol_t sym_preset = NULL; -static ftmax_symbol_t sym_reverb = NULL; -static ftmax_symbol_t sym_chorus = NULL; -static ftmax_symbol_t sym_polyphony = NULL; -static ftmax_symbol_t sym_nearest = NULL; -static ftmax_symbol_t sym_linear = NULL; -static ftmax_symbol_t sym_cubic = NULL; -static ftmax_symbol_t sym_sinc = NULL; - -/*************************************************************** - * - * generators - * - */ -typedef struct -{ - int index; - const char *name; - const char *unit; -} fluidmax_gen_descr_t; - -static fluidmax_gen_descr_t fluidmax_gen_info[] = -{ - {0, "startAddrsOffset", "samples"}, - {1, "endAddrsOffset", "samples"}, - {2, "startloopAddrsOffset", "samples"}, - {3, "endloopAddrsOffset", "samples"}, - {4, "startAddrsCoarseOffset", "32k samples"}, - {5, "modLfoToPitch", "cent fs"}, - {6, "vibLfoToPitch", "cent fs"}, - {7, "modEnvToPitch", "cent fs"}, - {8, "initialFilterFc", "cent 8.176 Hz"}, - {9, "initialFilterQ", "cB"}, - {10, "modLfoToFilterFc", "cent fs"}, - {11, "modEnvToFilterFc", "cent fs "}, - {12, "endAddrsCoarseOffset", "32k samples"}, - {13, "modLfoToVolume", "cB fs"}, - {14, "unused1", ""}, - {15, "chorusEffectsSend", "0.1%"}, - {16, "reverbEffectsSend", "0.1% "}, - {17, "pan", "0.1%"}, - {18, "unused2", ""}, - {19, "unused3", ""}, - {20, "unused4", ""}, - {21, "delayModLFO", "timecent"}, - {22, "freqModLFO", "cent 8.176 "}, - {23, "delayVibLFO", "timecent "}, - {24, "freqVibLFO", "cent 8.176"}, - {25, "delayModEnv", "timecent"}, - {26, "attackModEnv", "timecent "}, - {27, "holdModEnv", "timecent"}, - {28, "decayModEnv", "timecent"}, - {29, "sustainModEnv", "-0.1%"}, - {30, "releaseModEnv", "timecent"}, - {31, "keynumToModEnvHold", "tcent/key"}, - {32, "keynumToModEnvDecay", "tcent/key"}, - {33, "delayVolEnv", "timecent"}, - {34, "attackVolEnv", "timecent"}, - {35, "holdVolEnv", "timecent"}, - {36, "decayVolEnv", "timecent"}, - {37, "sustainVolEnv", "cB"}, - {38, "releaseVolEnv", "timecent "}, - {39, "keynumToVolEnvHold", "tcent/key"}, - {40, "keynumToVolEnvDecay", "tcent/key "}, - {41, "instrument", ""}, - {42, "reserved1", ""}, - {43, "keyRange MIDI", ""}, - {44, "velRange MIDI", ""}, - {45, "startloopAddrsCoarseOffset", "samples"}, - {46, "keynum MIDI", ""}, - {47, "velocity MIDI", ""}, - {48, "initialAttenuation", "cB"}, - {49, "reserved2", ""}, - {50, "endloopAddrsCoarseOffset", "samples"}, - {51, "coarseTune", "semitone"}, - {52, "fineTune", "cent"}, - {53, "sampleId", ""}, - {54, "sampleModes", "Bit Flags"}, - {55, "reserved3", ""}, - {56, "scaleTuning", "cent/key"}, - {57, "exclusiveClass", "arbitrary#"}, - {58, "unused5", ""}, - {59, "unused6", ""}, - {60, "unused7", ""}, - {61, "unused8", ""}, - {62, "unused9", ""}, - {63, "unused10", ""} -}; - -/*************************************************************** - * - * dsp - * - */ -static t_int * -fluidmax_perform(t_int *w) -{ - fluidmax_t *self = (fluidmax_t *)(w[1]); - t_float *left = (t_float *)(w[2]); - t_float *right = (t_float *)(w[3]); - int n_tick = (int)(w[4]); - - if(self->mute == 0) - { - fluid_synth_write_float(self->synth, n_tick, left, 0, 1, right, 0, 1); - } - else - { - int i; - - for(i = 0; i < n_tick; i++) - { - left[i] = right[i] = 0.0; - } - } - - return (w + 5); -} - -static void -fluidmax_dsp(fluidmax_t *self, t_signal **sp, short *count) -{ - int n_tick = sp[0]->s_n; - - dsp_add(fluidmax_perform, 4, self, sp[0]->s_vec, sp[1]->s_vec, n_tick); -} - -/*************************************************************** - * - * load utlilities - * - */ -static char * -fluidmax_translate_fullpath(char *maxpath, char *fullpath) -{ - int i; - - strcpy(fullpath, "/Volumes/"); - - for(i = 0; maxpath[i] != ':'; i++) - { - fullpath[i + 9] = maxpath[i]; - } - - /* skip ':' */ - i++; - - strcpy(fullpath + i + 8, maxpath + i); - - return fullpath; -} - -static ftmax_symbol_t -fluidmax_get_stripped_name(const char *fullpath) -{ - char stripped[1024]; - int i; - - for(i = strlen(fullpath) - 1; i >= 0; i--) - { - if(fullpath[i] == '/') - { - break; - } - } - - if(i != 0) - { - i++; - } - - strcpy(stripped, fullpath + i); - - for(i = 0; stripped[i] != '\0'; i++) - { - if((stripped[i] == '.') && - (stripped[i + 1] == 's' || stripped[i + 1] == 'S') && - (stripped[i + 2] == 'f' || stripped[i + 2] == 'F') && - (stripped[i + 3] == '2')) - { - stripped[i] = '\0'; - break; - } - } - - return ftmax_new_symbol(stripped); -} - -static ftmax_symbol_t -fluidmax_sfont_get_name(fluid_sfont_t *sfont) -{ - return fluidmax_get_stripped_name(fluid_sfont_get_name(sfont)); -} - -static fluid_sfont_t * -fluidmax_sfont_get_by_name(fluidmax_t *self, ftmax_symbol_t name) -{ - int n = fluid_synth_sfcount(self->synth); - int i; - - for(i = 0; i < n; i++) - { - fluid_sfont_t *sfont = fluid_synth_get_sfont(self->synth, i); - - if(fluidmax_sfont_get_name(sfont) == name) - { - return sfont; - } - } - - return NULL; -} - -static void -fluidmax_do_load(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_symbol(at)) - { - const char *filename = ftmax_symbol_name(ftmax_get_symbol(at)); - ftmax_symbol_t name = fluidmax_get_stripped_name(filename); - fluid_sfont_t *sf = fluidmax_sfont_get_by_name(self, name); - - if(sf == NULL) - { - int id = fluid_synth_sfload(self->synth, filename, 0); - - if(id >= 0) - { - post("fluidsynth~: loaded soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - - fluid_synth_program_reset(self->synth); - - outlet_bang(self->outlet); - } - else - { - error("fluidsynth~: cannot load soundfont from file '%s'", filename); - } - } - else - { - error("fluidsynth~: soundfont named '%s' is already loaded", ftmax_symbol_name(name)); - return; - } - } -} - -static void -fluidmax_load_with_dialog(t_object *o, t_symbol *s, short argc, t_atom *argv) -{ - char filename[256]; - char maxpath[1024]; - char fullpath[1024]; - long type; - short path; - - open_promptset("open SoundFont 2 file"); - - if(open_dialog(filename, &path, &type, 0, 0)) - { - return; - } - - if(path_topotentialname(path, filename, maxpath, 0) == 0) - { - ftmax_atom_t a; - - ftmax_set_symbol(&a, ftmax_new_symbol(fluidmax_translate_fullpath(maxpath, fullpath))); - fluidmax_do_load(o, NULL, 1, &a); - } -} - -/*************************************************************** - * - * user methods - * - */ -static void -fluidmax_load(t_object *o, Symbol *s, short ac, Atom *at) -{ - if(ac == 0) - { - defer(o, (method)fluidmax_load_with_dialog, NULL, 0, 0); - } - else - { - if(ftmax_is_symbol(at)) - { - ftmax_symbol_t name = ftmax_get_symbol(at); - char *string = (char *)ftmax_symbol_name(name); - - if(string[0] == '/') - { - defer(o, (method)fluidmax_do_load, NULL, ac, at); - } - else - { - char maxpath[1024]; - char fullpath[1024]; - short path; - long type; - ftmax_atom_t a; - - if(locatefile_extended(string, &path, &type, 0, 0) || path_topotentialname(path, string, maxpath, 0) != 0) - { - error("fluidsynth~: cannot find file '%s'", string); - return; - } - - ftmax_set_symbol(&a, ftmax_new_symbol(fluidmax_translate_fullpath(maxpath, fullpath))); - defer(o, (method)fluidmax_do_load, NULL, 1, &a); - } - } - } -} - -static void -fluidmax_unload(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0) - { - if(ftmax_is_number(at)) - { - int id = ftmax_get_number_int(at); - fluid_sfont_t *sf = fluid_synth_get_sfont_by_id(self->synth, id); - - if(sf != NULL) - { - ftmax_symbol_t name = fluidmax_sfont_get_name(sf); - - if(fluid_synth_sfunload(self->synth, id, 0) >= 0) - { - post("fluidsynth~: unloaded soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - return; - } - } - - error("fluidsynth~: cannot unload soundfont %d", id); - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == ftmax_new_symbol("all")) - { - fluid_sfont_t *sf = fluid_synth_get_sfont(self->synth, 0); - - fluid_synth_system_reset(self->synth); - - while(sf != NULL) - { - ftmax_symbol_t name = fluidmax_sfont_get_name(sf); - unsigned int id = fluid_sfont_get_id(sf); - - if(fluid_synth_sfunload(self->synth, id, 0) >= 0) - { - post("fluidsynth~: unloaded soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - } - else - { - error("fluidsynth~: cannot unload soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - } - - sf = fluid_synth_get_sfont(self->synth, 0); - } - } - else - { - fluid_sfont_t *sf = fluidmax_sfont_get_by_name(self, sym); - - if(sf != NULL) - { - unsigned int id = fluid_sfont_get_id(sf); - - if(fluid_synth_sfunload(self->synth, id, 0) >= 0) - { - post("fluidsynth~: unloaded soundfont '%s' (id %d)", ftmax_symbol_name(sym), id); - return; - } - } - - error("fluidsynth~: cannot unload soundfont '%s'", ftmax_symbol_name(sym)); - } - } - } -} - -static void -fluidmax_reload(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0) - { - if(ftmax_is_number(at)) - { - int id = ftmax_get_number_int(at); - fluid_sfont_t *sf = fluid_synth_get_sfont_by_id(self->synth, id); - - if(sf != NULL) - { - if(fluid_synth_sfreload(self->synth, id) >= 0) - { - post("fluidsynth~: reloaded soundfont '%s' (id %d)", id); - return; - } - - error("fluidsynth~: cannot reload soundfont %d", id); - } - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == ftmax_new_symbol("all")) - { - int n = fluid_synth_sfcount(self->synth); - int i; - - fluid_synth_system_reset(self->synth); - - for(i = 0; i < n; i++) - { - fluid_sfont_t *sf = fluid_synth_get_sfont(self->synth, i); - ftmax_symbol_t name = fluidmax_sfont_get_name(sf); - unsigned int id = fluid_sfont_get_id(sf); - - - if(fluid_synth_sfreload(self->synth, id) >= 0) - { - post("fluidsynth~: reloaded soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - } - else - { - error("fluidsynth~: cannot reload soundfont '%s' (id %d)", ftmax_symbol_name(name), id); - } - } - } - else - { - fluid_sfont_t *sf = fluidmax_sfont_get_by_name(self, sym); - - if(sf != NULL) - { - unsigned int id = fluid_sfont_get_id(sf); - - if(fluid_synth_sfreload(self->synth, id) >= 0) - { - post("fluidsynth~: reloaded soundfont '%s' (id %d)", ftmax_symbol_name(sym), id); - return; - } - } - - error("fluidsynth~: cannot reload soundfont '%s'", ftmax_symbol_name(sym)); - } - } - } -} - -static void -fluidmax_note(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int velocity = 64; - int channel = 1; - - switch(ac) - { - default: - case 3: - if(ftmax_is_number(at + 2)) - { - channel = ftmax_get_number_int(at + 2); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - case 2: - if(ftmax_is_number(at + 1)) - { - velocity = ftmax_get_number_int(at + 1); - } - - case 1: - fluid_synth_noteon(self->synth, channel - 1, ftmax_get_number_int(at), velocity); - - case 0: - break; - } - } -} - -static void -fluidmax_list(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_note(o, NULL, ac, at); -} - - -static void -fluidmax_control_change(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int value = 64; - int channel = 1; - - switch(ac) - { - default: - case 3: - if(ftmax_is_number(at + 2)) - { - channel = ftmax_get_number_int(at + 2); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - case 2: - if(ftmax_is_number(at + 1)) - { - value = ftmax_get_number_int(at + 1); - } - - case 1: - fluid_synth_cc(self->synth, channel - 1, ftmax_get_number_int(at), value); - - case 0: - break; - } - } -} - -static void -fluidmax_mod(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 1 && ftmax_is_number(at) && ftmax_is_number(at + 1)) - { - int param = ftmax_get_number_int(at); - float value = ftmax_get_number_float(at + 1); - int channel = 1; - - if(ac > 2 && ftmax_is_number(at + 2)) - { - channel = ftmax_get_number_int(at + 2); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - fluid_synth_set_gen(self->synth, channel - 1, param, value); - } -} - -static void -fluidmax_pitch_bend(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int channel = 1; - double bend = 0.0; - - if(ac > 1 && ftmax_is_number(at + 1)) - { - channel = ftmax_get_number_int(at + 1); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - bend = ftmax_get_number_float(at); - - if(bend < 0.0) - { - bend = 0.0; - } - else if(bend > 127.0) - { - bend = 127.0; - } - - fluid_synth_pitch_bend(self->synth, channel - 1, (int)(bend * 128.0)); - } -} - -static void -fluidmax_pitch_bend_wheel(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int channel = 1; - - if(ac > 1 && ftmax_is_number(at + 1)) - { - channel = ftmax_get_number_int(at + 1); - } - - fluid_synth_pitch_wheel_sens(self->synth, channel - 1, ftmax_get_number_int(at)); - } -} - -static void -fluidmax_program_change(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int channel = 1; - - if(ac > 1 && ftmax_is_number(at + 1)) - { - channel = ftmax_get_number_int(at + 1); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - fluid_synth_program_change(self->synth, channel - 1, ftmax_get_number_int(at)); - } -} - -static void -fluidmax_bank_select(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - int channel = 1; - unsigned int sf_id; - unsigned int bank_num; - unsigned int prog_num; - - if(ac > 1 && ftmax_is_number(at + 1)) - { - channel = ftmax_get_number_int(at + 1); - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - } - - fluid_synth_bank_select(self->synth, channel - 1, ftmax_get_number_int(at)); - fluid_synth_get_program(self->synth, channel - 1, &sf_id, &bank_num, &prog_num); - fluid_synth_program_change(self->synth, channel - 1, prog_num); - } -} - -static void -fluidmax_select(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - unsigned int bank = 0; - unsigned int preset = 0; - int channel = 1; - - switch(ac) - { - default: - case 4: - if(ftmax_is_number(at + 3)) - { - channel = ftmax_get_number_int(at + 3); - } - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - - case 3: - if(ftmax_is_number(at + 2)) - { - preset = ftmax_get_number_int(at + 2); - } - - case 2: - if(ftmax_is_number(at + 1)) - { - bank = ftmax_get_number_int(at + 1); - } - - case 1: - if(ftmax_is_number(at)) - { - fluid_synth_program_select(self->synth, channel - 1, ftmax_get_number_int(at), bank, preset); - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t name = ftmax_get_symbol(at); - fluid_sfont_t *sf = fluidmax_sfont_get_by_name(self, name); - - if(sf != NULL) - { - fluid_synth_program_select(self->synth, channel - 1, fluid_sfont_get_id(sf), bank, preset); - } - else - { - error("fluidsynth~ select: cannot find soundfont named '%s'", ftmax_symbol_name(name)); - } - } - - case 0: - break; - } -} - -static void -fluidmax_reverb(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac == 0) - { - fluid_synth_set_reverb_on(self->synth, 1); - fluid_synth_reset_reverb(self->synth); - self->reverb = 1; - } - else if(ftmax_is_number(at)) - { - double room = fluid_synth_get_reverb_roomsize(self->synth); - double damping = fluid_synth_get_reverb_damp(self->synth); - double width = fluid_synth_get_reverb_width(self->synth); - - fluid_synth_set_reverb_on(self->synth, 1); - self->reverb = 1; - - switch(ac) - { - default: - case 4: - if(ftmax_is_number(at + 3)) - { - width = ftmax_get_number_float(at + 3); - } - - case 3: - if(ftmax_is_number(at + 2)) - { - damping = ftmax_get_number_float(at + 2); - } - - case 2: - if(ftmax_is_number(at + 1)) - { - room = ftmax_get_number_float(at + 1); - } - - case 1: - fluid_synth_set_reverb(self->synth, room, damping, width, ftmax_get_number_float(at)); - - case 0: - break; - } - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == sym_on) - { - fluid_synth_set_reverb_on(self->synth, 1); - self->reverb = 1; - } - else if(sym == sym_off) - { - fluid_synth_set_reverb_on(self->synth, 0); - self->reverb = 0; - } - } -} - -static void -fluidmax_chorus(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac == 0) - { - fluid_synth_set_chorus_on(self->synth, 1); - fluid_synth_reset_chorus(self->synth); - self->chorus = 1; - } - else if(ftmax_is_number(at)) - { - double speed = fluid_synth_get_chorus_speed(self->synth); - double depth = fluid_synth_get_chorus_depth(self->synth); - int type = fluid_synth_get_chorus_type(self->synth); - int nr = fluid_synth_get_chorus_nr(self->synth); - - fluid_synth_set_chorus_on(self->synth, 1); - self->chorus = 1; - - switch(ac) - { - default: - case 5: - if(ftmax_is_number(at + 4)) - { - nr = ftmax_get_number_int(at + 4); - } - - case 4: - if(ftmax_is_number(at + 3)) - { - type = ftmax_get_number_int(at + 3); - } - - case 3: - if(ftmax_is_number(at + 2)) - { - depth = ftmax_get_number_float(at + 2); - } - - case 2: - if(ftmax_is_number(at + 1)) - { - speed = ftmax_get_number_float(at + 1); - } - - case 1: - fluid_synth_set_chorus(self->synth, nr, ftmax_get_number_float(at), speed, depth, type); - - case 0: - break; - } - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == sym_on) - { - fluid_synth_set_chorus_on(self->synth, 1); - self->chorus = 1; - } - else if(sym == sym_off) - { - fluid_synth_set_chorus_on(self->synth, 0); - self->chorus = 0; - } - } -} - -static void -fluidmax_set_gain(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0 && ftmax_is_number(at)) - { - float gain = ftmax_get_number_float(at); - - fluid_synth_set_gain(self->synth, gain); - } -} - -static void -fluidmax_set_resampling_method(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0) - { - if(ftmax_is_number(at)) - { - int ip = ftmax_get_int(at); - - if(ip == 0) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_NONE); - } - else if(ip < 3) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_LINEAR); - } - else if(ip < 6) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_4THORDER); - } - else - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_7THORDER); - } - } - else if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == sym_nearest) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_NONE); - } - else if(sym == sym_linear) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_LINEAR); - } - else if(sym == sym_cubic) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_4THORDER); - } - else if(sym == sym_sinc) - { - fluid_synth_set_interp_method(self->synth, -1, FLUID_INTERP_7THORDER); - } - else - { - error("fluidsynth~: undefined resampling method: %s", ftmax_symbol_name(sym)); - } - } - } -} - -static void -fluidmax_panic(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - fluid_synth_system_reset(self->synth); -} - -static void -fluidmax_reset(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - int n = fluid_synth_count_midi_channels(self->synth); - int i; - - for(i = 0; i < n; i++) - { - fluid_channel_reset(self->synth->channel[i]); - } -} - -static void -fluidmax_mute(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - int mute = 1; - - if(ac > 0 && ftmax_is_number(at)) - { - mute = (ftmax_get_number_int(at) != 0); - } - - fluid_synth_system_reset(self->synth); - - self->mute = mute; -} - -static void -fluidmax_unmute(t_object *o) -{ - ftmax_atom_t a; - - ftmax_set_int(&a, 0); - fluidmax_mute(o, NULL, 1, &a); -} - -/* -int fluid_synth_count_audio_channels (fluid_synth_t *synth) -int fluid_synth_count_audio_groups (fluid_synth_t *synth) -int fluid_synth_count_effects_channels (fluid_synth_t *synth) -*/ - -static void -fluidmax_tuning_octave(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - ftmax_symbol_t name; - int tuning_bank = 0; - int tuning_prog = 0; - double pitch[12]; - int i, n; - - if(ac > 0 && ftmax_is_symbol(at)) - { - name = ftmax_get_symbol(at); - at++; - ac--; - } - - n = ac - 2; - - if(n > 12) - { - n = 12; - } - - if(ac > 0 && ftmax_is_number(at)) - { - tuning_bank = ftmax_get_number_int(at) % 128; - } - - if(ac > 1 && ftmax_is_number(at + 1)) - { - tuning_prog = ftmax_get_number_int(at) % 128; - } - - for(i = 0; i < n; i++) - { - if(ftmax_is_number(at + i + 2)) - { - pitch[i] = ftmax_get_number_float(at + i + 2); - } - else - { - pitch[i] = 0.0; - } - } - - for(; i < 12; n++) - { - pitch[i] = 0.0; - } - - fluid_synth_create_octave_tuning(self->synth, tuning_bank, tuning_prog, ftmax_symbol_name(name), pitch); -} - -static void -fluidmax_tuning_select(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - int tuning_bank = 0; - int tuning_prog = 0; - int channel = 1; - - if(ac > 0 && ftmax_is_number(at)) - { - tuning_bank = ftmax_get_number_int(at) % 128; - } - - if(ac > 1 && ftmax_is_number(at + 1)) - { - tuning_prog = ftmax_get_number_int(at + 1) % 128; - } - - if(ac > 2 && ftmax_is_number(at + 2)) - { - channel = ftmax_get_number_int(at + 2); - } - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - - fluid_synth_select_tuning(self->synth, channel - 1, tuning_bank, tuning_prog); -} - -static void -fluidmax_tuning_reset(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - int channel = 0; - - if(ac > 0 && ftmax_is_number(at)) - { - channel = ftmax_get_number_int(at); - } - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - - fluid_synth_reset_tuning(self->synth, channel - 1); -} - -/* more tuning ?? -fluid_synth_create_key_tuning (fluid_synth_t *synth, int tuning_bank, int tuning_prog, char *name, double *pitch) -fluid_synth_tune_notes (fluid_synth_t *synth, int tuning_bank, int tuning_prog, int len, int *keys, double *pitch, int apply) -fluid_synth_tuning_iteration_start (fluid_synth_t *synth) -fluid_synth_tuning_iteration_next (fluid_synth_t *synth, int *bank, int *prog) -fluid_synth_tuning_dump (fluid_synth_t *synth, int bank, int prog, char *name, int len, double *pitch) -*/ - -static void -fluidmax_version(t_object *o) -{ - post("fluidsynth~, version %s (based on FluidSynth %s)", FLUIDMAX_VERSION, FLUIDSYNTH_VERSION); - post(" FluidSynth is written by Peter Hanappe et al. (see fluidsynth.org)"); - post(" Max/MSP integration by Norbert Schnell IMTR IRCAM - Centre Pompidou"); -} - -extern const fluid_gen_info_t fluid_gen_info[]; - -static void -fluidmax_print(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0) - { - if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == sym_soundfonts) - { - int n = fluid_synth_sfcount(self->synth); - int i; - - if(n > 0) - { - post("fluidsynth~ soundfonts:"); - } - else - { - post("fluidsynth~: no soundfonts loaded"); - } - - for(i = 0; i < n; i++) - { - fluid_sfont_t *sf = fluid_synth_get_sfont(self->synth, i); - ftmax_symbol_t name = fluidmax_sfont_get_name(sf); - unsigned int id = fluid_sfont_get_id(sf); - - post(" %d: '%s' (id %d)", i, ftmax_symbol_name(name), id); - } - } - else if(sym == sym_presets) - { - int n = fluid_synth_sfcount(self->synth); - - if(n > 0) - { - if(ac > 1) - { - fluid_sfont_t *sf = NULL; - ftmax_symbol_t name; - - if(ftmax_is_symbol(at + 1)) - { - name = ftmax_get_symbol(at + 1); - sf = fluidmax_sfont_get_by_name(self, name); - } - else if(ftmax_is_int(at + 1)) - { - int id = ftmax_get_int(at + 1); - - sf = fluid_synth_get_sfont_by_id(self->synth, id); - name = fluidmax_sfont_get_name(sf); - } - - if(sf != NULL) - { - fluid_preset_t *preset; - - fluid_sfont_iteration_start(sf); - - post("fluidsynth~ presets of soundfont '%s':", ftmax_symbol_name(name)); - - while((preset = fluid_sfont_iteration_next(sf)) != NULL) - { - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - int bank_num = fluid_preset_get_banknum(preset); - int prog_num = fluid_preset_get_num(preset); - - post(" '%s': bank %d, program %d", ftmax_symbol_name(preset_name), bank_num, prog_num); - } - } - } - else - { - int i; - - post("fluidsynth~ presets:"); - - for(i = 0; i < 128; i++) - { - int j; - - for(j = 0; j < 128; j++) - { - fluid_preset_t *preset = NULL; - fluid_sfont_t *sf = NULL; - int k; - - for(k = 0; k < n; k++) - { - sf = fluid_synth_get_sfont(self->synth, k); - preset = fluid_sfont_get_preset(sf, i, j); - - if(preset != NULL) - { - break; - } - } - - if(preset != NULL) - { - ftmax_symbol_t sf_name = fluidmax_sfont_get_name(sf); - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - - post(" '%s': soundfont '%s', bank %d, program %d", - ftmax_symbol_name(preset_name), ftmax_symbol_name(sf_name), i, j); - } - } - } - } - } - else - { - error("fluidsynth~: no soundfonts loaded"); - } - } - else if(sym == sym_channels) - { - int n = fluid_synth_count_midi_channels(self->synth); - int i; - - post("fluidsynth~ channels:"); - - for(i = 0; i < n; i++) - { - fluid_preset_t *preset = fluid_synth_get_channel_preset(self->synth, i); - - if(preset != NULL) - { - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - unsigned int sf_id; - unsigned int bank_num; - unsigned int prog_num; - fluid_sfont_t *sf; - - fluid_synth_get_program(self->synth, i, &sf_id, &bank_num, &prog_num); - sf = fluid_synth_get_sfont_by_id(self->synth, sf_id); - - post(" %d: soundfont '%s', bank %d, program %d: '%s'", - i + 1, ftmax_symbol_name(fluidmax_sfont_get_name(sf)), bank_num, prog_num, ftmax_symbol_name(preset_name)); - } - else - { - post(" channel %d: no preset", i + 1); - } - } - } - else if(sym == ftmax_new_symbol("generators")) - { - int channel = 1; - int n = GEN_LAST; - int i; - - if(ac > 1 && ftmax_is_number(at + 1)) - { - channel = ftmax_get_number_int(at + 1); - } - - if(channel < 1) - { - channel = 1; - } - else if(channel > fluid_synth_count_midi_channels(self->synth)) - { - channel = fluid_synth_count_midi_channels(self->synth); - } - - post("fluidsynth~ generators of channel %d:", channel); - - for(i = 0; i < n; i++) - { - const char *name = fluidmax_gen_info[i].name; - const char *unit = fluidmax_gen_info[i].unit; - double incr = fluid_synth_get_gen(self->synth, channel - 1, i); - double min = fluid_gen_info[i].min; - double max = fluid_gen_info[i].max; - - post(" %d '%s': %s %g [%g ... %g] (%s)", i, name, (incr >= 0) ? "" : "-", fabs(incr), min, max, unit); - } - } - else if(sym == sym_gain) - { - double gain = fluid_synth_get_gain(self->synth); - - post("gain: %g", gain); - } - else if(sym == sym_reverb) - { - double level = fluid_synth_get_reverb_level(self->synth); - double room = fluid_synth_get_reverb_roomsize(self->synth); - double damping = fluid_synth_get_reverb_damp(self->synth); - double width = fluid_synth_get_reverb_width(self->synth); - - if(self->reverb != 0) - { - post("fluidsynth~ current reverb parameters:"); - post(" level: %f", level); - post(" room size: %f", room); - post(" damping: %f", damping); - post(" width: %f", width); - } - else - { - post("fluidsynth~: reverb off"); - } - } - else if(sym == sym_chorus) - { - if(self->chorus != 0) - { - double level = fluid_synth_get_chorus_level(self->synth); - double speed = fluid_synth_get_chorus_speed(self->synth); - double depth = fluid_synth_get_chorus_depth(self->synth); - int type = fluid_synth_get_chorus_type(self->synth); - int nr = fluid_synth_get_chorus_nr(self->synth); - - post("fluidsynth~ current chorus parameters:"); - post(" level: %f", level); - post(" speed: %f Hz", speed); - post(" depth: %f msec", depth); - post(" type: %d (%s)", type, type ? "triangle" : "sine"); - post(" %d units", nr); - } - else - { - post("fluidsynth~: chorus off"); - } - } - } - } -} - -static void -fluidmax_info(t_object *o, Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(ac > 0) - { - if(ftmax_is_symbol(at)) - { - ftmax_symbol_t sym = ftmax_get_symbol(at); - - if(sym == sym_soundfonts) - { - int n = fluid_synth_sfcount(self->synth); - int i; - - for(i = 0; i < n; i++) - { - fluid_sfont_t *sf = fluid_synth_get_sfont(self->synth, i); - unsigned int id = fluid_sfont_get_id(sf); - ftmax_atom_t a[2]; - - ftmax_set_int(a, i); - ftmax_set_symbol(a + 1, fluidmax_sfont_get_name(sf)); - ftmax_set_int(a + 2, id); - outlet_anything(self->outlet, sym_soundfont, 3, a); - } - } - else if(sym == sym_presets) - { - int n = fluid_synth_sfcount(self->synth); - - if(n > 0) - { - if(ac > 1) - { - fluid_sfont_t *sf = NULL; - ftmax_symbol_t sf_name; - - if(ftmax_is_symbol(at + 1)) - { - sf_name = ftmax_get_symbol(at + 1); - sf = fluidmax_sfont_get_by_name(self, sf_name); - } - else if(ftmax_is_int(at + 1)) - { - int id = ftmax_get_int(at + 1); - - sf = fluid_synth_get_sfont_by_id(self->synth, id); - sf_name = fluidmax_sfont_get_name(sf); - } - - if(sf != NULL) - { - fluid_preset_t *preset; - - fluid_sfont_iteration_start(sf); - - while((preset = fluid_sfont_iteration_next(sf)) != NULL) - { - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - int bank_num = fluid_preset_get_banknum(preset); - int prog_num = fluid_preset_get_num(preset); - ftmax_atom_t a[4]; - - ftmax_set_symbol(a, preset_name); - ftmax_set_symbol(a + 1, sf_name); - ftmax_set_int(a + 2, bank_num); - ftmax_set_int(a + 3, prog_num); - outlet_anything(self->outlet, sym_preset, 4, a); - } - } - } - else - { - int i; - - for(i = 0; i < 128; i++) - { - int j; - - for(j = 0; j < 128; j++) - { - fluid_preset_t *preset = NULL; - fluid_sfont_t *sf = NULL; - int k; - - for(k = 0; k < n; k++) - { - sf = fluid_synth_get_sfont(self->synth, k); - preset = fluid_sfont_get_preset(sf, i, j); - - if(preset != NULL) - { - break; - } - } - - if(preset != NULL) - { - ftmax_symbol_t sf_name = fluidmax_sfont_get_name(sf); - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - ftmax_atom_t a[4]; - - ftmax_set_symbol(a, preset_name); - ftmax_set_symbol(a + 1, sf_name); - ftmax_set_int(a + 2, i); - ftmax_set_int(a + 3, j); - outlet_anything(self->outlet, sym_preset, 4, a); - } - } - } - } - } - else - { - error("fluidsynth~ info: no soundfonts loaded"); - } - } - else if(sym == sym_channels) - { - int n = fluid_synth_count_midi_channels(self->synth); - int i; - - for(i = 0; i < n; i++) - { - fluid_preset_t *preset = fluid_synth_get_channel_preset(self->synth, i); - - if(preset != NULL) - { - char *preset_str = fluid_preset_get_name(preset); - ftmax_symbol_t preset_name = ftmax_new_symbol(preset_str); - unsigned int sf_id, bank_num, prog_num; - fluid_sfont_t *sf; - ftmax_atom_t a[5]; - - fluid_synth_get_program(self->synth, i, &sf_id, &bank_num, &prog_num); - sf = fluid_synth_get_sfont_by_id(self->synth, sf_id); - - ftmax_set_int(a, i + 1); - ftmax_set_symbol(a + 1, fluidmax_sfont_get_name(sf)); - ftmax_set_int(a + 2, bank_num); - ftmax_set_int(a + 3, prog_num); - ftmax_set_symbol(a + 4, preset_name); - outlet_anything(self->outlet, sym_channel, 5, a); - } - else - { - ftmax_atom_t a[2]; - - ftmax_set_int(a, i + 1); - ftmax_set_symbol(a + 1, sym_undefined); - outlet_anything(self->outlet, sym_channel, 2, a); - } - } - } - else if(sym == sym_gain) - { - ftmax_atom_t a; - double gain = fluid_synth_get_gain(self->synth); - - ftmax_set_float(&a, gain); - outlet_anything(self->outlet, sym_channel, 1, &a); - } - else if(sym == sym_reverb) - { - if(self->reverb != 0) - { - double level = fluid_synth_get_reverb_level(self->synth); - double room = fluid_synth_get_reverb_roomsize(self->synth); - double damping = fluid_synth_get_reverb_damp(self->synth); - double width = fluid_synth_get_reverb_width(self->synth); - ftmax_atom_t a[4]; - - ftmax_set_float(a, level); - ftmax_set_float(a + 1, room); - ftmax_set_float(a + 2, damping); - ftmax_set_float(a + 3, width); - outlet_anything(self->outlet, sym_reverb, 4, a); - } - else - { - ftmax_atom_t a; - - ftmax_set_symbol(&a, sym_off); - outlet_anything(self->outlet, sym_reverb, 1, &a); - } - } - else if(sym == sym_chorus) - { - if(self->chorus != 0) - { - double level = fluid_synth_get_chorus_level(self->synth); - double speed = fluid_synth_get_chorus_speed(self->synth); - double depth = fluid_synth_get_chorus_depth(self->synth); - int type = fluid_synth_get_chorus_type(self->synth); - int nr = fluid_synth_get_chorus_nr(self->synth); - ftmax_atom_t a[5]; - - ftmax_set_float(a, level); - ftmax_set_float(a + 1, speed); - ftmax_set_float(a + 2, depth); - ftmax_set_int(a + 3, type); - ftmax_set_int(a + 4, nr); - outlet_anything(self->outlet, sym_chorus, 5, a); - } - else - { - ftmax_atom_t a; - - ftmax_set_symbol(&a, sym_off); - outlet_anything(self->outlet, sym_chorus, 1, &a); - } - } - else if(sym == sym_polyphony) - { - int polyphony = fluid_synth_get_polyphony(self->synth); - ftmax_atom_t a; - - ftmax_set_int(&a, polyphony); - outlet_anything(self->outlet, sym_polyphony, 1, &a); - } - } - } -} - -/*************************************************************** - * - * class - * - */ -static void * -fluidmax_new(Symbol *s, short ac, Atom *at) -{ - fluidmax_t *self = (fluidmax_t *)newobject(fluidmax_class); - int polyphony = 256; - int midi_channels = 16; - - self->outlet = outlet_new(self, "anything"); - - dsp_setup((t_pxobject *)self, 0); - outlet_new(self, "signal"); - outlet_new(self, "signal"); - - self->synth = NULL; - self->settings = new_fluid_settings(); - self->reverb = 0; - self->chorus = 0; - self->mute = 0; - - if(ac > 0 && ftmax_is_number(at)) - { - polyphony = ftmax_get_number_int(at); - ac--; - at++; - } - - if(ac > 0 && ftmax_is_number(at)) - { - midi_channels = ftmax_get_number_int(at); - ac--; - at++; - } - - if(ac > 0 && ftmax_is_symbol(at)) - { - fluidmax_load((t_object *)self, NULL, 1, at); - } - - if(self->settings != NULL) - { - fluid_settings_setint(self->settings, "synth.midi-channels", midi_channels); - fluid_settings_setint(self->settings, "synth.polyphony", polyphony); - fluid_settings_setnum(self->settings, "synth.gain", 0.600000); - fluid_settings_setnum(self->settings, "synth.sample-rate", sys_getsr()); - - self->synth = new_fluid_synth(self->settings); - - if(self->synth != NULL) - { - fluid_synth_set_reverb_on(self->synth, 0); - fluid_synth_set_chorus_on(self->synth, 0); - - if(ac > 0 && ftmax_is_symbol(at)) - { - fluidmax_load((t_object *)self, NULL, ac, at); - } - - return self; - } - - delete_fluid_settings(self->settings); - } - - error("fluidsynth~: cannot create FluidSynth core"); - - return NULL; -} - -static void -fluidmax_free(t_pxobject *o) -{ - fluidmax_t *self = (fluidmax_t *)o; - - if(self->settings != NULL) - { - delete_fluid_settings(self->settings); - } - - if(self->synth != NULL) - { - delete_fluid_synth(self->synth); - } - - dsp_free(o); -} - -int -main(void) -{ - setup(&fluidmax_class, (method)fluidmax_new, (method)fluidmax_free, (short)sizeof(fluidmax_t), 0, A_GIMME, 0); - dsp_initclass(); - - addmess((method)fluidmax_dsp, "dsp", A_CANT, 0); - - addmess((method)fluidmax_version, "version", 0); - addmess((method)fluidmax_print, "print", A_GIMME, 0); - - addmess((method)fluidmax_load, "load", A_GIMME, 0); - addmess((method)fluidmax_unload, "unload", A_GIMME, 0); - addmess((method)fluidmax_reload, "reload", A_GIMME, 0); - addmess((method)fluidmax_info, "info", A_GIMME, 0); - - addmess((method)fluidmax_panic, "panic", A_GIMME, 0); - addmess((method)fluidmax_reset, "reset", A_GIMME, 0); - addmess((method)fluidmax_mute, "mute", A_GIMME, 0); - addmess((method)fluidmax_unmute, "unmute", 0); - - /*addmess((method)fluidmax_tuning_keys, "tuning-keys", A_GIMME, 0);*/ - addmess((method)fluidmax_tuning_octave, "tuning-octave", A_GIMME, 0); - addmess((method)fluidmax_tuning_select, "tuning-select", A_GIMME, 0); - addmess((method)fluidmax_tuning_reset, "tuning-reset", A_GIMME, 0); - - addmess((method)fluidmax_reverb, "reverb", A_GIMME, 0); - addmess((method)fluidmax_chorus, "chorus", A_GIMME, 0); - addmess((method)fluidmax_set_gain, "gain", A_GIMME, 0); - addmess((method)fluidmax_set_resampling_method, "resample", A_GIMME, 0); - - addmess((method)fluidmax_note, "note", A_GIMME, 0); - addmess((method)fluidmax_list, "list", A_GIMME, 0); - - addmess((method)fluidmax_control_change, "control", A_GIMME, 0); - addmess((method)fluidmax_mod, "mod", A_GIMME, 0); - - addmess((method)fluidmax_pitch_bend, "bend", A_GIMME, 0); - addmess((method)fluidmax_pitch_bend_wheel, "wheel", A_GIMME, 0); - - addmess((method)fluidmax_program_change, "program", A_GIMME, 0); - addmess((method)fluidmax_bank_select, "bank", A_GIMME, 0); - addmess((method)fluidmax_select, "select", A_GIMME, 0); - - sym_on = ftmax_new_symbol("on"); - sym_off = ftmax_new_symbol("off"); - sym_undefined = ftmax_new_symbol("undefined"); - sym_gain = ftmax_new_symbol("gain"); - sym_channels = ftmax_new_symbol("channels"); - sym_channel = ftmax_new_symbol("channel"); - sym_soundfonts = ftmax_new_symbol("soundfonts"); - sym_soundfont = ftmax_new_symbol("soundfont"); - sym_presets = ftmax_new_symbol("presets"); - sym_preset = ftmax_new_symbol("preset"); - sym_reverb = ftmax_new_symbol("reverb"); - sym_chorus = ftmax_new_symbol("chorus"); - sym_polyphony = ftmax_new_symbol("polyphony"); - sym_nearest = ftmax_new_symbol("nearest"); - sym_linear = ftmax_new_symbol("linear"); - sym_cubic = ftmax_new_symbol("cubic"); - sym_sinc = ftmax_new_symbol("sinc"); - - - fluidmax_version(NULL); - - return 0; -} diff --git a/bindings/fluidmax/fluidmax.mcp b/bindings/fluidmax/fluidmax.mcp deleted file mode 100644 index 712146c0..00000000 Binary files a/bindings/fluidmax/fluidmax.mcp and /dev/null differ diff --git a/bindings/fluidmax/fluidmax_fakefuns.c b/bindings/fluidmax/fluidmax_fakefuns.c deleted file mode 100644 index b1fa41f1..00000000 --- a/bindings/fluidmax/fluidmax_fakefuns.c +++ /dev/null @@ -1,260 +0,0 @@ -/*************************************************************************************** - * - * fluidsynth~ - * - * Fluid Synth soundfont synthesizer for Max/MSP. - * - * Fluid Synth is written by Peter Hanappe et al. - * see http://www.fluidsynth.org/ - * - * Max/MSP integration by Norbert Schnell ATR IRCAM - Centre Pompidou - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * See file COPYING.LIB for further informations on licensing terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA. - * - */ -/* - * This file contains the (mostly empty) implementation of some functions without - * which Fluidsynth wouldn't compile. - * - * The Max/MSP version of FluidSynth tries to link only with a minimum of needed - * files. Some of the linked files depend on functions that are not necessary - * and that are implemnted in files we don't want to include. So, alternate or empty - * implemntations of these functions are provided here. - * - */ -#include "ftmax.h" -#include "fluidsynth.h" -#include "fluidsynth_priv.h" -#include "fluid_settings.h" - -unsigned int -fluid_curtime() -{ - return (unsigned int)gettime(); -} - -double -fluid_utime(void) -{ - return 0.0; -} - -typedef void fluid_timer_t; -typedef int(*fluid_timer_callback_t)(void *data, unsigned int msec); - -fluid_timer_t * -new_fluid_timer(int msec, fluid_timer_callback_t callback, void *data, int new_thread, int auto_destroy) -{ - /* just call it right away */ - (*callback)(data, msec); - - return NULL; -} - -void -fluid_sys_config() -{ -} - -char * -fluid_error() -{ - return NULL; -} - -/* This code is (unelegantly) copied from fluid_sys.c since other parts of fluid_sys.c - * that we don't need here depend on many other things that we don't want here. */ -char * -fluid_strtok(char **str, char *delim) -{ - char *s, *d, *token; - char c; - - if(str == NULL || delim == NULL || !*delim) - { - FLUID_LOG(FLUID_ERR, "Null pointer"); - return NULL; - } - - s = *str; - - if(!s) - { - return NULL; /* str points to a NULL pointer? (tokenize already ended) */ - } - - /* skip delimiter chars at beginning of token */ - do - { - c = *s; - - if(!c) /* end of source string? */ - { - *str = NULL; - return NULL; - } - - for(d = delim; *d; d++) /* is source char a token char? */ - { - if(c == *d) /* token char match? */ - { - s++; /* advance to next source char */ - break; - } - } - } - while(*d); /* while token char match */ - - token = s; /* start of token found */ - - /* search for next token char or end of source string */ - for(s = s + 1; *s; s++) - { - c = *s; - - for(d = delim; *d; d++) /* is source char a token char? */ - { - if(c == *d) /* token char match? */ - { - *s = '\0'; /* overwrite token char with zero byte to terminate token */ - *str = s + 1; /* update str to point to beginning of next token */ - return token; - } - } - } - - /* we get here only if source string ended */ - *str = NULL; - return token; -} - -int -fluid_log(int level, char *fmt, ...) -{ - char buf[1024]; - - va_list args; - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - - if((level > 0) && (level < LAST_LOG_LEVEL)) - { - post("fluidsynth~ core (level %d): %s", level, buf); - } - - return -1; -} - -void -fluid_shell_settings(fluid_settings_t *settings) -{ -} - -void -fluid_audio_driver_settings(fluid_settings_t *settings) -{ - fluid_settings_register_str(settings, "audio.driver", "", 0, NULL, NULL); -} - -void -fluid_midi_driver_settings(fluid_settings_t *settings) -{ - fluid_settings_register_str(settings, "midi.driver", "", 0, NULL, NULL); -} - -int fluid_midi_event_get_type(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_type(fluid_midi_event_t *evt, int type) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_channel(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_channel(fluid_midi_event_t *evt, int chan) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_key(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_key(fluid_midi_event_t *evt, int v) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_velocity(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_velocity(fluid_midi_event_t *evt, int v) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_control(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_control(fluid_midi_event_t *evt, int v) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_value(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_value(fluid_midi_event_t *evt, int v) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_program(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_program(fluid_midi_event_t *evt, int val) -{ - return FLUID_OK; -} - -int fluid_midi_event_get_pitch(fluid_midi_event_t *evt) -{ - return 0; -} - -int fluid_midi_event_set_pitch(fluid_midi_event_t *evt, int val) -{ - return FLUID_OK; -} - - diff --git a/bindings/fluidmax/fluidsynth.jpg b/bindings/fluidmax/fluidsynth.jpg deleted file mode 100644 index e00cd875..00000000 Binary files a/bindings/fluidmax/fluidsynth.jpg and /dev/null differ diff --git a/bindings/fluidmax/fluidsynth/version.h b/bindings/fluidmax/fluidsynth/version.h deleted file mode 100644 index 7521515d..00000000 --- a/bindings/fluidmax/fluidsynth/version.h +++ /dev/null @@ -1,44 +0,0 @@ -/* FluidSynth - A Software Synthesizer - * - * Copyright (C) 2003 Peter Hanappe and others. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301, USA - */ - -#ifndef _FLUIDSYNTH_VERSION_H -#define _FLUIDSYNTH_VERSION_H - - -#ifdef __cplusplus -extern "C" { -#endif - -#define FLUIDSYNTH_VERSION "1.0.3" -#define FLUIDSYNTH_VERSION_MAJOR 1 -#define FLUIDSYNTH_VERSION_MINOR 0 -#define FLUIDSYNTH_VERSION_MICRO 3 - - -FLUIDSYNTH_API void fluid_version(int *major, int *minor, int *micro); - -FLUIDSYNTH_API char *fluid_version_str(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* _FLUIDSYNTH_VERSION_H */ diff --git a/bindings/fluidmax/fluidsynth~.help b/bindings/fluidmax/fluidsynth~.help deleted file mode 100644 index fb666672..00000000 Binary files a/bindings/fluidmax/fluidsynth~.help and /dev/null differ diff --git a/bindings/fluidmax/ftmax.h b/bindings/fluidmax/ftmax.h deleted file mode 100644 index 7be7dcb6..00000000 --- a/bindings/fluidmax/ftmax.h +++ /dev/null @@ -1,76 +0,0 @@ -/*************************************************************************************** - * - * Copyright (C) 2004 by IRCAM-Centre Georges Pompidou, Paris, France. - * Author: Norbert.Schnell@ircam.fr - * - * FTS -> MAX/MSP utilities - * - */ - -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * See file COPYING.LIB for further informations on licensing terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA. - * - */ -#ifndef _FTMAX_H_ -#define _FTMAX_H_ - -#include - -#ifndef MAGIC -#include "ext.h" -#include "z_dsp.h" -#endif - -#define ftm_malloc(s) NewPtr(s) -#define ftmax_realloc NO_realloc -#define ftmax_free(p) DisposePtr((char *)(p)) - -#define restrict - -#define M_TWOPI 6.283185308 -//#define M_PI 3.141592654 - -#define ftmax_object_t t_object -#define ftmax_dsp_object_t t_pxobject - -typedef t_atom ftmax_atom_t; -typedef t_symbol *ftmax_symbol_t; -typedef t_messlist ftmax_class_t; -typedef method ftmax_method_t; - -#define ftmax_is_int(a) ((a)->a_type == A_LONG) -#define ftmax_is_float(a) ((a)->a_type == A_FLOAT) -#define ftmax_is_number(a) ((a)->a_type == A_LONG || (a)->a_type == A_FLOAT) -#define ftmax_is_symbol(a) ((a)->a_type == A_SYM) - -#define ftmax_get_int(a) ((a)->a_w.w_long) -#define ftmax_get_float(a) ((a)->a_w.w_float) -#define ftmax_get_number_int(a) (((a)->a_type == A_LONG)? ((a)->a_w.w_long): (int)((a)->a_w.w_float)) -#define ftmax_get_number_float(a) (((a)->a_type == A_FLOAT)? (double)((a)->a_w.w_float): (double)((a)->a_w.w_long)) -#define ftmax_get_symbol(a) ((a)->a_w.w_sym) - -#define ftmax_set_int(a, v) ((a)->a_type = A_LONG, (a)->a_w.w_long = (v)) -#define ftmax_set_float(a, v) ((a)->a_type = A_FLOAT, (a)->a_w.w_float = (v)) -#define ftmax_set_symbol(a, v) ((a)->a_type = A_SYM, (a)->a_w.w_sym = (v)) - -#define ftmax_symbol_name(s) ((s)->s_name) - -#define ftmax_new_symbol(s) gensym(s) - -extern void ftmax_class_message_varargs(ftmax_class_t *cl, ftmax_symbol_t sym, void *method); - -#endif diff --git a/bindings/fluidsynth_jni/README b/bindings/fluidsynth_jni/README deleted file mode 100644 index d0f103e9..00000000 --- a/bindings/fluidsynth_jni/README +++ /dev/null @@ -1,10 +0,0 @@ - -FluidSynth_JNI --------------- - -This directory contains a VC++ project, Java classes, and some C++ -files to use FluidSynth from within Java. This project was written -rather quickly and for a specific use. Is not intended to be complete -but may be useful as a starting point for complete Java interface. - -[Peter Hanappe] diff --git a/bindings/fluidsynth_jni/fluidsynth_jni.dsp b/bindings/fluidsynth_jni/fluidsynth_jni.dsp deleted file mode 100644 index a0c1d8e3..00000000 --- a/bindings/fluidsynth_jni/fluidsynth_jni.dsp +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Developer Studio Project File - Name="fluidsynth_jni" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=fluidsynth_jni - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "fluidsynth_jni.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "fluidsynth_jni.mak" CFG="fluidsynth_jni - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "fluidsynth_jni - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "fluidsynth_jni - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "fluidsynth_jni - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLUIDSYNTH_JNI_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "include" /I "C:\Program Files\Java\j2re1.4.0_03\include" /I "C:\Program Files\Java\j2re1.4.0_03\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLUIDSYNTH_JNI_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40c /d "NDEBUG" -# ADD RSC /l 0x40c /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 fluidsynth.lib libsndfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /libpath:"lib" - -!ELSEIF "$(CFG)" == "fluidsynth_jni - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLUIDSYNTH_JNI_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "include" /I "C:\Program Files\WebGain\VCafe\Java2\include" /I "C:\Program Files\WebGain\VCafe\Java2\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FLUIDSYNTH_JNI_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x40c /d "_DEBUG" -# ADD RSC /l 0x40c /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 fluidsynth_debug.lib libsndfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"fluidsynth_jni.dll" /pdbtype:sept /libpath:"lib" - -!ENDIF - -# Begin Target - -# Name "fluidsynth_jni - Win32 Release" -# Name "fluidsynth_jni - Win32 Debug" -# Begin Source File - -SOURCE=.\src\fluidsynth_jni.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\fluidsynth_jni.h -# End Source File -# Begin Source File - -SOURCE=.\src\fluidsynth_Sample.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\fluidsynth_Sample.h -# End Source File -# Begin Source File - -SOURCE=.\src\fluidsynth_Synth.cpp -# End Source File -# Begin Source File - -SOURCE=.\src\fluidsynth_Synth.h -# End Source File -# End Target -# End Project diff --git a/bindings/fluidsynth_jni/fluidsynth_jni.dsw b/bindings/fluidsynth_jni/fluidsynth_jni.dsw deleted file mode 100644 index 85193379..00000000 --- a/bindings/fluidsynth_jni/fluidsynth_jni.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "fluidsynth_jni"=".\fluidsynth_jni.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/bindings/fluidsynth_jni/include/sndfile.h b/bindings/fluidsynth_jni/include/sndfile.h deleted file mode 100644 index 4c3d9af0..00000000 --- a/bindings/fluidsynth_jni/include/sndfile.h +++ /dev/null @@ -1,436 +0,0 @@ -/* -** Copyright (C) 1999-2003 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU Lesser General Public License as published by -** the Free Software Foundation; either version 2.1 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU Lesser General Public License for more details. -** -** You should have received a copy of the GNU Lesser General Public License -** along with this program; if not, write to the Free Software -** Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA. -*/ - -/* -** sndfile.h -- system-wide definitions -** -** API documentation is in the doc/ directory of the source code tarball -** and at http://www.zip.com.au/~erikd/libsndfile/api.html. -*/ - -#ifndef SNDFILE_H -#define SNDFILE_H - -/* This is the version 1.0.X header file. */ -#define SNDFILE_1 - -#include -#include - -/* For the Metrowerks CodeWarrior Pro Compiler (mainly MacOS) */ - -#if (defined (__MWERKS__)) -#include -#else -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* The following file types can be read and written. -** A file type would consist of a major type (ie SF_FORMAT_WAV) bitwise -** ORed with a minor type (ie SF_FORMAT_PCM). SF_FORMAT_TYPEMASK and -** SF_FORMAT_SUBMASK can be used to separate the major and minor file -** types. -*/ - -enum -{ - /* Major formats. */ - SF_FORMAT_WAV = 0x010000, /* Microsoft WAV format (little endian). */ - SF_FORMAT_AIFF = 0x020000, /* Apple/SGI AIFF format (big endian). */ - SF_FORMAT_AU = 0x030000, /* Sun/NeXT AU format (big endian). */ - SF_FORMAT_RAW = 0x040000, /* RAW PCM data. */ - SF_FORMAT_PAF = 0x050000, /* Ensoniq PARIS file format. */ - SF_FORMAT_SVX = 0x060000, /* Amiga IFF / SVX8 / SV16 format. */ - SF_FORMAT_NIST = 0x070000, /* Sphere NIST format. */ - SF_FORMAT_VOC = 0x080000, /* VOC files. */ - SF_FORMAT_IRCAM = 0x0A0000, /* Berkeley/IRCAM/CARL */ - SF_FORMAT_W64 = 0x0B0000, /* Sonic Foundry's 64 bit RIFF/WAV */ - SF_FORMAT_MAT4 = 0x0C0000, /* Matlab (tm) V4.2 / GNU Octave 2.0 */ - SF_FORMAT_MAT5 = 0x0D0000, /* Matlab (tm) V5.0 / GNU Octave 2.1 */ - SF_FORMAT_PVF = 0x0E0000, /* Portable Voice Format */ - SF_FORMAT_XI = 0x0F0000, /* Fasttracker 2 Extended Instrument */ - SF_FORMAT_HTK = 0x100000, /* HMM Tool Kit format */ - - /* Subtypes from here on. */ - - SF_FORMAT_PCM_S8 = 0x0001, /* Signed 8 bit data */ - SF_FORMAT_PCM_16 = 0x0002, /* Signed 16 bit data */ - SF_FORMAT_PCM_24 = 0x0003, /* Signed 24 bit data */ - SF_FORMAT_PCM_32 = 0x0004, /* Signed 32 bit data */ - - SF_FORMAT_PCM_U8 = 0x0005, /* Unsigned 8 bit data (WAV and RAW only) */ - - SF_FORMAT_FLOAT = 0x0006, /* 32 bit float data */ - SF_FORMAT_DOUBLE = 0x0007, /* 64 bit float data */ - - SF_FORMAT_ULAW = 0x0010, /* U-Law encoded. */ - SF_FORMAT_ALAW = 0x0011, /* A-Law encoded. */ - SF_FORMAT_IMA_ADPCM = 0x0012, /* IMA ADPCM. */ - SF_FORMAT_MS_ADPCM = 0x0013, /* Microsoft ADPCM. */ - - SF_FORMAT_GSM610 = 0x0020, /* GSM 6.10 encoding. */ - SF_FORMAT_VOX_ADPCM = 0x0021, /* OKI / Dialogix ADPCM */ - - SF_FORMAT_G721_32 = 0x0030, /* 32kbs G721 ADPCM encoding. */ - SF_FORMAT_G723_24 = 0x0031, /* 24kbs G723 ADPCM encoding. */ - SF_FORMAT_G723_40 = 0x0032, /* 40kbs G723 ADPCM encoding. */ - - SF_FORMAT_DWVW_12 = 0x0040, /* 12 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_16 = 0x0041, /* 16 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_24 = 0x0042, /* 24 bit Delta Width Variable Word encoding. */ - SF_FORMAT_DWVW_N = 0x0043, /* N bit Delta Width Variable Word encoding. */ - - SF_FORMAT_DPCM_8 = 0x0050, /* 8 bit differential PCM (XI only) */ - SF_FORMAT_DPCM_16 = 0x0051, /* 16 bit differential PCM (XI only) */ - - - /* Endian-ness options. */ - - SF_ENDIAN_FILE = 0x00000000, /* Default file endian-ness. */ - SF_ENDIAN_LITTLE = 0x10000000, /* Force little endian-ness. */ - SF_ENDIAN_BIG = 0x20000000, /* Force big endian-ness. */ - SF_ENDIAN_CPU = 0x30000000, /* Force CPU endian-ness. */ - - SF_FORMAT_SUBMASK = 0x0000FFFF, - SF_FORMAT_TYPEMASK = 0x0FFF0000, - SF_FORMAT_ENDMASK = 0x30000000 -} ; - -/* -** The following are the valid command numbers for the sf_command() -** interface. The use of these commands is documented in the file -** command.html in the doc directory of the source code distribution. -*/ - -enum -{ - SFC_GET_LIB_VERSION = 0x1000, - SFC_GET_LOG_INFO = 0x1001, - - SFC_GET_NORM_DOUBLE = 0x1010, - SFC_GET_NORM_FLOAT = 0x1011, - SFC_SET_NORM_DOUBLE = 0x1012, - SFC_SET_NORM_FLOAT = 0x1013, - - SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020, - SFC_GET_SIMPLE_FORMAT = 0x1021, - - SFC_GET_FORMAT_INFO = 0x1028, - - SFC_GET_FORMAT_MAJOR_COUNT = 0x1030, - SFC_GET_FORMAT_MAJOR = 0x1031, - SFC_GET_FORMAT_SUBTYPE_COUNT = 0x1032, - SFC_GET_FORMAT_SUBTYPE = 0x1033, - - SFC_CALC_SIGNAL_MAX = 0x1040, - SFC_CALC_NORM_SIGNAL_MAX = 0x1041, - SFC_CALC_MAX_ALL_CHANNELS = 0x1042, - SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043, - - SFC_SET_ADD_PEAK_CHUNK = 0x1050, - - SFC_UPDATE_HEADER_NOW = 0x1060, - SFC_SET_UPDATE_HEADER_AUTO = 0x1061, - - SFC_FILE_TRUNCATE = 0x1080, - - SFC_SET_RAW_START_OFFSET = 0x1090, - - SFC_SET_DITHER_ON_WRITE = 0x10A0, - SFC_SET_DITHER_ON_READ = 0x10A1, - - SFC_GET_DITHER_INFO_COUNT = 0x10A2, - SFC_GET_DITHER_INFO = 0x10A3, - - SFC_GET_EMBED_FILE_INFO = 0x10B0, - - /* Following commands for testing only. */ - SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001, - - /* - ** SFC_SET_ADD_* values are deprecated and will disappear at some - ** time in the future. They are guaranteed to be here up to and - ** including version 1.0.8 to avoid breakage of existng software. - ** They currently do nothing and will continue to do nothing. - */ - SFC_SET_ADD_DITHER_ON_WRITE = 0x1070, - SFC_SET_ADD_DITHER_ON_READ = 0x1071 -} ; - - -/* -** String types that can be set and read from files. Not all file types -** support this and even the file types which support one, may not support -** all string types. -*/ - -enum -{ - SF_STR_TITLE = 0x01, - SF_STR_COPYRIGHT = 0x02, - SF_STR_SOFTWARE = 0x03, - SF_STR_ARTIST = 0x04, - SF_STR_COMMENT = 0x05, - SF_STR_DATE = 0x06 -} ; - -enum -{ - /* True and false */ - SF_FALSE = 0, - SF_TRUE = 1, - - /* Modes for opening files. */ - SFM_READ = 0x10, - SFM_WRITE = 0x20, - SFM_RDWR = 0x30 -} ; - -/* Pubic error values. These are guaranteed to remain unchanged for the duration -** of the library major version number. -** There are also a large number of private error numbers which are internal to -** the library which can change at any time. -*/ - -enum -{ - SF_ERR_NO_ERROR = 0, - SF_ERR_UNRECOGNISED_FORMAT = 1, - SF_ERR_SYSTEM = 2 -} ; - -/* A SNDFILE* pointer can be passed around much like stdio.h's FILE* pointer. */ - -typedef void SNDFILE ; - -typedef __int64 sf_count_t ; - -/* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in. -** On write, the SF_INFO structure is filled in by the user and passed into -** sf_open_write (). -*/ - -struct SF_INFO -{ - sf_count_t frames ; /* Used to be called samples. Changed to avoid confusion. */ - int samplerate ; - int channels ; - int format ; - int sections ; - int seekable ; -} ; - -typedef struct SF_INFO SF_INFO ; - -/* The SF_FORMAT_INFO struct is used to retrieve information about the sound -** file formats libsndfile supports using the sf_command () interface. -** -** Using this interface will allow applications to support new file formats -** and encoding types when libsndfile is upgraded, without requiring -** re-compilation of the application. -** -** Please consult the libsndfile documentation (particularly the information -** on the sf_command () interface) for examples of its use. -*/ - -typedef struct -{ - int format ; - const char *name ; - const char *extension ; -} SF_FORMAT_INFO ; - -/* -** Enums and typedefs for adding dither on read and write. -** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE -** and SFC_SET_DITHER_ON_READ. -*/ - -enum -{ - SFD_DEFAULT_LEVEL = 0, - SFD_CUSTOM_LEVEL = 0x40000000, - - SFD_NO_DITHER = 500, - SFD_WHITE = 501, - SFD_TRIANGULAR_PDF = 502 -} ; - -typedef struct -{ - int type ; - double level ; - const char *name ; -} SF_DITHER_INFO ; - -/* Struct used to retrieve information about a file embedded within a -** larger file. See SF_GET_EMBED_FILE_INFO. -*/ - -typedef struct -{ - sf_count_t offset ; - sf_count_t length ; -} SF_EMBED_FILE_INFO ; - - -/* Open the specified file for read, write or both. On error, this will -** return a NULL pointer. To find the error number, pass a NULL SNDFILE -** to sf_perror () or sf_error_str (). -** All calls to sf_open() should be matched with a call to sf_close(). -*/ - -SNDFILE *sf_open(const char *path, int mode, SF_INFO *sfinfo) ; - -/* Use the existing file descriptor to create a SNDFILE object. If close_desc -** is TRUE, the file descriptor will be closed when sf_close() is called. If -** it is FALSE, the descritor will not be closed. -** When passed a descriptor like this, the library will assume that the start -** of file header is at the current file offset. This allows sound files within -** larger container files to be read and/or written. -** On error, this will return a NULL pointer. To find the error number, pass a -** NULL SNDFILE to sf_perror () or sf_error_str (). -** All calls to sf_open_fd() should be matched with a call to sf_close(). - -*/ - -SNDFILE *sf_open_fd(int fd, int mode, SF_INFO *sfinfo, int close_desc) ; - -/* sf_error () returns a error number which can be translated to a text -** string using sf_error_number(). -*/ - -int sf_error(SNDFILE *sndfile) ; - -/* sf_strerror () returns to the caller a pointer to the current error message for -** the given SNDFILE. -*/ - -const char *sf_strerror(SNDFILE *sndfile) ; - -/* sf_error_number () allows the retrieval of the error string for each internal -** error number. -** -*/ - -const char *sf_error_number(int errnum) ; - -/* The following three error functions are deprecated but they will remain in the -** library for the forseeable future. The function sf_strerror() should be used -** in their place. -*/ - -int sf_perror(SNDFILE *sndfile) ; -int sf_error_str(SNDFILE *sndfile, char *str, size_t len) ; - - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_command(SNDFILE *sndfile, int command, void *data, int datasize) ; - -/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */ - -int sf_format_check(const SF_INFO *info) ; - -/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses -** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as -** stdio.h function fseek (). -** An offset of zero with whence set to SEEK_SET will position the -** read / write pointer to the first data sample. -** On success sf_seek returns the current position in (multi-channel) -** samples from the start of the file. -** Please see the libsndfile documentation for moving the read pointer -** separately from the write pointer on files open in mode SFM_RDWR. -** On error all of these functions return -1. -*/ - -sf_count_t sf_seek(SNDFILE *sndfile, sf_count_t frames, int whence) ; - -/* Functions for retrieving and setting string data within sound files. -** Not all file types support this features; AIFF and WAV do. For both -** functions, the str_type parameter must be one of the SF_STR_* values -** defined above. -** On error, sf_set_string() returns non-zero while sf_get_string() -** returns NULL. -*/ - -int sf_set_string(SNDFILE *sndfile, int str_type, const char *str) ; - -const char *sf_get_string(SNDFILE *sndfile, int str_type) ; - -/* Functions for reading/writing the waveform data of a sound file. -*/ - -sf_count_t sf_read_raw(SNDFILE *sndfile, void *ptr, sf_count_t bytes) ; -sf_count_t sf_write_raw(SNDFILE *sndfile, void *ptr, sf_count_t bytes) ; - -/* Functions for reading and writing the data chunk in terms of frames. -** The number of items actually read/written = frames * number of channels. -** sf_xxxx_raw read/writes the raw data bytes from/to the file -** sf_xxxx_short passes data in the native short format -** sf_xxxx_int passes data in the native int format -** sf_xxxx_float passes data in the native float format -** sf_xxxx_double passes data in the native double format -** All of these read/write function return number of frames read/written. -*/ - -sf_count_t sf_readf_short(SNDFILE *sndfile, short *ptr, sf_count_t frames) ; -sf_count_t sf_writef_short(SNDFILE *sndfile, short *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_int(SNDFILE *sndfile, int *ptr, sf_count_t frames) ; -sf_count_t sf_writef_int(SNDFILE *sndfile, int *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_float(SNDFILE *sndfile, float *ptr, sf_count_t frames) ; -sf_count_t sf_writef_float(SNDFILE *sndfile, float *ptr, sf_count_t frames) ; - -sf_count_t sf_readf_double(SNDFILE *sndfile, double *ptr, sf_count_t frames) ; -sf_count_t sf_writef_double(SNDFILE *sndfile, double *ptr, sf_count_t frames) ; - -/* Functions for reading and writing the data chunk in terms of items. -** Otherwise similar to above. -** All of these read/write function return number of items read/written. -*/ - -sf_count_t sf_read_short(SNDFILE *sndfile, short *ptr, sf_count_t items) ; -sf_count_t sf_write_short(SNDFILE *sndfile, short *ptr, sf_count_t items) ; - -sf_count_t sf_read_int(SNDFILE *sndfile, int *ptr, sf_count_t items) ; -sf_count_t sf_write_int(SNDFILE *sndfile, int *ptr, sf_count_t items) ; - -sf_count_t sf_read_float(SNDFILE *sndfile, float *ptr, sf_count_t items) ; -sf_count_t sf_write_float(SNDFILE *sndfile, float *ptr, sf_count_t items) ; - -sf_count_t sf_read_double(SNDFILE *sndfile, double *ptr, sf_count_t items) ; -sf_count_t sf_write_double(SNDFILE *sndfile, double *ptr, sf_count_t items) ; - -/* Close the SNDFILE and clean up all memory allocations associated with this -** file. -** Returns 0 on success, or an error number. -*/ - -int sf_close(SNDFILE *sndfile) ; - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* SNDFILE_H */ diff --git a/bindings/fluidsynth_jni/java/fluidsynth/FluidException.java b/bindings/fluidsynth_jni/java/fluidsynth/FluidException.java deleted file mode 100644 index 6a7bf518..00000000 --- a/bindings/fluidsynth_jni/java/fluidsynth/FluidException.java +++ /dev/null @@ -1,8 +0,0 @@ -package fluidsynth; - -public class FluidException extends Exception -{ - public FluidException(String what) { - super(what); - } -} diff --git a/bindings/fluidsynth_jni/java/fluidsynth/Sample.java b/bindings/fluidsynth_jni/java/fluidsynth/Sample.java deleted file mode 100644 index d0e5bca7..00000000 --- a/bindings/fluidsynth_jni/java/fluidsynth/Sample.java +++ /dev/null @@ -1,39 +0,0 @@ -package fluidsynth; - -public class Sample -{ - protected int sampleNum = -1; - protected int rootkey; - protected String filename; - - public Sample(String filename, int rootkey) throws FluidException { - sampleNum = newSample(filename, rootkey); - if (sampleNum < 0) { - throw new FluidException("Failed to load the sample (err=" + sampleNum + ")"); - } - this.filename = filename; - this.rootkey = rootkey; - } - - protected void finalize() { - if (sampleNum >= 0) { - deleteSample(sampleNum); - sampleNum = -1; - } - } - - public int getRootKey() { - return rootkey; - } - - public String getFileName() { - return filename; - } - - int getSampleNum() { - return sampleNum; - } - - protected native int newSample(String filename, int rootkey); - protected native void deleteSample(int sampleNum); -} diff --git a/bindings/fluidsynth_jni/java/fluidsynth/Synth.java b/bindings/fluidsynth_jni/java/fluidsynth/Synth.java deleted file mode 100644 index 50a87370..00000000 --- a/bindings/fluidsynth_jni/java/fluidsynth/Synth.java +++ /dev/null @@ -1,49 +0,0 @@ -package fluidsynth; - -public class Synth -{ - protected int synth = -1; - - static { - System.loadLibrary("fluidsynth_jni"); - } - - public Synth() throws FluidException { - synth = newSynth(); - if (synth < 0) { - throw new FluidException("Low-level initialization of the synthesizer failed"); - } - } - - protected void finalize() { - if (synth >= 0) { - deleteSynth(synth); - synth = -1; - } - } - - public void add(Sample sample, int bank, int preset, int lokey, int hikey) throws FluidException { - if (add(synth, sample.getSampleNum(), bank, preset, lokey, hikey) != 0) { - throw new FluidException("Failed to add the sample"); - } - } - - public void remove(Sample sample, int bank, int preset) throws FluidException { - if (remove(synth, sample.getSampleNum(), bank, preset) != 0) { - throw new FluidException("Failed to remove the sample"); - } - } - - public void loadSoundFont(String filename) throws FluidException { - if (loadSoundFont(synth, filename) != 0) { - throw new FluidException("Failed to load the SoundFont"); - } - } - - protected native int newSynth(); - protected native void deleteSynth(int synth); - protected native int add(int synth, int sample, int bank, - int preset, int lokey, int hikey); - protected native int remove(int synth, int sample, int bank, int preset); - protected native int loadSoundFont(int synth, String filename); -} diff --git a/bindings/fluidsynth_jni/java/fluidsynth/Test.java b/bindings/fluidsynth_jni/java/fluidsynth/Test.java deleted file mode 100644 index e1a8a517..00000000 --- a/bindings/fluidsynth_jni/java/fluidsynth/Test.java +++ /dev/null @@ -1,36 +0,0 @@ -package fluidsynth; -import java.io.*; - -public class Test -{ - static public void main(String[] argv) throws Exception { - try{ - Synth synth = new Synth(); - synth.add(new Sample("[accord guitar].wav", 55), 0, 0, 50,58); - - synth.add(new Sample("cabrel.wav_14.wav", 60), 0, 0, 59,59); - synth.add(new Sample("cabrel.wav_16.wav", 60), 0, 0, 60,60); - synth.add(new Sample("cabrel.wav_15.wav", 62), 0, 0, 61, 61); - synth.add(new Sample("cabrel.wav_17.wav", 62), 0, 0, 62, 62); - synth.add(new Sample("[TIR].wav", 64), 0, 0, 63,63); - synth.add(new Sample("cabrel.wav_18.wav", 64), 0, 0, 64,64); - synth.add(new Sample("cabrel.wav_5.wav", 64), 0, 0, 65,65); - synth.add(new Sample("cabrel.wav_7.wav", 64), 0, 0, 66,66); - synth.add(new Sample("cabrel.wav_8.wav", 64), 0, 0, 67,67); - synth.add(new Sample("cabrel.wav_19.wav", 64), 0, 0, 68,68); - synth.add(new Sample("cabrel.wav_9.wav", 65), 0, 0, 69,69); - synth.add(new Sample("cabrel.wav_10.wav", 67), 0, 0, 70, 70); - synth.add(new Sample("cabrel.wav_11.wav", 69), 0, 0, 71, 71); - - - waitCR(); - }catch(Exception e){System.out.println(e);waitCR();} - } - - public static void waitCR() { - System.out.println ("Appuyez sur CR ..."); - try {System.in.read();} - catch (IOException e) {System.out.println(e);} - } -} - diff --git a/bindings/fluidsynth_jni/lib/libsndfile.lib b/bindings/fluidsynth_jni/lib/libsndfile.lib deleted file mode 100644 index d627f8a3..00000000 Binary files a/bindings/fluidsynth_jni/lib/libsndfile.lib and /dev/null differ diff --git a/bindings/fluidsynth_jni/src/fluidsynth_Sample.cpp b/bindings/fluidsynth_jni/src/fluidsynth_Sample.cpp deleted file mode 100644 index a81f1abe..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_Sample.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "fluidsynth_Sample.h" -#include "fluidsynth_jni.h" - -JNIEXPORT jint JNICALL -Java_fluidsynth_Sample_newSample(JNIEnv *env, jobject obj, jstring filename, jint rootkey) -{ - const char *cfilename = env->GetStringUTFChars(filename, 0); - int err = fluid_jni_new_sample(cfilename, rootkey); - env->ReleaseStringUTFChars(filename, cfilename); - return err; -} - -JNIEXPORT void JNICALL -Java_fluidsynth_Sample_deleteSample(JNIEnv *env, jobject obj, jint samplenum) -{ - fluid_jni_delete_sample(samplenum); -} diff --git a/bindings/fluidsynth_jni/src/fluidsynth_Sample.h b/bindings/fluidsynth_jni/src/fluidsynth_Sample.h deleted file mode 100644 index fab30005..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_Sample.h +++ /dev/null @@ -1,29 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class fluidsynth_Sample */ - -#ifndef _Included_fluidsynth_Sample -#define _Included_fluidsynth_Sample -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: fluidsynth_Sample - * Method: newSample - * Signature: (Ljava/lang/String;I)I - */ -JNIEXPORT jint JNICALL Java_fluidsynth_Sample_newSample -(JNIEnv *, jobject, jstring, jint); - -/* - * Class: fluidsynth_Sample - * Method: deleteSample - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_fluidsynth_Sample_deleteSample -(JNIEnv *, jobject, jint); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/bindings/fluidsynth_jni/src/fluidsynth_Synth.cpp b/bindings/fluidsynth_jni/src/fluidsynth_Synth.cpp deleted file mode 100644 index a1e70ef0..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_Synth.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "fluidsynth_Synth.h" -#include "fluidsynth_jni.h" - -JNIEXPORT jint JNICALL -Java_fluidsynth_Synth_newSynth(JNIEnv *env, jobject obj) -{ - return fluid_jni_new_synth(); -} - -JNIEXPORT void JNICALL -Java_fluidsynth_Synth_deleteSynth(JNIEnv *env, jobject obj, jint synth) -{ - fluid_jni_delete_synth(synth); -} - -JNIEXPORT jint JNICALL -Java_fluidsynth_Synth_add(JNIEnv *env, jobject obj, jint synth, jint samplenum, - jint bank, jint preset, jint lokey, jint hikey) -{ - return fluid_jni_add(samplenum, bank, preset, lokey, hikey); -} - -JNIEXPORT jint JNICALL -Java_fluidsynth_Synth_remove(JNIEnv *env, jobject obj, jint synth, - jint samplenum, jint bank, jint preset) -{ - return fluid_jni_remove(samplenum, bank, preset); -} - -JNIEXPORT jint JNICALL -Java_fluidsynth_Synth_loadSoundFont(JNIEnv *env, jobject obj, jint synth, jstring filename) -{ - const char *cfilename = env->GetStringUTFChars(filename, 0); - int err = fluid_jni_sfload(cfilename); - env->ReleaseStringUTFChars(filename, cfilename); - return err; -} - diff --git a/bindings/fluidsynth_jni/src/fluidsynth_Synth.h b/bindings/fluidsynth_jni/src/fluidsynth_Synth.h deleted file mode 100644 index a586cc27..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_Synth.h +++ /dev/null @@ -1,48 +0,0 @@ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class fluidsynth_Synth */ - -#ifndef _Included_fluidsynth_Synth -#define _Included_fluidsynth_Synth -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: fluidsynth_Synth - * Method: newSynth - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_fluidsynth_Synth_newSynth -(JNIEnv *, jobject); - -/* - * Class: fluidsynth_Synth - * Method: deleteSynth - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_fluidsynth_Synth_deleteSynth -(JNIEnv *, jobject, jint); - -/* - * Class: fluidsynth_Synth - * Method: add - * Signature: (IIIIII)I - */ -JNIEXPORT jint JNICALL Java_fluidsynth_Synth_add -(JNIEnv *, jobject, jint, jint, jint, jint, jint, jint); - -/* - * Class: fluidsynth_Synth - * Method: remove - * Signature: (IIII)I - */ -JNIEXPORT jint JNICALL Java_fluidsynth_Synth_remove -(JNIEnv *, jobject, jint, jint, jint, jint); - -JNIEXPORT jint JNICALL Java_fluidsynth_Synth_loadSoundFont -(JNIEnv *env, jobject obj, jint synth, jstring filename); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/bindings/fluidsynth_jni/src/fluidsynth_jni.cpp b/bindings/fluidsynth_jni/src/fluidsynth_jni.cpp deleted file mode 100644 index 9789426a..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_jni.cpp +++ /dev/null @@ -1,334 +0,0 @@ -#include -#include "fluidsynth_jni.h" - -const int fluid_jni_maxsamples = 1024; - -static int _initialized = 0; -static fluid_settings_t *_settings = 0; -static fluid_synth_t *_synth = 0; -static fluid_audio_driver_t *_adriver = 0; -static fluid_midi_driver_t *_mdriver = 0; -static fluid_sfont_t *_sfloader = 0; -static fluid_sample_t *_sample[fluid_jni_maxsamples]; - - - -void fluid_jni_init() -{ - if(_initialized == 0) - { - _initialized++; - - for(int i = 0; i < fluid_jni_maxsamples; i++) - { - _sample[i] = 0; - } - } -} - -int fluid_jni_new_synth() -{ - if(_synth != 0) - { - return -1; - } - - fluid_jni_init(); - - _settings = new_fluid_settings(); - - if(_settings == 0) - { - goto error_recovery; - } - - fluid_settings_setstr(_settings, "midi.driver", "midishare"); - - _synth = new_fluid_synth(_settings); - - if(_synth == 0) - { - goto error_recovery; - } - - _adriver = new_fluid_audio_driver(_settings, _synth); - - if(_adriver == 0) - { - goto error_recovery; - } - - _mdriver = new_fluid_midi_driver(_settings, fluid_synth_handle_midi_event, _synth); - - if(_mdriver == 0) - { - goto error_recovery; - } - - - _sfloader = fluid_ramsfont_create_sfont(); - - if(_sfloader == 0) - { - goto error_recovery; - } - - fluid_ramsfont_set_name((fluid_ramsfont_t *) _sfloader->data, "Tada"); - - fluid_synth_add_sfont(_synth, _sfloader); - - return 0; - -error_recovery: - fluid_jni_delete_synth(0); - return -1; -} - - -int fluid_jni_delete_synth(int num) -{ - if(_mdriver) - { - - delete_fluid_midi_driver(_mdriver); - - _mdriver = 0; - } - - if(_adriver) - { - - delete_fluid_audio_driver(_adriver); - - _adriver = 0; - } - - if(_synth) - { - - delete_fluid_synth(_synth); - - _synth = 0; - } - - if(_settings) - { - delete_fluid_settings(_settings); - _settings = 0; - } - - return 0; -} - -int fluid_jni_sfload(const char *filename) -{ - if(_synth == 0) - { - return -1; - } - - fluid_synth_sfload(_synth, filename, 1); - return 0; -} - -int fluid_jni_add(int samplenum, int bank, int preset, int lokey, int hikey) -{ - if(_synth == 0) - { - return -1; - } - - if(_sfloader == 0) - { - return -1; - } - - fluid_sample_t *sample = fluid_jni_get_sample(samplenum); - - if(sample == 0) - { - return -2; - } - - - - if(fluid_ramsfont_add_izone((fluid_ramsfont_t *) _sfloader->data, bank, - preset, sample, lokey, hikey) != 0) - { - - - return -3; - } - - - - fluid_synth_program_select(_synth, 0, _sfloader->id, bank, preset); - return 0; -} - -int fluid_jni_remove(int samplenum, int bank, int preset) -{ - if(_synth == 0) - { - return -1; - } - - fluid_sample_t *sample = fluid_jni_get_sample(samplenum); - - if(sample == 0) - { - return -2; - } - - if(fluid_ramsfont_remove_izone((fluid_ramsfont_t *) _sfloader->data, - bank, preset, sample) != 0) - { - return -3; - } - - - return 0; -} - -int fluid_jni_get_sample_num() -{ - for(int i = 0; i < fluid_jni_maxsamples; i++) - { - if(_sample[i] == 0) - { - return i; - } - } - - return -1; -} - -int fluid_jni_new_sample(const char *filename, int rootkey) -{ - SF_INFO sfinfo; - SNDFILE *sndfile = 0; - fluid_sample_t *sample = 0; - short *data = 0; - sf_count_t count; - int err; - - int num = fluid_jni_get_sample_num(); - - if(num < 0) - { - return -1; - } - - - - - sndfile = sf_open(filename, SFM_READ, &sfinfo) ; - - if(sndfile == 0) - { - return -2; - } - - //printf("fluid_jni_new_sample: channels=%i, srate=%i, frames=%i\n", -// sfinfo.channels, sfinfo.samplerate, sfinfo.frames); - - - if(sfinfo.channels != 1) - { - err = -3; - goto error_recovery; - } - - if(sfinfo.samplerate != 44100) - { - err = -4; - goto error_recovery; - } - - sample = new_fluid_ramsample(); - - if(sample == 0) - { - err = -5; - goto error_recovery; - } - - data = new short[sfinfo.frames]; - - if(data == 0) - { - err = -6; - goto error_recovery; - } - -// printf("fluid_jni_new_sample 2\n"); - - count = sf_readf_short(sndfile, data, sfinfo.frames); - - if(count != sfinfo.frames) - { - err = -7; - goto error_recovery; - } - - //printf("fluid_jni_new_sample 3\n"); - - if(fluid_sample_set_sound_data(sample, data, sfinfo.frames, 1, rootkey) != 0) - { - err = -8; - goto error_recovery; - } - - //printf("fluid_jni_new_sample 4: sample=%p\n", sample); - - _sample[num] = sample; - - sf_close(sndfile); - delete data; - - return num; - -error_recovery: - - if(sndfile) - { - sf_close(sndfile); - } - - if(sample) - { - delete_fluid_ramsample(sample); - } - - if(data) - { - delete data; - } - - return err; -} - -fluid_sample_t *fluid_jni_get_sample(int num) -{ - if((num >= 0) - && (num < fluid_jni_maxsamples) - && (_sample[num] != 0)) - { - return _sample[num]; - } - - return 0; -} - -int fluid_jni_delete_sample(int num) -{ - if((num >= 0) - && (num < fluid_jni_maxsamples) - && (_sample[num] != 0)) - { - delete_fluid_ramsample(_sample[num]); - _sample[num] = 0; - } - - return 0; -} diff --git a/bindings/fluidsynth_jni/src/fluidsynth_jni.h b/bindings/fluidsynth_jni/src/fluidsynth_jni.h deleted file mode 100644 index 28b94e01..00000000 --- a/bindings/fluidsynth_jni/src/fluidsynth_jni.h +++ /dev/null @@ -1,18 +0,0 @@ - -#ifndef _FLUID_JNI_H -#define _FLUID_JNI_H - -#include - -int fluid_jni_new_synth(void); -int fluid_jni_delete_synth(int num); -int fluid_jni_add(int samplenum, int bank, int preset, int lokey, int hikey); -int fluid_jni_remove(int samplenum, int bank, int preset); -int fluid_jni_sfload(const char *filename); - -int fluid_jni_new_sample(const char *filename, int rootkey); -int fluid_jni_delete_sample(int num); -int fluid_jni_get_sample_num(void); -fluid_sample_t *fluid_jni_get_sample(int num); - -#endif /* _FLUID_JNI_H */