Initial Commit

This commit is contained in:
Jeff Farrand
2014-01-12 09:48:16 -06:00
commit 5b1ff23e0f
759 changed files with 319871 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES = \
lib_src/eas_chorus.c \
lib_src/eas_chorusdata.c \
lib_src/eas_data.c \
lib_src/eas_dlssynth.c \
lib_src/eas_flog.c \
lib_src/eas_ima_tables.c \
lib_src/eas_imaadpcm.c \
lib_src/eas_imelody.c \
lib_src/eas_imelodydata.c \
lib_src/eas_math.c \
lib_src/eas_mdls.c \
lib_src/eas_midi.c \
lib_src/eas_mididata.c \
lib_src/eas_mixbuf.c \
lib_src/eas_mixer.c \
lib_src/eas_ota.c \
lib_src/eas_otadata.c \
lib_src/eas_pan.c \
lib_src/eas_pcm.c \
lib_src/eas_pcmdata.c \
lib_src/eas_public.c \
lib_src/eas_reverb.c \
lib_src/eas_reverbdata.c \
lib_src/eas_rtttl.c \
lib_src/eas_rtttldata.c \
lib_src/eas_smf.c \
lib_src/eas_smfdata.c \
lib_src/eas_voicemgt.c \
lib_src/eas_wtengine.c \
lib_src/eas_wtsynth.c \
lib_src/eas_xmf.c \
lib_src/eas_xmfdata.c \
lib_src/wt_22khz.c \
lib_src/jet.c \
host_src/eas_config.c \
host_src/eas_hostmm.c \
host_src/eas_main.c \
host_src/eas_report.c \
host_src/eas_wave.c
# not using these modules
# lib_src/eas_wavefile.c \
# lib_src/eas_wavefiledata.c \
LOCAL_CFLAGS+= -O2 -D UNIFIED_DEBUG_MESSAGES -D EAS_WT_SYNTH \
-D _IMELODY_PARSER -D _RTTTL_PARSER -D _OTA_PARSER \
-D _XMF_PARSER -D NUM_OUTPUT_CHANNELS=2 \
-D _SAMPLE_RATE_22050 -D MAX_SYNTH_VOICES=64 \
-D _8_BIT_SAMPLES -D _FILTER_ENABLED \
-D DLS_SYNTHESIZER \
-D _REVERB_ENABLED
# not using these options
# -D _WAVE_PARSER
# -D _IMA_DECODER (needed for IMA-ADPCM wave files)
# -D _CHORUS_ENABLED
LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/host_src \
$(LOCAL_PATH)/lib_src
LOCAL_ARM_MODE := arm
LOCAL_MODULE := libsonivox
LOCAL_COPY_HEADERS_TO := libsonivox
LOCAL_COPY_HEADERS := \
host_src/eas.h \
host_src/eas_types.h \
host_src/eas_reverb.h \
host_src/jet.h
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES+= \
lib_src/ARM-E_filter_gnu.s \
lib_src/ARM-E_interpolate_loop_gnu.s \
lib_src/ARM-E_interpolate_noloop_gnu.s \
lib_src/ARM-E_mastergain_gnu.s \
lib_src/ARM-E_voice_gain_gnu.s
asm_flags := \
-I $(LOCAL_PATH)/lib_src \
--defsym SAMPLE_RATE_22050=1 \
--defsym STEREO_OUTPUT=1 \
--defsym FILTER_ENABLED=1 \
--defsym SAMPLES_8_BIT=1
LOCAL_CFLAGS+= -D NATIVE_EAS_KERNEL \
$(foreach f,$(asm_flags),-Wa,"$(f)")
LOCAL_COPY_HEADERS += lib_src/ARM_synth_constants_gnu.inc
endif
LOCAL_SHARED_LIBRARIES := \
libutils libcutils
LOCAL_LDLIBS := -lpthread
include $(BUILD_SHARED_LIBRARY)

Binary file not shown.

View File

@@ -0,0 +1,25 @@
#
# Auto-generated sample makefile
#
# This makefile is intended for use with GNU make.
# Set the paths to the tools (CC, AR, LD, etc.)
#
vpath %.c host_src
CC = C:\Program Files\GNUARM\bin\arm-elf-gcc.exe
AS = C:\Program Files\GNUARM\bin\arm-elf-as.exe
LD = C:\Program Files\GNUARM\bin\arm-elf-gcc.exe
AR = C:\Program Files\GNUARM\bin\arm-elf-ar.exe
%.o: %.c
$(CC) -c -O2 -o $@ -I host_src -D UNIFIED_DEBUG_MESSAGES -D EAS_WT_SYNTH -D _IMELODY_PARSER -D _RTTTL_PARSER -D _OTA_PARSER -D _XMF_PARSER -D _WAVE_PARSER -D _REVERB_ENABLED -D _CHORUS_ENABLED -D MMAPI_SUPPORT -D JET_INTERFACE $<
%.o: %.s
$(AS) -o $@ -EL -mcpu=arm946e-s -mfpu=softfpa -I lib_src --defsym CHECK_STACK=0 --defsym REVERB=0 --defsym CHORUS=0 --defsym STEREO_OUTPUT=1 --defsym SAMPLE_RATE_22050=1 --defsym SAMPLES_8_BIT=1 --defsym FILTER_ENABLED=1 $<
OBJS = eas_main.o eas_report.o eas_wave.o eas_hostmm.o eas_config.o
arm-wt-22k: $(OBJS)
$(LD) -o $@ $(OBJS) libarm-wt-22k.a -lm

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
/*----------------------------------------------------------------------------
*
* File:
* host_src\eas_build.h
*
* Contents and purpose:
* This file contains the build configuration for this
* build. The buildGUIDStr is a GUID created during
* the build process and is guaranteed to be unique
* for each build.
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file was autogenerated by buildid.exe
*----------------------------------------------------------------------------
*/
#ifndef _GUID_1feda229b9a845e996f473c0a80e7220_
#define _GUID_1feda229b9a845e996f473c0a80e7220_
#define _BUILD_VERSION_ "1feda229-b9a8-45e9-96f4-73c0a80e7220"
#define _BUILD_TIME_ 0x4743badd
#endif /* _GUID_1feda229b9a845e996f473c0a80e7220_ */

View File

@@ -0,0 +1,53 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_chorus.h
*
* Contents and purpose:
* Contains parameter enumerations for the Chorus effect
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 309 $
* $Date: 2006-09-12 18:52:45 -0700 (Tue, 12 Sep 2006) $
*----------------------------------------------------------------------------
*/
#ifndef EAS_CHORUS_H
#define EAS_CHORUS_H
/* enumerated parameter settings for Chorus effect */
typedef enum
{
EAS_PARAM_CHORUS_BYPASS,
EAS_PARAM_CHORUS_PRESET,
EAS_PARAM_CHORUS_RATE,
EAS_PARAM_CHORUS_DEPTH,
EAS_PARAM_CHORUS_LEVEL
} E_CHORUS_PARAMS;
typedef enum
{
EAS_PARAM_CHORUS_PRESET1,
EAS_PARAM_CHORUS_PRESET2,
EAS_PARAM_CHORUS_PRESET3,
EAS_PARAM_CHORUS_PRESET4
} E_CHORUS_PRESETS;
#endif

View File

@@ -0,0 +1,619 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_config.c
*
* Contents and purpose:
* This file contains the Configuration Module interface (CM). The CM
* is a module compiled external to the library that sets the configuration
* for this build. It allows the library to find optional components and
* links to static memory allocations (when used in a static configuration).
*
* DO NOT MODIFY THIS FILE!
*
* NOTE: This module is not intended to be modified by the customer. It
* needs to be included in the build process with the correct configuration
* defines (see the library documentation for information on how to configure
* the library).
*
* Copyright Sonic Network Inc. 2004-2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 796 $
* $Date: 2007-08-01 00:15:25 -0700 (Wed, 01 Aug 2007) $
*----------------------------------------------------------------------------
*/
#include "eas.h"
#include "eas_config.h"
#ifdef _MFI_PARSER
/*----------------------------------------------------------------------------
* Vendor/Device ID for MFi Extensions
*
* Define the preprocessor symbols to establish the vendor ID and
* device ID for the MFi PCM/ADPCM extensions.
*----------------------------------------------------------------------------
*/
const EAS_U8 eas_MFIVendorIDMSB = (MFI_VENDOR_ID >> 8) & 0xff;
const EAS_U8 eas_MFIVendorIDLSB = MFI_VENDOR_ID & 0xff;
const EAS_U8 eas_MFIDeviceID = MFI_DEVICE_ID;
#endif
/*----------------------------------------------------------------------------
*
* parserModules
*
* This structure is used by the EAS library to locate file parsing
* modules.
*----------------------------------------------------------------------------
*/
/* define the external file parsers */
extern EAS_VOID_PTR EAS_SMF_Parser;
#ifdef _XMF_PARSER
extern EAS_VOID_PTR EAS_XMF_Parser;
#endif
#ifdef _SMAF_PARSER
extern EAS_VOID_PTR EAS_SMAF_Parser;
#endif
#ifdef _WAVE_PARSER
extern EAS_VOID_PTR EAS_Wave_Parser;
#endif
#ifdef _OTA_PARSER
extern EAS_VOID_PTR EAS_OTA_Parser;
#endif
#ifdef _IMELODY_PARSER
extern EAS_VOID_PTR EAS_iMelody_Parser;
#endif
#ifdef _RTTTL_PARSER
extern EAS_VOID_PTR EAS_RTTTL_Parser;
#endif
#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
extern EAS_VOID_PTR EAS_CMF_Parser;
#endif
/* initalize pointers to parser interfaces */
/*lint -e{605} not pretty, but it works */
EAS_VOID_PTR const parserModules[] =
{
&EAS_SMF_Parser,
#ifdef _XMF_PARSER
&EAS_XMF_Parser,
#endif
#ifdef _WAVE_PARSER
&EAS_Wave_Parser,
#endif
#ifdef _SMAF_PARSER
&EAS_SMAF_Parser,
#endif
#ifdef _OTA_PARSER
&EAS_OTA_Parser,
#endif
#ifdef _IMELODY_PARSER
&EAS_iMelody_Parser,
#endif
#ifdef _RTTTL_PARSER
&EAS_RTTTL_Parser,
#endif
#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
&EAS_CMF_Parser
#endif
};
#define NUM_PARSER_MODULES (sizeof(parserModules) / sizeof(EAS_VOID_PTR))
/*----------------------------------------------------------------------------
* Data Modules
*----------------------------------------------------------------------------
*/
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_SMFData;
extern EAS_VOID_PTR eas_Data;
extern EAS_VOID_PTR eas_MixBuffer;
extern EAS_VOID_PTR eas_Synth;
extern EAS_VOID_PTR eas_MIDI;
extern EAS_VOID_PTR eas_PCMData;
extern EAS_VOID_PTR eas_MIDIData;
#ifdef _XMF_PARSER
extern EAS_VOID_PTR eas_XMFData;
#endif
#ifdef _SMAF_PARSER
extern EAS_VOID_PTR eas_SMAFData;
#endif
#ifdef _OTA_PARSER
extern EAS_VOID_PTR eas_OTAData;
#endif
#ifdef _IMELODY_PARSER
extern EAS_VOID_PTR eas_iMelodyData;
#endif
#ifdef _RTTTL_PARSER
extern EAS_VOID_PTR eas_RTTTLData;
#endif
#ifdef _WAVE_PARSER
extern EAS_VOID_PTR eas_WaveData;
#endif
#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
extern EAS_VOID_PTR eas_CMFData;
#endif
#endif
/*----------------------------------------------------------------------------
*
* Effects Modules
*
* These declarations are used by the EAS library to locate
* effects modules.
*----------------------------------------------------------------------------
*/
#ifdef _ENHANCER_ENABLED
extern EAS_VOID_PTR EAS_Enhancer;
#define EAS_ENHANCER_INTERFACE &EAS_Enhancer
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_EnhancerData;
#define EAS_ENHANCER_DATA &eas_EnhancerData
#else
#define EAS_ENHANCER_DATA NULL
#endif
#else
#define EAS_ENHANCER_INTERFACE NULL
#define EAS_ENHANCER_DATA NULL
#endif
#ifdef _COMPRESSOR_ENABLED
extern EAS_VOID_PTR EAS_Compressor;
#define EAS_COMPRESSOR_INTERFACE &EAS_Compressor
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_CompressorData;
#define EAS_COMPRESSOR_DATA &eas_CompressorData
#else
#define EAS_COMPRESSOR_DATA NULL
#endif
#else
#define EAS_COMPRESSOR_INTERFACE NULL
#define EAS_COMPRESSOR_DATA NULL
#endif
#ifdef _MAXIMIZER_ENABLED
extern EAS_VOID_PTR EAS_Maximizer;
#define EAS_MAXIMIZER_INTERFACE &EAS_Maximizer
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_MaximizerData;
#define EAS_MAXIMIZER_DATA &eas_MaximizerData
#else
#define EAS_MAXIMIZER_DATA NULL
#endif
#else
#define EAS_MAXIMIZER_INTERFACE NULL
#define EAS_MAXIMIZER_DATA NULL
#endif
#ifdef _REVERB_ENABLED
extern EAS_VOID_PTR EAS_Reverb;
#define EAS_REVERB_INTERFACE &EAS_Reverb
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_ReverbData;
#define EAS_REVERB_DATA &eas_ReverbData
#else
#define EAS_REVERB_DATA NULL
#endif
#else
#define EAS_REVERB_INTERFACE NULL
#define EAS_REVERB_DATA NULL
#endif
#ifdef _CHORUS_ENABLED
extern EAS_VOID_PTR EAS_Chorus;
#define EAS_CHORUS_INTERFACE &EAS_Chorus
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_ChorusData;
#define EAS_CHORUS_DATA &eas_ChorusData
#else
#define EAS_CHORUS_DATA NULL
#endif
#else
#define EAS_CHORUS_INTERFACE NULL
#define EAS_CHORUS_DATA NULL
#endif
#ifdef _WIDENER_ENABLED
extern EAS_VOID_PTR EAS_Widener;
#define EAS_WIDENER_INTERFACE &EAS_Widener
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_WidenerData;
#define EAS_WIDENER_DATA &eas_WidenerData
#else
#define EAS_WIDENER_DATA NULL
#endif
#else
#define EAS_WIDENER_INTERFACE NULL
#define EAS_WIDENER_DATA NULL
#endif
#ifdef _GRAPHIC_EQ_ENABLED
extern EAS_VOID_PTR EAS_GraphicEQ;
#define EAS_GRAPHIC_EQ_INTERFACE &EAS_GraphicEQ
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_GraphicEQData;
#define EAS_GRAPHIC_EQ_DATA &eas_GraphicEQData
#else
#define EAS_GRAPHIC_EQ_DATA NULL
#endif
#else
#define EAS_GRAPHIC_EQ_INTERFACE NULL
#define EAS_GRAPHIC_EQ_DATA NULL
#endif
#ifdef _WOW_ENABLED
extern EAS_VOID_PTR EAS_Wow;
#define EAS_WOW_INTERFACE &EAS_Wow
#ifdef _STATIC_MEMORY
#error "WOW module requires dynamic memory model"
#else
#define EAS_WOW_DATA NULL
#endif
#else
#define EAS_WOW_INTERFACE NULL
#define EAS_WOW_DATA NULL
#endif
#ifdef _TONECONTROLEQ_ENABLED
extern EAS_VOID_PTR EAS_ToneControlEQ;
#define EAS_TONECONTROLEQ_INTERFACE &EAS_ToneControlEQ
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_ToneControlEQData;
#define EAS_TONECONTROLEQ_DATA &eas_ToneControlEQData
#else
#define EAS_TONECONTROLEQ_DATA NULL
#endif
#else
#define EAS_TONECONTROLEQ_INTERFACE NULL
#define EAS_TONECONTROLEQ_DATA NULL
#endif
/*lint -e{605} not pretty, but it works */
EAS_VOID_PTR const effectsModules[] =
{
EAS_ENHANCER_INTERFACE,
EAS_COMPRESSOR_INTERFACE,
EAS_REVERB_INTERFACE,
EAS_CHORUS_INTERFACE,
EAS_WIDENER_INTERFACE,
EAS_GRAPHIC_EQ_INTERFACE,
EAS_WOW_INTERFACE,
EAS_MAXIMIZER_INTERFACE,
EAS_TONECONTROLEQ_INTERFACE
};
EAS_VOID_PTR const effectsData[] =
{
EAS_ENHANCER_DATA,
EAS_COMPRESSOR_DATA,
EAS_REVERB_DATA,
EAS_CHORUS_DATA,
EAS_WIDENER_DATA,
EAS_GRAPHIC_EQ_DATA,
EAS_WOW_DATA,
EAS_MAXIMIZER_DATA,
EAS_TONECONTROLEQ_DATA
};
/*----------------------------------------------------------------------------
*
* Optional Modules
*
* These declarations are used by the EAS library to locate
* effects modules.
*----------------------------------------------------------------------------
*/
#ifdef _METRICS_ENABLED
extern EAS_VOID_PTR EAS_Metrics;
#define EAS_METRICS_INTERFACE &EAS_Metrics
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_MetricsData;
#define EAS_METRICS_DATA &eas_MetricsData
#else
#define EAS_METRICS_DATA NULL
#endif
#else
#define EAS_METRICS_INTERFACE NULL
#define EAS_METRICS_DATA NULL
#endif
#ifdef MMAPI_SUPPORT
extern EAS_VOID_PTR EAS_TC_Parser;
#define EAS_TONE_CONTROL_PARSER &EAS_TC_Parser
#ifdef _STATIC_MEMORY
extern EAS_VOID_PTR eas_TCData;
#define EAS_TONE_CONTROL_DATA &eas_TCData
#else
#define EAS_TONE_CONTROL_DATA NULL
#endif
#else
#define EAS_TONE_CONTROL_PARSER NULL
#define EAS_TONE_CONTROL_DATA NULL
#endif
/*lint -e{605} not pretty, but it works */
EAS_VOID_PTR const optionalModules[] =
{
EAS_TONE_CONTROL_PARSER,
EAS_METRICS_INTERFACE
};
EAS_VOID_PTR const optionalData[] =
{
EAS_TONE_CONTROL_DATA,
EAS_METRICS_DATA
};
/*----------------------------------------------------------------------------
* EAS_CMStaticMemoryModel()
*----------------------------------------------------------------------------
* Purpose:
* This function returns true if EAS has been configured for
* a static memory model. There are some limitations in the
* static memory model, see the documentation for more
* information.
*
* Outputs:
* returns EAS_TRUE if a module is found
*----------------------------------------------------------------------------
*/
EAS_BOOL EAS_CMStaticMemoryModel (void)
{
#ifdef _STATIC_MEMORY
return EAS_TRUE;
#else
return EAS_FALSE;
#endif
}
/*----------------------------------------------------------------------------
* EAS_CMEnumModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional modules.
*
* Inputs:
* module - module number
*
* Outputs:
* returns a pointer to the module function table or NULL if no module
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module)
{
if (module >= (EAS_INT) NUM_PARSER_MODULES)
return NULL;
return parserModules[module];
}
/*----------------------------------------------------------------------------
* EAS_CMEnumData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
/*lint -esym(715, dataModule) used only when _STATIC_MEMORY is defined */
EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule)
{
#ifdef _STATIC_MEMORY
switch (dataModule)
{
/* main instance data for synthesizer */
case EAS_CM_EAS_DATA:
return &eas_Data;
/* mix buffer for mix engine */
case EAS_CM_MIX_BUFFER:
/*lint -e{545} lint doesn't like this because it sees the underlying type */
return &eas_MixBuffer;
/* instance data for synth */
case EAS_CM_SYNTH_DATA:
return &eas_Synth;
/* instance data for MIDI parser */
case EAS_CM_MIDI_DATA:
return &eas_MIDI;
/* instance data for SMF parser */
case EAS_CM_SMF_DATA:
return &eas_SMFData;
#ifdef _XMF_PARSER
/* instance data for XMF parser */
case EAS_CM_XMF_DATA:
return &eas_XMFData;
#endif
#ifdef _SMAF_PARSER
/* instance data for SMAF parser */
case EAS_CM_SMAF_DATA:
return &eas_SMAFData;
#endif
/* instance data for the PCM engine */
case EAS_CM_PCM_DATA:
/*lint -e{545} lint doesn't like this because it sees the underlying type */
return &eas_PCMData;
case EAS_CM_MIDI_STREAM_DATA:
return &eas_MIDIData;
#ifdef _OTA_PARSER
/* instance data for OTA parser */
case EAS_CM_OTA_DATA:
return &eas_OTAData;
#endif
#ifdef _IMELODY_PARSER
/* instance data for iMelody parser */
case EAS_CM_IMELODY_DATA:
return &eas_iMelodyData;
#endif
#ifdef _RTTTL_PARSER
/* instance data for RTTTL parser */
case EAS_CM_RTTTL_DATA:
return &eas_RTTTLData;
#endif
#ifdef _WAVE_PARSER
/* instance data for WAVE parser */
case EAS_CM_WAVE_DATA:
return &eas_WaveData;
#endif
#if defined (_CMX_PARSER) || defined(_MFI_PARSER)
/* instance data for CMF parser */
case EAS_CM_CMF_DATA:
return &eas_CMFData;
#endif
default:
return NULL;
}
#else
return NULL;
#endif
}
/*----------------------------------------------------------------------------
* EAS_CMEnumFXModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional effects modules.
*
* Inputs:
* module - enumerated module number
* pModule - pointer to module interface
*
* Outputs:
* Returns pointer to function table or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module)
{
if (module >= NUM_EFFECTS_MODULES)
return NULL;
return effectsModules[module];
}
/*----------------------------------------------------------------------------
* EAS_CMEnumFXData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
* pData - pointer to handle variable
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule)
{
if (dataModule >= NUM_EFFECTS_MODULES)
return NULL;
return effectsData[dataModule];
}
/*----------------------------------------------------------------------------
* EAS_CMEnumOptModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional modules.
*
* Inputs:
* module - enumerated module number
*
* Outputs:
* returns pointer to function table or NULL if no module
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module)
{
/* sanity check */
if (module >= NUM_OPTIONAL_MODULES)
return EAS_FALSE;
return optionalModules[module];
}
/*----------------------------------------------------------------------------
* EAS_CMEnumOptData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule)
{
if (dataModule >= NUM_OPTIONAL_MODULES)
return NULL;
return optionalData[dataModule];
}

View File

@@ -0,0 +1,191 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_config.h
*
* Contents and purpose:
* This header declares the Configuration Module interface (CM). The CM
* is a module compiled external to the library that sets the configuration
* for this build. It allows the library to find optional components and
* links to static memory allocations (when used in a static configuration).
*
* NOTE: This module is not intended to be modified by the customer. It
* needs to be included in the build process with the correct configuration
* defines (see the library documentation for information on how to configure
* the library).
*
* DO NOT MODIFY THIS FILE!
*
* Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
// sentinel
#ifndef _EAS_CONFIG_H
#define _EAS_CONFIG_H
#include "eas_types.h"
/* list of enumerators for optional modules */
typedef enum {
EAS_CM_FILE_PARSERS = 1
} E_CM_ENUM_MODULES;
/* list of enumerators for module and memory pointers */
typedef enum {
EAS_CM_EAS_DATA = 1,
EAS_CM_MIX_BUFFER,
EAS_CM_SYNTH_DATA,
EAS_CM_MIDI_DATA,
EAS_CM_SMF_DATA,
EAS_CM_XMF_DATA,
EAS_CM_SMAF_DATA,
EAS_CM_PCM_DATA,
EAS_CM_MIDI_STREAM_DATA,
EAS_CM_METRICS_DATA,
EAS_CM_OTA_DATA,
EAS_CM_IMELODY_DATA,
EAS_CM_RTTTL_DATA,
EAS_CM_WAVE_DATA,
EAS_CM_CMF_DATA
} E_CM_DATA_MODULES;
typedef struct
{
int maxSMFStreams;
void *pSMFData;
void *pSMFStream;
} S_EAS_SMF_PTRS;
typedef struct
{
int maxSMAFStreams;
void *pSMAFData;
void *pSMAFStream;
} S_EAS_SMAF_PTRS;
/*----------------------------------------------------------------------------
* EAS_CMStaticMemoryModel()
*----------------------------------------------------------------------------
* Purpose:
* This function returns true if EAS has been configured for
* a static memory model. There are some limitations in the
* static memory model, see the documentation for more
* information.
*
* Outputs:
* returns EAS_TRUE if a module is found
*----------------------------------------------------------------------------
*/
EAS_BOOL EAS_CMStaticMemoryModel (void);
/*----------------------------------------------------------------------------
* EAS_CMEnumModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional modules.
*
* Inputs:
* module - module number
*
* Outputs:
* returns a pointer to the module function table or NULL if no module
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumModules (EAS_INT module);
/*----------------------------------------------------------------------------
* EAS_CMEnumData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumData (EAS_INT dataModule);
/*----------------------------------------------------------------------------
* EAS_CMEnumFXModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional effects modules.
*
* Inputs:
* module - enumerated module number
* pModule - pointer to module interface
*
* Outputs:
* Returns pointer to function table or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumFXModules (EAS_INT module);
/*----------------------------------------------------------------------------
* EAS_CMEnumFXData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
* pData - pointer to handle variable
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumFXData (EAS_INT dataModule);
/*----------------------------------------------------------------------------
* EAS_CMEnumOptModules()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to optional modules.
*
* Inputs:
* module - enumerated module number
*
* Outputs:
* returns pointer to function table or NULL if no module
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumOptModules (EAS_INT module);
/*----------------------------------------------------------------------------
* EAS_CMEnumOptData()
*----------------------------------------------------------------------------
* Purpose:
* This function is used to find pointers to static memory allocations.
*
* Inputs:
* dataModule - enumerated module number
*
* Outputs:
* Returns handle to data or NULL if not found
*----------------------------------------------------------------------------
*/
EAS_VOID_PTR EAS_CMEnumOptData (EAS_INT dataModule);
#endif /* end _EAS_CONFIG_H */

View File

@@ -0,0 +1,87 @@
/* Auto-generated from source file: eas_chorusdata.c */
/* Auto-generated from source file: eas_xmfdata.c */
/* Auto-generated from source file: eas_mdls.c */
{ 0x19299ed4, 0x00000022, "eas_mdls.c[2561]: #Instruments: %u\n" },
{ 0x19299ed4, 0x00000023, "eas_mdls.c[2562]: #Regions: %u\n" },
{ 0x19299ed4, 0x00000024, "eas_mdls.c[2563]: #Articulations: %u\n" },
{ 0x19299ed4, 0x00000025, "eas_mdls.c[2564]: #Waves: %u\n" },
{ 0x19299ed4, 0x00000026, "eas_mdls.c[2569]: Locale: %lu:%lu:%lu\n" },
{ 0x19299ed4, 0x00000027, "eas_mdls.c[2576]: \tRegion: %u\n" },
{ 0x19299ed4, 0x00000028, "eas_mdls.c[2578]: \t\tm_nGain: %d\n" },
{ 0x19299ed4, 0x00000029, "eas_mdls.c[2579]: \t\trangeLow:rangeHigh %u:%u\n" },
{ 0x19299ed4, 0x0000002a, "eas_mdls.c[2580]: \t\tm_nKeyGroupAndFlags: %04x\n" },
{ 0x19299ed4, 0x0000002b, "eas_mdls.c[2581]: \t\tm_nLoopStart: %u\n" },
{ 0x19299ed4, 0x0000002c, "eas_mdls.c[2582]: \t\tm_nLoopEnd: %u\n" },
{ 0x19299ed4, 0x0000002d, "eas_mdls.c[2583]: \t\tm_nNetTuningInCents: %d\n" },
{ 0x19299ed4, 0x0000002e, "eas_mdls.c[2584]: \t\tArt Index: %u\n" },
{ 0x19299ed4, 0x0000002f, "eas_mdls.c[2585]: \t\tWave Index: %u\n" },
{ 0x19299ed4, 0x00000030, "eas_mdls.c[2597]: Articulation: %u\n" },
{ 0x19299ed4, 0x00000031, "eas_mdls.c[2599]: \t\tm_nEG2toFilterDepth: %d\n" },
{ 0x19299ed4, 0x00000032, "eas_mdls.c[2600]: \t\tm_nEG2toPitchDepth: %d\n" },
{ 0x19299ed4, 0x00000033, "eas_mdls.c[2601]: \t\tm_nFilterCutoffFrequency: %d\n" },
{ 0x19299ed4, 0x00000034, "eas_mdls.c[2602]: \t\tm_nFilterResonance: %u\n" },
{ 0x19299ed4, 0x00000035, "eas_mdls.c[2603]: \t\tm_nLFOAmplitudeDepth: %d\n" },
{ 0x19299ed4, 0x00000036, "eas_mdls.c[2604]: \t\tm_nLFODelayTime: %d\n" },
{ 0x19299ed4, 0x00000037, "eas_mdls.c[2605]: \t\tm_nLFOFrequency: %d\n" },
{ 0x19299ed4, 0x00000038, "eas_mdls.c[2606]: \t\tm_nLFOPitchDepth: %d\n" },
{ 0x19299ed4, 0x00000039, "eas_mdls.c[2607]: \t\tm_nPan: %d\n" },
{ 0x19299ed4, 0x0000003a, "eas_mdls.c[2610]: \t\tm_nAttack: %d\n" },
{ 0x19299ed4, 0x0000003b, "eas_mdls.c[2611]: \t\tm_nDecay: %d\n" },
{ 0x19299ed4, 0x0000003c, "eas_mdls.c[2612]: \t\tm_nSustain: %d\n" },
{ 0x19299ed4, 0x0000003d, "eas_mdls.c[2613]: \t\tm_nRelease: %d\n" },
{ 0x19299ed4, 0x0000003e, "eas_mdls.c[2616]: \t\tm_nAttack: %d\n" },
{ 0x19299ed4, 0x0000003f, "eas_mdls.c[2617]: \t\tm_nDecay: %d\n" },
{ 0x19299ed4, 0x00000040, "eas_mdls.c[2618]: \t\tm_nSustain: %d\n" },
{ 0x19299ed4, 0x00000041, "eas_mdls.c[2619]: \t\tm_nRelease: %d\n" },
{ 0x19299ed4, 0x00000042, "eas_mdls.c[2626]: Wave Index: %d\n" },
{ 0x19299ed4, 0x00000043, "eas_mdls.c[2627]: \tSize %u\n" },
{ 0x19299ed4, 0x00000044, "eas_mdls.c[2628]: \tPointer %08lx\n" },
/* Auto-generated from source file: eas_mididata.c */
/* Auto-generated from source file: eas_pan.c */
/* Auto-generated from source file: eas_wavefiledata.c */
/* Auto-generated from source file: eas_reverbdata.c */
/* Auto-generated from source file: eas_imelodydata.c */
/* Auto-generated from source file: eas_ota.c */
/* Auto-generated from source file: eas_mixbuf.c */
/* Auto-generated from source file: eas_tcdata.c */
/* Auto-generated from source file: jet.c */
/* Auto-generated from source file: eas_rtttl.c */
/* Auto-generated from source file: eas_reverb.c */
/* Auto-generated from source file: eas_pcmdata.c */
/* Auto-generated from source file: eas_chorus.c */
/* Auto-generated from source file: eas_math.c */
/* Auto-generated from source file: eas_xmf.c */
/* Auto-generated from source file: eas_smfdata.c */
/* Auto-generated from source file: eas_imelody.c */
/* Auto-generated from source file: eas_dlssynth.c */
/* Auto-generated from source file: eas_public.c */
/* Auto-generated from source file: eas_rtttldata.c */
/* Auto-generated from source file: eas_voicemgt.c */
/* Auto-generated from source file: eas_tonecontrol.c */
/* Auto-generated from source file: eas_wtengine.c */
/* Auto-generated from source file: eas_imaadpcm.c */
{ 0x2380b977, 0x00000006, "eas_imaadpcm.c[305]: IMADecoderLocate: Time=%d, samples=%d\n" },
{ 0x2380b977, 0x00000007, "eas_imaadpcm.c[328]: IMADecoderLocate: Looped sample, numBlocks=%d, samplesPerLoop=%d, samplesInLastBlock=%d, samples=%d\n" },
{ 0x2380b977, 0x00000008, "eas_imaadpcm.c[335]: IMADecoderLocate: Byte location in audio = %d\n" },
{ 0x2380b977, 0x00000009, "eas_imaadpcm.c[345]: IMADecoderLocate: bytesLeft = %d\n" },
/* Auto-generated from source file: eas_flog.c */
/* Auto-generated from source file: eas_midi.c */
/* Auto-generated from source file: eas_otadata.c */
/* Auto-generated from source file: eas_ima_tables.c */
/* Auto-generated from source file: eas_data.c */
/* Auto-generated from source file: eas_pcm.c */
/* Auto-generated from source file: eas_mixer.c */
/* Auto-generated from source file: eas_wavefile.c */
/* Auto-generated from source file: eas_wtsynth.c */
/* Auto-generated from source file: eas_smf.c */
/* Auto-generated from source file: eas_wave.c */
/* Auto-generated from source file: eas_hostmm.c */
{ 0x1a54b6e8, 0x00000001, "eas_hostmm.c[586]: Vibrate state: %d\n" },
{ 0x1a54b6e8, 0x00000002, "eas_hostmm.c[601]: LED state: %d\n" },
{ 0x1a54b6e8, 0x00000003, "eas_hostmm.c[616]: Backlight state: %d\n" },
{ 0x1a54b6e8, 0x00000004, "eas_hostmm.c[162]: HWMemCpy: bad amount: %d\n" },
{ 0x1a54b6e8, 0x00000005, "eas_hostmm.c[179]: HWMemSet: bad amount: %d\n" },
{ 0x1a54b6e8, 0x00000006, "eas_hostmm.c[196]: HWMemCmp: bad amount: %d\n" },
/* Auto-generated from source file: eas_config.c */
/* Auto-generated from source file: eas_main.c */
{ 0xe624f4d9, 0x00000005, "eas_main.c[106]: Play length: %d.%03d (secs)\n" },

View File

@@ -0,0 +1,87 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_host.h
*
* Contents and purpose:
* This header defines the host wrapper functions for stdio, stdlib, etc.
* The host application must provide an abstraction layer for these functions
* to support certain features, such as SMAF and SMF-1 conversion.
*
* DO NOT MODIFY THIS FILE!
*
* Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
// sentinel
#ifndef _EAS_HOST_H
#define _EAS_HOST_H
#include "eas_types.h"
/* for C++ linkage */
#ifdef __cplusplus
extern "C" {
#endif
/* initialization and shutdown routines */
extern EAS_RESULT EAS_HWInit(EAS_HW_DATA_HANDLE *hwInstData);
extern EAS_RESULT EAS_HWShutdown(EAS_HW_DATA_HANDLE hwInstData);
/* threading */
extern void* EAS_HWRegisterSignalHandler();
extern EAS_RESULT EAS_HWUnRegisterSignalHandler(void *cookie);
/* memory functions */
extern void *EAS_HWMemSet(void *s, int c, EAS_I32 n);
extern void *EAS_HWMemCpy(void *s1, const void *s2, EAS_I32 n);
extern EAS_I32 EAS_HWMemCmp(const void *s1, const void *s2, EAS_I32 n);
/* memory allocation */
extern void *EAS_HWMalloc(EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size);
extern void EAS_HWFree(EAS_HW_DATA_HANDLE hwInstData, void *p);
/* file I/O */
extern EAS_RESULT EAS_HWOpenFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode);
extern EAS_RESULT EAS_HWReadFile(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead);
extern EAS_RESULT EAS_HWGetByte(EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p);
extern EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
extern EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst);
extern EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition);
extern EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
extern EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position);
extern EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength);
extern EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE* pFile);
extern EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file);
/* vibrate, LED, and backlight functions */
extern EAS_RESULT EAS_HWVibrate(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
extern EAS_RESULT EAS_HWLED(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
extern EAS_RESULT EAS_HWBackLight(EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state);
#ifdef __cplusplus
} /* end extern "C" */
#endif
/* host yield function */
extern EAS_BOOL EAS_HWYield(EAS_HW_DATA_HANDLE hwInstData);
#endif /* end _EAS_HOST_H */

View File

@@ -0,0 +1,688 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_hostmm.c
*
* Contents and purpose:
* This file contains the host wrapper functions for stdio, stdlib, etc.
* This is a sample version that reads from a filedescriptor.
* The file locator (EAS_FILE_LOCATOR) handle passed to
* HWOpenFile is the same one that is passed to EAS_OpenFile.
*
* Modify this file to suit the needs of your particular system.
*
* EAS_MAX_FILE_HANDLES sets the maximum number of MIDI streams within
* a MIDI type 1 file that can be played.
*
* EAS_HW_FILE is a structure to support the file I/O functions. It
* comprises the file descriptor, the file read pointer, and
* the dup flag, which when set, indicates that the file handle has
* been duplicated, and offset and length within the file.
*
* Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 795 $
* $Date: 2007-08-01 00:14:45 -0700 (Wed, 01 Aug 2007) $
*----------------------------------------------------------------------------
*/
#ifdef _lint
#include "lint_stdlib.h"
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <limits.h>
#include <sys/mman.h>
#include <errno.h>
#include <signal.h>
#define LOG_TAG "Sonivox"
#endif
#include "eas_host.h"
/* Only for debugging LED, vibrate, and backlight functions */
#include "eas_report.h"
/* this module requires dynamic memory support */
#ifdef _STATIC_MEMORY
#error "eas_hostmm.c requires the dynamic memory model!\n"
#endif
#ifndef EAS_MAX_FILE_HANDLES
// 100 max file handles == 3 * (nb tracks(32) + 1 for the segment) + 1 for jet file
// 3 == 1(playing segment) + 1(prepared segment)
// + 1(after end of playing segment, before files closed)
#define EAS_MAX_FILE_HANDLES 100
#endif
/*
* this structure and the related function are here
* to support the ability to create duplicate handles
* and buffering it in memory. If your system uses
* in-memory resources, you can eliminate the calls
* to malloc and free, the dup flag, and simply track
* the file size and read position.
*/
typedef struct eas_hw_file_tag
{
EAS_I32 fileSize;
EAS_I32 filePos;
EAS_BOOL dup;
int fd;
EAS_I32 offset;
} EAS_HW_FILE;
typedef struct eas_hw_inst_data_tag
{
EAS_HW_FILE files[EAS_MAX_FILE_HANDLES];
} EAS_HW_INST_DATA;
pthread_key_t EAS_sigbuskey;
/*----------------------------------------------------------------------------
* EAS_HWInit
*
* Initialize host wrapper interface
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_HWInit (EAS_HW_DATA_HANDLE *pHWInstData)
{
EAS_HW_FILE *file;
int i;
/* need to track file opens for duplicate handles */
*pHWInstData = malloc(sizeof(EAS_HW_INST_DATA));
if (!(*pHWInstData))
return EAS_ERROR_MALLOC_FAILED;
EAS_HWMemSet(*pHWInstData, 0, sizeof(EAS_HW_INST_DATA));
file = (*pHWInstData)->files;
for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
{
file->fd = -1;
file++;
}
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* EAS_HWShutdown
*
* Shut down host wrapper interface
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_HWShutdown (EAS_HW_DATA_HANDLE hwInstData)
{
free(hwInstData);
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWMalloc
*
* Allocates dynamic memory
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
void *EAS_HWMalloc (EAS_HW_DATA_HANDLE hwInstData, EAS_I32 size)
{
/* Since this whole library loves signed sizes, let's not let
* negative or 0 values through */
if (size <= 0)
return NULL;
return malloc((size_t) size);
}
/*----------------------------------------------------------------------------
*
* EAS_HWFree
*
* Frees dynamic memory
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
void EAS_HWFree (EAS_HW_DATA_HANDLE hwInstData, void *p)
{
free(p);
}
/*----------------------------------------------------------------------------
*
* EAS_HWMemCpy
*
* Copy memory wrapper
*
*----------------------------------------------------------------------------
*/
void *EAS_HWMemCpy (void *dest, const void *src, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000004 , amount);
exit(255);
}
return memcpy(dest, src, (size_t) amount);
}
/*----------------------------------------------------------------------------
*
* EAS_HWMemSet
*
* Set memory wrapper
*
*----------------------------------------------------------------------------
*/
void *EAS_HWMemSet (void *dest, int val, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000005 , amount);
exit(255);
}
return memset(dest, val, (size_t) amount);
}
/*----------------------------------------------------------------------------
*
* EAS_HWMemCmp
*
* Compare memory wrapper
*
*----------------------------------------------------------------------------
*/
EAS_I32 EAS_HWMemCmp (const void *s1, const void *s2, EAS_I32 amount)
{
if (amount < 0) {
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000006 , amount);
exit(255);
}
return (EAS_I32) memcmp(s1, s2, (size_t) amount);
}
/*----------------------------------------------------------------------------
*
* EAS_HWOpenFile
*
* Open a file for read or write
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_HWOpenFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_LOCATOR locator, EAS_FILE_HANDLE *pFile, EAS_FILE_MODE mode)
{
EAS_HW_FILE *file;
int fd;
int i;
/* set return value to NULL */
*pFile = NULL;
/* only support read mode at this time */
if (mode != EAS_FILE_READ)
return EAS_ERROR_INVALID_FILE_MODE;
/* find an empty entry in the file table */
file = hwInstData->files;
for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
{
/* is this slot being used? */
if (file->fd < 0)
{
if (locator->path) {
/* open the file */
if ((fd = open(locator->path, O_RDONLY)) < 0) {
return EAS_ERROR_FILE_OPEN_FAILED;
}
} else {
/* else file is already open */
fd = dup(locator->fd);
}
/* determine the file size */
if (locator->length == 0) {
if (lseek(fd, 0, SEEK_END) < 0) {
close(fd);
return EAS_ERROR_FILE_LENGTH;
}
if ((file->fileSize = (EAS_I32)lseek(fd, 0, SEEK_CUR)) == -1L) {
close(fd);
return EAS_ERROR_FILE_LENGTH;
}
}
// file size was passed in
else {
file->fileSize = (EAS_I32) locator->length;
}
file->fd = fd;
file->offset = (EAS_I32)locator->offset;
/* initialize some values */
file->filePos = 0;
file->dup = EAS_FALSE;
*pFile = file;
return EAS_SUCCESS;
}
file++;
}
/* too many open files */
return EAS_ERROR_MAX_FILES_OPEN;
}
/*----------------------------------------------------------------------------
*
* EAS_HWReadFile
*
* Read data from a file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWReadFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *pBuffer, EAS_I32 n, EAS_I32 *pBytesRead)
{
EAS_I32 count;
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
if (n < 0)
return EAS_EOF;
/* calculate the bytes to read */
count = file->fileSize - file->filePos;
if (n < count)
count = n;
if (count < 0)
return EAS_EOF;
/* copy the data to the requested location, and advance the pointer */
if (count) {
lseek(file->fd, file->filePos + file->offset, SEEK_SET);
count = read(file->fd, pBuffer, count);
}
file->filePos += count;
*pBytesRead = count;
/* were n bytes read? */
if (count!= n)
return EAS_EOF;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWGetByte
*
* Read a byte from a file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWGetByte (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p)
{
EAS_I32 numread;
return EAS_HWReadFile(hwInstData, file, p, 1, &numread);
}
/*----------------------------------------------------------------------------
*
* EAS_HWGetWord
*
* Read a 16 bit word from a file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWGetWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
{
EAS_RESULT result;
EAS_U8 c1, c2;
/* read 2 bytes from the file */
if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
return result;
if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
return result;
/* order them as requested */
if (msbFirst)
*((EAS_U16*) p) = ((EAS_U16) c1 << 8) | c2;
else
*((EAS_U16*) p) = ((EAS_U16) c2 << 8) | c1;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWGetDWord
*
* Returns the current location in the file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWGetDWord (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, void *p, EAS_BOOL msbFirst)
{
EAS_RESULT result;
EAS_U8 c1, c2,c3,c4;
/* read 4 bytes from the file */
if ((result = EAS_HWGetByte(hwInstData, file, &c1)) != EAS_SUCCESS)
return result;
if ((result = EAS_HWGetByte(hwInstData, file, &c2)) != EAS_SUCCESS)
return result;
if ((result = EAS_HWGetByte(hwInstData, file, &c3)) != EAS_SUCCESS)
return result;
if ((result = EAS_HWGetByte(hwInstData, file, &c4)) != EAS_SUCCESS)
return result;
/* order them as requested */
if (msbFirst)
*((EAS_U32*) p) = ((EAS_U32) c1 << 24) | ((EAS_U32) c2 << 16) | ((EAS_U32) c3 << 8) | c4;
else
*((EAS_U32*) p)= ((EAS_U32) c4 << 24) | ((EAS_U32) c3 << 16) | ((EAS_U32) c2 << 8) | c1;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWFilePos
*
* Returns the current location in the file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWFilePos (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pPosition)
{
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
*pPosition = file->filePos;
return EAS_SUCCESS;
} /* end EAS_HWFilePos */
/*----------------------------------------------------------------------------
*
* EAS_HWFileSeek
*
* Seek to a specific location in the file
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWFileSeek (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
{
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
/* validate new position */
if ((position < 0) || (position > file->fileSize))
return EAS_ERROR_FILE_SEEK;
/* save new position */
file->filePos = position;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWFileSeekOfs
*
* Seek forward or back relative to the current position
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWFileSeekOfs (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 position)
{
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
/* determine the file position */
position += file->filePos;
if ((position < 0) || (position > file->fileSize))
return EAS_ERROR_FILE_SEEK;
/* save new position */
file->filePos = position;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWFileLength
*
* Return the file length
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWFileLength (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_I32 *pLength)
{
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
*pLength = file->fileSize;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWDupHandle
*
* Duplicate a file handle
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_HWDupHandle (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file, EAS_FILE_HANDLE *pDupFile)
{
EAS_HW_FILE *dupFile;
int i;
/* make sure we have a valid handle */
if (file->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
/* find an empty entry in the file table */
dupFile = hwInstData->files;
for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
{
/* is this slot being used? */
if (dupFile->fd < 0)
{
/* copy info from the handle to be duplicated */
dupFile->filePos = file->filePos;
dupFile->fileSize = file->fileSize;
dupFile->fd = file->fd;
dupFile->offset = file->offset;
/* set the duplicate handle flag */
dupFile->dup = file->dup = EAS_TRUE;
*pDupFile = dupFile;
return EAS_SUCCESS;
}
dupFile++;
}
/* too many open files */
return EAS_ERROR_MAX_FILES_OPEN;
}
/*----------------------------------------------------------------------------
*
* EAS_HWClose
*
* Wrapper for fclose function
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_HWCloseFile (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE file1)
{
EAS_HW_FILE *file2,*dupFile;
int i;
/* make sure we have a valid handle */
if (file1->fd < 0)
return EAS_ERROR_INVALID_HANDLE;
/* check for duplicate handle */
if (file1->dup)
{
dupFile = NULL;
file2 = hwInstData->files;
for (i = 0; i < EAS_MAX_FILE_HANDLES; i++)
{
/* check for duplicate */
if ((file1 != file2) && (file2->fd == file1->fd))
{
/* is there more than one duplicate? */
if (dupFile != NULL)
{
/* clear this entry and return */
file1->fd = -1;
return EAS_SUCCESS;
}
/* this is the first duplicate found */
else
dupFile = file2;
}
file2++;
}
/* there is only one duplicate, clear the dup flag */
if (dupFile)
dupFile->dup = EAS_FALSE;
else
/* if we get here, there's a serious problem */
return EAS_ERROR_HANDLE_INTEGRITY;
/* clear this entry and return */
file1->fd = -1;
return EAS_SUCCESS;
}
/* no duplicates - close the file */
close(file1->fd);
/* clear this entry and return */
file1->fd = -1;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWVibrate
*
* Turn on/off vibrate function
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWVibrate (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
{
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000001 , state);
return EAS_SUCCESS;
} /* end EAS_HWVibrate */
/*----------------------------------------------------------------------------
*
* EAS_HWLED
*
* Turn on/off LED
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWLED (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
{
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000002 , state);
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWBackLight
*
* Turn on/off backlight
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_RESULT EAS_HWBackLight (EAS_HW_DATA_HANDLE hwInstData, EAS_BOOL state)
{
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x1a54b6e8, 0x00000003 , state);
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
*
* EAS_HWYield
*
* This function is called periodically by the EAS library to give the
* host an opportunity to allow other tasks to run. There are two ways to
* use this call:
*
* If you have a multi-tasking OS, you can call the yield function in the
* OS to allow other tasks to run. In this case, return EAS_FALSE to tell
* the EAS library to continue processing when control returns from this
* function.
*
* If tasks run in a single thread by sequential function calls (sometimes
* call a "commutator loop"), return EAS_TRUE to cause the EAS Library to
* return to the caller. Be sure to check the number of bytes rendered
* before passing the audio buffer to the codec - it may not be filled.
* The next call to EAS_Render will continue processing until the buffer
* has been filled.
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, hwInstData) hwInstData available for customer use */
EAS_BOOL EAS_HWYield (EAS_HW_DATA_HANDLE hwInstData)
{
/* put your code here */
return EAS_FALSE;
}

View File

@@ -0,0 +1,464 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_main.c
*
* Contents and purpose:
* The entry point and high-level functions for the EAS Synthesizer test
* harness.
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 775 $
* $Date: 2007-07-20 10:11:11 -0700 (Fri, 20 Jul 2007) $
*----------------------------------------------------------------------------
*/
#ifdef _lint
#include "lint_stdlib.h"
#else
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#endif
#include "eas.h"
#include "eas_wave.h"
#include "eas_report.h"
/* determines how many EAS buffers to fill a host buffer */
#define NUM_BUFFERS 8
/* default file to play if no filename is specified on the command line */
static const char defaultTestFile[] = "test.mid";
EAS_I32 polyphony;
/* prototypes for helper functions */
static void StrCopy(char *dest, const char *src, EAS_I32 size);
static EAS_BOOL ChangeFileExt(char *str, const char *ext, EAS_I32 size);
static EAS_RESULT PlayFile (EAS_DATA_HANDLE easData, const char* filename, const char* outputFile, const S_EAS_LIB_CONFIG *pLibConfig, void *buffer, EAS_I32 bufferSize);
static EAS_BOOL EASLibraryCheck (const S_EAS_LIB_CONFIG *pLibConfig);
/* main is defined after playfile to avoid the need for two passes through lint */
/*----------------------------------------------------------------------------
* PlayFile()
*----------------------------------------------------------------------------
* Purpose:
* This function plays the file requested by filename
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT PlayFile (EAS_DATA_HANDLE easData, const char* filename, const char* outputFile, const S_EAS_LIB_CONFIG *pLibConfig, void *buffer, EAS_I32 bufferSize)
{
EAS_HANDLE handle;
EAS_RESULT result, reportResult;
EAS_I32 count;
EAS_STATE state;
EAS_I32 playTime;
char waveFilename[256];
WAVE_FILE *wFile;
EAS_INT i;
EAS_PCM *p;
EAS_FILE file;
/* determine the name of the output file */
wFile = NULL;
if (outputFile == NULL)
{
StrCopy(waveFilename, filename, sizeof(waveFilename));
if (!ChangeFileExt(waveFilename, "wav", sizeof(waveFilename)))
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error in output filename %s\n", waveFilename); */ }
return EAS_FAILURE;
}
outputFile = waveFilename;
}
/* call EAS library to open file */
file.path = filename;
file.fd = 0;
if ((reportResult = EAS_OpenFile(easData, &file, &handle)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_OpenFile returned %ld\n", reportResult); */ }
return reportResult;
}
/* prepare to play the file */
if ((result = EAS_Prepare(easData, handle)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Prepare returned %ld\n", result); */ }
reportResult = result;
}
/* get play length */
if ((result = EAS_ParseMetaData(easData, handle, &playTime)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_ParseMetaData returned %ld\n", result); */ }
return result;
}
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0xe624f4d9, 0x00000005 , playTime / 1000, playTime % 1000);
if (reportResult == EAS_SUCCESS)
{
/* create the output file */
wFile = WaveFileCreate(outputFile, pLibConfig->numChannels, pLibConfig->sampleRate, sizeof(EAS_PCM) * 8);
if (!wFile)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Unable to create output file %s\n", waveFilename); */ }
reportResult = EAS_FAILURE;
}
}
/* rendering loop */
while (reportResult == EAS_SUCCESS)
{
/* we may render several buffers here to fill one host buffer */
for (i = 0, p = buffer; i < NUM_BUFFERS; i++, p+= pLibConfig->mixBufferSize * pLibConfig->numChannels)
{
/* get the current time */
if ((result = EAS_GetLocation(easData, handle, &playTime)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_GetLocation returned %d\n",result); */ }
if (reportResult == EAS_SUCCESS)
reportResult = result;
break;
}
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Parser time: %d.%03d\n", playTime / 1000, playTime % 1000); */ }
/* render a buffer of audio */
if ((result = EAS_Render(easData, p, pLibConfig->mixBufferSize, &count)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Render returned %d\n",result); */ }
if (reportResult == EAS_SUCCESS)
reportResult = result;
}
}
if (result == EAS_SUCCESS)
{
/* write it to the wave file */
if (WaveFileWrite(wFile, buffer, bufferSize) != bufferSize)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "WaveFileWrite failed\n"); */ }
reportResult = EAS_FAILURE;
}
}
if (reportResult == EAS_SUCCESS)
{
/* check stream state */
if ((result = EAS_State(easData, handle, &state)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_State returned %d\n", result); */ }
reportResult = result;
}
/* is playback complete */
if ((state == EAS_STATE_STOPPED) || (state == EAS_STATE_ERROR))
break;
}
}
/* close the output file */
if (wFile)
{
if (!WaveFileClose(wFile))
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error closing wave file %s\n", waveFilename); */ }
if (reportResult == EAS_SUCCESS)
result = EAS_FAILURE;
}
}
/* close the input file */
if ((result = EAS_CloseFile(easData,handle)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "EAS_Close returned %ld\n", result); */ }
if (reportResult == EAS_SUCCESS)
result = EAS_FAILURE;
}
return reportResult;
} /* end PlayFile */
/*----------------------------------------------------------------------------
* main()
*----------------------------------------------------------------------------
* Purpose: The entry point for the EAS sample application
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
int main( int argc, char **argv )
{
EAS_DATA_HANDLE easData;
const S_EAS_LIB_CONFIG *pLibConfig;
void *buffer;
EAS_RESULT result, playResult;
EAS_I32 bufferSize;
int i;
int temp;
FILE *debugFile;
char *outputFile = NULL;
/* set the error reporting level */
EAS_SetDebugLevel(_EAS_SEVERITY_INFO);
debugFile = NULL;
/* process command-line arguments */
for (i = 1; i < argc; i++)
{
/* check for switch */
if (argv[i][0] == '-')
{
switch (argv[i][1])
{
case 'd':
temp = argv[i][2];
if ((temp >= '0') || (temp <= '9'))
EAS_SetDebugLevel(temp);
else
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Invalid debug level %d\n", temp); */ }
break;
case 'f':
if ((debugFile = fopen(&argv[i][2],"w")) == NULL)
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Unable to create debug file %s\n", &argv[i][2]); */ }
else
EAS_SetDebugFile(debugFile, EAS_TRUE);
break;
case 'o':
outputFile = &argv[i][2];
break;
case 'p':
polyphony = atoi(&argv[i][2]);
if (polyphony < 1)
polyphony = 1;
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Polyphony set to %d\n", polyphony); */ }
break;
default:
break;
}
continue;
}
}
/* assume success */
playResult = EAS_SUCCESS;
/* get the library configuration */
pLibConfig = EAS_Config();
if (!EASLibraryCheck(pLibConfig))
return -1;
if (polyphony > pLibConfig->maxVoices)
polyphony = pLibConfig->maxVoices;
/* calculate buffer size */
bufferSize = pLibConfig->mixBufferSize * pLibConfig->numChannels * (EAS_I32)sizeof(EAS_PCM) * NUM_BUFFERS;
/* allocate output buffer memory */
buffer = malloc((EAS_U32)bufferSize);
if (!buffer)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Error allocating memory for audio buffer\n"); */ }
return EAS_FAILURE;
}
/* initialize the EAS library */
polyphony = pLibConfig->maxVoices;
if ((result = EAS_Init(&easData)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Init returned %ld - aborting!\n", result); */ }
free(buffer);
return result;
}
/*
* Some debugging environments don't allow for passed parameters.
* In this case, just play the default MIDI file "test.mid"
*/
if (argc < 2)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", defaultTestFile); */ }
if ((playResult = PlayFile(easData, defaultTestFile, NULL, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, defaultTestFile); */ }
}
}
/* iterate through the list of files to be played */
else
{
for (i = 1; i < argc; i++)
{
/* check for switch */
if (argv[i][0] != '-')
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "Playing '%s'\n", argv[i]); */ }
if ((playResult = PlayFile(easData, argv[i], outputFile, pLibConfig, buffer, bufferSize)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Error %d playing file %s\n", playResult, argv[i]); */ }
break;
}
}
}
}
/* shutdown the EAS library */
if ((result = EAS_Shutdown(easData)) != EAS_SUCCESS)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "EAS_Shutdown returned %ld\n", result); */ }
}
/* free the output buffer */
free(buffer);
/* close the debug file */
if (debugFile)
fclose(debugFile);
/* play errors take precedence over shutdown errors */
if (playResult != EAS_SUCCESS)
return playResult;
return result;
} /* end main */
/*----------------------------------------------------------------------------
* StrCopy()
*----------------------------------------------------------------------------
* Purpose:
* Safe string copy
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static void StrCopy(char *dest, const char *src, EAS_I32 size)
{
int len;
strncpy(dest, src, (size_t) size-1);
len = (int) strlen(src);
if (len < size)
dest[len] = 0;
} /* end StrCopy */
/*----------------------------------------------------------------------------
* ChangeFileExt()
*----------------------------------------------------------------------------
* Purpose:
* Changes the file extension of a filename
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static EAS_BOOL ChangeFileExt(char *str, const char *ext, EAS_I32 size)
{
char *p;
/* find the extension, if any */
p = strrchr(str,'.');
if (!p)
{
if ((EAS_I32)(strlen(str) + 5) > size)
return EAS_FALSE;
strcat(str,".");
strcat(str,ext);
return EAS_TRUE;
}
/* make sure there's room for the extension */
p++;
*p = 0;
if ((EAS_I32)(strlen(str) + 4) > size)
return EAS_FALSE;
strcat(str,ext);
return EAS_TRUE;
} /* end ChangeFileExt */
/*----------------------------------------------------------------------------
* EASLibraryCheck()
*----------------------------------------------------------------------------
* Purpose:
* Displays the library version and checks it against the header
* file used to build this code.
*
* Inputs:
* pLibConfig - library configuration retrieved from the library
*
* Outputs:
* returns EAS_TRUE if matched
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_BOOL EASLibraryCheck (const S_EAS_LIB_CONFIG *pLibConfig)
{
/* display the library version */
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "EAS Library Version %d.%d.%d.%d\n",
pLibConfig->libVersion >> 24,
(pLibConfig->libVersion >> 16) & 0x0f,
(pLibConfig->libVersion >> 8) & 0x0f,
pLibConfig->libVersion & 0x0f); */ }
/* display some info about the library build */
if (pLibConfig->checkedVersion)
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tChecked library\n"); */ }
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMaximum polyphony: %d\n", pLibConfig->maxVoices); */ }
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tNumber of channels: %d\n", pLibConfig->numChannels); */ }
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tSample rate: %d\n", pLibConfig->sampleRate); */ }
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tMix buffer size: %d\n", pLibConfig->mixBufferSize); */ }
if (pLibConfig->filterEnabled)
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tFilter enabled\n"); */ }
#ifndef _WIN32_WCE
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build Timestamp: %s", ctime((time_t*)&pLibConfig->buildTimeStamp)); */ }
#endif
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "\tLibrary Build ID: %s\n", pLibConfig->buildGUID); */ }
/* check it against the header file used to build this code */
/*lint -e{778} constant expression used for display purposes may evaluate to zero */
if (LIB_VERSION != pLibConfig->libVersion)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Library version does not match header files. EAS Header Version %d.%d.%d.%d\n",
LIB_VERSION >> 24,
(LIB_VERSION >> 16) & 0x0f,
(LIB_VERSION >> 8) & 0x0f,
LIB_VERSION & 0x0f); */ }
return EAS_FALSE;
}
return EAS_TRUE;
} /* end EASLibraryCheck */

View File

@@ -0,0 +1,264 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_report.c
*
* Contents and purpose:
* This file contains the debug message handling routines for the EAS library.
* These routines should be modified as needed for your system.
*
* Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 659 $
* $Date: 2007-04-24 13:36:35 -0700 (Tue, 24 Apr 2007) $
*----------------------------------------------------------------------------
*/
#ifdef _lint
#include "lint_stdlib.h"
#else
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#endif
#include "eas_report.h"
static int severityLevel = 9999;
/* debug file */
static FILE *debugFile = NULL;
int flush = 0;
#ifndef _NO_DEBUG_PREPROCESSOR
/* structure should have an #include for each error message header file */
S_DEBUG_MESSAGES debugMessages[] =
{
#ifndef UNIFIED_DEBUG_MESSAGES
#include "eas_config_msgs.h"
#include "eas_host_msgs.h"
#include "eas_hostmm_msgs.h"
#include "eas_math_msgs.h"
#include "eas_midi_msgs.h"
#include "eas_mixer_msgs.h"
#include "eas_pcm_msgs.h"
#include "eas_public_msgs.h"
#include "eas_smf_msgs.h"
#include "eas_wave_msgs.h"
#include "eas_voicemgt_msgs.h"
#ifdef _FM_SYNTH
#include "eas_fmsynth_msgs.h"
#include "eas_fmengine_msgs.h"
#endif
#ifdef _WT_SYNTH
#include "eas_wtsynth_msgs.h"
#include "eas_wtengine_msgs.h"
#endif
#ifdef _ARM_TEST_MAIN
#include "arm_main_msgs.h"
#endif
#ifdef _EAS_MAIN
#include "eas_main_msgs.h"
#endif
#ifdef _EAS_MAIN_IPC
#include "eas_main_ipc_msgs.h"
#endif
#ifdef _METRICS_ENABLED
#include "eas_perf_msgs.h"
#endif
#ifdef _COMPRESSOR_ENABLED
#include "eas_compressor_msgs.h"
#endif
#ifdef _ENHANCER_ENABLED
#include "eas_enhancer_msgs.h"
#endif
#ifdef _WOW_ENABLED
#include "eas_wow_msgs.h"
#endif
#ifdef _SMAF_PARSER
#include "eas_smaf_msgs.h"
#endif
#ifdef _OTA_PARSER
#include "eas_ota_msgs.h"
#endif
#ifdef _IMELODY_PARSER
#include "eas_imelody_msgs.h"
#endif
#ifdef _WAVE_PARSER
#include "eas_wavefile_msgs.h"
#endif
#if defined(_CMX_PARSER) || defined(_MFI_PARSER)
#include "eas_cmf_msgs.h"
#endif
#if defined(_CMX_PARSER) || defined(_MFI_PARSER) || defined(_WAVE_PARSER)
#include "eas_imaadpcm_msgs.h"
#endif
#else
#include "eas_debugmsgs.h"
#endif
/* denotes end of error messages */
{ 0,0,0 }
};
/*----------------------------------------------------------------------------
* EAS_ReportEx()
*
* This is the error message handler. The default handler outputs error
* messages to stdout. Modify this as needed for your system.
*----------------------------------------------------------------------------
*/
void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...)
{
va_list vargs;
int i;
/* check severity level */
if (severity > severityLevel)
return;
/* find the error message and output to stdout */
/*lint -e{661} we check for NULL pointer - no fence post error here */
for (i = 0; debugMessages[i].m_pDebugMsg; i++)
{
if ((debugMessages[i].m_nHashCode == hashCode) &&
(debugMessages[i].m_nSerialNum == serialNum))
{
/*lint -e{826} <allow variable args> */
va_start(vargs, serialNum);
if (debugFile)
{
vfprintf(debugFile, debugMessages[i].m_pDebugMsg, vargs);
if (flush)
fflush(debugFile);
}
else
{
vprintf(debugMessages[i].m_pDebugMsg, vargs);
}
va_end(vargs);
return;
}
}
printf("Unrecognized error: Severity=%d; HashCode=%lu; SerialNum=%d\n", severity, hashCode, serialNum);
} /* end EAS_ReportEx */
#else
/*----------------------------------------------------------------------------
* EAS_Report()
*
* This is the error message handler. The default handler outputs error
* messages to stdout. Modify this as needed for your system.
*----------------------------------------------------------------------------
*/
void EAS_Report (int severity, const char *fmt, ...)
{
va_list vargs;
/* check severity level */
if (severity > severityLevel)
return;
/*lint -e{826} <allow variable args> */
va_start(vargs, fmt);
if (debugFile)
{
vfprintf(debugFile, fmt, vargs);
if (flush)
fflush(debugFile);
}
else
{
vprintf(fmt, vargs);
}
va_end(vargs);
} /* end EAS_Report */
/*----------------------------------------------------------------------------
* EAS_ReportX()
*
* This is the error message handler. The default handler outputs error
* messages to stdout. Modify this as needed for your system.
*----------------------------------------------------------------------------
*/
void EAS_ReportX (int severity, const char *fmt, ...)
{
va_list vargs;
/* check severity level */
if (severity > severityLevel)
return;
/*lint -e{826} <allow variable args> */
va_start(vargs, fmt);
if (debugFile)
{
vfprintf(debugFile, fmt, vargs);
if (flush)
fflush(debugFile);
}
else
{
vprintf(fmt, vargs);
}
va_end(vargs);
} /* end EAS_ReportX */
#endif
/*----------------------------------------------------------------------------
* EAS_SetDebugLevel()
*
* Sets the level for debug message output
*----------------------------------------------------------------------------
*/
void EAS_SetDebugLevel (int severity)
{
severityLevel = severity;
} /* end EAS_SetDebugLevel */
/*----------------------------------------------------------------------------
* EAS_SetDebugFile()
*
* Redirect debugger output to the specified file.
*----------------------------------------------------------------------------
*/
void EAS_SetDebugFile (void *file, int flushAfterWrite)
{
debugFile = (FILE*) file;
flush = flushAfterWrite;
} /* end EAS_SetDebugFile */

View File

@@ -0,0 +1,77 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_report.h
*
* Contents and purpose:
* This file contains the debug message handling routines for the EAS library.
* These routines should be modified as needed for your system.
*
* DO NOT MODIFY THIS FILE!
*
* Copyright 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
/* sentinel */
#ifndef _EAS_REPORT_H
#define _EAS_REPORT_H
#define _EAS_SEVERITY_NOFILTER 0
#define _EAS_SEVERITY_FATAL 1
#define _EAS_SEVERITY_ERROR 2
#define _EAS_SEVERITY_WARNING 3
#define _EAS_SEVERITY_INFO 4
#define _EAS_SEVERITY_DETAIL 5
/* for C++ linkage */
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _NO_DEBUG_PREPROCESSOR
/* structure for included debug message header files */
typedef struct
{
unsigned long m_nHashCode;
int m_nSerialNum;
char *m_pDebugMsg;
} S_DEBUG_MESSAGES;
/* debug message handling prototypes */
extern void EAS_ReportEx (int severity, unsigned long hashCode, int serialNum, ...);
#else
/* these prototypes are used if the debug preprocessor is not used */
extern void EAS_Report (int severity, const char* fmt, ...);
extern void EAS_ReportX (int severity, const char* fmt, ...);
#endif
extern void EAS_SetDebugLevel (int severity);
extern void EAS_SetDebugFile (void *file, int flushAfterWrite);
#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif

View File

@@ -0,0 +1,54 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_reverb.h
*
* Contents and purpose:
* Contains parameter enumerations for the Reverb effect
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 300 $
* $Date: 2006-09-11 17:37:20 -0700 (Mon, 11 Sep 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_REVERB_H
#define _EAS_REVERB_H
/* enumerated parameter settings for Reverb effect */
typedef enum
{
EAS_PARAM_REVERB_BYPASS,
EAS_PARAM_REVERB_PRESET,
EAS_PARAM_REVERB_WET,
EAS_PARAM_REVERB_DRY
} E_REVERB_PARAMS;
typedef enum
{
EAS_PARAM_REVERB_LARGE_HALL,
EAS_PARAM_REVERB_HALL,
EAS_PARAM_REVERB_CHAMBER,
EAS_PARAM_REVERB_ROOM,
} E_REVERB_PRESETS;
#endif /* _REVERB_H */

View File

@@ -0,0 +1,273 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_types.h
*
* Contents and purpose:
* The public interface header for the EAS synthesizer.
*
* This header only contains declarations that are specific
* to this implementation.
*
* DO NOT MODIFY THIS FILE!
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 726 $
* $Date: 2007-06-14 23:10:46 -0700 (Thu, 14 Jun 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_TYPES_H
#define _EAS_TYPES_H
/* EAS_RESULT return codes */
typedef long EAS_RESULT;
#define EAS_SUCCESS 0
#define EAS_FAILURE -1
#define EAS_ERROR_INVALID_MODULE -2
#define EAS_ERROR_MALLOC_FAILED -3
#define EAS_ERROR_FILE_POS -4
#define EAS_ERROR_INVALID_FILE_MODE -5
#define EAS_ERROR_FILE_SEEK -6
#define EAS_ERROR_FILE_LENGTH -7
#define EAS_ERROR_NOT_IMPLEMENTED -8
#define EAS_ERROR_CLOSE_FAILED -9
#define EAS_ERROR_FILE_OPEN_FAILED -10
#define EAS_ERROR_INVALID_HANDLE -11
#define EAS_ERROR_NO_MIX_BUFFER -12
#define EAS_ERROR_PARAMETER_RANGE -13
#define EAS_ERROR_MAX_FILES_OPEN -14
#define EAS_ERROR_UNRECOGNIZED_FORMAT -15
#define EAS_BUFFER_SIZE_MISMATCH -16
#define EAS_ERROR_FILE_FORMAT -17
#define EAS_ERROR_SMF_NOT_INITIALIZED -18
#define EAS_ERROR_LOCATE_BEYOND_END -19
#define EAS_ERROR_INVALID_PCM_TYPE -20
#define EAS_ERROR_MAX_PCM_STREAMS -21
#define EAS_ERROR_NO_VOICE_ALLOCATED -22
#define EAS_ERROR_INVALID_CHANNEL -23
#define EAS_ERROR_ALREADY_STOPPED -24
#define EAS_ERROR_FILE_READ_FAILED -25
#define EAS_ERROR_HANDLE_INTEGRITY -26
#define EAS_ERROR_MAX_STREAMS_OPEN -27
#define EAS_ERROR_INVALID_PARAMETER -28
#define EAS_ERROR_FEATURE_NOT_AVAILABLE -29
#define EAS_ERROR_SOUND_LIBRARY -30
#define EAS_ERROR_NOT_VALID_IN_THIS_STATE -31
#define EAS_ERROR_NO_VIRTUAL_SYNTHESIZER -32
#define EAS_ERROR_FILE_ALREADY_OPEN -33
#define EAS_ERROR_FILE_ALREADY_CLOSED -34
#define EAS_ERROR_INCOMPATIBLE_VERSION -35
#define EAS_ERROR_QUEUE_IS_FULL -36
#define EAS_ERROR_QUEUE_IS_EMPTY -37
#define EAS_ERROR_FEATURE_ALREADY_ACTIVE -38
/* special return codes */
#define EAS_EOF 3
#define EAS_STREAM_BUFFERING 4
#define EAS_BUFFER_FULL 5
/* EAS_STATE return codes */
typedef long EAS_STATE;
typedef enum
{
EAS_STATE_READY = 0,
EAS_STATE_PLAY,
EAS_STATE_STOPPING,
EAS_STATE_PAUSING,
EAS_STATE_STOPPED,
EAS_STATE_PAUSED,
EAS_STATE_OPEN,
EAS_STATE_ERROR,
EAS_STATE_EMPTY
} E_EAS_STATE;
/* constants */
#ifndef EAS_CONST
#define EAS_CONST const
#endif
/* definition for public interface functions */
#ifndef EAS_PUBLIC
#define EAS_PUBLIC
#endif
/* boolean values */
typedef unsigned EAS_BOOL;
typedef unsigned char EAS_BOOL8;
#define EAS_FALSE 0
#define EAS_TRUE 1
/* scalar variable definitions */
typedef unsigned char EAS_U8;
typedef signed char EAS_I8;
typedef char EAS_CHAR;
typedef unsigned short EAS_U16;
typedef short EAS_I16;
typedef unsigned long EAS_U32;
typedef long EAS_I32;
typedef unsigned EAS_UINT;
typedef int EAS_INT;
typedef long EAS_LONG;
/* audio output type */
typedef short EAS_PCM;
/* file open modes */
typedef EAS_I32 EAS_FILE_MODE;
#define EAS_FILE_READ 1
#define EAS_FILE_WRITE 2
/* file locator e.g. filename or memory pointer */
typedef struct s_eas_file_tag {
const char* path;
int fd;
long long offset;
long long length;
} EAS_FILE, *EAS_FILE_LOCATOR;
/* handle to stream */
typedef struct s_eas_stream_tag *EAS_HANDLE;
/* handle to file */
typedef struct eas_hw_file_tag *EAS_FILE_HANDLE;
/* handle for synthesizer data */
typedef struct s_eas_data_tag *EAS_DATA_HANDLE;
/* handle to persistent data for host wrapper interface */
typedef struct eas_hw_inst_data_tag *EAS_HW_DATA_HANDLE;
/* handle to sound library */
typedef struct s_eas_sndlib_tag *EAS_SNDLIB_HANDLE;
typedef struct s_eas_dls_tag *EAS_DLSLIB_HANDLE;
/* pointer to frame buffer - used in split architecture only */
typedef struct s_eas_frame_buffer_tag *EAS_FRAME_BUFFER_HANDLE;
/* untyped pointer for instance data */
typedef void *EAS_VOID_PTR;
/* inline functions */
#ifndef EAS_INLINE
#if defined (__XCC__)
#define EAS_INLINE __inline__
#elif defined (__GNUC__)
#define EAS_INLINE inline static
#else
#define EAS_INLINE __inline
#endif
#endif
/* define NULL value */
#ifndef NULL
#define NULL 0
#endif
/* metadata types for metadata return codes */
typedef enum
{
EAS_METADATA_UNKNOWN = 0,
EAS_METADATA_TITLE,
EAS_METADATA_AUTHOR,
EAS_METADATA_COPYRIGHT,
EAS_METADATA_LYRIC,
EAS_METADATA_TEXT
} E_EAS_METADATA_TYPE;
/* metadata callback function */
typedef void (*EAS_METADATA_CBFUNC) (E_EAS_METADATA_TYPE metaDataType, char *metaDataBuf, EAS_VOID_PTR pUserData);
/* file types for metadata return codes */
typedef enum
{
EAS_FILE_UNKNOWN = 0,
EAS_FILE_SMF0,
EAS_FILE_SMF1,
EAS_FILE_SMAF_UNKNOWN,
EAS_FILE_SMAF_MA2,
EAS_FILE_SMAF_MA3,
EAS_FILE_SMAF_MA5,
EAS_FILE_CMX,
EAS_FILE_MFI,
EAS_FILE_OTA,
EAS_FILE_IMELODY,
EAS_FILE_RTTTL,
EAS_FILE_XMF0,
EAS_FILE_XMF1,
EAS_FILE_WAVE_PCM,
EAS_FILE_WAVE_IMA_ADPCM,
EAS_FILE_MMAPI_TONE_CONTROL
} E_EAS_FILE_TYPE;
/* enumeration for synthesizers */
typedef enum
{
EAS_MCU_SYNTH = 0,
EAS_DSP_SYNTH
} E_SYNTHESIZER;
/* external audio callback program change */
typedef struct s_ext_audio_prg_chg_tag
{
EAS_U16 bank;
EAS_U8 program;
EAS_U8 channel;
} S_EXT_AUDIO_PRG_CHG;
/* external audio callback event */
typedef struct s_ext_audio_event_tag
{
EAS_U8 channel;
EAS_U8 note;
EAS_U8 velocity;
EAS_BOOL8 noteOn;
} S_EXT_AUDIO_EVENT;
typedef struct s_midi_controllers_tag
{
EAS_U8 modWheel; /* CC1 */
EAS_U8 volume; /* CC7 */
EAS_U8 pan; /* CC10 */
EAS_U8 expression; /* CC11 */
EAS_U8 channelPressure; /* MIDI channel pressure */
#ifdef _REVERB
EAS_U8 reverbSend; /* CC91 */
#endif
#ifdef _CHORUS
EAS_U8 chorusSend; /* CC93 */
#endif
} S_MIDI_CONTROLLERS;
/* iMode play modes enumeration for EAS_SetPlayMode */
typedef enum
{
IMODE_PLAY_ALL = 0,
IMODE_PLAY_PARTIAL
} E_I_MODE_PLAY_MODE;
typedef EAS_BOOL (*EAS_EXT_PRG_CHG_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_PRG_CHG *pPrgChg);
typedef EAS_BOOL (*EAS_EXT_EVENT_FUNC) (EAS_VOID_PTR pInstData, S_EXT_AUDIO_EVENT *pEvent);
#endif /* #ifndef _EAS_TYPES_H */

View File

@@ -0,0 +1,423 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_wave.c
*
* Contents and purpose:
* This module contains .WAV file functions for the EAS synthesizer
* test harness.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 658 $
* $Date: 2007-04-24 13:35:49 -0700 (Tue, 24 Apr 2007) $
*----------------------------------------------------------------------------
*/
/* lint complaints about most C library headers, so we use our own during lint step */
#ifdef _lint
#include "lint_stdlib.h"
#else
#include <stdio.h>
#include <stdlib.h>
#endif
#include "eas_wave.h"
/* .WAV file format tags */
const EAS_U32 riffTag = 0x46464952;
const EAS_U32 waveTag = 0x45564157;
const EAS_U32 fmtTag = 0x20746d66;
const EAS_U32 dataTag = 0x61746164;
#ifdef _BIG_ENDIAN
/*----------------------------------------------------------------------------
* FlipDWord()
*----------------------------------------------------------------------------
* Purpose: Endian flip a DWORD for big-endian processors
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static void FlipDWord (EAS_U32 *pValue)
{
EAS_U8 *p;
EAS_U32 temp;
p = (EAS_U8*) pValue;
temp = (((((p[3] << 8) | p[2]) << 8) | p[1]) << 8) | p[0];
*pValue = temp;
}
/*----------------------------------------------------------------------------
* FlipWord()
*----------------------------------------------------------------------------
* Purpose: Endian flip a WORD for big-endian processors
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static void FlipWord (EAS_U16 *pValue)
{
EAS_U8 *p;
EAS_U16 temp;
p = (EAS_U8*) pValue;
temp = (p[1] << 8) | p[0];
*pValue = temp;
}
/*----------------------------------------------------------------------------
* FlipWaveHeader()
*----------------------------------------------------------------------------
* Purpose: Endian flip the wave header for big-endian processors
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static void FlipWaveHeader (WAVE_HEADER *p)
{
FlipDWord(&p->nRiffTag);
FlipDWord(&p->nRiffSize);
FlipDWord(&p->nWaveTag);
FlipDWord(&p->nFmtTag);
FlipDWord(&p->nFmtSize);
FlipDWord(&p->nDataTag);
FlipDWord(&p->nDataSize);
FlipWord(&p->fc.wFormatTag);
FlipWord(&p->fc.nChannels);
FlipDWord(&p->fc.nSamplesPerSec);
FlipDWord(&p->fc.nAvgBytesPerSec);
FlipWord(&p->fc.nBlockAlign);
FlipWord(&p->fc.wBitsPerSample);
}
#endif
/*----------------------------------------------------------------------------
* WaveFileCreate()
*----------------------------------------------------------------------------
* Purpose: Opens a wave file for writing and writes the header
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample)
{
WAVE_FILE *wFile;
/* allocate memory */
wFile = malloc(sizeof(WAVE_FILE));
if (!wFile)
return NULL;
wFile->write = EAS_TRUE;
/* create the file */
wFile->file = fopen(filename,"wb");
if (!wFile->file)
{
free(wFile);
return NULL;
}
/* initialize PCM format .WAV file header */
wFile->wh.nRiffTag = riffTag;
wFile->wh.nRiffSize = sizeof(WAVE_HEADER) - 8;
wFile->wh.nWaveTag = waveTag;
wFile->wh.nFmtTag = fmtTag;
wFile->wh.nFmtSize = sizeof(FMT_CHUNK);
/* initalize 'fmt' chunk */
wFile->wh.fc.wFormatTag = 1;
wFile->wh.fc.nChannels = (EAS_U16) nChannels;
wFile->wh.fc.nSamplesPerSec = (EAS_U32) nSamplesPerSec;
wFile->wh.fc.wBitsPerSample = (EAS_U16) wBitsPerSample;
wFile->wh.fc.nBlockAlign = (EAS_U16) (nChannels * (EAS_U16) (wBitsPerSample / 8));
wFile->wh.fc.nAvgBytesPerSec = wFile->wh.fc.nBlockAlign * (EAS_U32) nSamplesPerSec;
/* initialize 'data' chunk */
wFile->wh.nDataTag = dataTag;
wFile->wh.nDataSize = 0;
#ifdef _BIG_ENDIAN
FlipWaveHeader(&wFile->wh);
#endif
/* write the header */
if (fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file) != 1)
{
fclose(wFile->file);
free(wFile);
return NULL;
}
#ifdef _BIG_ENDIAN
FlipWaveHeader(&wFile->wh);
#endif
/* return the file handle */
return wFile;
} /* end WaveFileCreate */
/*----------------------------------------------------------------------------
* WaveFileWrite()
*----------------------------------------------------------------------------
* Purpose: Writes data to the wave file
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n)
{
EAS_I32 count;
/* make sure we have an open file */
if (wFile == NULL)
{
return 0;
}
#ifdef _BIG_ENDIAN
{
EAS_I32 i;
EAS_U16 *p;
p = buffer;
i = n >> 1;
while (i--)
FlipWord(p++);
}
#endif
/* write the data */
count = (EAS_I32) fwrite(buffer, 1, (size_t) n, wFile->file);
/* add the number of bytes written */
wFile->wh.nRiffSize += (EAS_U32) count;
wFile->wh.nDataSize += (EAS_U32) count;
/* return the count of bytes written */
return count;
} /* end WriteWaveHeader */
/*----------------------------------------------------------------------------
* WaveFileClose()
*----------------------------------------------------------------------------
* Purpose: Opens a wave file for writing and writes the header
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
EAS_BOOL WaveFileClose (WAVE_FILE *wFile)
{
EAS_I32 count = 1;
/* return to beginning of file and write the header */
if (wFile->write)
{
if (fseek(wFile->file, 0L, SEEK_SET) == 0)
{
#ifdef _BIG_ENDIAN
FlipWaveHeader(&wFile->wh);
#endif
count = (EAS_I32) fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file);
#ifdef _BIG_ENDIAN
FlipWaveHeader(&wFile->wh);
#endif
}
}
/* close the file */
if (fclose(wFile->file) != 0)
count = 0;
/* free the memory */
free(wFile);
/* return the file handle */
return (count == 1 ? EAS_TRUE : EAS_FALSE);
} /* end WaveFileClose */
#ifdef _WAVE_FILE_READ
#ifdef _BIG_ENDIAN
#error "WaveFileOpen not currently supported on big-endian processors"
#endif
/*----------------------------------------------------------------------------
* WaveFileOpen()
*----------------------------------------------------------------------------
* Purpose: Opens a wave file for reading and reads the header
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
WAVE_FILE *WaveFileOpen (const char *filename)
{
WAVE_FILE *wFile;
struct
{
EAS_U32 tag;
EAS_U32 size;
} chunk;
EAS_U32 tag;
EAS_I32 startChunkPos;
EAS_INT state;
EAS_BOOL done;
/* allocate memory */
wFile = malloc(sizeof(WAVE_FILE));
if (!wFile)
return NULL;
/* open the file */
wFile->write = EAS_FALSE;
wFile->file = fopen(filename,"rb");
if (!wFile->file)
{
free(wFile);
return NULL;
}
/* make lint happy */
chunk.tag = chunk.size = 0;
startChunkPos = 0;
/* read the RIFF tag and file size */
state = 0;
done = EAS_FALSE;
while (!done)
{
switch(state)
{
/* read the RIFF tag */
case 0:
if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
done = EAS_TRUE;
else
{
if (chunk.tag != riffTag)
done = EAS_TRUE;
else
state++;
}
break;
/* read the WAVE tag */
case 1:
if (fread(&tag, sizeof(tag), 1, wFile->file) != 1)
done = EAS_TRUE;
else
{
if (tag != waveTag)
done = EAS_TRUE;
else
state++;
}
break;
/* looking for fmt chunk */
case 2:
if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
done = EAS_TRUE;
else
{
startChunkPos = ftell(wFile->file);
/* not fmt tag, skip it */
if (chunk.tag != fmtTag)
fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
else
state++;
}
break;
/* read fmt chunk */
case 3:
if (fread(&wFile->wh.fc, sizeof(FMT_CHUNK), 1, wFile->file) != 1)
done = EAS_TRUE;
else
{
fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
state++;
}
break;
/* looking for data chunk */
case 4:
if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
done = EAS_TRUE;
else
{
startChunkPos = ftell(wFile->file);
/* not data tag, skip it */
if (chunk.tag != dataTag)
fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
else
{
wFile->dataSize = chunk.size;
state++;
done = EAS_TRUE;
}
}
break;
default:
done = EAS_TRUE;
break;
}
}
/* if not final state, an error occurred */
if (state != 5)
{
fclose(wFile->file);
free(wFile);
return NULL;
}
/* return the file handle */
return wFile;
} /* end WaveFileOpen */
#endif

View File

@@ -0,0 +1,74 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_wave.h
*
* Contents and purpose:
* Writes output to a .WAV file
*
* DO NOT MODIFY THIS FILE!
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
/* sentinel */
#ifndef _EAS_WAVE_H
#define _EAS_WAVE_H
/* .WAV file format chunk */
typedef struct {
EAS_U16 wFormatTag;
EAS_U16 nChannels;
EAS_U32 nSamplesPerSec;
EAS_U32 nAvgBytesPerSec;
EAS_U16 nBlockAlign;
EAS_U16 wBitsPerSample;
} FMT_CHUNK;
/* .WAV file header */
typedef struct {
EAS_U32 nRiffTag;
EAS_U32 nRiffSize;
EAS_U32 nWaveTag;
EAS_U32 nFmtTag;
EAS_U32 nFmtSize;
FMT_CHUNK fc;
EAS_U32 nDataTag;
EAS_U32 nDataSize;
} WAVE_HEADER;
typedef struct {
WAVE_HEADER wh;
FILE *file;
EAS_BOOL write;
EAS_U32 dataSize;
} WAVE_FILE;
WAVE_FILE *WaveFileCreate (const char *filename, EAS_I32 nChannels, EAS_I32 nSamplesPerSec, EAS_I32 wBitsPerSample);
EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n);
EAS_BOOL WaveFileClose (WAVE_FILE *wFile);
WAVE_FILE *WaveFileOpen (const char *filename);
#endif /* end #ifndef _EAS_WAVE_H */

View File

@@ -0,0 +1,199 @@
/*----------------------------------------------------------------------------
*
* File:
* jet.h
*
* Contents and purpose:
* Public interface for JET sound engine
*
* Copyright (c) 2006 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 554 $
* $Date: 2007-02-02 11:06:10 -0800 (Fri, 02 Feb 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _JET_H
#define _JET_H
#include "eas_types.h"
#include "eas.h"
/* for C++ linkage */
#ifdef __cplusplus
extern "C" {
#endif
/* opaque handle types for JET interface */
typedef struct s_jet_data_tag *JET_DATA_HANDLE;
typedef struct s_jet_config_tag
{
EAS_U8 appEventRangeLow;
EAS_U8 appEventRangeHigh;
} S_JET_CONFIG;
typedef struct s_jet_status_tag
{
EAS_INT currentUserID;
EAS_INT segmentRepeatCount;
EAS_INT numQueuedSegments;
EAS_BOOL paused;
EAS_I32 location;
EAS_U8 currentPlayingSegment;
EAS_U8 currentQueuedSegment;
} S_JET_STATUS;
typedef struct s_jet_event_tag
{
EAS_U8 segment;
EAS_U8 channel;
EAS_U8 track;
EAS_U8 controller;
EAS_U8 value;
} S_JET_EVENT;
/*----------------------------------------------------------------------------
* JET_Init()
*----------------------------------------------------------------------------
* Initializes the JET library, allocates memory, etc. Call
* JET_Shutdown to de-allocate memory. Pass NULL for pConfig
* to use defaults. If passing config data, configSize should be
* sizeof(S_JET_CONFIG). This allows for future expansion of the
* config structure while maintaining compatibility.
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Init (EAS_DATA_HANDLE easHandle, const S_JET_CONFIG *pConfig, EAS_INT configSize);
/*----------------------------------------------------------------------------
* JET_Shutdown()
*----------------------------------------------------------------------------
* Frees any memory used by the JET library
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Shutdown (EAS_DATA_HANDLE easHandle);
/*----------------------------------------------------------------------------
* JET_OpenFile()
*----------------------------------------------------------------------------
* Opens a JET content file for playback
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_OpenFile (EAS_DATA_HANDLE easHandle, EAS_FILE_LOCATOR locator);
/*----------------------------------------------------------------------------
* JET_GetAppData()
*----------------------------------------------------------------------------
* Returns location and size of application data in the JET file
*----------------------------------------------------------------------------
*/
EAS_RESULT JET_GetAppData (EAS_DATA_HANDLE easHandle, EAS_I32 *pAppDataOffset, EAS_I32 *pAppDataSize);
/*----------------------------------------------------------------------------
* JET_CloseFile()
*----------------------------------------------------------------------------
* Closes a JET content file and releases associated resources
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_CloseFile (EAS_DATA_HANDLE easHandle);
/*----------------------------------------------------------------------------
* JET_Status()
*----------------------------------------------------------------------------
* Returns current status
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Status (EAS_DATA_HANDLE easHandle, S_JET_STATUS *pStatus);
/*----------------------------------------------------------------------------
* JET_GetEvent()
*----------------------------------------------------------------------------
* Checks for application events
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_BOOL JET_GetEvent (EAS_DATA_HANDLE easHandle, EAS_U32 *pEventRaw, S_JET_EVENT *pEvent);
/*----------------------------------------------------------------------------
* JET_ParseEvent()
*----------------------------------------------------------------------------
* Returns current status
*----------------------------------------------------------------------------
*/
EAS_PUBLIC void JET_ParseEvent (EAS_U32 event, S_JET_EVENT *pEvent);
/*----------------------------------------------------------------------------
* JET_QueueSegment()
*----------------------------------------------------------------------------
* Queue a segment for playback
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_QueueSegment (EAS_DATA_HANDLE easHandle, EAS_INT segmentNum, EAS_INT libNum, EAS_INT repeatCount, EAS_INT transpose, EAS_U32 muteFlags, EAS_U8 userID);
/*----------------------------------------------------------------------------
* JET_Play()
*----------------------------------------------------------------------------
* Starts playback of the file
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Play (EAS_DATA_HANDLE easHandle);
/*----------------------------------------------------------------------------
* JET_Pause()
*----------------------------------------------------------------------------
* Pauses playback of the file
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Pause (EAS_DATA_HANDLE easHandle);
/*----------------------------------------------------------------------------
* JET_SetMuteFlags()
*----------------------------------------------------------------------------
* Change the state of the mute flags
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_SetMuteFlags (EAS_DATA_HANDLE easHandle, EAS_U32 muteFlags, EAS_BOOL sync);
/*----------------------------------------------------------------------------
* JET_SetMuteFlag()
*----------------------------------------------------------------------------
* Change the state of a single mute flag
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_SetMuteFlag (EAS_DATA_HANDLE easHandle, EAS_INT trackNum, EAS_BOOL muteFlag, EAS_BOOL sync);
/*----------------------------------------------------------------------------
* JET_TriggerClip()
*----------------------------------------------------------------------------
* Unmute a track and then mute it when it is complete
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_TriggerClip (EAS_DATA_HANDLE easHandle, EAS_INT clipID);
/*----------------------------------------------------------------------------
* JET_Clear_Queue()
*----------------------------------------------------------------------------
* Clears all segments in the queue
*----------------------------------------------------------------------------
*/
EAS_PUBLIC EAS_RESULT JET_Clear_Queue (EAS_DATA_HANDLE easHandle);
#ifdef __cplusplus
} /* end extern "C" */
#endif
#endif

View File

@@ -0,0 +1,361 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {
/* Begin PBXBuildFile section */
9A56ACEA0F72B84D00D115A7 /* libeaswt_vst_lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A56ACD80F72B7D600D115A7 /* libeaswt_vst_lib.a */; };
C5AB01090E3400DC0051F183 /* EASLib.h in Headers */ = {isa = PBXBuildFile; fileRef = C5AB01070E3400DC0051F183 /* EASLib.h */; };
C5AB010A0E3400DC0051F183 /* EASLib.c in Sources */ = {isa = PBXBuildFile; fileRef = C5AB01080E3400DC0051F183 /* EASLib.c */; };
C5AB01240E3406090051F183 /* eas_config.c in Sources */ = {isa = PBXBuildFile; fileRef = C5AB01230E3406090051F183 /* eas_config.c */; };
C5AB017A0E340DD60051F183 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5AB01790E340DD60051F183 /* AudioUnit.framework */; };
C5AB018C0E340EAA0051F183 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5AB018B0E340EAA0051F183 /* AudioToolbox.framework */; };
C5AB01910E340EC50051F183 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5AB01900E340EC50051F183 /* CoreAudio.framework */; };
C5AB02F60E341AAC0051F183 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C5AB02F50E341AAC0051F183 /* Carbon.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
9A56ACD70F72B7D600D115A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A56ACD30F72B7D600D115A7 /* easwt_vst_lib.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC046055464E500DB518D;
remoteInfo = easwt_vst_lib;
};
9A56ACFC0F72B8B200D115A7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A56ACD30F72B7D600D115A7 /* easwt_vst_lib.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC045055464E500DB518D;
remoteInfo = easwt_vst_lib;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
9A56ACD30F72B7D600D115A7 /* easwt_vst_lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = easwt_vst_lib.xcodeproj; sourceTree = "<group>"; };
C5AB01070E3400DC0051F183 /* EASLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EASLib.h; sourceTree = "<group>"; };
C5AB01080E3400DC0051F183 /* EASLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = EASLib.c; sourceTree = "<group>"; };
C5AB01230E3406090051F183 /* eas_config.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_config.c; path = ../../host_src/eas_config.c; sourceTree = SOURCE_ROOT; };
C5AB01790E340DD60051F183 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
C5AB018B0E340EAA0051F183 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
C5AB01900E340EC50051F183 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = "<absolute>"; };
C5AB02F50E341AAC0051F183 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
D2AAC0630554660B00DB518D /* libEASLIb.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libEASLIb.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D289988505E68E00004EDB86 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9A56ACEA0F72B84D00D115A7 /* libeaswt_vst_lib.a in Frameworks */,
C5AB017A0E340DD60051F183 /* AudioUnit.framework in Frameworks */,
C5AB018C0E340EAA0051F183 /* AudioToolbox.framework in Frameworks */,
C5AB01910E340EC50051F183 /* CoreAudio.framework in Frameworks */,
C5AB02F60E341AAC0051F183 /* Carbon.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* EASLIb */ = {
isa = PBXGroup;
children = (
9A56ACD30F72B7D600D115A7 /* easwt_vst_lib.xcodeproj */,
C5AB02F50E341AAC0051F183 /* Carbon.framework */,
C5AB01900E340EC50051F183 /* CoreAudio.framework */,
C5AB018B0E340EAA0051F183 /* AudioToolbox.framework */,
C5AB01790E340DD60051F183 /* AudioUnit.framework */,
08FB7795FE84155DC02AAC07 /* Source */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = EASLIb;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
C5AB01230E3406090051F183 /* eas_config.c */,
C5AB01070E3400DC0051F183 /* EASLib.h */,
C5AB01080E3400DC0051F183 /* EASLib.c */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
D2AAC0630554660B00DB518D /* libEASLIb.dylib */,
);
name = Products;
sourceTree = "<group>";
};
9A56ACD40F72B7D600D115A7 /* Products */ = {
isa = PBXGroup;
children = (
9A56ACD80F72B7D600D115A7 /* libeaswt_vst_lib.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
D2AAC0600554660B00DB518D /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
C5AB01090E3400DC0051F183 /* EASLib.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
D2AAC0620554660B00DB518D /* EASLIb */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "EASLIb" */;
buildPhases = (
D2AAC0600554660B00DB518D /* Headers */,
D2AAC0610554660B00DB518D /* Sources */,
D289988505E68E00004EDB86 /* Frameworks */,
);
buildRules = (
);
dependencies = (
9A56ACFD0F72B8B200D115A7 /* PBXTargetDependency */,
);
name = EASLIb;
productName = EASLIb;
productReference = D2AAC0630554660B00DB518D /* libEASLIb.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "EASLIb" */;
compatibilityVersion = "Xcode 3.0";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 08FB7794FE84155DC02AAC07 /* EASLIb */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = 9A56ACD40F72B7D600D115A7 /* Products */;
ProjectRef = 9A56ACD30F72B7D600D115A7 /* easwt_vst_lib.xcodeproj */;
},
);
projectRoot = "";
targets = (
D2AAC0620554660B00DB518D /* EASLIb */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
9A56ACD80F72B7D600D115A7 /* libeaswt_vst_lib.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libeaswt_vst_lib.a;
remoteRef = 9A56ACD70F72B7D600D115A7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXSourcesBuildPhase section */
D2AAC0610554660B00DB518D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C5AB010A0E3400DC0051F183 /* EASLib.c in Sources */,
C5AB01240E3406090051F183 /* eas_config.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
9A56ACFD0F72B8B200D115A7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = easwt_vst_lib;
targetProxy = 9A56ACFC0F72B8B200D115A7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
1DEB914B08733D8E0010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
EXECUTABLE_PREFIX = lib;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"EAS_MAX_FILE_HANDLES=100",
"_DEBUG_CMF=1",
"JET_INTERFACE=1",
"MAX_SMF_STREAMS=32",
"NUM_OUTPUT_CHANNELS=2",
"_SAMPLE_RATE_44100=1",
"_8_BIT_SAMPLES=1",
"_FILTER_ENABLED=1",
"_NO_DEBUG_PREPROCESSOR=1",
"_CORE_CYCLES_PER_MEMORY_CYCLE=1",
"_IMA_DECODER=1",
"_XMF_PARSER=1",
"_DLS_PARSER=1",
"MAX_DLS_MEMORY=16777216",
"EAS_WT_SYNTH=1",
"MAX_SYNTH_VOICES=64",
"X_ENHANCER_ENABLED=1",
"_REVERB_ENABLED=1",
"_CHORUS_ENABLED=1",
"DLS_SYNTHESIZER=1",
"EXTERNAL_AUDIO=1",
"TEST_HARNESS=1",
"MMAPI_SUPPORT=1",
"X_MAXIMIZER_ENABLED=1",
"X_COMPRESSOR_ENABLED=1",
"X_STATS=1",
"X_DEBUG_DLS=1",
"X_OPTIMIZED_MONO=1",
"X_CHECKED_BUILD=1",
"_NO_ALIGN=1",
"_C_REFERENCE=1",
"XMAXIMIZER_USE_FLOATING_POINT=1",
"BUFFERED_FILE_ACCESS=1",
);
HEADER_SEARCH_PATHS = (
"${TARGET_BUILD_DIR}/**",
"../../Common/**",
"../../Parsers/**",
"../../Effects/**",
"../../WTSynth/**",
"../../FMSynth/**",
"../../SplitArch/**",
"../../Jet/**",
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = EASLIb;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB914C08733D8E0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
EXECUTABLE_PREFIX = lib;
GCC_AUTO_VECTORIZATION = YES;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = (
"BUFFERED_FILE_ACCESS=1",
"EAS_FILE_BUFFER_SIZE=1024",
"EAS_MAX_FILE_HANDLES=100",
"JET_INTERFACE=1",
"MAX_SMF_STREAMS=32",
"EAS_WT_SYNTH=1",
"NUM_OUTPUT_CHANNELS=2",
"_SAMPLE_RATE_44100=1",
"_8_BIT_SAMPLES=1",
"_FILTER_ENABLED=1",
"_NO_DEBUG_PREPROCESSOR=1",
"_CORE_CYCLES_PER_MEMORY_CYCLE=1",
"_IMA_DECODER=1",
"_XMF_PARSER=1",
"_DLS_PARSER=1",
"MAX_DLS_MEMORY=16777216",
"MAX_SYNTH_VOICES=64",
"X_ENHANCER_ENABLED=1",
"_REVERB_ENABLED=1",
"_CHORUS_ENABLED=1",
"DLS_SYNTHESIZER=1",
"EXTERNAL_AUDIO=1",
"TEST_HARNESS=1",
"MMAPI_SUPPORT=1",
"X_MAXIMIZER_ENABLED=1",
"X_COMPRESSOR_ENABLED=1",
"X_STATS=1",
"X_DEBUG_DLS=1",
"X_OPTIMIZED_MONO=1",
"X_CHECKED_BUILD=1",
"_NO_ALIGN=1",
"_C_REFERENCE=1",
"XMAXIMIZER_USE_FLOATING_POINT=1",
);
GCC_UNROLL_LOOPS = YES;
HEADER_SEARCH_PATHS = (
"${TARGET_BUILD_DIR}/**",
"../../Common/**",
"../../Parsers/**",
"../../Effects/**",
"../../WTSynth/**",
"../../FMSynth/**",
"../../SplitArch/**",
"../../Jet/**",
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = EASLIb;
};
name = Release;
};
1DEB914F08733D8E0010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Debug;
};
1DEB915008733D8E0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "EASLIb" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB914B08733D8E0010E9CD /* Debug */,
1DEB914C08733D8E0010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "EASLIb" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB914F08733D8E0010E9CD /* Debug */,
1DEB915008733D8E0010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC0620554660B00DB518D"
BuildableName = "libEASLIb.dylib"
BlueprintName = "EASLIb"
ReferencedContainer = "container:EASLIb.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EASLIb.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>13</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D2AAC0620554660B00DB518D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC0620554660B00DB518D"
BuildableName = "libEASLIb.dylib"
BlueprintName = "EASLIb"
ReferencedContainer = "container:EASLIb.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EASLIb.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D2AAC0620554660B00DB518D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,31 @@
/*
* EASLib.h
* EASLIb
*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include "eas_types.h"
extern EAS_RESULT EAS_LibInit (EAS_DATA_HANDLE *pHandle)
{
return EAS_Init(pEASData);
}
EAS_EXPORT EAS_LibShutdown (EAS_DATA_HANDLE handle)
{
EAS_Shutdown(handle);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
OS X JetCreator Library Build Instructions
1/ Open easwt_vst_lib.xcodeproj and build
2/ Open EASLIb.xcodeproj and build
3/ Copy build/Release/libEASLIb.dylib to the JetCreator folder

View File

@@ -0,0 +1,47 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_host_debug.h
*
* Contents and purpose:
* This header defines the host wrapper functions for simulating
* error conditions.
*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// sentinel
#ifndef _EAS_HOST_DEBUG_H
#define _EAS_HOST_DEBUG_H
#include "eas_types.h"
typedef enum
{
eInitError,
eShutdownError,
eMallocError,
eOpenError,
eReadError,
ePosError,
eSeekError,
eLengthError,
eDupError,
eCloseError,
eNumErrorConditions,
} E_ERROR_CONDITIONS;
#endif

View File

@@ -0,0 +1,999 @@
/*----------------------------------------------------------------------------
*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "eas_sndlib.h"
/*----------------------------------------------------------------------------
* Articulations
*----------------------------------------------------------------------------
*/
const S_ARTICULATION testArticulations[] =
{
{ /* articulation 0 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 1 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 19, 0, 0, 0, 0, 0, 0
},
{ /* articulation 2 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 34, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 3 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 86, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 4 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 172, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 5 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 345, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 6 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 517, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 7 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 689, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 8 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 861, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 9 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 1723, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 10 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 191, 0, 0, 0, 0, 0, 0
},
{ /* articulation 11 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 382, 0, 0, 0, 0, 0, 0
},
{ /* articulation 12 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 13 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 1903, 0, 0, 0, 0, 0, 0
},
{ /* articulation 14 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 3804, 0, 0, 0, 0, 0, 0
},
{ /* articulation 15 */
{ 1902, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 16 */
{ 380, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 17 */
{ 190, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 18 */
{ 38, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 19 */
{ 19, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 20 */
{ 10, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 21 */
{ 5, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 22 */
{ 32767, 17213, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 23 */
{ 32767, 28809, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 24 */
{ 32767, 30725, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 25 */
{ 32767, 32349, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 26 */
{ 32767, 32558, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 27 */
{ 32767, 32663, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 28 */
{ 32767, 32715, 0, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 29 */
{ 32767, 30725, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 30 */
{ 32767, 30725, 3566, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 31 */
{ 32767, 30725, 42, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 32 */
{ 32767, 30725, 5, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 33 */
{ 32767, 30725, 2, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 34 */
{ 32767, 0, 32767, 17213 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 35 */
{ 32767, 0, 32767, 28809 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 36 */
{ 32767, 0, 32767, 30725 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 37 */
{ 32767, 0, 32767, 32349 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 38 */
{ 32767, 0, 32767, 32558 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 39 */
{ 32767, 0, 32767, 32663 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 40 */
{ 32767, 0, 32767, 32715 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 0
},
{ /* articulation 41 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 190, 0, 0, 0, 1, 0, 0
},
{ /* articulation 42 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 189, 0, 0, 0, 3, 0, 0
},
{ /* articulation 43 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 190, 0, 0, 0, 4, 0, 0
},
{ /* articulation 44 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 190, 0, 0, 0, 6, 0, 0
},
{ /* articulation 45 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
-1200, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 46 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
-600, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 47 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
-100, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 48 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
-50, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 49 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
50, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 50 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 51 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
600, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 52 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
1200, 0, 190, 0, 0, 0, 0, 0, 0
},
{ /* articulation 53 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, -1200, 0, 0, 0, 0, 0
},
{ /* articulation 54 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, -600, 0, 0, 0, 0, 0
},
{ /* articulation 55 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, -100, 0, 0, 0, 0, 0
},
{ /* articulation 56 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, -50, 0, 0, 0, 0, 0
},
{ /* articulation 57 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 50, 0, 0, 0, 0, 0
},
{ /* articulation 58 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 100, 0, 0, 0, 0, 0
},
{ /* articulation 59 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 600, 0, 0, 0, 0, 0
},
{ /* articulation 60 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 1200, 0, 0, 0, 0, 0
},
{ /* articulation 61 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 5535, 0, 0, 0
},
{ /* articulation 62 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 7121, 0, 0, 0
},
{ /* articulation 63 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 8321, 0, 0, 0
},
{ /* articulation 64 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9906, 0, 0, 0
},
{ /* articulation 65 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 11106, 0, 0, 0
},
{ /* articulation 66 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9521, 0, 0, 0
},
{ /* articulation 67 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9521, 0, 8, 0
},
{ /* articulation 68 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9521, 0, 16, 0
},
{ /* articulation 69 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9521, 0, 24, 0
},
{ /* articulation 70 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9521, 0, 30, 0
},
{ /* articulation 71 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, -6400, 9521, 0, 0, 0
},
{ /* articulation 72 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, -3200, 9521, 0, 0, 0
},
{ /* articulation 73 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, -1600, 9521, 0, 0, 0
},
{ /* articulation 74 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, -800, 9521, 0, 0, 0
},
{ /* articulation 75 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, 800, 7121, 0, 0, 0
},
{ /* articulation 76 */
{ 190, 30725, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, 1600, 7121, 0, 0, 0
},
{ /* articulation 77 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, 3200, 7121, 0, 0, 0
},
{ /* articulation 78 */
{ 32767, 0, 32767, 0 },
{ 190, 190, 0, 0 },
0, 0, 951, 0, 6400, 7121, 0, 0, 0
},
{ /* articulation 79 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 190, 0, 0, 11106, 0, 0, 0
},
{ /* articulation 80 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 191, 0, 0, 11106, 0, 0, 0
},
{ /* articulation 81 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 190, 0, 0, 7121, 0, 0, 0
},
{ /* articulation 82 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, -63
},
{ /* articulation 83 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, -50
},
{ /* articulation 84 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, -37
},
{ /* articulation 85 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, -25
},
{ /* articulation 86 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, -12
},
{ /* articulation 87 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 12
},
{ /* articulation 88 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 25
},
{ /* articulation 89 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 37
},
{ /* articulation 90 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 50
},
{ /* articulation 91 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 0, 0, 0, 63
},
{ /* articulation 92 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 9907, 0, 0, 0
},
{ /* articulation 93 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 10574, 0, 0, 0
},
{ /* articulation 94 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 11373, 0, 0, 0
},
{ /* articulation 95 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
0, 0, 951, 0, 0, 11376, 0, 0, 0
},
{ /* articulation 96 */
{ 32767, 0, 32767, 0 },
{ 32767, 32767, 32767, 0 },
100, 0, 949, 0, 0, 0, 0, 0, 0
}
}; /*end Articulations */
/*----------------------------------------------------------------------------
* Regions
*----------------------------------------------------------------------------
*/
const S_WT_REGION testRegions[] =
{
{ { 32769, 0, 127 }, -6000, 32767, 101, 301, 4, 0 }, /* region 0 */
{ { 1, 0, 60 }, -6000, 32767, 101, 301, 4, 2 }, /* region 1 */
{ { 1, 61, 61 }, -6000, 32767, 101, 301, 4, 3 }, /* region 2 */
{ { 1, 62, 62 }, -6000, 32767, 101, 301, 4, 4 }, /* region 3 */
{ { 1, 63, 63 }, -6000, 32767, 101, 301, 4, 5 }, /* region 4 */
{ { 1, 64, 64 }, -6000, 32767, 101, 301, 4, 6 }, /* region 5 */
{ { 1, 65, 65 }, -6000, 32767, 101, 301, 4, 7 }, /* region 6 */
{ { 1, 66, 66 }, -6000, 32767, 101, 301, 4, 8 }, /* region 7 */
{ { 32769, 67, 127 }, -6000, 32767, 101, 301, 4, 9 }, /* region 8 */
{ { 32769, 0, 127 }, -6005, 32767, 3, 171, 5, 0 }, /* region 9 */
{ { 32768, 0, 127 }, -6555, 32767, 0, 0, 2, 0 }, /* region 10 */
{ { 32770, 0, 127 }, -6000, 32767, 0, 0, 0, 0 }, /* region 11 */
{ { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 12 */
{ { 1, 61, 61 }, -6100, 16422, 101, 151, 4, 0 }, /* region 13 */
{ { 1, 62, 62 }, -6200, 8231, 101, 151, 4, 0 }, /* region 14 */
{ { 1, 63, 63 }, -6300, 2067, 101, 151, 4, 0 }, /* region 15 */
{ { 1, 64, 64 }, -6400, 130, 101, 151, 4, 0 }, /* region 16 */
{ { 32769, 65, 65 }, -6500, 1, 101, 151, 4, 0 }, /* region 17 */
{ { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 18 */
{ { 1, 61, 61 }, -6200, 32767, 101, 151, 4, 0 }, /* region 19 */
{ { 1, 62, 62 }, -6400, 32767, 101, 151, 4, 0 }, /* region 20 */
{ { 1, 63, 63 }, -6600, 32767, 101, 151, 4, 0 }, /* region 21 */
{ { 1, 64, 64 }, -6800, 32767, 101, 151, 4, 0 }, /* region 22 */
{ { 1, 65, 65 }, -7000, 32767, 101, 151, 4, 0 }, /* region 23 */
{ { 1, 66, 66 }, -7200, 32767, 101, 151, 4, 0 }, /* region 24 */
{ { 1, 67, 67 }, -7400, 32767, 101, 151, 4, 0 }, /* region 25 */
{ { 1, 68, 68 }, -7600, 32767, 101, 151, 4, 0 }, /* region 26 */
{ { 1, 69, 69 }, -7800, 32767, 101, 151, 4, 0 }, /* region 27 */
{ { 1, 70, 70 }, -8000, 32767, 101, 151, 4, 0 }, /* region 28 */
{ { 1, 71, 71 }, -8200, 32767, 101, 151, 4, 0 }, /* region 29 */
{ { 32769, 72, 72 }, -8400, 32767, 101, 151, 4, 0 }, /* region 30 */
{ { 1, 60, 60 }, -6000, 32767, 101, 301, 4, 0 }, /* region 31 */
{ { 1, 61, 61 }, -6099, 32767, 101, 151, 4, 0 }, /* region 32 */
{ { 1, 62, 62 }, -6190, 32767, 101, 151, 4, 0 }, /* region 33 */
{ { 1, 63, 63 }, -6250, 32767, 101, 151, 4, 0 }, /* region 34 */
{ { 1, 64, 64 }, -6300, 32767, 101, 151, 4, 0 }, /* region 35 */
{ { 1, 65, 65 }, -6500, 32767, 101, 151, 4, 0 }, /* region 36 */
{ { 1, 66, 66 }, -6601, 32767, 101, 151, 4, 0 }, /* region 37 */
{ { 1, 67, 67 }, -6710, 32767, 101, 151, 4, 0 }, /* region 38 */
{ { 1, 68, 68 }, -6850, 32767, 101, 151, 4, 0 }, /* region 39 */
{ { 32769, 69, 69 }, -7000, 32767, 101, 151, 4, 0 }, /* region 40 */
{ { 1, 0, 0 }, 0, 32767, 101, 151, 4, 1 }, /* region 41 */
{ { 1, 1, 1 }, -100, 32767, 101, 151, 4, 10 }, /* region 42 */
{ { 1, 2, 2 }, -200, 32767, 101, 151, 4, 11 }, /* region 43 */
{ { 1, 3, 3 }, -300, 32767, 101, 151, 4, 12 }, /* region 44 */
{ { 1, 4, 4 }, -400, 32767, 101, 151, 4, 13 }, /* region 45 */
{ { 1, 5, 5 }, -500, 32767, 101, 151, 4, 14 }, /* region 46 */
{ { 1, 6, 6 }, -600, 32767, 101, 151, 4, 0 }, /* region 47 */
{ { 1, 7, 7 }, -700, 32767, 101, 151, 4, 15 }, /* region 48 */
{ { 1, 8, 8 }, -800, 32767, 101, 151, 4, 16 }, /* region 49 */
{ { 1, 9, 9 }, -900, 32767, 101, 151, 4, 17 }, /* region 50 */
{ { 1, 10, 10 }, -1000, 32767, 101, 151, 4, 18 }, /* region 51 */
{ { 1, 11, 11 }, -1100, 32767, 101, 151, 4, 19 }, /* region 52 */
{ { 1, 12, 12 }, -1200, 32767, 101, 151, 4, 20 }, /* region 53 */
{ { 1, 13, 13 }, -1300, 32767, 101, 151, 4, 21 }, /* region 54 */
{ { 1, 14, 14 }, -1400, 32767, 101, 151, 4, 22 }, /* region 55 */
{ { 1, 15, 15 }, -1500, 32767, 101, 151, 4, 23 }, /* region 56 */
{ { 1, 16, 16 }, -1600, 32767, 101, 151, 4, 24 }, /* region 57 */
{ { 1, 17, 17 }, -1700, 32767, 101, 151, 4, 25 }, /* region 58 */
{ { 1, 18, 18 }, -1800, 32767, 101, 151, 4, 26 }, /* region 59 */
{ { 1, 19, 19 }, -1900, 32767, 101, 151, 4, 27 }, /* region 60 */
{ { 1, 20, 20 }, -2000, 32767, 101, 151, 4, 28 }, /* region 61 */
{ { 1, 21, 21 }, -2100, 32767, 101, 151, 4, 29 }, /* region 62 */
{ { 1, 22, 22 }, -2200, 32767, 101, 151, 4, 30 }, /* region 63 */
{ { 1, 23, 23 }, -2300, 32767, 101, 151, 4, 31 }, /* region 64 */
{ { 1, 24, 24 }, -2400, 32767, 101, 151, 4, 32 }, /* region 65 */
{ { 1, 25, 25 }, -2500, 32767, 101, 151, 4, 33 }, /* region 66 */
{ { 1, 26, 26 }, -2600, 32767, 101, 151, 4, 24 }, /* region 67 */
{ { 1, 27, 27 }, -2700, 32767, 101, 151, 4, 0 }, /* region 68 */
{ { 1, 28, 28 }, -2800, 32767, 101, 151, 4, 34 }, /* region 69 */
{ { 1, 29, 29 }, -2900, 32767, 101, 151, 4, 35 }, /* region 70 */
{ { 1, 30, 30 }, -3000, 32767, 101, 151, 4, 36 }, /* region 71 */
{ { 1, 31, 31 }, -3100, 32767, 101, 151, 4, 37 }, /* region 72 */
{ { 1, 32, 32 }, -3200, 32767, 101, 151, 4, 38 }, /* region 73 */
{ { 1, 33, 33 }, -3300, 32767, 101, 151, 4, 39 }, /* region 74 */
{ { 1, 34, 34 }, -3400, 32767, 101, 151, 4, 40 }, /* region 75 */
{ { 1, 35, 35 }, -3500, 32767, 101, 151, 4, 41 }, /* region 76 */
{ { 1, 36, 36 }, -3600, 32767, 101, 151, 4, 42 }, /* region 77 */
{ { 1, 37, 37 }, -3700, 32767, 101, 151, 4, 43 }, /* region 78 */
{ { 1, 38, 38 }, -3800, 32767, 101, 151, 4, 44 }, /* region 79 */
{ { 1, 39, 39 }, -3900, 32767, 101, 151, 4, 45 }, /* region 80 */
{ { 1, 40, 40 }, -4000, 32767, 101, 151, 4, 46 }, /* region 81 */
{ { 1, 41, 41 }, -4100, 32767, 101, 151, 4, 47 }, /* region 82 */
{ { 1, 42, 42 }, -4200, 32767, 101, 151, 4, 48 }, /* region 83 */
{ { 1, 43, 43 }, -4300, 32767, 101, 151, 4, 49 }, /* region 84 */
{ { 1, 44, 44 }, -4400, 32767, 101, 151, 4, 50 }, /* region 85 */
{ { 1, 45, 45 }, -4500, 32767, 101, 151, 4, 51 }, /* region 86 */
{ { 1, 46, 46 }, -4600, 32767, 101, 151, 4, 52 }, /* region 87 */
{ { 1, 47, 47 }, -4700, 32767, 101, 151, 4, 53 }, /* region 88 */
{ { 1, 48, 48 }, -4800, 32767, 101, 151, 4, 54 }, /* region 89 */
{ { 1, 49, 49 }, -4900, 32767, 101, 151, 4, 55 }, /* region 90 */
{ { 1, 50, 50 }, -5000, 32767, 101, 151, 4, 56 }, /* region 91 */
{ { 1, 51, 51 }, -5100, 32767, 101, 151, 4, 57 }, /* region 92 */
{ { 1, 52, 52 }, -5200, 32767, 101, 151, 4, 58 }, /* region 93 */
{ { 1, 53, 53 }, -5300, 32767, 101, 151, 4, 59 }, /* region 94 */
{ { 1, 54, 54 }, -5400, 32767, 101, 151, 4, 60 }, /* region 95 */
{ { 2, 55, 55 }, -5500, 32767, 0, 0, 0, 61 }, /* region 96 */
{ { 2, 56, 56 }, -5600, 32767, 0, 0, 0, 62 }, /* region 97 */
{ { 2, 57, 57 }, -5700, 32767, 0, 0, 0, 63 }, /* region 98 */
{ { 2, 58, 58 }, -5800, 32767, 0, 0, 0, 64 }, /* region 99 */
{ { 2, 59, 59 }, -5900, 32767, 0, 0, 0, 65 }, /* region 100 */
{ { 2, 60, 60 }, -6000, 32767, 0, 0, 0, 0 }, /* region 101 */
{ { 2, 61, 61 }, -6100, 32767, 0, 0, 0, 66 }, /* region 102 */
{ { 2, 62, 62 }, -6200, 32767, 0, 0, 0, 67 }, /* region 103 */
{ { 2, 63, 63 }, -6300, 32767, 0, 0, 0, 68 }, /* region 104 */
{ { 2, 64, 64 }, -6400, 32767, 0, 0, 0, 69 }, /* region 105 */
{ { 2, 65, 65 }, -6500, 32767, 0, 0, 0, 70 }, /* region 106 */
{ { 2, 66, 66 }, -6600, 32767, 0, 0, 0, 71 }, /* region 107 */
{ { 2, 67, 67 }, -6700, 32767, 0, 0, 0, 72 }, /* region 108 */
{ { 2, 68, 68 }, -6800, 32767, 0, 0, 0, 73 }, /* region 109 */
{ { 2, 69, 69 }, -6900, 32767, 0, 0, 0, 74 }, /* region 110 */
{ { 2, 70, 70 }, -7000, 32767, 0, 0, 0, 75 }, /* region 111 */
{ { 2, 71, 71 }, -7100, 32767, 0, 0, 0, 76 }, /* region 112 */
{ { 2, 72, 72 }, -7200, 32767, 0, 0, 0, 77 }, /* region 113 */
{ { 2, 73, 73 }, -7300, 32767, 0, 0, 0, 78 }, /* region 114 */
{ { 2, 74, 74 }, -7400, 32767, 0, 0, 0, 79 }, /* region 115 */
{ { 2, 75, 75 }, -7500, 32767, 0, 0, 0, 79 }, /* region 116 */
{ { 2, 76, 76 }, -7600, 32767, 0, 0, 0, 79 }, /* region 117 */
{ { 2, 77, 77 }, -7700, 32767, 0, 0, 0, 80 }, /* region 118 */
{ { 2, 78, 78 }, -7800, 32767, 0, 0, 0, 81 }, /* region 119 */
{ { 2, 79, 79 }, -7900, 32767, 0, 0, 0, 81 }, /* region 120 */
{ { 2, 80, 80 }, -8000, 32767, 0, 0, 0, 81 }, /* region 121 */
{ { 2, 81, 81 }, -8100, 32767, 0, 0, 0, 81 }, /* region 122 */
{ { 2, 82, 82 }, -8200, 32767, 0, 0, 0, 0 }, /* region 123 */
{ { 257, 83, 83 }, -8300, 32767, 101, 151, 4, 0 }, /* region 124 */
{ { 257, 84, 84 }, -8405, 32767, 0, 171, 5, 0 }, /* region 125 */
{ { 0, 85, 85 }, -9055, 32767, 0, 0, 2, 82 }, /* region 126 */
{ { 0, 86, 86 }, -9155, 32767, 0, 0, 2, 83 }, /* region 127 */
{ { 0, 87, 87 }, -9255, 32767, 0, 0, 2, 84 }, /* region 128 */
{ { 0, 88, 88 }, -9355, 32767, 0, 0, 2, 85 }, /* region 129 */
{ { 0, 89, 89 }, -9455, 32767, 0, 0, 2, 86 }, /* region 130 */
{ { 0, 90, 90 }, -9555, 32767, 0, 0, 2, 0 }, /* region 131 */
{ { 0, 91, 91 }, -9655, 32767, 0, 0, 2, 87 }, /* region 132 */
{ { 0, 92, 92 }, -9755, 32767, 0, 0, 2, 88 }, /* region 133 */
{ { 0, 93, 93 }, -9855, 32767, 0, 0, 2, 89 }, /* region 134 */
{ { 0, 94, 94 }, -9955, 32767, 0, 0, 2, 90 }, /* region 135 */
{ { 0, 95, 95 }, -10055, 32767, 0, 0, 2, 91 }, /* region 136 */
{ { 2, 96, 96 }, -9600, 32767, 0, 0, 0, 63 }, /* region 137 */
{ { 2, 97, 97 }, -9700, 32767, 0, 0, 0, 92 }, /* region 138 */
{ { 2, 98, 98 }, -9800, 32767, 0, 0, 0, 93 }, /* region 139 */
{ { 2, 99, 99 }, -9900, 32767, 0, 0, 0, 94 }, /* region 140 */
{ { 2, 100, 100 }, -10000, 32767, 0, 0, 0, 95 }, /* region 141 */
{ { 32770, 101, 101 }, -10100, 32767, 0, 0, 0, 0 }, /* region 142 */
{ { 1, 36, 60 }, -6000, 32767, 1481, 1565, 0, 0 }, /* region 143 */
{ { 1, 61, 61 }, -7300, 32767, 740, 782, 1, 0 }, /* region 144 */
{ { 32769, 62, 62 }, -8599, 32767, 370, 391, 3, 0 }, /* region 145 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 1 }, /* region 146 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 50 }, /* region 147 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 11 }, /* region 148 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 96 }, /* region 149 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 13 }, /* region 150 */
{ { 32769, 60, 60 }, -6000, 32767, 101, 301, 4, 14 } /* region 151 */
}; /* end Regions */
/*----------------------------------------------------------------------------
* Programs
*----------------------------------------------------------------------------
*/
const S_PROGRAM testPrograms[] =
{
{ 0, 41 } /* program 0 */,
{ 1, 10 } /* program 1 */,
{ 2, 11 } /* program 2 */,
{ 3, 12 } /* program 3 */,
{ 4, 18 } /* program 4 */,
{ 5, 31 } /* program 5 */,
{ 6, 143 } /* program 6 */,
{ 7, 146 } /* program 7 */,
{ 8, 147 } /* program 8 */,
{ 9, 148 } /* program 9 */,
{ 10, 149 } /* program 10 */,
{ 11, 150 } /* program 11 */,
{ 12, 151 } /* program 12 */,
{ 13, 0 } /* program 13 */,
{ 14, 9 } /* program 14 */,
{ 15, 1 } /* program 15 */
}; /* end Programs */
/*----------------------------------------------------------------------------
* Banks
*----------------------------------------------------------------------------
*/
#define testBanks NULL
/*----------------------------------------------------------------------------
* Samples
*----------------------------------------------------------------------------
*/
const EAS_SAMPLE testSamples[] =
{
-1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12,
13, 13, 14, 13, 13, 13, 12, 12, 10, 9, 8, 6, 5, 3, 2, 0,
-1, -3, -5, -8, -10, -12, -14, -15, -16, -17, -17, -17, -17, -16, -14, -13,
-11, -10, -8, -6, -5, -4, -4, -3, -3, -2, -1, -1, -1, -1, -1, -1,
-1, -2, -3, -3, -3, -3, -3, -2, -2, -2, -1, -1, -1, -1, 0, 0,
0, 0, 0, 0, 0, 1, 2, 4, 6, 9, 11, 12, 13, 15, 16, 17,
19, 20, 22, 23, 25, 28, 32, 34, 36, 36, 35, 31, 25, 18, 11, 3,
-5, -13, -20, -26, -31, -34, -35, -36, -36, -35, -34, -32, -29, -26, -23, -19,
-16, -12, -8, -5, -4, -4, -4, -6, -8, -9, -11, -11, -12, -13, -13, -13,
-12, -11, -10, -9, -7, -5, -4, -3, -2, -1, -1, 0, 0, 2, 4, 5,
7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 7, 9, 12, 14, 17, 20,
24, 27, 30, 33, 36, 39, 41, 43, 46, 49, 51, 51, 50, 48, 43, 35,
25, 14, 1, -12, -25, -37, -48, -56, -61, -63, -62, -60, -57, -53, -48, -42,
-35, -29, -23, -17, -12, -8, -5, -3, -3, -4, -5, -7, -9, -11, -12, -14,
-14, -14, -14, -13, -11, -9, -7, -5, -3, -1, 0, 1, 1, 1, 2, 3,
4, 5, 6, 6, 7, 8, 9, 10, 11, 11, 11, 11, 10, 9, 9, 10,
12, 14, 17, 20, 23, 26, 30, 34, 38, 40, 43, 46, 49, 52, 55, 57,
58, 56, 50, 42, 30, 16, 1, -15, -29, -43, -54, -63, -68, -69, -68, -65,
-60, -55, -49, -42, -35, -29, -22, -16, -10, -6, -2, -1, 0, -1, -3, -6,
-9, -12, -16, -18, -20, -21, -21, -21, -19, -17, -14, -11, -8, -5, -2, 1,
3, 5, 7, 9, 11, 12, 12, 12, 11, 10, 9, 8, 7, 7, 7, 7,
8, 9, 10, 12, 15, 17, 19, 22, 24, 26, 28, 30, 32, 34, 36, 38,
42, 44, 47, 49, 53, 56, 55, 52, 45, 35, 22, 8, -8, -23, -37, -50,
-60, -67, -71, -71, -69, -63, -56, -48, -40, -33, -27, -21, -16, -12, -8, -6,
-5, -5, -6, -8, -11, -14, -17, -19, -21, -22, -22, -22, -20, -18, -16, -13,
-9, -6, -2, 1, 5, 7, 8, 9, 10, 11, 11, 11, 10, 10, 9, 9,
9, 8, 8, 9, 9, 10, 10, 12, 13, 14, 16, 18, 19, 21, 24, 26,
29, 32, 35, 39, 42, 46, 49, 51, 53, 56, 59, 59, 55, 48, 37, 22,
5, -12, -29, -45, -58, -68, -74, -77, -77, -75, -69, -62, -53, -44, -35, -28,
-21, -15, -11, -8, -5, -4, -4, -4, -6, -8, -10, -13, -15, -17, -19, -19,
-19, -18, -16, -13, -10, -8, -4, -1, 1, 4, 5, 7, 8, 10, 11, 12,
13, 14, 14, 13, 12, 12, 11, 9, 8, 7, 6, 6, 7, 8, 10, 12,
15, 18, 21, 25, 29, 34, 39, 45, 51, 57, 61, 67, 73, 77, 82, 84,
81, 70, 52, 29, 3, -24, -49, -72, -90, -103, -110, -112, -109, -102, -91, -78,
-64, -49, -35, -23, -13, -5, 1, 5, 8, 9, 9, 7, 4, 0, -4, -9,
-12, -15, -18, -18, -18, -17, -14, -12, -9, -6, -3, 0, 3, 6, 8, 10,
11, 12, 11, 11, 10, 8, 7, 5, 4, 2, 2, 1, 2, 3, 4, 6,
8, 11, 13, 15, 18, 21, 26, 31, 36, 42, 48, 53, 60, 66, 72, 77,
82, 87, 91, 91, 86, 73, 54, 28, -2, -32, -61, -86, -105, -119, -126, -126,
-121, -111, -98, -82, -65, -48, -33, -19, -7, 1, 8, 12, 14, 14, 12, 10,
6, 1, -4, -9, -14, -18, -20, -21, -22, -21, -19, -17, -14, -11, -8, -4,
0, 3, 7, 10, 12, 13, 14, 14, 13, 12, 11, 10, 9, 8, 7, 5,
4, 3, 2, 2, 4, 6, 9, 12, 16, 20, 26, 31, 36, 42, 48, 53,
58, 64, 69, 74, 79, 82, 84, 83, 80, 72, 59, 39, 14, -14, -43, -70,
-92, -109, -119, -123, -120, -113, -102, -88, -73, -56, -40, -25, -12, -2, 5, 10,
12, 12, 11, 9, 5, 1, -3, -8, -12, -15, -18, -20, -21, -21, -20, -18,
-16, -13, -9, -6, -2, 1, 5, 8, 11, 13, 15, 16, 16, 16, 15, 14,
12, 10, 7, 5, 4, 3, 3, 5, 6, 8, 9, 12, 15, 19, 23, 27,
31, 35, 38, 42, 46, 50, 54, 59, 65, 71, 75, 77, 78, 76, 68, 54,
34, 10, -16, -43, -68, -88, -103, -112, -114, -112, -105, -94, -80, -65, -50, -35,
-22, -10, -2, 5, 9, 11, 10, 9, 6, 2, -3, -7, -12, -15, -18, -20,
-21, -22, -21, -20, -17, -14, -11, -7, -3, 0, 4, 7, 9, 11, 13, 15,
17, 17, 17, 16, 14, 12, 11, 10, 8, 7, 5, 5, 5, 6, 7, 8,
10, 11, 14, 17, 20, 24, 28, 32, 37, 43, 49, 57, 63, 70, 77, 82,
83, 80, 73, 60, 42, 18, -8, -34, -59, -80, -95, -105, -110, -109, -103, -94,
-81, -67, -53, -38, -24, -13, -3, 4, 9, 11, 11, 9, 6, 3, -2, -6,
-10, -14, -17, -19, -20, -20, -20, -19, -17, -15, -12, -8, -5, -1, 2, 6,
9, 11, 13, 15, 15, 16, 16, 15, 14, 12, 11, 9, 8, 6, 6, 5,
5, 5, 6, 7, 8, 10, 12, 15, 19, 23, 28, 32, 38, 44, 50, 58,
66, 74, 82, 87, 90, 89, 83, 69, 48, 21, -9, -41, -69, -93, -111, -121,
-124, -121, -113, -100, -85, -68, -50, -33, -18, -5, 5, 12, 16, 17, 16, 13,
9, 4, -1, -6, -11, -15, -18, -20, -21, -21, -21, -19, -17, -15, -12, -8,
-4, -1, 3, 6, 9, 12, 14, 15, 15, 14, 13, 12, 11, 10, 9, 9,
8, 8, 6, 6, 5, 5, 6, 7, 8, 11, 15, 18, 23, 27, 31, 36,
41, 46, 51, 58, 66, 74, 82, 88, 91, 90, 83, 68, 46, 16, -16, -48,
-77, -101, -118, -127, -128, -124, -114, -101, -84, -66, -47, -30, -14, -1, 9, 16,
19, 20, 19, 15, 11, 5, -1, -6, -11, -16, -19, -21, -23, -23, -23, -21,
-19, -16, -12, -8, -4, 0, 4, 8, 11, 13, 14, 15, 15, 14, 13, 12,
11, 10, 9, 8, 7, 7, 7, 7, 7, 8, 8, 9, 11, 12, 14, 16,
19, 23, 27, 31, 35, 40, 45, 51, 58, 66, 74, 82, 88, 90, 88, 77,
58, 32, 1, -31, -62, -87, -107, -119, -125, -123, -117, -105, -90, -73, -56, -38,
-22, -8, 2, 10, 15, 17, 17, 15, 11, 7, 2, -4, -9, -14, -17, -20,
-22, -23, -22, -21, -19, -17, -14, -10, -6, -2, 2, 5, 9, 12, 14, 15,
17, 18, 18, 18, 17, 15, 12, 10, 8, 6, 4, 4, 4, 5, 6, 7,
8, 10, 13, 16, 19, 22, 25, 28, 32, 35, 40, 45, 52, 59, 67, 75,
81, 85, 86, 80, 66, 45, 18, -12, -42, -69, -91, -107, -116, -119, -115, -107,
-95, -80, -64, -47, -31, -17, -5, 4, 10, 13, 14, 14, 11, 7, 3, -2,
-7, -12, -15, -18, -20, -21, -21, -20, -18, -16, -14, -11, -7, -4, 0, 4,
7, 10, 12, 14, 16, 16, 16, 16, 16, 15, 14, 12, 10, 9, 7, 6,
5, 4, 4, 5, 6, 7, 8, 10, 12, 15, 19, 23, 27, 31, 36, 41,
47, 55, 64, 73, 81, 87, 90, 86, 75, 56, 30, 1, -30, -58, -82, -100,
-112, -117, -115, -109, -98, -84, -69, -52, -37, -22, -10, 0, 8, 12, 14, 14,
13, 10, 6, 2, -3, -8, -12, -16, -18, -20, -20, -20, -19, -17, -15, -12,
-9, -5, -1, 2, 6, 9, 12, 14, 16, 17, 17, 17, 16, 14, 13, 11,
8, 6, 4, 3, 2, 2, 2, 3, 5, 6, 8, 10, 12, 15, 18, 22,
26, 30, 35, 40, 47, 55, 63, 71, 80, 87, 90, 88, 78, 59, 34, 4,
-27, -57, -82, -101, -113, -118, -117, -110, -99, -85, -69, -53, -37, -22, -9, 2,
9, 14, 17, 17, 15, 12, 8, 3, -2, -7, -12, -16, -19, -20, -21, -21,
-19, -18, -15, -12, -9, -6, -2, 2, 6, 9, 12, 14, 16, 17, 17, 16,
14, 12, 10, 8, 6, 5, 4, 3, 3, 2, 3, 4, 6, 7, 9, 11,
13, 16, 19, 22, 26, 30, 34, 39, 46, 53, 61, 70, 80, 88, 93, 91,
80, 61, 34, 3, -30, -59, -84, -102, -114, -119, -117, -110, -99, -84, -68, -51,
-35, -20, -7, 3, 11, 15, 17, 18, 16, 13, 9, 4, -2, -7, -11, -15,
-18, -20, -21, -21, -20, -19, -16, -14, -11, -8, -4, 0, 3, 7, 10, 13,
15, 16, 17, 16, 14, 12, 10, 9, 7, 6, 5, 4, 4, 4, 5, 6,
7, 8, 9, 11, 13, 15, 18, 21, 24, 27, 31, 35, 41, 48, 55, 64,
73, 82, 89, 91, 85, 71, 48, 19, -13, -44, -71, -93, -108, -117, -118, -114,
-105, -92, -77, -60, -43, -27, -13, -1, 8, 14, 17, 18, 17, 14, 8, 13,
-1, -1, 0, 2, 4, 6, 9, 11, 13, 14, 13, 12, 11, 8, 5, 2,
-1, -5, -10, -14, -16, -17, -16, -14, -11, -8, -5, -4, -3, -1, -1, -1,
-1, -3, -3, -3, -2, -1, -1, 0, 0, 0, 0, 2, 6, 11, 14, 16,
19, 22, 25, 32, 36, 34, 25, 11, -5, -20, -31, -35, -36, -34, -29, -23,
-16, -8, -4, -4, -8, -11, -12, -13, -12, -10, -7, -4, -2, -1, 1, 4,
7, 7, 6, 6, 6, 7, 12, 17, 24, 30, 36, 41, 46, 51, 50, 43,
25, 2, -25, -48, -61, -62, -57, -48, -35, -23, -12, -5, -3, -5, -9, -12,
-14, -14, -12, -7, -3, 0, 1, 2, 4, 6, 7, 9, 11, 11, 10, 9,
12, 17, 23, 30, 37, 43, 49, 55, 58, 50, 30, 1, -29, -54, -68, -68,
-60, -49, -35, -22, -10, -2, 0, -3, -9, -16, -20, -21, -19, -14, -8, -2,
3, 7, 11, 12, 11, 9, 7, 7, 8, 10, 15, 19, 24, 28, 33, 36,
42, 47, 53, 56, 45, 23, -8, -37, -60, -71, -69, -56, -40, -27, -16, -8,
-5, -6, -11, -17, -21, -22, -20, -16, -9, -2, 5, 8, 10, 11, 10, 9,
8, 8, 9, 10, 13, 16, 19, 24, 29, 35, 42, 49, 53, 59, 55, 37,
5, -29, -58, -74, -77, -69, -53, -35, -21, -11, -5, -4, -6, -10, -15, -19,
-19, -16, -10, -5, 1, 5, 8, 11, 13, 14, 12, 10, 8, 6, 7, 10,
15, 21, 29, 39, 51, 62, 72, 82, 81, 52, 3, -50, -90, -110, -109, -91,
-64, -35, -13, 1, 8, 9, 4, -4, -12, -18, -18, -14, -9, -3, 3, 8,
11, 11, 10, 7, 4, 2, 2, 4, 8, 13, 18, 26, 36, 48, 60, 72,
82, 91, 86, 54, -2, -61, -105, -126, -121, -98, -65, -33, -7, 8, 14, 12,
6, -4, -14, -20, -22, -19, -14, -8, 0, 7, 12, 14, 13, 11, 9, 7,
4, 2, 4, 9, 16, 26, 36, 48, 58, 69, 79, 84, 80, 59, 14, -43,
-92, -119, -120, -102, -73, -40, -12, 5, 12, 11, 5, -3, -12, -18, -21, -20,
-16, -9, -2, 5, 11, 15, 16, 15, 12, 7, 4, 4, 6, 9, 15, 23,
31, 38, 46, 54, 65, 75, 78, 68, 34, -16, -68, -103, -114, -105, -80, -50,
-22, -1, 9, 10, 6, -3, -12, -18, -21, -21, -17, -11, -3, 4, 9, 13,
16, 17, 14, 11, 8, 5, 5, 7, 10, 14, 20, 28, 37, 49, 64, 77,
83, 73, 42, -8, -59, -95, -110, -103, -81, -53, -24, -3, 9, 11, 6, -2,
-10, -17, -20, -20, -17, -12, -5, 2, 9, 13, 15, 16, 14, 11, 8, 6,
5, 6, 8, 12, 19, 28, 38, 50, 66, 82, 90, 83, 48, -9, -69, -111,
-124, -113, -85, -50, -18, 5, 16, 16, 9, -1, -11, -18, -21, -21, -17, -12,
-5, 3, 9, 14, 15, 13, 11, 9, 8, 6, 5, 6, 8, 15, 23, 31,
41, 52, 66, 82, 91, 83, 46, -16, -77, -118, -128, -114, -84, -47, -14, 9,
19, 19, 10, -1, -11, -19, -23, -23, -19, -12, -4, 4, 11, 14, 15, 13,
11, 9, 7, 7, 7, 8, 11, 14, 19, 27, 35, 45, 58, 74, 88, 88,
58, 1, -62, -107, -125, -116, -90, -56, -22, 2, 15, 17, 11, 2, -9, -17,
-22, -22, -20, -14, -6, 2, 9, 14, 17, 18, 17, 12, 8, 4, 4, 6,
8, 13, 19, 25, 32, 40, 52, 67, 81, 86, 66, 18, -42, -91, -116, -115,
-95, -64, -31, -5, 10, 14, 11, 3, -7, -15, -20, -21, -18, -14, -7, 0,
7, 12, 16, 17, 16, 14, 10, 7, 5, 4, 6, 8, 12, 19, 27, 36,
47, 64, 81, 90, 75, 30, -30, -82, -112, -115, -98, -69, -37, -10, 8, 14,
13, 6, -3, -12, -18, -20, -19, -15, -9, -1, 6, 12, 16, 17, 16, 13,
8, 4, 2, 2, 5, 8, 12, 18, 26, 35, 47, 63, 80, 90, 78, 34,
-27, -82, -113, -117, -99, -69, -37, -9, 9, 17, 15, 8, -2, -12, -19, -21,
-19, -15, -9, -2, 6, 12, 16, 17, 14, 10, 6, 4, 3, 3, 6, 9,
13, 19, 26, 34, 46, 61, 80, 93, 80, 34, -30, -84, -114, -117, -99, -68,
-35, -7, 11, 17, 16, 9, -2, -11, -18, -21, -20, -16, -11, -4, 3, 10,
15, 17, 14, 10, 7, 5, 4, 5, 7, 9, 13, 18, 24, 31, 41, 55,
73, 89, 85, 48, -12, -71, -108, -118, -104, -77, -43, -13, 8, 16, 17, 16,
0, -3, -4, -5, -4, 0, -4, -8, -20, -25, 51, 11, -55, 9, 39, 55,
-76, -19, 92, -23, -58, 2, -15, 57, 71, 34, -41, 20, 51, 22, 63, -21,
63, 74, 32, 36, 99, -14, 27, 102, 66, 90, 79, 77, 58, 66, 65, 114,
69, 26, 30, 92, 90, 53, 78, 97, 77, 66, 39, -4, 60, 57, 64, 68,
-16, 36, 49, 12, 19, 12, -12, 21, 11, -32, -19, -41, -44, -12, -36, -44,
-45, -51, -55, -70, -69, -73, -85, -102, -86, -99, -92, -105, -108, -103, -100, -107,
-112, -104, -113, -112, -104, -119, -124, -115, -87, -100, -128, -106, -83, -105, -108, -109,
-91, -95, -90, -83, -80, -79, -83, -68, -59, -53, -63, -69, -57, -28, -11, -38,
-43, -23, -10, -6, 3, 1, 6, 14, 21, 23, 34, 40, 42, 48, 57, 61,
63, 65, 73, 82, 90, 82, 89, 98, 100, 110, 111, 109, 115, 120, 121, 121,
123, 123, 123, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 121, 121,
121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 120, 120, 120, 120, 120, 120,
120, 120, 120, 120, 113, 104, 103, 113, 110, 94, 80, 88, 96, 89, 81, 70,
68, 64, 59, 59, 54, 44, 44, 39, 31, 31, 21, 18, 16, 8, 6, 2,
-3, -6, -13, -19, -27, -31, -34, -30, -38, -47, -48, -51, -56, -64, -68, -67,
-68, -76, -73, -79, -85, -94, -89, -90, -94, -92, -99, -100, -107, -107, -104, -107,
-106, -112, -114, -113, -112, -111, -112, -116, -116, -115, -115, -115, -115, -115, -115, -115,
-114, -114, -114, -114, -114, -114, -114, -114, -113, -113, -113, -113, -113, -108, -106, -107,
-111, -110, -105, -108, -107, -102, -100, -103, -103, -100, -100, -97, -97, -100, -99, -97,
-94, -90, -94, -94, -93, -93, -92, -92, -90, -89, -89, -90, -91, -87, -87, -88,
-89, -88, -84, -85, -88, -87, -86, -85, -85, -84, -82, -83, -83, -82, -81, -80,
-79, -79, -79, -78, -75, -74, -75, -73, -74, -71, -69, -67, -69, -66, -64, -66,
-65, -64, -62, -58, -57, -57, -57, -56, -52, -51, -50, -48, -46, -43, -43, -42,
-39, -36, -35, -34, -32, -31, -29, -26, -23, -23, -21, -15, -18, -15, -11, -8,
-6, -7, 0, 2, 0, 2, 7, 15, 14, 15, 16, 19, 23, 27, 29, 30,
31, 34, 41, 41, 42, 44, 45, 51, 55, 54, 56, 57, 60, 65, 67, 69,
69, 71, 74, 77, 79, 78, 80, 82, 86, 86, 84, 86, 88, 87, 87, 87,
87, 87, 86, 86, 86, 86, 86, 85, 85, 85, 85, 85, 84, 84, 84, 84,
84, 83, 83, 83, 83, 83, 83, 82, 82, 82, 82, 82, 81, 81, 81, 81,
81, 80, 80, 80, 80, 80, 79, 79, 79, 79, 79, 78, 78, 78, 78, 76,
75, 72, 69, 67, 65, 64, 63, 59, 55, 54, 52, 50, 48, 45, 42, 38,
36, 34, 31, 30, 27, 24, 21, 18, 16, 14, 12, 9, 7, 4, 1, -2,
-4, -7, -10, -11, -13, -16, -17, -18, -21, -24, -26, -27, -28, -30, -32, -33,
-35, -36, -38, -39, -41, -42, -43, -45, -45, -46, -47, -48, -49, -50, -51, -50,
-51, -52, -53, -53, -53, -53, -53, -53, -53, -54, -54, -54, -54, -53, -53, -52,
-52, -52, -51, -51, -51, -50, -50, -50, -48, -49, -48, -47, -46, -45, -45, -44,
-43, -42, -41, -41, -40, -39, -38, -37, -36, -35, -34, -33, -31, -30, -29, -28,
-27, -26, -24, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -13,
-12, -11, -11, -10, -9, -9, -8, -8, -7, -6, -7, -6, -5, -5, -5, -4,
-4, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, 0, 0,
0, 0, -1, 0, 4, 9, 13, 13, 11, 5, -1, -10, -16, -17, -11, -5,
-2, -1, -2, -3, -2, -1, 0, 0, 6, 14, 19, 26, 36, 25, -5, -30,
-36, -29, -16, -4, -7, -13, -12, -7, -2, 1, 6, 7, 6, 11, 24, 36,
46, 50, 26, -25, -60, -57, -36, -12, -3, -9, -14, -12, -3, 1, 4, 7,
11, 10, 12, 23, 37, 49, 58, 31, -29, -67, -61, -36, -10, 0, -9, -20,
-19, -8, 3, 11, 11, 7, 8, 15, 24, 32, 41, 53, 45, -7, -60, -68,
-41, -16, -5, -11, -21, -20, -10, 4, 10, 10, 8, 9, 13, 19, 29, 42,
54, 55, 6, -57, -77, -54, -21, -6, -6, -15, -19, -11, 1, 8, 13, 12,
8, 7, 15, 29, 50, 73, 80, 5, -90, -109, -65, -13, 8, 4, -13, -18,
-10, 3, 11, 10, 4, 2, 8, 18, 36, 60, 82, 86, 1, -105, -121, -66,
-8, 13, 6, -14, -22, -15, -1, 12, 13, 9, 4, 3, 16, 36, 58, 78,
81, 15, -91, -121, -74, -13, 12, 5, -11, -21, -16, -2, 11, 16, 12, 4,
6, 15, 31, 46, 64, 79, 36, -66, -115, -81, -23, 9, 6, -11, -21, -17,
-4, 9, 16, 15, 8, 5, 9, 20, 37, 63, 83, 43, -57, -110, -83, -25,
8, 7, -10, -20, -17, -5, 9, 15, 14, 8, 5, 8, 18, 37, 65, 91,
50, -67, -124, -86, -19, 16, 9, -10, -21, -18, -5, 9, 15, 11, 8, 5,
8, 22, 40, 65, 92, 48, -74, -128, -85, -16, 19, 11, -11, -23, -19, -4,
10, 15, 11, 8, 7, 11, 19, 35, 57, 88, 60, -58, -125, -92, -24, 15,
12, -8, -22, -20, -7, 9, 17, 17, 8, 4, 8, 18, 31, 51, 81, 67,
-38, -116, -96, -33, 9, 11, -6, -20, -19, -8, 7, 16, 16, 11, 5, 5,
12, 26, 47, 80, 76, -26, -111, -99, -39, 7, 13, -3, -18, -19, -9, 5,
16, 16, 8, 2, 4, 12, 25, 46, 79, 79, -23, -112, -101, -39, 9, 15,
-2, -18, -20, -9, 5, 16, 14, 7, 3, 5, 13, 25, 44, 79, 81, -25,
-113, -100, -37, 10, 16, -1, -18, -20, -11, 3, 15, 15, 7, 4, 6, 13,
23, 40, 72, 86, -7, -107, -106, -46, 7, 16, 0, 16, 31, 47, 61, 75,
87, 98, 107, 115, 121, 125, 127, 127, 125, 121, 116, 108, 99, 88, 75, 62,
47, 32, 16, 0, -16, -31, -47, -61, -75, -87, -98, -108, -116, -122, -126, -128,
-128, -126, -123, -117, -109, -100, -89, -77, -64, -49, -34, -18, -2, 14, 29, 45,
59, 73, 86, 97, 106, 114, 121, 125, 127, 127, 126, 122, 116, 109, 100, 89,
77, 63, 49, 34, 18, 2, -14, -30, -45, -60, -73, -86, -97, -107, -115, -121,
-126, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20, -4, 12,
28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122, 117, 109,
100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85, -97, -107,
-115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51, -36, -20,
-4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127, 126, 122,
117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59, -73, -85,
-97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79, -65, -51,
-36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124, 127, 127,
126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29, -44, -59,
-73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101, -91, -79,
-65, -51, -36, -20, -4, 12, 28, 43, 58, 72, 84, 96, 106, 114, 120, 124,
127, 127, 126, 122, 117, 109, 100, 90, 78, 64, 50, 35, 19, 3, -13, -29,
-44, -59, -73, -85, -97, -107, -115, -121, -125, -128, -128, -127, -123, -118, -110, -101,
-91, -79, -65, -51, -36, -20, -4, 12, 0, -104, -55, -11, 24, 33, 30, 7,
-15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7,
-33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40,
-81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31, -30, -25, -23, -20,
-9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64, -81, -81, -71, -51,
-22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112, -124, -102, -57, -11,
24, 33, 30, 7, -15, -31, -30, -25, -23, -20, -9, 10, 31, 59, 91, 111,
115, 92, 51, 7, -33, -64, -81, -81, -71, -51, -22, 16, 52, 74, 82, 81,
68, 38, 0, -40, -81, -112, -124, -102, -57, -11, 24, 33, 30, 7, -15, -31,
-30, -25, -23, -20, -9, 10, 31, 59, 91, 111, 115, 92, 51, 7, -33, -64,
-81, -81, -71, -51, -22, 16, 52, 74, 82, 81, 68, 38, 0, -40, -81, -112,
-124, -102, -57, -11, 0
};
const EAS_U32 testSampleLengths[] =
{
1568, 784, 642, 392, 302, 172
};
const EAS_U32 testSampleOffsets[] =
{
0x00000000, 0x00000620, 0x00000930, 0x00000bb2, 0x00000d3a, 0x00000e68
};
/*----------------------------------------------------------------------------
* S_EAS
*----------------------------------------------------------------------------
*/
const S_EAS easTestLib =
{
0x01534145,
0x00105622,
testBanks,
testPrograms,
testRegions,
testArticulations,
testSampleLengths,
testSampleOffsets,
testSamples,
0,
0,
16,
152,
97,
6,
0
}; /* end S_EAS */
/*----------------------------------------------------------------------------
* Statistics
*
* Number of banks: 0
* Number of programs: 16
* Number of regions: 152
* Number of articulations: 97
* Number of samples: 6
* Size of sample pool: 3861
*----------------------------------------------------------------------------
*/
/* end ..\..\EASLib\WTLibrary\eastestv37.c */

View File

@@ -0,0 +1,645 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {
/* Begin PBXBuildFile section */
9A56AB8F0F7197AE00D115A7 /* wt_44khz.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A56AB8E0F7197AE00D115A7 /* wt_44khz.c */; };
9A56ABD00F71998600D115A7 /* eas_fmengine.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A56ABCF0F71998600D115A7 /* eas_fmengine.h */; };
9A56ABDB0F719D4600D115A7 /* eas_xmf.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A56ABD70F719D4600D115A7 /* eas_xmf.c */; };
9A56ABDC0F719D4600D115A7 /* eas_xmf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A56ABD80F719D4600D115A7 /* eas_xmf.h */; };
9A56ABDD0F719D4600D115A7 /* eas_xmfdata.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A56ABD90F719D4600D115A7 /* eas_xmfdata.c */; };
9A56ABDE0F719D4600D115A7 /* eas_xmfdata.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A56ABDA0F719D4600D115A7 /* eas_xmfdata.h */; };
9A56AC050F71BCFE00D115A7 /* eas_build.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A56AC040F71BCFE00D115A7 /* eas_build.h */; };
C55B113D0E2D33B4006357C1 /* eas.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11290E2D33B4006357C1 /* eas.h */; };
C55B113E0E2D33B4006357C1 /* eas_audioconst.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B112A0E2D33B4006357C1 /* eas_audioconst.h */; };
C55B11400E2D33B4006357C1 /* eas_config.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B112C0E2D33B4006357C1 /* eas_config.h */; };
C55B11410E2D33B4006357C1 /* eas_data.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B112D0E2D33B4006357C1 /* eas_data.h */; };
C55B11420E2D33B4006357C1 /* eas_host.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B112E0E2D33B4006357C1 /* eas_host.h */; };
C55B11430E2D33B4006357C1 /* eas_math.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B112F0E2D33B4006357C1 /* eas_math.h */; };
C55B11440E2D33B4006357C1 /* eas_midi.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11300E2D33B4006357C1 /* eas_midi.h */; };
C55B11450E2D33B4006357C1 /* eas_midictrl.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11310E2D33B4006357C1 /* eas_midictrl.h */; };
C55B11460E2D33B4006357C1 /* eas_mixer.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11320E2D33B4006357C1 /* eas_mixer.c */; };
C55B11470E2D33B4006357C1 /* eas_pan.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11330E2D33B4006357C1 /* eas_pan.h */; };
C55B11480E2D33B4006357C1 /* eas_pcm.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11340E2D33B4006357C1 /* eas_pcm.h */; };
C55B11490E2D33B4006357C1 /* eas_pcmdata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11350E2D33B4006357C1 /* eas_pcmdata.h */; };
C55B114B0E2D33B4006357C1 /* eas_report.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11370E2D33B4006357C1 /* eas_report.h */; };
C55B114C0E2D33B4006357C1 /* eas_sndlib.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11380E2D33B4006357C1 /* eas_sndlib.h */; };
C55B114D0E2D33B4006357C1 /* eas_synth.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11390E2D33B4006357C1 /* eas_synth.h */; };
C55B114E0E2D33B4006357C1 /* eas_synth_protos.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B113A0E2D33B4006357C1 /* eas_synth_protos.h */; };
C55B114F0E2D33B4006357C1 /* eas_types.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B113B0E2D33B4006357C1 /* eas_types.h */; };
C55B11500E2D33B4006357C1 /* eas_vm_protos.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B113C0E2D33B4006357C1 /* eas_vm_protos.h */; };
C55B115B0E2D3796006357C1 /* eas_effects.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11530E2D3796006357C1 /* eas_effects.h */; };
C55B11640E2D37FC006357C1 /* eas_imelodydata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11620E2D37FC006357C1 /* eas_imelodydata.h */; };
C55B11760E2D38CE006357C1 /* eas_mdls.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B116B0E2D38CE006357C1 /* eas_mdls.h */; };
C55B11770E2D38CE006357C1 /* eas_otadata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B116C0E2D38CE006357C1 /* eas_otadata.h */; };
C55B11780E2D38CE006357C1 /* eas_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B116D0E2D38CE006357C1 /* eas_parser.h */; };
C55B11790E2D38CE006357C1 /* eas_rtttldata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B116E0E2D38CE006357C1 /* eas_rtttldata.h */; };
C55B117B0E2D38CE006357C1 /* eas_smf.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11700E2D38CE006357C1 /* eas_smf.h */; };
C55B117C0E2D38CE006357C1 /* eas_smfdata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11710E2D38CE006357C1 /* eas_smfdata.h */; };
C55B117D0E2D38CE006357C1 /* eas_tcdata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11720E2D38CE006357C1 /* eas_tcdata.h */; };
C55B117E0E2D38CE006357C1 /* eas_wavefile.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11730E2D38CE006357C1 /* eas_wavefile.h */; };
C55B11830E2D38FB006357C1 /* jet.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11810E2D38FB006357C1 /* jet.h */; };
C55B11840E2D38FB006357C1 /* jet_data.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11820E2D38FB006357C1 /* jet_data.h */; };
C55B11860E2D395F006357C1 /* eas_wtengine.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11850E2D395F006357C1 /* eas_wtengine.h */; };
C55B11900E2D39ED006357C1 /* eas_reverb.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B118E0E2D39ED006357C1 /* eas_reverb.h */; };
C55B11910E2D39ED006357C1 /* eas_reverbdata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B118F0E2D39ED006357C1 /* eas_reverbdata.h */; };
C55B11940E2D39FE006357C1 /* eas_chorus.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11920E2D39FE006357C1 /* eas_chorus.h */; };
C55B11950E2D39FE006357C1 /* eas_chorusdata.h in Headers */ = {isa = PBXBuildFile; fileRef = C55B11930E2D39FE006357C1 /* eas_chorusdata.h */; };
C55B11AE0E2D3B1B006357C1 /* eas_data.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B119F0E2D3B1B006357C1 /* eas_data.c */; };
C55B11AF0E2D3B1B006357C1 /* eas_flog.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A00E2D3B1B006357C1 /* eas_flog.c */; };
C55B11B10E2D3B1B006357C1 /* eas_ima_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A20E2D3B1B006357C1 /* eas_ima_tables.c */; };
C55B11B20E2D3B1B006357C1 /* eas_imaadpcm.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A30E2D3B1B006357C1 /* eas_imaadpcm.c */; };
C55B11B30E2D3B1B006357C1 /* eas_math.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A40E2D3B1B006357C1 /* eas_math.c */; };
C55B11B40E2D3B1B006357C1 /* eas_midi.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A50E2D3B1B006357C1 /* eas_midi.c */; };
C55B11B50E2D3B1B006357C1 /* eas_mididata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A60E2D3B1B006357C1 /* eas_mididata.c */; };
C55B11B60E2D3B1B006357C1 /* eas_mixbuf.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A70E2D3B1B006357C1 /* eas_mixbuf.c */; };
C55B11B70E2D3B1B006357C1 /* eas_pan.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A80E2D3B1B006357C1 /* eas_pan.c */; };
C55B11B80E2D3B1B006357C1 /* eas_pcm.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11A90E2D3B1B006357C1 /* eas_pcm.c */; };
C55B11B90E2D3B1B006357C1 /* eas_pcmdata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11AA0E2D3B1B006357C1 /* eas_pcmdata.c */; };
C55B11BA0E2D3B1B006357C1 /* eas_public.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11AB0E2D3B1B006357C1 /* eas_public.c */; };
C55B11BB0E2D3B1B006357C1 /* eas_voicemgt.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11AC0E2D3B1B006357C1 /* eas_voicemgt.c */; };
C55B11BD0E2D3B55006357C1 /* jet.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11BC0E2D3B55006357C1 /* jet.c */; };
C55B11C10E2D3BFD006357C1 /* eas_chorus.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11C00E2D3BFD006357C1 /* eas_chorus.c */; };
C55B11E40E2D3C62006357C1 /* eas_imelody.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D00E2D3C62006357C1 /* eas_imelody.c */; };
C55B11E50E2D3C62006357C1 /* eas_imelodydata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D10E2D3C62006357C1 /* eas_imelodydata.c */; };
C55B11E60E2D3C62006357C1 /* eas_mdls.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D20E2D3C62006357C1 /* eas_mdls.c */; };
C55B11E70E2D3C62006357C1 /* eas_ota.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D30E2D3C62006357C1 /* eas_ota.c */; };
C55B11E80E2D3C62006357C1 /* eas_otadata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D40E2D3C62006357C1 /* eas_otadata.c */; };
C55B11E90E2D3C62006357C1 /* eas_rtttl.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D50E2D3C62006357C1 /* eas_rtttl.c */; };
C55B11EA0E2D3C62006357C1 /* eas_rtttldata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11D60E2D3C62006357C1 /* eas_rtttldata.c */; };
C55B11EE0E2D3C62006357C1 /* eas_smf.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DA0E2D3C62006357C1 /* eas_smf.c */; };
C55B11EF0E2D3C62006357C1 /* eas_smfdata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DB0E2D3C62006357C1 /* eas_smfdata.c */; };
C55B11F00E2D3C62006357C1 /* eas_tcdata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DC0E2D3C62006357C1 /* eas_tcdata.c */; };
C55B11F10E2D3C62006357C1 /* eas_tonecontrol.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DD0E2D3C62006357C1 /* eas_tonecontrol.c */; };
C55B11F20E2D3C62006357C1 /* eas_wavefile.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DE0E2D3C62006357C1 /* eas_wavefile.c */; };
C55B11F30E2D3C62006357C1 /* eas_wavefiledata.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11DF0E2D3C62006357C1 /* eas_wavefiledata.c */; };
C55B11F70E2D3C7B006357C1 /* eas_reverb.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11F60E2D3C7B006357C1 /* eas_reverb.c */; };
C55B11FA0E2D3CAC006357C1 /* eastestv37.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B11F80E2D3CAC006357C1 /* eastestv37.c */; };
C55B12050E2D3D56006357C1 /* eas_dlssynth.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B12020E2D3D56006357C1 /* eas_dlssynth.c */; };
C55B12060E2D3D56006357C1 /* eas_wtengine.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B12030E2D3D56006357C1 /* eas_wtengine.c */; };
C55B12070E2D3D56006357C1 /* eas_wtsynth.c in Sources */ = {isa = PBXBuildFile; fileRef = C55B12040E2D3D56006357C1 /* eas_wtsynth.c */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
9A56AB8E0F7197AE00D115A7 /* wt_44khz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = wt_44khz.c; sourceTree = "<group>"; };
9A56ABCF0F71998600D115A7 /* eas_fmengine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_fmengine.h; path = "../../../arm-fm-22k/lib_src/eas_fmengine.h"; sourceTree = SOURCE_ROOT; };
9A56ABD70F719D4600D115A7 /* eas_xmf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_xmf.c; path = ../../lib_src/eas_xmf.c; sourceTree = SOURCE_ROOT; };
9A56ABD80F719D4600D115A7 /* eas_xmf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_xmf.h; path = ../../lib_src/eas_xmf.h; sourceTree = SOURCE_ROOT; };
9A56ABD90F719D4600D115A7 /* eas_xmfdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_xmfdata.c; path = ../../lib_src/eas_xmfdata.c; sourceTree = SOURCE_ROOT; };
9A56ABDA0F719D4600D115A7 /* eas_xmfdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_xmfdata.h; path = ../../lib_src/eas_xmfdata.h; sourceTree = SOURCE_ROOT; };
9A56AC040F71BCFE00D115A7 /* eas_build.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_build.h; path = ../../host_src/eas_build.h; sourceTree = SOURCE_ROOT; };
C55B11290E2D33B4006357C1 /* eas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas.h; path = ../../host_src/eas.h; sourceTree = SOURCE_ROOT; };
C55B112A0E2D33B4006357C1 /* eas_audioconst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_audioconst.h; path = ../../lib_src/eas_audioconst.h; sourceTree = SOURCE_ROOT; };
C55B112C0E2D33B4006357C1 /* eas_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_config.h; path = ../../host_src/eas_config.h; sourceTree = SOURCE_ROOT; };
C55B112D0E2D33B4006357C1 /* eas_data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_data.h; path = ../../lib_src/eas_data.h; sourceTree = SOURCE_ROOT; };
C55B112E0E2D33B4006357C1 /* eas_host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_host.h; path = ../../host_src/eas_host.h; sourceTree = SOURCE_ROOT; };
C55B112F0E2D33B4006357C1 /* eas_math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_math.h; path = ../../lib_src/eas_math.h; sourceTree = SOURCE_ROOT; };
C55B11300E2D33B4006357C1 /* eas_midi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_midi.h; path = ../../lib_src/eas_midi.h; sourceTree = SOURCE_ROOT; };
C55B11310E2D33B4006357C1 /* eas_midictrl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_midictrl.h; path = ../../lib_src/eas_midictrl.h; sourceTree = SOURCE_ROOT; };
C55B11320E2D33B4006357C1 /* eas_mixer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_mixer.c; path = ../../lib_src/eas_mixer.c; sourceTree = SOURCE_ROOT; };
C55B11330E2D33B4006357C1 /* eas_pan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_pan.h; path = ../../lib_src/eas_pan.h; sourceTree = SOURCE_ROOT; };
C55B11340E2D33B4006357C1 /* eas_pcm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_pcm.h; path = ../../lib_src/eas_pcm.h; sourceTree = SOURCE_ROOT; };
C55B11350E2D33B4006357C1 /* eas_pcmdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_pcmdata.h; path = ../../lib_src/eas_pcmdata.h; sourceTree = SOURCE_ROOT; };
C55B11370E2D33B4006357C1 /* eas_report.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_report.h; path = ../../host_src/eas_report.h; sourceTree = SOURCE_ROOT; };
C55B11380E2D33B4006357C1 /* eas_sndlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_sndlib.h; path = ../../lib_src/eas_sndlib.h; sourceTree = SOURCE_ROOT; };
C55B11390E2D33B4006357C1 /* eas_synth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_synth.h; path = ../../lib_src/eas_synth.h; sourceTree = SOURCE_ROOT; };
C55B113A0E2D33B4006357C1 /* eas_synth_protos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_synth_protos.h; path = ../../lib_src/eas_synth_protos.h; sourceTree = SOURCE_ROOT; };
C55B113B0E2D33B4006357C1 /* eas_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_types.h; path = ../../host_src/eas_types.h; sourceTree = SOURCE_ROOT; };
C55B113C0E2D33B4006357C1 /* eas_vm_protos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_vm_protos.h; path = ../../lib_src/eas_vm_protos.h; sourceTree = SOURCE_ROOT; };
C55B11530E2D3796006357C1 /* eas_effects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_effects.h; path = ../../lib_src/eas_effects.h; sourceTree = SOURCE_ROOT; };
C55B11620E2D37FC006357C1 /* eas_imelodydata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_imelodydata.h; path = ../../lib_src/eas_imelodydata.h; sourceTree = SOURCE_ROOT; };
C55B116B0E2D38CE006357C1 /* eas_mdls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_mdls.h; path = ../../lib_src/eas_mdls.h; sourceTree = SOURCE_ROOT; };
C55B116C0E2D38CE006357C1 /* eas_otadata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_otadata.h; path = ../../lib_src/eas_otadata.h; sourceTree = SOURCE_ROOT; };
C55B116D0E2D38CE006357C1 /* eas_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_parser.h; path = ../../lib_src/eas_parser.h; sourceTree = SOURCE_ROOT; };
C55B116E0E2D38CE006357C1 /* eas_rtttldata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_rtttldata.h; path = ../../lib_src/eas_rtttldata.h; sourceTree = SOURCE_ROOT; };
C55B11700E2D38CE006357C1 /* eas_smf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_smf.h; path = ../../lib_src/eas_smf.h; sourceTree = SOURCE_ROOT; };
C55B11710E2D38CE006357C1 /* eas_smfdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_smfdata.h; path = ../../lib_src/eas_smfdata.h; sourceTree = SOURCE_ROOT; };
C55B11720E2D38CE006357C1 /* eas_tcdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_tcdata.h; path = ../../lib_src/eas_tcdata.h; sourceTree = SOURCE_ROOT; };
C55B11730E2D38CE006357C1 /* eas_wavefile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_wavefile.h; path = ../../lib_src/eas_wavefile.h; sourceTree = SOURCE_ROOT; };
C55B11810E2D38FB006357C1 /* jet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jet.h; path = ../../host_src/jet.h; sourceTree = SOURCE_ROOT; };
C55B11820E2D38FB006357C1 /* jet_data.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jet_data.h; path = ../../lib_src/jet_data.h; sourceTree = SOURCE_ROOT; };
C55B11850E2D395F006357C1 /* eas_wtengine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_wtengine.h; path = ../../lib_src/eas_wtengine.h; sourceTree = SOURCE_ROOT; };
C55B118E0E2D39ED006357C1 /* eas_reverb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_reverb.h; path = ../../host_src/eas_reverb.h; sourceTree = SOURCE_ROOT; };
C55B118F0E2D39ED006357C1 /* eas_reverbdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_reverbdata.h; path = ../../lib_src/eas_reverbdata.h; sourceTree = SOURCE_ROOT; };
C55B11920E2D39FE006357C1 /* eas_chorus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_chorus.h; path = ../../host_src/eas_chorus.h; sourceTree = SOURCE_ROOT; };
C55B11930E2D39FE006357C1 /* eas_chorusdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eas_chorusdata.h; path = ../../lib_src/eas_chorusdata.h; sourceTree = SOURCE_ROOT; };
C55B119F0E2D3B1B006357C1 /* eas_data.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_data.c; path = ../../lib_src/eas_data.c; sourceTree = SOURCE_ROOT; };
C55B11A00E2D3B1B006357C1 /* eas_flog.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_flog.c; path = ../../lib_src/eas_flog.c; sourceTree = SOURCE_ROOT; };
C55B11A20E2D3B1B006357C1 /* eas_ima_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_ima_tables.c; path = ../../lib_src/eas_ima_tables.c; sourceTree = SOURCE_ROOT; };
C55B11A30E2D3B1B006357C1 /* eas_imaadpcm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_imaadpcm.c; path = ../../lib_src/eas_imaadpcm.c; sourceTree = SOURCE_ROOT; };
C55B11A40E2D3B1B006357C1 /* eas_math.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_math.c; path = ../../lib_src/eas_math.c; sourceTree = SOURCE_ROOT; };
C55B11A50E2D3B1B006357C1 /* eas_midi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_midi.c; path = ../../lib_src/eas_midi.c; sourceTree = SOURCE_ROOT; };
C55B11A60E2D3B1B006357C1 /* eas_mididata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_mididata.c; path = ../../lib_src/eas_mididata.c; sourceTree = SOURCE_ROOT; };
C55B11A70E2D3B1B006357C1 /* eas_mixbuf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_mixbuf.c; path = ../../lib_src/eas_mixbuf.c; sourceTree = SOURCE_ROOT; };
C55B11A80E2D3B1B006357C1 /* eas_pan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_pan.c; path = ../../lib_src/eas_pan.c; sourceTree = SOURCE_ROOT; };
C55B11A90E2D3B1B006357C1 /* eas_pcm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_pcm.c; path = ../../lib_src/eas_pcm.c; sourceTree = SOURCE_ROOT; };
C55B11AA0E2D3B1B006357C1 /* eas_pcmdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_pcmdata.c; path = ../../lib_src/eas_pcmdata.c; sourceTree = SOURCE_ROOT; };
C55B11AB0E2D3B1B006357C1 /* eas_public.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_public.c; path = ../../lib_src/eas_public.c; sourceTree = "<group>"; };
C55B11AC0E2D3B1B006357C1 /* eas_voicemgt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_voicemgt.c; path = ../../lib_src/eas_voicemgt.c; sourceTree = SOURCE_ROOT; };
C55B11BC0E2D3B55006357C1 /* jet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jet.c; path = ../../lib_src/jet.c; sourceTree = SOURCE_ROOT; };
C55B11C00E2D3BFD006357C1 /* eas_chorus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_chorus.c; path = ../../lib_src/eas_chorus.c; sourceTree = SOURCE_ROOT; };
C55B11D00E2D3C62006357C1 /* eas_imelody.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_imelody.c; path = ../../lib_src/eas_imelody.c; sourceTree = SOURCE_ROOT; };
C55B11D10E2D3C62006357C1 /* eas_imelodydata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_imelodydata.c; path = ../../lib_src/eas_imelodydata.c; sourceTree = SOURCE_ROOT; };
C55B11D20E2D3C62006357C1 /* eas_mdls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_mdls.c; path = ../../lib_src/eas_mdls.c; sourceTree = SOURCE_ROOT; };
C55B11D30E2D3C62006357C1 /* eas_ota.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_ota.c; path = ../../lib_src/eas_ota.c; sourceTree = SOURCE_ROOT; };
C55B11D40E2D3C62006357C1 /* eas_otadata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_otadata.c; path = ../../lib_src/eas_otadata.c; sourceTree = SOURCE_ROOT; };
C55B11D50E2D3C62006357C1 /* eas_rtttl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_rtttl.c; path = ../../lib_src/eas_rtttl.c; sourceTree = SOURCE_ROOT; };
C55B11D60E2D3C62006357C1 /* eas_rtttldata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_rtttldata.c; path = ../../lib_src/eas_rtttldata.c; sourceTree = SOURCE_ROOT; };
C55B11DA0E2D3C62006357C1 /* eas_smf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_smf.c; path = ../../lib_src/eas_smf.c; sourceTree = SOURCE_ROOT; };
C55B11DB0E2D3C62006357C1 /* eas_smfdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_smfdata.c; path = ../../lib_src/eas_smfdata.c; sourceTree = SOURCE_ROOT; };
C55B11DC0E2D3C62006357C1 /* eas_tcdata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_tcdata.c; path = ../../lib_src/eas_tcdata.c; sourceTree = SOURCE_ROOT; };
C55B11DD0E2D3C62006357C1 /* eas_tonecontrol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_tonecontrol.c; path = ../../lib_src/eas_tonecontrol.c; sourceTree = SOURCE_ROOT; };
C55B11DE0E2D3C62006357C1 /* eas_wavefile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_wavefile.c; path = ../../lib_src/eas_wavefile.c; sourceTree = SOURCE_ROOT; };
C55B11DF0E2D3C62006357C1 /* eas_wavefiledata.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_wavefiledata.c; path = ../../lib_src/eas_wavefiledata.c; sourceTree = SOURCE_ROOT; };
C55B11F60E2D3C7B006357C1 /* eas_reverb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_reverb.c; path = ../../lib_src/eas_reverb.c; sourceTree = SOURCE_ROOT; };
C55B11F80E2D3CAC006357C1 /* eastestv37.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = eastestv37.c; sourceTree = "<group>"; };
C55B12020E2D3D56006357C1 /* eas_dlssynth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_dlssynth.c; path = ../../lib_src/eas_dlssynth.c; sourceTree = SOURCE_ROOT; };
C55B12030E2D3D56006357C1 /* eas_wtengine.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_wtengine.c; path = ../../lib_src/eas_wtengine.c; sourceTree = SOURCE_ROOT; };
C55B12040E2D3D56006357C1 /* eas_wtsynth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = eas_wtsynth.c; path = ../../lib_src/eas_wtsynth.c; sourceTree = SOURCE_ROOT; };
D2AAC046055464E500DB518D /* libeaswt_vst_lib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libeaswt_vst_lib.a; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D289987405E68DCB004EDB86 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* easwt_vst_lib */ = {
isa = PBXGroup;
children = (
C55B11280E2D31B6006357C1 /* Header Files */,
08FB7795FE84155DC02AAC07 /* Source */,
C6A0FF2B0290797F04C91782 /* Documentation */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = easwt_vst_lib;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
C55B119F0E2D3B1B006357C1 /* eas_data.c */,
C55B11A00E2D3B1B006357C1 /* eas_flog.c */,
C55B11A20E2D3B1B006357C1 /* eas_ima_tables.c */,
C55B11A30E2D3B1B006357C1 /* eas_imaadpcm.c */,
C55B11A40E2D3B1B006357C1 /* eas_math.c */,
C55B11A50E2D3B1B006357C1 /* eas_midi.c */,
C55B11A60E2D3B1B006357C1 /* eas_mididata.c */,
C55B11A70E2D3B1B006357C1 /* eas_mixbuf.c */,
C55B11320E2D33B4006357C1 /* eas_mixer.c */,
C55B11A80E2D3B1B006357C1 /* eas_pan.c */,
C55B11A90E2D3B1B006357C1 /* eas_pcm.c */,
C55B11AA0E2D3B1B006357C1 /* eas_pcmdata.c */,
C55B11AB0E2D3B1B006357C1 /* eas_public.c */,
C55B11AC0E2D3B1B006357C1 /* eas_voicemgt.c */,
C55B11BC0E2D3B55006357C1 /* jet.c */,
C55B11960E2D3A56006357C1 /* Chorus */,
C55B119A0E2D3A7F006357C1 /* Parsers */,
C55B11970E2D3A5C006357C1 /* Reverb */,
C55B119B0E2D3A99006357C1 /* SoundLibs */,
C55B119D0E2D3AB6006357C1 /* Wavetable */,
);
name = Source;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
D2AAC046055464E500DB518D /* libeaswt_vst_lib.a */,
);
name = Products;
sourceTree = "<group>";
};
C55B11280E2D31B6006357C1 /* Header Files */ = {
isa = PBXGroup;
children = (
9A56AC040F71BCFE00D115A7 /* eas_build.h */,
9A56ABCF0F71998600D115A7 /* eas_fmengine.h */,
C55B11880E2D39B0006357C1 /* Reverb */,
C55B11870E2D39A9006357C1 /* Chorus */,
C55B11850E2D395F006357C1 /* eas_wtengine.h */,
C55B11810E2D38FB006357C1 /* jet.h */,
C55B11820E2D38FB006357C1 /* jet_data.h */,
C55B116B0E2D38CE006357C1 /* eas_mdls.h */,
C55B116C0E2D38CE006357C1 /* eas_otadata.h */,
C55B116D0E2D38CE006357C1 /* eas_parser.h */,
C55B116E0E2D38CE006357C1 /* eas_rtttldata.h */,
C55B11700E2D38CE006357C1 /* eas_smf.h */,
C55B11710E2D38CE006357C1 /* eas_smfdata.h */,
C55B11720E2D38CE006357C1 /* eas_tcdata.h */,
C55B11730E2D38CE006357C1 /* eas_wavefile.h */,
C55B11620E2D37FC006357C1 /* eas_imelodydata.h */,
C55B11530E2D3796006357C1 /* eas_effects.h */,
C55B11290E2D33B4006357C1 /* eas.h */,
C55B112A0E2D33B4006357C1 /* eas_audioconst.h */,
C55B112C0E2D33B4006357C1 /* eas_config.h */,
C55B112D0E2D33B4006357C1 /* eas_data.h */,
C55B112E0E2D33B4006357C1 /* eas_host.h */,
C55B112F0E2D33B4006357C1 /* eas_math.h */,
C55B11300E2D33B4006357C1 /* eas_midi.h */,
C55B11310E2D33B4006357C1 /* eas_midictrl.h */,
C55B11330E2D33B4006357C1 /* eas_pan.h */,
C55B11340E2D33B4006357C1 /* eas_pcm.h */,
C55B11350E2D33B4006357C1 /* eas_pcmdata.h */,
C55B11370E2D33B4006357C1 /* eas_report.h */,
C55B11380E2D33B4006357C1 /* eas_sndlib.h */,
C55B11390E2D33B4006357C1 /* eas_synth.h */,
C55B113A0E2D33B4006357C1 /* eas_synth_protos.h */,
C55B113B0E2D33B4006357C1 /* eas_types.h */,
C55B113C0E2D33B4006357C1 /* eas_vm_protos.h */,
);
name = "Header Files";
sourceTree = "<group>";
};
C55B11870E2D39A9006357C1 /* Chorus */ = {
isa = PBXGroup;
children = (
C55B11920E2D39FE006357C1 /* eas_chorus.h */,
C55B11930E2D39FE006357C1 /* eas_chorusdata.h */,
);
name = Chorus;
sourceTree = "<group>";
};
C55B11880E2D39B0006357C1 /* Reverb */ = {
isa = PBXGroup;
children = (
C55B118E0E2D39ED006357C1 /* eas_reverb.h */,
C55B118F0E2D39ED006357C1 /* eas_reverbdata.h */,
);
name = Reverb;
sourceTree = "<group>";
};
C55B11960E2D3A56006357C1 /* Chorus */ = {
isa = PBXGroup;
children = (
C55B11C00E2D3BFD006357C1 /* eas_chorus.c */,
);
name = Chorus;
sourceTree = "<group>";
};
C55B11970E2D3A5C006357C1 /* Reverb */ = {
isa = PBXGroup;
children = (
C55B11F60E2D3C7B006357C1 /* eas_reverb.c */,
);
name = Reverb;
sourceTree = "<group>";
};
C55B119A0E2D3A7F006357C1 /* Parsers */ = {
isa = PBXGroup;
children = (
9A56ABD70F719D4600D115A7 /* eas_xmf.c */,
9A56ABD80F719D4600D115A7 /* eas_xmf.h */,
9A56ABD90F719D4600D115A7 /* eas_xmfdata.c */,
9A56ABDA0F719D4600D115A7 /* eas_xmfdata.h */,
C55B11D00E2D3C62006357C1 /* eas_imelody.c */,
C55B11D10E2D3C62006357C1 /* eas_imelodydata.c */,
C55B11D20E2D3C62006357C1 /* eas_mdls.c */,
C55B11D30E2D3C62006357C1 /* eas_ota.c */,
C55B11D40E2D3C62006357C1 /* eas_otadata.c */,
C55B11D50E2D3C62006357C1 /* eas_rtttl.c */,
C55B11D60E2D3C62006357C1 /* eas_rtttldata.c */,
C55B11DA0E2D3C62006357C1 /* eas_smf.c */,
C55B11DB0E2D3C62006357C1 /* eas_smfdata.c */,
C55B11DC0E2D3C62006357C1 /* eas_tcdata.c */,
C55B11DD0E2D3C62006357C1 /* eas_tonecontrol.c */,
C55B11DE0E2D3C62006357C1 /* eas_wavefile.c */,
C55B11DF0E2D3C62006357C1 /* eas_wavefiledata.c */,
);
name = Parsers;
sourceTree = "<group>";
};
C55B119B0E2D3A99006357C1 /* SoundLibs */ = {
isa = PBXGroup;
children = (
9A56AB8E0F7197AE00D115A7 /* wt_44khz.c */,
C55B11F80E2D3CAC006357C1 /* eastestv37.c */,
);
name = SoundLibs;
sourceTree = "<group>";
};
C55B119D0E2D3AB6006357C1 /* Wavetable */ = {
isa = PBXGroup;
children = (
C55B12020E2D3D56006357C1 /* eas_dlssynth.c */,
C55B12030E2D3D56006357C1 /* eas_wtengine.c */,
C55B12040E2D3D56006357C1 /* eas_wtsynth.c */,
);
name = Wavetable;
sourceTree = "<group>";
};
C6A0FF2B0290797F04C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
);
name = Documentation;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
D2AAC043055464E500DB518D /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
C55B113D0E2D33B4006357C1 /* eas.h in Headers */,
C55B113E0E2D33B4006357C1 /* eas_audioconst.h in Headers */,
C55B11400E2D33B4006357C1 /* eas_config.h in Headers */,
C55B11410E2D33B4006357C1 /* eas_data.h in Headers */,
C55B11420E2D33B4006357C1 /* eas_host.h in Headers */,
C55B11430E2D33B4006357C1 /* eas_math.h in Headers */,
C55B11440E2D33B4006357C1 /* eas_midi.h in Headers */,
C55B11450E2D33B4006357C1 /* eas_midictrl.h in Headers */,
C55B11470E2D33B4006357C1 /* eas_pan.h in Headers */,
C55B11480E2D33B4006357C1 /* eas_pcm.h in Headers */,
C55B11490E2D33B4006357C1 /* eas_pcmdata.h in Headers */,
C55B114B0E2D33B4006357C1 /* eas_report.h in Headers */,
C55B114C0E2D33B4006357C1 /* eas_sndlib.h in Headers */,
C55B114D0E2D33B4006357C1 /* eas_synth.h in Headers */,
C55B114E0E2D33B4006357C1 /* eas_synth_protos.h in Headers */,
C55B114F0E2D33B4006357C1 /* eas_types.h in Headers */,
C55B11500E2D33B4006357C1 /* eas_vm_protos.h in Headers */,
C55B115B0E2D3796006357C1 /* eas_effects.h in Headers */,
C55B11640E2D37FC006357C1 /* eas_imelodydata.h in Headers */,
C55B11760E2D38CE006357C1 /* eas_mdls.h in Headers */,
C55B11770E2D38CE006357C1 /* eas_otadata.h in Headers */,
C55B11780E2D38CE006357C1 /* eas_parser.h in Headers */,
C55B11790E2D38CE006357C1 /* eas_rtttldata.h in Headers */,
C55B117B0E2D38CE006357C1 /* eas_smf.h in Headers */,
C55B117C0E2D38CE006357C1 /* eas_smfdata.h in Headers */,
C55B117D0E2D38CE006357C1 /* eas_tcdata.h in Headers */,
C55B117E0E2D38CE006357C1 /* eas_wavefile.h in Headers */,
C55B11830E2D38FB006357C1 /* jet.h in Headers */,
C55B11840E2D38FB006357C1 /* jet_data.h in Headers */,
C55B11860E2D395F006357C1 /* eas_wtengine.h in Headers */,
C55B11900E2D39ED006357C1 /* eas_reverb.h in Headers */,
C55B11910E2D39ED006357C1 /* eas_reverbdata.h in Headers */,
C55B11940E2D39FE006357C1 /* eas_chorus.h in Headers */,
C55B11950E2D39FE006357C1 /* eas_chorusdata.h in Headers */,
9A56ABD00F71998600D115A7 /* eas_fmengine.h in Headers */,
9A56ABDC0F719D4600D115A7 /* eas_xmf.h in Headers */,
9A56ABDE0F719D4600D115A7 /* eas_xmfdata.h in Headers */,
9A56AC050F71BCFE00D115A7 /* eas_build.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
D2AAC045055464E500DB518D /* easwt_vst_lib */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "easwt_vst_lib" */;
buildPhases = (
D2AAC043055464E500DB518D /* Headers */,
D2AAC044055464E500DB518D /* Sources */,
D289987405E68DCB004EDB86 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = easwt_vst_lib;
productName = easwt_vst_lib;
productReference = D2AAC046055464E500DB518D /* libeaswt_vst_lib.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "easwt_vst_lib" */;
compatibilityVersion = "Xcode 3.0";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* easwt_vst_lib */;
projectDirPath = "";
projectRoot = "";
targets = (
D2AAC045055464E500DB518D /* easwt_vst_lib */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D2AAC044055464E500DB518D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C55B11460E2D33B4006357C1 /* eas_mixer.c in Sources */,
C55B11AE0E2D3B1B006357C1 /* eas_data.c in Sources */,
C55B11AF0E2D3B1B006357C1 /* eas_flog.c in Sources */,
C55B11B10E2D3B1B006357C1 /* eas_ima_tables.c in Sources */,
C55B11B20E2D3B1B006357C1 /* eas_imaadpcm.c in Sources */,
C55B11B30E2D3B1B006357C1 /* eas_math.c in Sources */,
C55B11B40E2D3B1B006357C1 /* eas_midi.c in Sources */,
C55B11B50E2D3B1B006357C1 /* eas_mididata.c in Sources */,
C55B11B60E2D3B1B006357C1 /* eas_mixbuf.c in Sources */,
C55B11B70E2D3B1B006357C1 /* eas_pan.c in Sources */,
C55B11B80E2D3B1B006357C1 /* eas_pcm.c in Sources */,
C55B11B90E2D3B1B006357C1 /* eas_pcmdata.c in Sources */,
C55B11BA0E2D3B1B006357C1 /* eas_public.c in Sources */,
C55B11BB0E2D3B1B006357C1 /* eas_voicemgt.c in Sources */,
C55B11BD0E2D3B55006357C1 /* jet.c in Sources */,
C55B11C10E2D3BFD006357C1 /* eas_chorus.c in Sources */,
C55B11E40E2D3C62006357C1 /* eas_imelody.c in Sources */,
C55B11E50E2D3C62006357C1 /* eas_imelodydata.c in Sources */,
C55B11E60E2D3C62006357C1 /* eas_mdls.c in Sources */,
C55B11E70E2D3C62006357C1 /* eas_ota.c in Sources */,
C55B11E80E2D3C62006357C1 /* eas_otadata.c in Sources */,
C55B11E90E2D3C62006357C1 /* eas_rtttl.c in Sources */,
C55B11EA0E2D3C62006357C1 /* eas_rtttldata.c in Sources */,
C55B11EE0E2D3C62006357C1 /* eas_smf.c in Sources */,
C55B11EF0E2D3C62006357C1 /* eas_smfdata.c in Sources */,
C55B11F00E2D3C62006357C1 /* eas_tcdata.c in Sources */,
C55B11F10E2D3C62006357C1 /* eas_tonecontrol.c in Sources */,
C55B11F20E2D3C62006357C1 /* eas_wavefile.c in Sources */,
C55B11F30E2D3C62006357C1 /* eas_wavefiledata.c in Sources */,
C55B11F70E2D3C7B006357C1 /* eas_reverb.c in Sources */,
C55B11FA0E2D3CAC006357C1 /* eastestv37.c in Sources */,
C55B12050E2D3D56006357C1 /* eas_dlssynth.c in Sources */,
C55B12060E2D3D56006357C1 /* eas_wtengine.c in Sources */,
C55B12070E2D3D56006357C1 /* eas_wtsynth.c in Sources */,
9A56AB8F0F7197AE00D115A7 /* wt_44khz.c in Sources */,
9A56ABDB0F719D4600D115A7 /* eas_xmf.c in Sources */,
9A56ABDD0F719D4600D115A7 /* eas_xmfdata.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB91EC08733DB70010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG_JET=1",
"_DEBUG_SMAF=1",
"_DEBUG_CMF=1",
"JET_INTERFACE=1",
"MAX_SMF_STREAMS=32",
"NUM_OUTPUT_CHANNELS=2",
"_SAMPLE_RATE_44100=1",
"_8_BIT_SAMPLES=1",
"_FILTER_ENABLED=1",
"_NO_DEBUG_PREPROCESSOR=1",
"_CORE_CYCLES_PER_MEMORY_CYCLE=1",
"_IMA_DECODER=1",
"_XMF_PARSER=1",
"_DLS_PARSER=1",
"MAX_DLS_MEMORY=16777216",
"EAS_WT_SYNTH=1",
"MAX_SYNTH_VOICES=64",
"X_ENHANCER_ENABLED=1",
"_REVERB_ENABLED=1",
"_CHORUS_ENABLED=1",
"DLS_SYNTHESIZER=1",
"EXTERNAL_AUDIO=1",
"TEST_HARNESS=1",
"MMAPI_SUPPORT=1",
"X_MAXIMIZER_ENABLED=1",
"X_COMPRESSOR_ENABLED=1",
"X_STATS=1",
"X_DEBUG_DLS=1",
"X_OPTIMIZED_MONO=1",
"X_CHECKED_BUILD=1",
"_NO_ALIGN=1",
"_C_REFERENCE=1",
"XMAXIMIZER_USE_FLOATING_POINT=1",
);
HEADER_SEARCH_PATHS = (
"${TARGET_BUILD_DIR}/**",
"../../Common/**",
"../../Parsers/**",
"../../Effects/**",
"../../WTSynth/**",
"../../FMSynth/**",
"../../SplitArch/**",
"../../Jet/**",
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = easwt_vst_lib;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB91ED08733DB70010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_AUTO_VECTORIZATION = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 3;
GCC_PREPROCESSOR_DEFINITIONS = (
"JET_INTERFACE=1",
"MAX_SMF_STREAMS=32",
"NUM_OUTPUT_CHANNELS=2",
"_SAMPLE_RATE_44100=1",
"_8_BIT_SAMPLES=1",
"_FILTER_ENABLED=1",
"_NO_DEBUG_PREPROCESSOR=1",
"_CORE_CYCLES_PER_MEMORY_CYCLE=1",
"_IMA_DECODER=1",
"_XMF_PARSER=1",
"_DLS_PARSER=1",
"MAX_DLS_MEMORY=16777216",
"EAS_WT_SYNTH=1",
"MAX_SYNTH_VOICES=64",
"X_ENHANCER_ENABLED=1",
"_REVERB_ENABLED=1",
"_CHORUS_ENABLED=1",
"DLS_SYNTHESIZER=1",
"EXTERNAL_AUDIO=1",
"TEST_HARNESS=1",
"MMAPI_SUPPORT=1",
"X_MAXIMIZER_ENABLED=1",
"X_COMPRESSOR_ENABLED=1",
"X_STATS=1",
"X_DEBUG_DLS=1",
"X_OPTIMIZED_MONO=1",
"X_CHECKED_BUILD=1",
"_NO_ALIGN=1",
"_C_REFERENCE=1",
"XMAXIMIZER_USE_FLOATING_POINT=1",
);
GCC_UNROLL_LOOPS = YES;
HEADER_SEARCH_PATHS = (
"${TARGET_BUILD_DIR}/**",
"../../Common/**",
"../../Parsers/**",
"../../Effects/**",
"../../WTSynth/**",
"../../FMSynth/**",
"../../SplitArch/**",
"../../Jet/**",
);
INSTALL_PATH = /usr/local/lib;
MACOSX_DEPLOYMENT_TARGET = 10.4;
PRODUCT_NAME = easwt_vst_lib;
};
name = Release;
};
1DEB91F008733DB70010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Debug;
};
1DEB91F108733DB70010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "easwt_vst_lib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91EC08733DB70010E9CD /* Debug */,
1DEB91ED08733DB70010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "easwt_vst_lib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91F008733DB70010E9CD /* Debug */,
1DEB91F108733DB70010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC045055464E500DB518D"
BuildableName = "libeaswt_vst_lib.a"
BlueprintName = "easwt_vst_lib"
ReferencedContainer = "container:easwt_vst_lib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>easwt_vst_lib.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>11</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D2AAC045055464E500DB518D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D2AAC045055464E500DB518D"
BuildableName = "libeaswt_vst_lib.a"
BlueprintName = "easwt_vst_lib"
ReferencedContainer = "container:easwt_vst_lib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>easwt_vst_lib.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D2AAC045055464E500DB518D</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,134 @@
@***********************************************************
@ Function: WT_VoiceFilter
@ Processor: ARM
@ Description:
@ Implements a 2-pole low-pass filter with resonanance
@
@ Usage:
@ void WT_VoiceFilter(
@ S_FILTER CONTROL *pFilter,
@ S_WT_FRAME *pWTFrame);
@
@ Copyright 2005 Sonic Network, Inc.
@****************************************************************
@ Revision Control:
@ $Revision: 496 $
@ $Date: 2006-12-11 14:33:26 -0800 (Mon, 11 Dec 2006) $
@****************************************************************
@
@ where:
@ S_FILTER_CONTROL *pFilter
@ PASSED IN: r0
@
@ S_WT_FRAME *pWTFrame
@ PASSED IN: r1
@****************************************************************
.include "ARM_synth_constants_gnu.inc"
.arm
.text
.global WT_VoiceFilter
@ Register usage
@ --------------
pFilter .req r0
pWTFrame .req r1
pBuffer .req r2
numSamples .req r3
z1 .req r4
z2 .req r5
b1 .req r6
b2 .req r7
K .req r8
tmp0 .req r1 @ reuse register
tmp1 .req r9
tmp2 .req r10
@SaveRegs RLIST {r4-r10, lr}
@RestoreRegs RLIST {r4-r10, pc}
.func WT_VoiceFilter
WT_VoiceFilter:
STMFD sp!, {r4-r10, lr}
@
@ Setup passed parameters in their destination registers
@----------------------------------------------------------------
LDR pBuffer, [pWTFrame, #m_pAudioBuffer]
LDR numSamples, [pWTFrame, #m_numSamples]
@load state variables from pFilter structure
LDRSH z1, [pFilter, #m_z1]
LDRSH z2, [pFilter, #m_z2]
@load coefficients from pWTFrame structure
LDR K, [pWTFrame, #m_k]
LDR b1, [pWTFrame, #m_b1]
LDR b2, [pWTFrame, #m_b2]
RSB b1, b1, #0 @ b1 = -b1
RSB b2, b2, #0 @ b2 = -b2
MOV b2, b2, ASR #1 @ b2 = b2 >> 1
MOV K, K, ASR #1 @ K = K >> 1
@
@ Start processing
@----------------------------------------------------------------
LDRSH tmp0, [pBuffer] @ fetch sample
FilterLoop:
SMULBB tmp2, z1, b1 @ tmp2 = z1 * -b1
SMLABB tmp2, z2, b2, tmp2 @ tmp2 = (-b1 * z1) + (-b2 * z2)
MOV z2, z1 @ delay line
SMLABB tmp0, tmp0, K, tmp2 @ tmp1 = (K * x[n]) + (-b1 * z1) + (-b2 * z2)
LDRSH tmp1, [pBuffer, #NEXT_OUTPUT_PCM] @ fetch next sample
MOV z1, tmp0, ASR #14 @ shift result to low word
STRH z1, [pBuffer], #NEXT_OUTPUT_PCM @ write back to buffer
SMULBB tmp2, z1, b1 @ tmp2 = z1 * -b1
SUBS numSamples, numSamples, #2 @ unroll loop once
SMLABB tmp2, z2, b2, tmp2 @ tmp2 = (-b1 * z1) + (-b2 * z2)
SMLABB tmp1, tmp1, K, tmp2 @ tmp1 = (K * x[n]) + (-b1 * z1) + (-b2 * z2)
MOV z2, z1 @ delay line
MOV z1, tmp1, ASR #14 @ shift result to low word
LDRGTSH tmp0, [pBuffer, #NEXT_OUTPUT_PCM] @ fetch next sample
STRH z1, [pBuffer], #NEXT_OUTPUT_PCM @ write back to buffer
BGT FilterLoop
@ save z terms
@----------------------------------------------------------------
STRH z1, [pFilter, #m_z1]
STRH z2, [pFilter, #m_z2]
@ Return to calling function
@----------------------------------------------------------------
LDMFD sp!,{r4-r10, lr}
BX lr
.endfunc
.end

View File

@@ -0,0 +1,131 @@
@***********************************************************
@ Function: WT_Interpolate
@ Processor: ARM-E
@ Description: the main synthesis function when fetching
@ wavetable samples.
@ C-callable.
@
@ Usage:
@ void WT_Interpolate(
@ S_WT_VOICE *pWTVoice,
@ S_WT_FRAME *pWTFrame);
@
@ Copyright Sonic Network Inc. 2004
@****************************************************************
@ Revision Control:
@ $Revision: 496 $
@ $Date: 2006-12-11 14:33:26 -0800 (Mon, 11 Dec 2006) $
@****************************************************************
@
@ where:
@ S_WT_VOICE *pWTVoice
@ PASSED IN: r0
@
@ S_WT_FRAME *pWTFrame;
@ PASSED IN: r1
@****************************************************************
.include "ARM_synth_constants_gnu.inc"
.arm
.text
.global WT_Interpolate
@ Register usage
@ --------------
pWTVoice .req r0
pWTFrame .req r1
numSamples .req r2
phaseIncrement .req r3
pOutputBuffer .req r4
tmp0 .req r1 @reuse register
tmp1 .req r5
tmp2 .req r6
pLoopEnd .req r7
pLoopStart .req r8
pPhaseAccum .req r9
phaseFrac .req r10
phaseFracMask .req r11
@SaveRegs RLIST {r4-r11,lr}
@RestoreRegs RLIST {r4-r11,pc}
.func WT_Interpolate
WT_Interpolate:
STMFD sp!,{r4-r11,lr}
@
@ Fetch parameters from structures
@----------------------------------------------------------------
LDR pOutputBuffer, [pWTFrame, #m_pAudioBuffer]
LDR numSamples, [pWTFrame, #m_numSamples]
LDR phaseIncrement, [pWTFrame, #m_phaseIncrement]
LDR pPhaseAccum, [pWTVoice, #m_pPhaseAccum]
LDR phaseFrac, [pWTVoice, #m_phaseFrac]
LDR phaseFracMask,=PHASE_FRAC_MASK
LDR pLoopStart, [pWTVoice, #m_pLoopStart]
LDR pLoopEnd, [pWTVoice, #m_pLoopEnd]
ADD pLoopEnd, pLoopEnd, #1 @ need loop end to equal last sample + 1
InterpolationLoop:
SUBS tmp0, pPhaseAccum, pLoopEnd @ check for loop end
ADDGE pPhaseAccum, pLoopStart, tmp0 @ loop back to start
.ifdef SAMPLES_8_BIT
LDRSB tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSB tmp1, [pPhaseAccum, #1] @ tmp1 = x1
.else
LDRSH tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSH tmp1, [pPhaseAccum, #2] @ tmp1 = x1
.endif
ADD tmp2, phaseIncrement, phaseFrac @ increment pointer here to avoid pipeline stall
SUB tmp1, tmp1, tmp0 @ tmp1 = x1 - x0
SMULBB tmp1, phaseFrac, tmp1 @ tmp1 = phaseFrac * tmp2
@ This section performs a gain adjustment of -12dB for 16-bit samples
@ or +36dB for 8-bit samples. For a high quality synthesizer, the output
@ can be set to full scale, however if the filter is used, it can overflow
@ with certain coefficients and signal sources. In this case, either a
@ saturation operation should take in the filter before scaling back to
@ 16 bits or the signal path should be increased to 18 bits or more.
.ifdef SAMPLES_8_BIT
MOV tmp0, tmp0, LSL #6 @ boost 8-bit signal by 36dB
.else
MOV tmp0, tmp0, ASR #2 @ reduce 16-bit signal by 12dB
.endif
ADD tmp1, tmp0, tmp1, ASR #(NUM_EG1_FRAC_BITS-6) @ tmp1 = tmp0 + (tmp1 >> (15-6))
@ = x0 + f * (x1 - x0) == interpolated result
STRH tmp1, [pOutputBuffer], #NEXT_OUTPUT_PCM @ *pOutputBuffer++ = interpolated result
@ carry overflow from fraction to integer portion
ADD pPhaseAccum, pPhaseAccum, tmp2, LSR #(NUM_PHASE_FRAC_BITS - NEXT_INPUT_PCM_SHIFT)
AND phaseFrac, tmp2, phaseFracMask @ nphaseFrac = frac part
SUBS numSamples, numSamples, #1
BGT InterpolationLoop
@ update and store phase
STR pPhaseAccum, [pWTVoice, #m_pPhaseAccum]
STR phaseFrac, [pWTVoice, #m_phaseFrac]
LDMFD sp!,{r4-r11,lr}
BX lr
.endfunc
.end

View File

@@ -0,0 +1,130 @@
@***********************************************************
@ Function: WT_InterpolateNoLoop
@ Processor: ARM-E
@ Description: the main synthesis function when fetching
@ wavetable samples.
@ C-callable.
@
@ Usage:
@ void WT_InterpolateNoLoop(
@ S_WT_VOICE *pWTVoice,
@ S_WT_FRAME *pWTFrame);
@
@ Copyright Sonic Network Inc. 2004
@****************************************************************
@ Revision Control:
@ $Revision: 496 $
@ $Date: 2006-12-11 14:33:26 -0800 (Mon, 11 Dec 2006) $
@****************************************************************
@
@ where:
@ S_WT_VOICE *pWTVoice
@ PASSED IN: r0
@
@ S_WT_FRAME *pWTFrame;
@ PASSED IN: r1
@****************************************************************
.include "ARM_synth_constants_gnu.inc"
.arm
.text
.global WT_InterpolateNoLoop
@ Register usage
@ --------------
pWTVoice .req r0
pWTFrame .req r1
pOutputBuffer .req r2
numSamples .req r3
phaseIncrement .req r4
pPhaseAccum .req r5
phaseFrac .req r6
phaseFracMask .req r7
tmp0 .req r1 @ reuse register
tmp1 .req r8
tmp2 .req r9
@SaveRegs RLIST {r4-r9,lr}
@RestoreRegs RLIST {r4-r9,pc}
.func WT_InterpolateNoLoop
WT_InterpolateNoLoop:
STMFD sp!, {r4-r9,lr}
@
@ Fetch parameters from structures
@----------------------------------------------------------------
LDR pOutputBuffer, [pWTFrame, #m_pAudioBuffer]
LDR numSamples, [pWTFrame, #m_numSamples]
LDR phaseIncrement, [pWTFrame, #m_phaseIncrement]
LDR pPhaseAccum, [pWTVoice, #m_pPhaseAccum]
LDR phaseFrac, [pWTVoice, #m_phaseFrac]
LDR phaseFracMask,=PHASE_FRAC_MASK
InterpolationLoop:
.ifdef SAMPLES_8_BIT
LDRSB tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSB tmp1, [pPhaseAccum, #1] @ tmp1 = x1
.else
LDRSH tmp0, [pPhaseAccum] @ tmp0 = x0
LDRSH tmp1, [pPhaseAccum, #2] @ tmp1 = x1
.endif
ADD tmp2, phaseIncrement, phaseFrac @ increment pointer here to avoid pipeline stall
SUB tmp1, tmp1, tmp0 @ tmp1 = x1 - x0
SMULBB tmp1, phaseFrac, tmp1 @ tmp1 = phaseFrac * tmp2
@ This section performs a gain adjustment of -12dB for 16-bit samples
@ or +36dB for 8-bit samples. For a high quality synthesizer, the output
@ can be set to full scale, however if the filter is used, it can overflow
@ with certain coefficients and signal sources. In this case, either a
@ saturation operation should take in the filter before scaling back to
@ 16 bits or the signal path should be increased to 18 bits or more.
.ifdef SAMPLES_8_BIT
MOV tmp0, tmp0, LSL #6 @ boost 8-bit signal by 36dB
.else
MOV tmp0, tmp0, ASR #2 @ reduce 16-bit signal by 12dB
.endif
ADD tmp1, tmp0, tmp1, ASR #(NUM_EG1_FRAC_BITS-6) @ tmp1 = tmp0 + (tmp1 >> (15-6))
@ = x0 + f * (x1 - x0) == interpolated result
STRH tmp1, [pOutputBuffer], #NEXT_OUTPUT_PCM @ *pOutputBuffer++ = interpolated result
@ carry overflow from fraction to integer portion
ADD pPhaseAccum, pPhaseAccum, tmp2, LSR #(NUM_PHASE_FRAC_BITS - NEXT_INPUT_PCM_SHIFT)
AND phaseFrac, tmp2, phaseFracMask @ nphaseFrac = frac part
SUBS numSamples, numSamples, #1
BGT InterpolationLoop
@ Clean up and store any changes that were caused during the loop
@----------------------------------------------------------------
@ update and store phase
STR pPhaseAccum, [pWTVoice, #m_pPhaseAccum]
STR phaseFrac, [pWTVoice, #m_phaseFrac]
@
@ Return to calling function
@----------------------------------------------------------------
LDMFD sp!,{r4-r9,lr}
BX lr
.endfunc
.end

View File

@@ -0,0 +1,109 @@
@***********************************************************
@ Function: SynthMasterGain
@ Processor: ARM-E
@ Description: Copies 32-bit synth output to 16-bit buffer
@ with saturated gain control
@ C-callable.
@
@ Usage:
@ SynthMasterGain(
@ pInputBuffer
@ pOutputBuffer,
@ nGain,
@ nNumLoopSamples
@ );
@
@ Copyright Sonic Network Inc. 2004
@****************************************************************
@ Revision Control:
@ $Revision: 496 $
@ $Date: 2006-12-11 14:33:26 -0800 (Mon, 11 Dec 2006) $
@****************************************************************
@
@ where:
@ long *pInputBuffer
@ PASSED IN: r0
@
@ EAS_PCM *pOutputBuffer
@ PASSED IN: r1
@
@ short nGain
@ PASSED IN: r2
@
@ EAS_U16 nNumLoopSamples
@ PASSED IN: r3
@
@****************************************************************
.include "ARM_synth_constants_gnu.inc"
.arm
.text
.func SynthMasterGain
SynthMasterGain:
.global SynthMasterGain @ allow other files to use this function
@ Stack frame
@ -----------
.equ RET_ADDR_SZ, 0 @return address
.equ REG_SAVE_SZ, 0 @save-on-entry registers saved
.equ FRAME_SZ, (8) @local variables
.equ ARG_BLK_SZ, 0 @argument block
.equ PARAM_OFFSET, (ARG_BLK_SZ + FRAME_SZ + REG_SAVE_SZ + RET_ADDR_SZ)
@ Register usage
@ --------------
pnInputBuffer .req r0
pnOutputBuffer .req r1
nGain .req r2
nNumLoopSamples .req r3
STMFD sp!,{r4-r6,r14} @Save any save-on-entry registers that are used
LDR r6, =0x7fff @constant for saturation tests
loop:
LDR r4, [pnInputBuffer], #4 @fetch 1st output sample
LDR r5, [pnInputBuffer], #4 @fetch 2nd output sample
SMULWB r4, r4, nGain @output = gain * input
CMP r4, r6 @check for positive saturation
MOVGT r4, r6 @saturate
CMN r4, r6 @check for negative saturation
MVNLT r4, r6 @saturate
SMULWB r5, r5, nGain @output = gain * input
STRH r4, [pnOutputBuffer], #NEXT_OUTPUT_PCM @save 1st output sample
CMP r5, r6 @check for positive saturation
MOVGT r5, r6 @saturate
CMN r5, r6 @check for negative saturation
MVNLT r5, r6 @saturate
STRH r5, [pnOutputBuffer], #NEXT_OUTPUT_PCM @save 2nd output sample
SUBS nNumLoopSamples, nNumLoopSamples, #2
BGT loop
@
@ Return to calling function
@----------------------------------------------------------------
LDMFD sp!,{r4-r6, lr} @ return to calling function
BX lr
@*****************************************************************************
.endfunc @ end of function/procedure
.end @ end of assembly code

View File

@@ -0,0 +1,166 @@
@***********************************************************
@ Function: WT_VoiceGain
@ Processor: ARM-E
@ Description: the main synthesis function when fetching
@ wavetable samples.
@ C-callable.
@
@ Usage:
@ Usage:
@ WT_VoiceGain(
@ S_WT_VOICE *pWTVoice,
@ S_WT_FRAME *pWTFrame);
@
@ Copyright 2004, 2005 Sonic Network, Inc.
@****************************************************************
@ Revision Control:
@ $Revision: 814 $
@ $Date: 2007-08-02 10:34:53 -0700 (Thu, 02 Aug 2007) $
@****************************************************************
@
@ where:
@ S_WT_VOICE *psVoice
@ PASSED IN: r0
@
@ S_WT_FRAME *pWTFrame
@ PASSED IN: r1
@****************************************************************
.include "ARM_synth_constants_gnu.inc"
.arm
.text
.global WT_VoiceGain
@ Register usage
@ --------------
pWTVoice .req r0
pWTFrame .req r1
pInputBuffer .req r2
pMixBuffer .req r3
tmp0 .req r4
tmp1 .req r5
tmp2 .req r1 @ reuse register
tmp3 .req r6
numSamples .req r9
.if STEREO_OUTPUT
gainIncLeft .req r7
gainIncRight .req r8
gainLeft .req r10
gainRight .req r11
.else
gainIncrement .req r7
gain .req r8
.endif
@ register context for local variables
@SaveRegs RLIST {r4-r11,lr}
@RestoreRegs RLIST {r4-r11,pc}
.func WT_VoiceGain
WT_VoiceGain:
STMFD sp!, {r4-r11,lr}
LDR pInputBuffer, [pWTFrame, #m_pAudioBuffer]
LDR pMixBuffer, [pWTFrame, #m_pMixBuffer]
LDR numSamples, [pWTFrame, #m_numSamples]
@----------------------------------------------------------------
@ Stereo version
@----------------------------------------------------------------
@ NOTE: instructions are reordered to reduce the effect of latency
@ due to storage and computational dependencies.
@----------------------------------------------------------------
.if STEREO_OUTPUT
LDR tmp0, [pWTFrame, #m_prevGain]
LDR tmp1, [pWTFrame, #m_gainTarget]
LDRSH gainLeft, [pWTVoice, #m_gainLeft]
LDRSH gainRight, [pWTVoice, #m_gainRight]
MOV gainIncLeft, gainLeft
SMULBB gainLeft, tmp0, gainLeft
SMULBB gainIncLeft, tmp1, gainIncLeft
SUB gainIncLeft, gainIncLeft, gainLeft
MOV gainLeft, gainLeft, ASR #(NUM_MIXER_GUARD_BITS - 2)
MOV gainIncLeft, gainIncLeft, ASR #(SYNTH_UPDATE_PERIOD_IN_BITS + NUM_MIXER_GUARD_BITS - 2)
MOV gainIncRight, gainRight
SMULBB gainRight, tmp0, gainRight
SMULBB gainIncRight, tmp1, gainIncRight
SUB gainIncRight, gainIncRight, gainRight
MOV gainRight, gainRight, ASR #(NUM_MIXER_GUARD_BITS - 2)
MOV gainIncRight, gainIncRight, ASR #(SYNTH_UPDATE_PERIOD_IN_BITS + NUM_MIXER_GUARD_BITS - 2)
LDRSH tmp0, [pInputBuffer], #2
StereoGainLoop:
LDR tmp1, [pMixBuffer]
ADD gainLeft, gainLeft, gainIncLeft
SMLAWB tmp1, gainLeft, tmp0, tmp1
LDR tmp2, [pMixBuffer, #4]
ADD gainRight, gainRight, gainIncRight
STR tmp1, [pMixBuffer], #4
SMLAWB tmp2, gainRight, tmp0, tmp2
SUBS numSamples, numSamples, #1
LDRGTSH tmp0, [pInputBuffer], #2
STR tmp2, [pMixBuffer], #4
BGT StereoGainLoop
@----------------------------------------------------------------
@ Mono version
@----------------------------------------------------------------
.else
LDR gain, [pWTFrame, #m_prevGain]
MOV gain, gain, LSL #(NUM_MIXER_GUARD_BITS + 4)
LDR gainIncrement, [pWTFrame, #m_gainTarget]
MOV gainIncrement, gainIncrement, LSL #(NUM_MIXER_GUARD_BITS + 4)
SUB gainIncrement, gainIncrement, gain
MOV gainIncrement, gainIncrement, ASR #SYNTH_UPDATE_PERIOD_IN_BITS
MonoGainLoop:
LDRSH tmp0, [pInputBuffer], #NEXT_OUTPUT_PCM @ fetch voice output
LDR tmp1, [pMixBuffer] @ get left channel output sample
ADD gain, gain, gainIncrement @ gain step to eliminate zipper noise
SMULWB tmp0, gain, tmp0 @ sample * local gain
MOV tmp0, tmp0, ASR #1 @ add 6dB headroom
ADD tmp1, tmp0, tmp1
STR tmp1, [pMixBuffer], #4 @ save and bump pointer
SUBS numSamples, numSamples, #1
BGT MonoGainLoop
.endif @end Mono version
LDMFD sp!,{r4-r11,lr}
BX lr
.endfunc
.end

View File

@@ -0,0 +1,153 @@
@***********************************************************
@ File: ARM_synth_constants.inc
@ Processor: ARM
@ Description: Contains constants and defines, most of which
@ are mirrored in synth.h
@
@ Copyright Sonic Network Inc. 2004
@****************************************************************
@ Revision Control:
@ $Revision: 741 $
@ $Date: 2007-06-22 16:39:21 -0700 (Fri, 22 Jun 2007) $
@****************************************************************
.ifdef SAMPLE_RATE_8000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 5
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 32
.endif
.ifdef SAMPLE_RATE_16000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 6
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 64
.endif
.ifdef SAMPLE_RATE_20000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
.endif
.ifdef SAMPLE_RATE_22050
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
.endif
.ifdef SAMPLE_RATE_24000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
.endif
.ifdef SAMPLE_RATE_32000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 7
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 128
.endif
.ifdef SAMPLE_RATE_44100
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 8
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 256
.endif
.ifdef SAMPLE_RATE_48000
.equ SYNTH_UPDATE_PERIOD_IN_BITS, 8
.equ BUFFER_SIZE_IN_MONO_SAMPLES, 256
.endif
@ if the OUTPUT PCM sample is 16-bits, then when using indexed addressing,
@ the next sample is this many bytes away
.equ NEXT_OUTPUT_PCM, 2
@****************************************************************************
@/* macros for fractional phase accumulator */
.equ NUM_PHASE_FRAC_BITS, 15
.equ PHASE_FRAC_MASK, 0x7FFF
@ shift for phase accumulator when fraction carries over
.ifdef SAMPLES_8_BIT
.equ NEXT_INPUT_PCM_SHIFT, 0
.endif
.ifdef SAMPLES_16_BIT
.equ NEXT_INPUT_PCM_SHIFT, 1
.endif
@****************************************************************************
.equ NUM_MIXER_GUARD_BITS, 4
@****************************************************************************
@/* Envelope 1 (EG1) calculation macros */
.equ NUM_EG1_FRAC_BITS, 15
@****************************************************************************
.equ NUM_ENHANCER_FILTER_COEF_FRAC_BITS, 5
@****************************************************************************
@
@ I've temporarily given up on the idea of getting ADS/RV and gcc to
@ handle a struct in a compatible fashion. Switching to old fashion EQU
@
.if FILTER_ENABLED
@**************************************
@ typedef struct s_filter_tag
.equ m_z1, 0
.equ m_z2, 2
.endif
@**************************************
@ typedef struct s_wt_frame_tag
.equ m_gainTarget, 0
.equ m_phaseIncrement, 4
.if FILTER_ENABLED
.equ m_k, 8
.equ m_b1, 12
.equ m_b2, 16
.equ m_pAudioBuffer, 20
.equ m_pMixBuffer, 24
.equ m_numSamples, 28
.equ m_prevGain, 32
.else
.equ m_pAudioBuffer, 8
.equ m_pMixBuffer, 12
.equ m_numSamples, 16
.equ m_prevGain, 20
.endif
@**************************************
@ typedef struct s_wt_voice_tag
.equ m_pLoopEnd, 0 @ /* points to last PCM sample (not 1 beyond last) */
.equ m_pLoopStart, 4 @ /* points to first sample at start of loop */
.equ m_pPhaseAccum, 8 @ /* points to first sample at start of loop */
.equ m_phaseFrac, 12 @ /* points to first sample at start of loop */
.if STEREO_OUTPUT
.equ m_gainLeft, 16 @ /* current gain, left ch */
.equ m_gainRight, 18 @ /* current gain, right ch */
.endif
@****************************************************************************
@ enhancer
.equ m_nEnhancerFeedForward1, 0
.equ m_nEnhancerFeedback1, 1
.equ m_nDriveCoef, 2
.equ m_nEnhancerFeedback2, 3
.equ m_nWet, 4
.equ m_nDry, 5
.equ m_zF0L, 6 @ filter 1 zero state var, left
.equ m_zF1L, 8 @ filter 1 pole state var, left
.equ m_zF2L, 10 @ filter 2 zero state var, left
.equ m_zF0R, 12 @ filter 1 zero state var, right
.equ m_zF1R, 14 @ filter 1 pole state var, right
.equ m_zF2R, 16 @ filter 2 zero state var, right
@****************************************************************************

View File

@@ -0,0 +1,25 @@
#
# Auto-generated sample makefile
#
# This makefile is intended for use with GNU make.
# Set the paths to the tools (CC, AR, LD, etc.)
#
vpath %.c lib_src
CC = C:\Program Files\GNUARM\bin\arm-elf-gcc.exe
AS = C:\Program Files\GNUARM\bin\arm-elf-as.exe
LD = C:\Program Files\GNUARM\bin\arm-elf-gcc.exe
AR = C:\Program Files\GNUARM\bin\arm-elf-ar.exe
%.o: %.c
$(CC) -c -O2 -o $@ -I lib_src -I host_src -D NUM_OUTPUT_CHANNELS=2 -D _SAMPLE_RATE_22050 -D MAX_SYNTH_VOICES=64 -D EAS_WT_SYNTH -D _8_BIT_SAMPLES -D _FILTER_ENABLED -D _IMELODY_PARSER -D _RTTTL_PARSER -D _OTA_PARSER -D _XMF_PARSER -D _WAVE_PARSER -D _REVERB_ENABLED -D _CHORUS_ENABLED -D DLS_SYNTHESIZER -D _IMA_DECODER -D MMAPI_SUPPORT -D NATIVE_EAS_KERNEL -D JET_INTERFACE $<
%.o: %.s
$(AS) -o $@ -EL -mcpu=arm946e-s -mfpu=softfpa -I lib_src --defsym CHECK_STACK=0 --defsym REVERB=0 --defsym CHORUS=0 --defsym STEREO_OUTPUT=1 --defsym SAMPLE_RATE_22050=1 --defsym SAMPLES_8_BIT=1 --defsym FILTER_ENABLED=1 $<
OBJS = eas_mididata.o eas_pan.o eas_wavefiledata.o eas_imelody.o eas_xmfdata.o ARM-E_interpolate_noloop_gnu.o eas_chorusdata.o ARM-E_voice_gain_gnu.o eas_ota.o eas_reverbdata.o eas_rtttl.o eas_reverb.o jet.o eas_mdls.o eas_mixbuf.o eas_smf.o eas_tcdata.o eas_chorus.o eas_pcmdata.o eas_xmf.o eas_smfdata.o eas_math.o eas_tonecontrol.o eas_rtttldata.o eas_voicemgt.o eas_public.o eas_dlssynth.o ARM-E_interpolate_loop_gnu.o ARM-E_filter_gnu.o eas_midi.o eas_otadata.o eas_flog.o eas_wtengine.o eas_imaadpcm.o eas_wtsynth.o wt_22khz.o eas_pcm.o eas_mixer.o eas_wavefile.o eas_ima_tables.o eas_data.o ARM-E_mastergain_gnu.o eas_imelodydata.o
arm-wt-22k.a: $(OBJS)
$(AR) rc lib$@ $(OBJS)

View File

@@ -0,0 +1,268 @@
/*
dls.h
Description:
Interface defines and structures for the Instrument Collection Form
RIFF DLS.
Written by Sonic Foundry 1996. Released for public use.
*/
#ifndef _INC_DLS
#define _INC_DLS
/*
Layout of an instrument collection:
RIFF [] 'DLS ' [colh,INSTLIST,WAVEPOOL,INFOLIST]
INSTLIST
LIST [] 'lins'
LIST [] 'ins ' [insh,RGNLIST,ARTLIST,INFOLIST]
LIST [] 'ins ' [insh,RGNLIST,ARTLIST,INFOLIST]
LIST [] 'ins ' [insh,RGNLIST,ARTLIST,INFOLIST]
RGNLIST
LIST [] 'lrgn'
LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
ARTLIST
LIST [] 'lart'
'art1' level 1 Articulation connection graph
'art2' level 2 Articulation connection graph
'3rd1' Possible 3rd party articulation structure 1
'3rd2' Possible 3rd party articulation structure 2 .... and so on
WAVEPOOL
ptbl [] [pool table]
LIST [] 'wvpl'
[path],
[path],
LIST [] 'wave',RIFFWAVE
LIST [] 'wave',RIFFWAVE
LIST [] 'wave',RIFFWAVE
LIST [] 'wave',RIFFWAVE
LIST [] 'wave',RIFFWAVE
INFOLIST
LIST [] 'INFO'
'icmt' 'One of those crazy comments.'
'icop' 'Copyright (C) 1996 Sonic Foundry'
*/
/*
FOURCC's used in the DLS file
*/
/* shree */
//#define FAR
/* shree
#define FOURCC_DLS mmioFOURCC('D','L','S',' ')
#define FOURCC_COLH mmioFOURCC('c','o','l','h')
#define FOURCC_WVPL mmioFOURCC('w','v','p','l')
#define FOURCC_PTBL mmioFOURCC('p','t','b','l')
#define FOURCC_PATH mmioFOURCC('p','a','t','h')
#define FOURCC_wave mmioFOURCC('w','a','v','e')
#define FOURCC_LINS mmioFOURCC('l','i','n','s')
#define FOURCC_INS mmioFOURCC('i','n','s',' ')
#define FOURCC_INSH mmioFOURCC('i','n','s','h')
#define FOURCC_LRGN mmioFOURCC('l','r','g','n')
#define FOURCC_RGN mmioFOURCC('r','g','n',' ')
#define FOURCC_RGNH mmioFOURCC('r','g','n','h')
#define FOURCC_LART mmioFOURCC('l','a','r','t')
#define FOURCC_ART1 mmioFOURCC('a','r','t','1')
#define FOURCC_WLNK mmioFOURCC('w','l','n','k')
#define FOURCC_WSMP mmioFOURCC('w','s','m','p')
#define FOURCC_VERS mmioFOURCC('v','e','r','s')
*/
/*
Articulation connection graph definitions
*/
/* Generic Sources */
#define CONN_SRC_NONE 0x0000
#define CONN_SRC_LFO 0x0001
#define CONN_SRC_KEYONVELOCITY 0x0002
#define CONN_SRC_KEYNUMBER 0x0003
#define CONN_SRC_EG1 0x0004
#define CONN_SRC_EG2 0x0005
#define CONN_SRC_PITCHWHEEL 0x0006
/* Midi Controllers 0-127 */
#define CONN_SRC_CC1 0x0081
#define CONN_SRC_CC7 0x0087
#define CONN_SRC_CC10 0x008a
#define CONN_SRC_CC11 0x008b
/* Registered Parameter Numbers */
#define CONN_SRC_RPN0 0x0100
#define CONN_SRC_RPN1 0x0101
#define CONN_SRC_RPN2 0x0102
/* Generic Destinations */
#define CONN_DST_NONE 0x0000
#define CONN_DST_ATTENUATION 0x0001
#define CONN_DST_RESERVED 0x0002
#define CONN_DST_PITCH 0x0003
#define CONN_DST_PAN 0x0004
/* LFO Destinations */
#define CONN_DST_LFO_FREQUENCY 0x0104
#define CONN_DST_LFO_STARTDELAY 0x0105
/* EG1 Destinations */
#define CONN_DST_EG1_ATTACKTIME 0x0206
#define CONN_DST_EG1_DECAYTIME 0x0207
#define CONN_DST_EG1_RESERVED 0x0208
#define CONN_DST_EG1_RELEASETIME 0x0209
#define CONN_DST_EG1_SUSTAINLEVEL 0x020a
/* EG2 Destinations */
#define CONN_DST_EG2_ATTACKTIME 0x030a
#define CONN_DST_EG2_DECAYTIME 0x030b
#define CONN_DST_EG2_RESERVED 0x030c
#define CONN_DST_EG2_RELEASETIME 0x030d
#define CONN_DST_EG2_SUSTAINLEVEL 0x030e
#define CONN_TRN_NONE 0x0000
#define CONN_TRN_CONCAVE 0x0001
typedef struct _DLSVERSION {
DWORD dwVersionMS;
DWORD dwVersionLS;
}DLSVERSION, FAR *LPDLSVERSION;
typedef struct _CONNECTION {
USHORT usSource;
USHORT usControl;
USHORT usDestination;
USHORT usTransform;
LONG lScale;
}CONNECTION, FAR *LPCONNECTION;
/* Level 1 Articulation Data */
typedef struct _CONNECTIONLIST {
ULONG cbSize; /* size of the connection list structure */
ULONG cConnections; /* count of connections in the list */
} CONNECTIONLIST, FAR *LPCONNECTIONLIST;
/*
Generic type defines for regions and instruments
*/
typedef struct _RGNRANGE {
USHORT usLow;
USHORT usHigh;
}RGNRANGE, FAR * LPRGNRANGE;
#define F_INSTRUMENT_DRUMS 0x80000000
typedef struct _MIDILOCALE {
ULONG ulBank;
ULONG ulInstrument;
}MIDILOCALE, FAR *LPMIDILOCALE;
/*
Header structures found in an DLS file for collection, instruments, and
regions.
*/
#define F_RGN_OPTION_SELFNONEXCLUSIVE 0x0001
typedef struct _RGNHEADER {
RGNRANGE RangeKey; /* Key range */
RGNRANGE RangeVelocity; /* Velocity Range */
USHORT fusOptions; /* Synthesis options for this range */
USHORT usKeyGroup; /* Key grouping for non simultaneous play
0 = no group, 1 up is group
for Level 1 only groups 1-15 are allowed */
}RGNHEADER, FAR *LPRGNHEADER;
typedef struct _INSTHEADER {
ULONG cRegions; /* Count of regions in this instrument */
MIDILOCALE Locale; /* Intended MIDI locale of this instrument */
}INSTHEADER, FAR *LPINSTHEADER;
typedef struct _DLSHEADER {
ULONG cInstruments; /* Count of instruments in the collection */
}DLSHEADER, FAR *LPDLSHEADER;
/*
definitions for the Wave link structure
*/
/***** For level 1 only WAVELINK_CHANNEL_MONO is valid ****
ulChannel allows for up to 32 channels of audio with each bit position
specifiying a channel of playback */
#define WAVELINK_CHANNEL_LEFT 0x0001
#define WAVELINK_CHANNEL_RIGHT 0x0002
#define F_WAVELINK_PHASE_MASTER 0x0001
typedef struct _WAVELINK { /* any paths or links are stored right after struct */
USHORT fusOptions; /* options flags for this wave */
USHORT usPhaseGroup; /* Phase grouping for locking channels */
ULONG ulChannel; /* channel placement */
ULONG ulTableIndex; /* index into the wave pool table, 0 based */
}WAVELINK, FAR *LPWAVELINK;
#define POOL_CUE_NULL 0xffffffff
typedef struct _POOLCUE {
// ULONG ulEntryIndex; /* Index entry in the list */
ULONG ulOffset; /* Offset to the entry in the list */
}POOLCUE, FAR *LPPOOLCUE;
typedef struct _POOLTABLE {
ULONG cbSize; /* size of the pool table structure */
ULONG cCues; /* count of cues in the list */
} POOLTABLE, FAR *LPPOOLTABLE;
/*
Structures for the "wsmp" chunk
*/
#define F_WSMP_NO_TRUNCATION 0x0001
#define F_WSMP_NO_COMPRESSION 0x0002
typedef struct _rwsmp {
ULONG cbSize;
USHORT usUnityNote; /* MIDI Unity Playback Note */
SHORT sFineTune; /* Fine Tune in log tuning */
LONG lAttenuation; /* Overall Attenuation to be applied to data */
ULONG fulOptions; /* Flag options */
ULONG cSampleLoops; /* Count of Sample loops, 0 loops is one shot */
} WSMPL, FAR *LPWSMPL;
/* This loop type is a normal forward playing loop which is continually
played until the envelope reaches an off threshold in the release
portion of the volume envelope */
#define WLOOP_TYPE_FORWARD 0
typedef struct _rloop {
ULONG cbSize;
ULONG ulType; /* Loop Type */
ULONG ulStart; /* Start of loop in samples */
ULONG ulLength; /* Length of loop in samples */
} WLOOP, FAR *LPWLOOP;
#endif /* _INC_DLS */

View File

@@ -0,0 +1,122 @@
/*
dls2.h
Description:
Interface defines and structures for the DLS2 extensions of DLS.
Written by Microsoft 1998. Released for public use.
*/
#ifndef _INC_DLS2
#define _INC_DLS2
/*
FOURCC's used in the DLS2 file, in addition to DLS1 chunks
*/
#define FOURCC_RGN2 mmioFOURCC('r','g','n','2')
#define FOURCC_LAR2 mmioFOURCC('l','a','r','2')
#define FOURCC_ART2 mmioFOURCC('a','r','t','2')
#define FOURCC_CDL mmioFOURCC('c','d','l',' ')
#define FOURCC_DLID mmioFOURCC('d','l','i','d')
/*
Articulation connection graph definitions. These are in addition to
the definitions in the DLS1 header.
*/
/* Generic Sources (in addition to DLS1 sources. */
#define CONN_SRC_POLYPRESSURE 0x0007 /* Polyphonic Pressure */
#define CONN_SRC_CHANNELPRESSURE 0x0008 /* Channel Pressure */
#define CONN_SRC_VIBRATO 0x0009 /* Vibrato LFO */
#define CONN_SRC_MONOPRESSURE 0x000a /* MIDI Mono pressure */
/* Midi Controllers */
#define CONN_SRC_CC91 0x00db /* Reverb Send */
#define CONN_SRC_CC93 0x00dd /* Chorus Send */
/* Generic Destinations */
#define CONN_DST_GAIN 0x0001 /* Same as CONN_DST_ ATTENUATION, but more appropriate terminology. */
#define CONN_DST_KEYNUMBER 0x0005 /* Key Number Generator */
/* Audio Channel Output Destinations */
#define CONN_DST_LEFT 0x0010 /* Left Channel Send */
#define CONN_DST_RIGHT 0x0011 /* Right Channel Send */
#define CONN_DST_CENTER 0x0012 /* Center Channel Send */
#define CONN_DST_LEFTREAR 0x0013 /* Left Rear Channel Send */
#define CONN_DST_RIGHTREAR 0x0014 /* Right Rear Channel Send */
#define CONN_DST_LFE_CHANNEL 0x0015 /* LFE Channel Send */
#define CONN_DST_CHORUS 0x0080 /* Chorus Send */
#define CONN_DST_REVERB 0x0081 /* Reverb Send */
/* Vibrato LFO Destinations */
#define CONN_DST_VIB_FREQUENCY 0x0114 /* Vibrato Frequency */
#define CONN_DST_VIB_STARTDELAY 0x0115 /* Vibrato Start Delay */
/* EG1 Destinations */
#define CONN_DST_EG1_DELAYTIME 0x020B /* EG1 Delay Time */
#define CONN_DST_EG1_HOLDTIME 0x020C /* EG1 Hold Time */
#define CONN_DST_EG1_SHUTDOWNTIME 0x020D /* EG1 Shutdown Time */
/* EG2 Destinations */
#define CONN_DST_EG2_DELAYTIME 0x030F /* EG2 Delay Time */
#define CONN_DST_EG2_HOLDTIME 0x0310 /* EG2 Hold Time */
/* Filter Destinations */
#define CONN_DST_FILTER_CUTOFF 0x0500 /* Filter Cutoff Frequency */
#define CONN_DST_FILTER_Q 0x0501 /* Filter Resonance */
/* Transforms */
#define CONN_TRN_CONVEX 0x0002 /* Convex Transform */
#define CONN_TRN_SWITCH 0x0003 /* Switch Transform */
/* Conditional chunk operators */
#define DLS_CDL_AND 0x0001 /* X = X & Y */
#define DLS_CDL_OR 0x0002 /* X = X | Y */
#define DLS_CDL_XOR 0x0003 /* X = X ^ Y */
#define DLS_CDL_ADD 0x0004 /* X = X + Y */
#define DLS_CDL_SUBTRACT 0x0005 /* X = X - Y */
#define DLS_CDL_MULTIPLY 0x0006 /* X = X * Y */
#define DLS_CDL_DIVIDE 0x0007 /* X = X / Y */
#define DLS_CDL_LOGICAL_AND 0x0008 /* X = X && Y */
#define DLS_CDL_LOGICAL_OR 0x0009 /* X = X || Y */
#define DLS_CDL_LT 0x000A /* X = (X < Y) */
#define DLS_CDL_LE 0x000B /* X = (X <= Y) */
#define DLS_CDL_GT 0x000C /* X = (X > Y) */
#define DLS_CDL_GE 0x000D /* X = (X >= Y) */
#define DLS_CDL_EQ 0x000E /* X = (X == Y) */
#define DLS_CDL_NOT 0x000F /* X = !X */
#define DLS_CDL_CONST 0x0010 /* 32-bit constant */
#define DLS_CDL_QUERY 0x0011 /* 32-bit value returned from query */
#define DLS_CDL_QUERYSUPPORTED 0x0012 /* 32-bit value returned from query */
/*
Loop and release
*/
#define WLOOP_TYPE_RELEASE 1
/*
DLSID queries for <cdl-ck>
*/
DEFINE_DLSID(DLSID_GMInHardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_DLSID(DLSID_GSInHardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_DLSID(DLSID_XGInHardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_DLSID(DLSID_SupportsDLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_DLSID(DLSID_SupportsDLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
DEFINE_DLSID(DLSID_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
DEFINE_DLSID(DLSID_ManufacturersID, 0xb03e1181, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_DLSID(DLSID_ProductID, 0xb03e1182, 0x8095, 0x11d2, 0xa1, 0xef, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
DEFINE_DLSID(DLSID_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
#endif /* _INC_DLS2 */

View File

@@ -0,0 +1,97 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_audioconst.h
*
* Contents and purpose:
* Defines audio constants related to the sample rate, bit size, etc.
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_AUDIOCONST_H
#define _EAS_AUDIOCONST_H
/*----------------------------------------------------------------------------
* These macros define the various characteristics of the defined sample rates
*----------------------------------------------------------------------------
* BUFFER_SIZE_IN_MONO_SAMPLES size of buffer in samples
* _OUTPUT_SAMPLE_RATE compiled output sample rate
* AUDIO_FRAME_LENGTH length of an audio frame in 256ths of a millisecond
* SYNTH_UPDATE_PERIOD_IN_BITS length of an audio frame (2^x samples)
*----------------------------------------------------------------------------
*/
#if defined (_SAMPLE_RATE_8000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 32
#define _OUTPUT_SAMPLE_RATE 8000
#define AUDIO_FRAME_LENGTH 1024
#define SYNTH_UPDATE_PERIOD_IN_BITS 5
#elif defined (_SAMPLE_RATE_16000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 64
#define _OUTPUT_SAMPLE_RATE 16000
#define AUDIO_FRAME_LENGTH 1024
#define SYNTH_UPDATE_PERIOD_IN_BITS 6
#elif defined (_SAMPLE_RATE_20000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 128
#define _OUTPUT_SAMPLE_RATE 20000
#define AUDIO_FRAME_LENGTH 1638
#define SYNTH_UPDATE_PERIOD_IN_BITS 7
#elif defined (_SAMPLE_RATE_22050)
#define BUFFER_SIZE_IN_MONO_SAMPLES 128
#define _OUTPUT_SAMPLE_RATE 22050
#define AUDIO_FRAME_LENGTH 1486
#define SYNTH_UPDATE_PERIOD_IN_BITS 7
#elif defined (_SAMPLE_RATE_24000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 128
#define _OUTPUT_SAMPLE_RATE 24000
#define AUDIO_FRAME_LENGTH 1365
#define SYNTH_UPDATE_PERIOD_IN_BITS 7
#elif defined (_SAMPLE_RATE_32000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 128
#define _OUTPUT_SAMPLE_RATE 32000
#define AUDIO_FRAME_LENGTH 1024
#define SYNTH_UPDATE_PERIOD_IN_BITS 7
#elif defined (_SAMPLE_RATE_44100)
#define BUFFER_SIZE_IN_MONO_SAMPLES 256
#define _OUTPUT_SAMPLE_RATE 44100
#define AUDIO_FRAME_LENGTH 1486
#define SYNTH_UPDATE_PERIOD_IN_BITS 8
#elif defined (_SAMPLE_RATE_48000)
#define BUFFER_SIZE_IN_MONO_SAMPLES 256
#define _OUTPUT_SAMPLE_RATE 48000
#define AUDIO_FRAME_LENGTH 1365
#define SYNTH_UPDATE_PERIOD_IN_BITS 8
#else
#error "_SAMPLE_RATE_XXXXX must be defined to valid rate"
#endif
#endif /* #ifndef _EAS_AUDIOCONST_H */

View File

@@ -0,0 +1,604 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_chorus.c
*
* Contents and purpose:
* Contains the implementation of the Chorus effect.
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 499 $
* $Date: 2006-12-11 16:07:20 -0800 (Mon, 11 Dec 2006) $
*----------------------------------------------------------------------------
*/
#include "eas_data.h"
#include "eas_effects.h"
#include "eas_math.h"
#include "eas_chorusdata.h"
#include "eas_chorus.h"
#include "eas_config.h"
#include "eas_host.h"
#include "eas_report.h"
/* prototypes for effects interface */
static EAS_RESULT ChorusInit (EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData);
static void ChorusProcess (EAS_VOID_PTR pInstData, EAS_PCM *pSrc, EAS_PCM *pDst, EAS_I32 numSamples);
static EAS_RESULT ChorusShutdown (EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData);
static EAS_RESULT ChorusGetParam (EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
static EAS_RESULT ChorusSetParam (EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
/* common effects interface for configuration module */
const S_EFFECTS_INTERFACE EAS_Chorus =
{
ChorusInit,
ChorusProcess,
ChorusShutdown,
ChorusGetParam,
ChorusSetParam
};
//LFO shape table used by the chorus, larger table would sound better
//this is a sine wave, where 32767 = 1.0
static const EAS_I16 EAS_chorusShape[CHORUS_SHAPE_SIZE] = {
0, 1608, 3212, 4808, 6393, 7962, 9512, 11309, 12539, 14010, 15446, 16846, 18204, 19519, 20787, 22005, 23170,
24279, 25329, 26319, 27245, 28105, 28898, 29621, 30273, 30852, 31356, 31785, 32137, 32412, 32609, 32728,
32767, 32728, 32609, 32412, 32137, 31785, 31356, 30852, 30273, 29621, 28898, 28105, 27245, 26319, 25329,
24279, 23170, 22005, 20787, 19519, 18204, 16846, 15446, 14010, 12539, 11039, 9512, 7962, 6393, 4808, 3212,
1608, 0, -1608, -3212, -4808, -6393, -7962, -9512, -11309, -12539, -14010, -15446, -16846, -18204, -19519,
-20787, -22005, -23170, -24279, -25329, -26319, -27245, -28105, -28898, -29621, -30273, -30852, -31356, -31785,
-32137, -32412, -32609, -32728, -32767, -32728, -32609, -32412, -32137, -31785, -31356, -30852, -30273, -29621,
-28898, -28105, -27245, -26319, -25329, -24279, -23170, -22005, -20787, -19519, -18204, -16846, -15446, -14010,
-12539, -11039, -9512, -7962, -6393, -4808, -3212, -1608
};
/*----------------------------------------------------------------------------
* InitializeChorus()
*----------------------------------------------------------------------------
* Purpose: Initializes chorus parameters
*
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ChorusInit (EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData)
{
S_CHORUS_OBJECT *pChorusData;
S_CHORUS_PRESET *pPreset;
EAS_I32 index;
/* check Configuration Module for data allocation */
if (pEASData->staticMemoryModel)
pChorusData = EAS_CMEnumFXData(EAS_MODULE_CHORUS);
/* allocate dynamic memory */
else
pChorusData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_CHORUS_OBJECT));
if (pChorusData == NULL)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Failed to allocate Chorus memory\n"); */ }
return EAS_ERROR_MALLOC_FAILED;
}
/* clear the structure */
EAS_HWMemSet(pChorusData, 0, sizeof(S_CHORUS_OBJECT));
ChorusReadInPresets(pChorusData);
/* set some default values */
pChorusData->bypass = EAS_CHORUS_BYPASS_DEFAULT;
pChorusData->preset = EAS_CHORUS_PRESET_DEFAULT;
pChorusData->m_nLevel = EAS_CHORUS_LEVEL_DEFAULT;
pChorusData->m_nRate = EAS_CHORUS_RATE_DEFAULT;
pChorusData->m_nDepth = EAS_CHORUS_DEPTH_DEFAULT;
//chorus rate and depth need some massaging from preset value (which is sample rate independent)
//convert rate from steps of .05 Hz to value which can be used as phase increment,
//with current CHORUS_SHAPE_SIZE and rate limits, this fits into 16 bits
//want to compute ((shapeSize * 65536) * (storedRate/20))/sampleRate;
//computing it as below allows rate steps to be evenly spaced
//uses 32 bit divide, but only once when new value is selected
pChorusData->m_nRate = (EAS_I16)
((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
//convert depth from steps of .05 ms, to samples, with 16 bit whole part, discard fraction
//want to compute ((depth * sampleRate)/20000)
//use the following approximation since 105/32 is roughly 65536/20000
/*lint -e{704} use shift for performance */
pChorusData->m_nDepth = (EAS_I16)
(((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
pChorusData->m_nLevel = pChorusData->m_nLevel;
//zero delay memory for chorus
for (index = CHORUS_L_SIZE - 1; index >= 0; index--)
{
pChorusData->chorusDelayL[index] = 0;
}
for (index = CHORUS_R_SIZE - 1; index >= 0; index--)
{
pChorusData->chorusDelayR[index] = 0;
}
//init delay line index, these are used to implement circular delay buffer
pChorusData->chorusIndexL = 0;
pChorusData->chorusIndexR = 0;
//init LFO phase
//16 bit whole part, 16 bit fraction
pChorusData->lfoLPhase = 0;
pChorusData->lfoRPhase = (CHORUS_SHAPE_SIZE << 16) >> 2; // 1/4 of total, i.e. 90 degrees out of phase;
//init chorus delay position
//right now chorus delay is a compile-time value, as is sample rate
pChorusData->chorusTapPosition = (EAS_I16)((CHORUS_DELAY_MS * _OUTPUT_SAMPLE_RATE)/1000);
//now copy from the new preset into Chorus
pPreset = &pChorusData->m_sPreset.m_sPreset[pChorusData->m_nNextChorus];
pChorusData->m_nLevel = pPreset->m_nLevel;
pChorusData->m_nRate = pPreset->m_nRate;
pChorusData->m_nDepth = pPreset->m_nDepth;
pChorusData->m_nRate = (EAS_I16)
((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
/*lint -e{704} use shift for performance */
pChorusData->m_nDepth = (EAS_I16)
(((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
*pInstData = pChorusData;
return EAS_SUCCESS;
} /* end ChorusInit */
/*----------------------------------------------------------------------------
* WeightedTap()
*----------------------------------------------------------------------------
* Purpose: Does fractional array look-up using linear interpolation
*
* first convert indexDesired to actual desired index by taking into account indexReference
* then do linear interpolation between two actual samples using fractional part
*
* Inputs:
* array: pointer to array of signed 16 bit values, typically either PCM data or control data
* indexReference: the circular buffer relative offset
* indexDesired: the fractional index we are looking up (16 bits index + 16 bits fraction)
* indexLimit: the total size of the array, used to compute buffer wrap
*
* Outputs:
* Value from the input array, linearly interpolated between two actual data values
*
*----------------------------------------------------------------------------
*/
EAS_I16 WeightedTap(const EAS_I16 *array, EAS_I16 indexReference, EAS_I32 indexDesired, EAS_I16 indexLimit)
{
EAS_I16 index;
EAS_I16 fraction;
EAS_I16 val1;
EAS_I16 val2;
//separate indexDesired into whole and fractional parts
/*lint -e{704} use shift for performance */
index = (EAS_I16)(indexDesired >> 16);
/*lint -e{704} use shift for performance */
fraction = (EAS_I16)((indexDesired>>1) & 0x07FFF); //just use 15 bits of fractional part
//adjust whole part by indexReference
index = indexReference - index;
//make sure we stay within array bounds, this implements circular buffer
while (index < 0)
{
index += indexLimit;
}
//get two adjacent values from the array
val1 = array[index];
//handle special case when index == 0, else typical case
if (index == 0)
{
val2 = array[indexLimit-1]; //get last value from array
}
else
{
val2 = array[index-1]; //get previous value from array
}
//compute linear interpolation as (val1 + ((val2-val1)*fraction))
return(val1 + (EAS_I16)MULT_EG1_EG1(val2-val1,fraction));
}
/*----------------------------------------------------------------------------
* ChorusProcess()
*----------------------------------------------------------------------------
* Purpose: compute the chorus on the input buffer, and mix into output buffer
*
*
* Inputs:
* src: pointer to input buffer of PCM values to be processed
* dst: pointer to output buffer of PCM values we are to sume the result with
* bufSize: the number of sample frames (i.e. stereo samples) in the buffer
*
* Outputs:
* None
*
*----------------------------------------------------------------------------
*/
//compute the chorus, and mix into output buffer
static void ChorusProcess (EAS_VOID_PTR pInstData, EAS_PCM *pSrc, EAS_PCM *pDst, EAS_I32 numSamples)
{
EAS_I32 ix;
EAS_I32 nChannelNumber;
EAS_I16 lfoValueLeft;
EAS_I16 lfoValueRight;
EAS_I32 positionOffsetL;
EAS_I32 positionOffsetR;
EAS_PCM tapL;
EAS_PCM tapR;
EAS_I32 tempValue;
EAS_PCM nInputSample;
EAS_I32 nOutputSample;
EAS_PCM *pIn;
EAS_PCM *pOut;
S_CHORUS_OBJECT *pChorusData;
pChorusData = (S_CHORUS_OBJECT*) pInstData;
//if the chorus is disabled or turned all the way down
if (pChorusData->bypass == EAS_TRUE || pChorusData->m_nLevel == 0)
{
if (pSrc != pDst)
EAS_HWMemCpy(pSrc, pDst, numSamples * NUM_OUTPUT_CHANNELS * (EAS_I32) sizeof(EAS_PCM));
return;
}
if (pChorusData->m_nNextChorus != pChorusData->m_nCurrentChorus)
{
ChorusUpdate(pChorusData);
}
for (nChannelNumber = 0; nChannelNumber < NUM_OUTPUT_CHANNELS; nChannelNumber++)
{
pIn = pSrc + nChannelNumber;
pOut = pDst + nChannelNumber;
if(nChannelNumber==0)
{
for (ix = 0; ix < numSamples; ix++)
{
nInputSample = *pIn;
pIn += NUM_OUTPUT_CHANNELS;
//feed input into chorus delay line
pChorusData->chorusDelayL[pChorusData->chorusIndexL] = nInputSample;
//compute chorus lfo value using phase as fractional index into chorus shape table
//resulting value is between -1.0 and 1.0, expressed as signed 16 bit number
lfoValueLeft = WeightedTap(EAS_chorusShape, 0, pChorusData->lfoLPhase, CHORUS_SHAPE_SIZE);
//scale chorus depth by lfo value to get relative fractional sample index
//index is expressed as 32 bit number with 16 bit fractional part
/*lint -e{703} use shift for performance */
positionOffsetL = pChorusData->m_nDepth * (((EAS_I32)lfoValueLeft) << 1);
//add fixed chorus delay to get actual fractional sample index
positionOffsetL += ((EAS_I32)pChorusData->chorusTapPosition) << 16;
//get tap value from chorus delay using fractional sample index
tapL = WeightedTap(pChorusData->chorusDelayL, pChorusData->chorusIndexL, positionOffsetL, CHORUS_L_SIZE);
//scale by chorus level, then sum with input buffer contents and saturate
tempValue = MULT_EG1_EG1(tapL, pChorusData->m_nLevel);
nOutputSample = SATURATE(tempValue + nInputSample);
*pOut = (EAS_I16)SATURATE(nOutputSample);
pOut += NUM_OUTPUT_CHANNELS;
//increment chorus delay index and make it wrap as needed
//this implements circular buffer
if ((pChorusData->chorusIndexL+=1) >= CHORUS_L_SIZE)
pChorusData->chorusIndexL = 0;
//increment fractional lfo phase, and make it wrap as needed
pChorusData->lfoLPhase += pChorusData->m_nRate;
while (pChorusData->lfoLPhase >= (CHORUS_SHAPE_SIZE<<16))
{
pChorusData->lfoLPhase -= (CHORUS_SHAPE_SIZE<<16);
}
}
}
else
{
for (ix = 0; ix < numSamples; ix++)
{
nInputSample = *pIn;
pIn += NUM_OUTPUT_CHANNELS;
//feed input into chorus delay line
pChorusData->chorusDelayR[pChorusData->chorusIndexR] = nInputSample;
//compute chorus lfo value using phase as fractional index into chorus shape table
//resulting value is between -1.0 and 1.0, expressed as signed 16 bit number
lfoValueRight = WeightedTap(EAS_chorusShape, 0, pChorusData->lfoRPhase, CHORUS_SHAPE_SIZE);
//scale chorus depth by lfo value to get relative fractional sample index
//index is expressed as 32 bit number with 16 bit fractional part
/*lint -e{703} use shift for performance */
positionOffsetR = pChorusData->m_nDepth * (((EAS_I32)lfoValueRight) << 1);
//add fixed chorus delay to get actual fractional sample index
positionOffsetR += ((EAS_I32)pChorusData->chorusTapPosition) << 16;
//get tap value from chorus delay using fractional sample index
tapR = WeightedTap(pChorusData->chorusDelayR, pChorusData->chorusIndexR, positionOffsetR, CHORUS_R_SIZE);
//scale by chorus level, then sum with output buffer contents and saturate
tempValue = MULT_EG1_EG1(tapR, pChorusData->m_nLevel);
nOutputSample = SATURATE(tempValue + nInputSample);
*pOut = (EAS_I16)SATURATE(nOutputSample);
pOut += NUM_OUTPUT_CHANNELS;
//increment chorus delay index and make it wrap as needed
//this implements circular buffer
if ((pChorusData->chorusIndexR+=1) >= CHORUS_R_SIZE)
pChorusData->chorusIndexR = 0;
//increment fractional lfo phase, and make it wrap as needed
pChorusData->lfoRPhase += pChorusData->m_nRate;
while (pChorusData->lfoRPhase >= (CHORUS_SHAPE_SIZE<<16))
{
pChorusData->lfoRPhase -= (CHORUS_SHAPE_SIZE<<16);
}
}
}
}
} /* end ChorusProcess */
/*----------------------------------------------------------------------------
* ChorusShutdown()
*----------------------------------------------------------------------------
* Purpose:
* Initializes the Chorus effect.
*
* Inputs:
* pInstData - handle to instance data
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ChorusShutdown (EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData)
{
/* check Configuration Module for static memory allocation */
if (!pEASData->staticMemoryModel)
EAS_HWFree(pEASData->hwInstData, pInstData);
return EAS_SUCCESS;
} /* end ChorusShutdown */
/*----------------------------------------------------------------------------
* ChorusGetParam()
*----------------------------------------------------------------------------
* Purpose:
* Get a Chorus parameter
*
* Inputs:
* pInstData - handle to instance data
* param - parameter index
* *pValue - pointer to variable to hold retrieved value
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ChorusGetParam (EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue)
{
S_CHORUS_OBJECT *p;
p = (S_CHORUS_OBJECT*) pInstData;
switch (param)
{
case EAS_PARAM_CHORUS_BYPASS:
*pValue = (EAS_I32) p->bypass;
break;
case EAS_PARAM_CHORUS_PRESET:
*pValue = (EAS_I8) p->m_nCurrentChorus;
break;
case EAS_PARAM_CHORUS_RATE:
*pValue = (EAS_I32) p->m_nRate;
break;
case EAS_PARAM_CHORUS_DEPTH:
*pValue = (EAS_I32) p->m_nDepth;
break;
case EAS_PARAM_CHORUS_LEVEL:
*pValue = (EAS_I32) p->m_nLevel;
break;
default:
return EAS_ERROR_INVALID_PARAMETER;
}
return EAS_SUCCESS;
} /* end ChorusGetParam */
/*----------------------------------------------------------------------------
* ChorusSetParam()
*----------------------------------------------------------------------------
* Purpose:
* Set a Chorus parameter
*
* Inputs:
* pInstData - handle to instance data
* param - parameter index
* *pValue - new paramter value
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ChorusSetParam (EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value)
{
S_CHORUS_OBJECT *p;
p = (S_CHORUS_OBJECT*) pInstData;
switch (param)
{
case EAS_PARAM_CHORUS_BYPASS:
p->bypass = (EAS_BOOL) value;
break;
case EAS_PARAM_CHORUS_PRESET:
if(value!=EAS_PARAM_CHORUS_PRESET1 && value!=EAS_PARAM_CHORUS_PRESET2 &&
value!=EAS_PARAM_CHORUS_PRESET3 && value!=EAS_PARAM_CHORUS_PRESET4)
return EAS_ERROR_INVALID_PARAMETER;
p->m_nNextChorus = (EAS_I8)value;
break;
case EAS_PARAM_CHORUS_RATE:
if(value<EAS_CHORUS_RATE_MIN || value>EAS_CHORUS_RATE_MAX)
return EAS_ERROR_INVALID_PARAMETER;
p->m_nRate = (EAS_I16) value;
break;
case EAS_PARAM_CHORUS_DEPTH:
if(value<EAS_CHORUS_DEPTH_MIN || value>EAS_CHORUS_DEPTH_MAX)
return EAS_ERROR_INVALID_PARAMETER;
p->m_nDepth = (EAS_I16) value;
break;
case EAS_PARAM_CHORUS_LEVEL:
if(value<EAS_CHORUS_LEVEL_MIN || value>EAS_CHORUS_LEVEL_MAX)
return EAS_ERROR_INVALID_PARAMETER;
p->m_nLevel = (EAS_I16) value;
break;
default:
return EAS_ERROR_INVALID_PARAMETER;
}
return EAS_SUCCESS;
} /* end ChorusSetParam */
/*----------------------------------------------------------------------------
* ChorusReadInPresets()
*----------------------------------------------------------------------------
* Purpose: sets global Chorus preset bank to defaults
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT ChorusReadInPresets(S_CHORUS_OBJECT *pChorusData)
{
int preset = 0;
int defaultPreset = 0;
//now init any remaining presets to defaults
for (defaultPreset = preset; defaultPreset < CHORUS_MAX_TYPE; defaultPreset++)
{
S_CHORUS_PRESET *pPreset = &pChorusData->m_sPreset.m_sPreset[defaultPreset];
if (defaultPreset == 0 || defaultPreset > CHORUS_MAX_TYPE-1)
{
pPreset->m_nDepth = 39;
pPreset->m_nRate = 30;
pPreset->m_nLevel = 32767;
}
else if (defaultPreset == 1)
{
pPreset->m_nDepth = 21;
pPreset->m_nRate = 45;
pPreset->m_nLevel = 25000;
}
else if (defaultPreset == 2)
{
pPreset->m_nDepth = 53;
pPreset->m_nRate = 25;
pPreset->m_nLevel = 32000;
}
else if (defaultPreset == 3)
{
pPreset->m_nDepth = 32;
pPreset->m_nRate = 37;
pPreset->m_nLevel = 29000;
}
}
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* ChorusUpdate
*----------------------------------------------------------------------------
* Purpose:
* Update the Chorus preset parameters as required
*
* Inputs:
*
* Outputs:
*
*
* Side Effects:
* - chorus paramters will be changed
* - m_nCurrentRoom := m_nNextRoom
*----------------------------------------------------------------------------
*/
EAS_RESULT ChorusUpdate(S_CHORUS_OBJECT *pChorusData)
{
S_CHORUS_PRESET *pPreset = &pChorusData->m_sPreset.m_sPreset[pChorusData->m_nNextChorus];
pChorusData->m_nLevel = pPreset->m_nLevel;
pChorusData->m_nRate = pPreset->m_nRate;
pChorusData->m_nDepth = pPreset->m_nDepth;
pChorusData->m_nRate = (EAS_I16)
((((EAS_I32)CHORUS_SHAPE_SIZE<<16)/(20*(EAS_I32)_OUTPUT_SAMPLE_RATE)) * pChorusData->m_nRate);
/*lint -e{704} use shift for performance */
pChorusData->m_nDepth = (EAS_I16)
(((((EAS_I32)pChorusData->m_nDepth * _OUTPUT_SAMPLE_RATE)>>5) * 105) >> 16);
pChorusData->m_nCurrentChorus = pChorusData->m_nNextChorus;
return EAS_SUCCESS;
} /* end ChorusUpdate */

View File

@@ -0,0 +1,34 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_chorusdata.c
*
* Contents and purpose:
* Contains the static data allocation for the Chorus effect
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 550 $
* $Date: 2007-02-02 09:37:03 -0800 (Fri, 02 Feb 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_chorusdata.h"
S_CHORUS_OBJECT eas_ChorusData;

View File

@@ -0,0 +1,160 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_chorusdata.h
*
* Contents and purpose:
* Contains the prototypes for the Chorus effect.
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 309 $
* $Date: 2006-09-12 18:52:45 -0700 (Tue, 12 Sep 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_CHORUS_H
#define _EAS_CHORUS_H
#include "eas_types.h"
#include "eas_audioconst.h"
//defines for chorus
#define EAS_CHORUS_BYPASS_DEFAULT 1
#define EAS_CHORUS_PRESET_DEFAULT 0
#define EAS_CHORUS_RATE_DEFAULT 30
#define EAS_CHORUS_DEPTH_DEFAULT 39
#define EAS_CHORUS_LEVEL_DEFAULT 32767
#define EAS_CHORUS_LEVEL_MIN 0
#define EAS_CHORUS_LEVEL_MAX 32767
#define EAS_CHORUS_RATE_MIN 10
#define EAS_CHORUS_RATE_MAX 50
#define EAS_CHORUS_DEPTH_MIN 15
#define EAS_CHORUS_DEPTH_MAX 60
#define CHORUS_SIZE_MS 20
#define CHORUS_L_SIZE ((CHORUS_SIZE_MS*_OUTPUT_SAMPLE_RATE)/1000)
#define CHORUS_R_SIZE CHORUS_L_SIZE
#define CHORUS_SHAPE_SIZE 128
#define CHORUS_DELAY_MS 10
#define CHORUS_MAX_TYPE 4 // any Chorus numbers larger than this are invalid
typedef struct
{
EAS_I16 m_nRate;
EAS_I16 m_nDepth;
EAS_I16 m_nLevel;
} S_CHORUS_PRESET;
typedef struct
{
S_CHORUS_PRESET m_sPreset[CHORUS_MAX_TYPE]; //array of presets
} S_CHORUS_PRESET_BANK;
/* parameters for each Chorus */
typedef struct
{
EAS_I32 lfoLPhase;
EAS_I32 lfoRPhase;
EAS_I16 chorusIndexL;
EAS_I16 chorusIndexR;
EAS_U16 chorusTapPosition;
EAS_I16 m_nRate;
EAS_I16 m_nDepth;
EAS_I16 m_nLevel;
//delay lines used by the chorus, longer would sound better
EAS_PCM chorusDelayL[CHORUS_L_SIZE];
EAS_PCM chorusDelayR[CHORUS_R_SIZE];
EAS_BOOL bypass;
EAS_I8 preset;
EAS_I16 m_nCurrentChorus; // preset number for current Chorus
EAS_I16 m_nNextChorus; // preset number for next Chorus
S_CHORUS_PRESET pPreset;
S_CHORUS_PRESET_BANK m_sPreset;
} S_CHORUS_OBJECT;
/*----------------------------------------------------------------------------
* WeightedTap()
*----------------------------------------------------------------------------
* Purpose: Does fractional array look-up using linear interpolation
*
* first convert indexDesired to actual desired index by taking into account indexReference
* then do linear interpolation between two actual samples using fractional part
*
* Inputs:
* array: pointer to array of signed 16 bit values, typically either PCM data or control data
* indexReference: the circular buffer relative offset
* indexDesired: the fractional index we are looking up (16 bits index + 16 bits fraction)
* indexLimit: the total size of the array, used to compute buffer wrap
*
* Outputs:
* Value from the input array, linearly interpolated between two actual data values
*
*----------------------------------------------------------------------------
*/
EAS_I16 WeightedTap(const EAS_I16 *array, EAS_I16 indexReference, EAS_I32 indexDesired, EAS_I16 indexLimit);
/*----------------------------------------------------------------------------
* ChorusReadInPresets()
*----------------------------------------------------------------------------
* Purpose: sets global Chorus preset bank to defaults
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT ChorusReadInPresets(S_CHORUS_OBJECT *pChorusData);
/*----------------------------------------------------------------------------
* ChorusUpdate
*----------------------------------------------------------------------------
* Purpose:
* Update the Chorus preset parameters as required
*
* Inputs:
*
* Outputs:
*
*
* Side Effects:
* - chorus paramters will be changed
* - m_nCurrentChorus := m_nNextChorus
*----------------------------------------------------------------------------
*/
EAS_RESULT ChorusUpdate(S_CHORUS_OBJECT* pChorusData);
#endif /* #ifndef _EAS_CHORUSDATA_H */

View File

@@ -0,0 +1,41 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_ctype.h
*
* Contents and purpose:
* This is a replacement for the CRT ctype.h functions. These
* functions are currently ASCII only, but eventually, we will want
* to support wide-characters for localization.
*
* Copyright (c) 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 429 $
* $Date: 2006-10-19 23:50:15 -0700 (Thu, 19 Oct 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_CTYPE_H
#define _EAS_CTYPE_H
EAS_INLINE EAS_I8 IsDigit (EAS_I8 c) { return ((c >= '0') && (c <= '9')); }
EAS_INLINE EAS_I8 IsSpace (EAS_I8 c) { return (((c >= 9) && (c <= 13)) || (c == ' ')); }
EAS_INLINE EAS_I8 ToUpper (EAS_I8 c) { if ((c >= 'a') && (c <= 'z')) return c & ~0x20; else return c; }
EAS_INLINE EAS_I8 ToLower (EAS_I8 c) { if ((c >= 'A') && (c <= 'Z')) return c |= 0x20; else return c; }
#endif

View File

@@ -0,0 +1,37 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_data.c
*
* Contents and purpose:
* Contains a data allocation for synthesizer
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
// includes
#include "eas_data.h"
// globals
S_EAS_DATA eas_Data;
S_VOICE_MGR eas_Synth;
S_SYNTH eas_MIDI;

View File

@@ -0,0 +1,133 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_data.h
*
* Contents and purpose:
* This header defines all types, to support dynamic allocation of the
* memory resources needed for persistent EAS data.
*
* Copyright 2004 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 842 $
* $Date: 2007-08-23 14:32:31 -0700 (Thu, 23 Aug 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_DATA_H
#define _EAS_DATA_H
//#define JET_INTERFACE
#include "eas_types.h"
#include "eas_synthcfg.h"
#include "eas.h"
#include "eas_audioconst.h"
#include "eas_sndlib.h"
#include "eas_pcm.h"
#include "eas_pcmdata.h"
#include "eas_synth.h"
#include "eas_miditypes.h"
#include "eas_effects.h"
#ifdef AUX_MIXER
#include "eas_auxmixdata.h"
#endif
#ifdef JET_INTERFACE
#include "jet.h"
#endif
#ifdef _METRICS_ENABLED
#include "eas_perf.h"
#endif
#ifndef MAX_NUMBER_STREAMS
#define MAX_NUMBER_STREAMS 4
#endif
/* flags for S_EAS_STREAM */
#define STREAM_FLAGS_PARSED 1
#define STREAM_FLAGS_PAUSE 2
#define STREAM_FLAGS_LOCATE 4
#define STREAM_FLAGS_RESUME 8
/* structure for parsing a stream */
typedef struct s_eas_stream_tag
{
void *pParserModule;
EAS_U32 time;
EAS_U32 frameLength;
EAS_I32 repeatCount;
EAS_VOID_PTR handle;
EAS_U8 volume;
EAS_BOOL8 streamFlags;
} S_EAS_STREAM;
/* default master volume is -10dB */
#define DEFAULT_VOLUME 90
#define DEFAULT_STREAM_VOLUME 100
#define DEFAULT_STREAM_GAIN 14622
/* 10 dB of boost available for individual parsers */
#define STREAM_VOLUME_HEADROOM 10
/* amalgamated persistent data type */
typedef struct s_eas_data_tag
{
#ifdef _CHECKED_BUILD
EAS_U32 handleCheck;
#endif
EAS_HW_DATA_HANDLE hwInstData;
S_EFFECTS_MODULE effectsModules[NUM_EFFECTS_MODULES];
#ifdef _METRICS_ENABLED
S_METRICS_INTERFACE *pMetricsModule;
EAS_VOID_PTR pMetricsData;
#endif
EAS_I32 *pMixBuffer;
EAS_PCM *pOutputAudioBuffer;
#ifdef AUX_MIXER
S_EAS_AUX_MIXER auxMixer;
#endif
#ifdef _MAXIMIZER_ENABLED
EAS_VOID_PTR pMaximizerData;
#endif
S_EAS_STREAM streams[MAX_NUMBER_STREAMS];
S_PCM_STATE *pPCMStreams;
S_VOICE_MGR *pVoiceMgr;
#ifdef JET_INTERFACE
JET_DATA_HANDLE jetHandle;
#endif
EAS_U32 renderTime;
EAS_I16 masterGain;
EAS_U8 masterVolume;
EAS_BOOL8 staticMemoryModel;
EAS_BOOL8 searchHeaderFlag;
} S_EAS_DATA;
#endif

View File

@@ -0,0 +1,578 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_dlssynth.c
*
* Contents and purpose:
* Implements the Mobile DLS synthesizer.
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 795 $
* $Date: 2007-08-01 00:14:45 -0700 (Wed, 01 Aug 2007) $
*----------------------------------------------------------------------------
*/
// includes
#include "eas_data.h"
#include "eas_report.h"
#include "eas_host.h"
#include "eas_math.h"
#include "eas_synth_protos.h"
#include "eas_wtsynth.h"
#include "eas_pan.h"
#include "eas_mdls.h"
#include "eas_dlssynth.h"
#ifdef _METRICS_ENABLED
#include "eas_perf.h"
#endif
static void DLS_UpdateEnvelope (S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, const S_DLS_ENVELOPE *pEnvParams, EAS_I16 *pValue, EAS_I16 *pIncrement, EAS_U8 *pState);
/*----------------------------------------------------------------------------
* DLS_MuteVoice()
*----------------------------------------------------------------------------
* Mute the voice using shutdown time from the DLS articulation data
*----------------------------------------------------------------------------
*/
void DLS_MuteVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum)
{
S_WT_VOICE *pWTVoice;
const S_DLS_ARTICULATION *pDLSArt;
pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex];
/* clear deferred action flags */
pVoice->voiceFlags &=
~(VOICE_FLAG_DEFER_MIDI_NOTE_OFF |
VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF |
VOICE_FLAG_DEFER_MUTE);
/* set the envelope state */
pVoiceMgr->wtVoices[voiceNum].eg1State = eEnvelopeStateRelease;
pWTVoice->eg1Increment = pDLSArt->eg1ShutdownTime;
pVoiceMgr->wtVoices[voiceNum].eg2State = eEnvelopeStateRelease;
pWTVoice->eg2Increment = pDLSArt->eg2.releaseTime;
}
/*----------------------------------------------------------------------------
* DLS_ReleaseVoice()
*----------------------------------------------------------------------------
* Release the selected voice.
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pVoice) standard API, pVoice may be used by other synthesizers */
void DLS_ReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum)
{
S_WT_VOICE *pWTVoice;
const S_DLS_ARTICULATION *pDLSArt;
pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex];
/* if still in attack phase, convert units to log */
/*lint -e{732} eg1Value is never negative */
/*lint -e{703} use shift for performance */
if (pWTVoice->eg1State == eEnvelopeStateAttack)
pWTVoice->eg1Value = (EAS_I16) ((EAS_flog2(pWTVoice->eg1Value) << 1) + 2048);
/* release EG1 */
pWTVoice->eg1State = eEnvelopeStateRelease;
pWTVoice->eg1Increment = pDLSArt->eg1.releaseTime;
/* release EG2 */
pWTVoice->eg2State = eEnvelopeStateRelease;
pWTVoice->eg2Increment = pDLSArt->eg2.releaseTime;
}
/*----------------------------------------------------------------------------
* DLS_SustainPedal()
*----------------------------------------------------------------------------
* The sustain pedal was just depressed. If the voice is still
* above the sustain level, catch the voice and continue holding.
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pChannel) pChannel reserved for future use */
void DLS_SustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, EAS_I32 voiceNum)
{
S_WT_VOICE *pWTVoice;
const S_DLS_ARTICULATION *pDLSArt;
pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex];
/* don't catch the voice if below the sustain level */
if (pWTVoice->eg1Value < pDLSArt->eg1.sustainLevel)
return;
/* defer releasing this note until the damper pedal is off */
pWTVoice->eg1State = eEnvelopeStateDecay;
pVoice->voiceState = eVoiceStatePlay;
pVoice->voiceFlags |= VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF;
#ifdef _DEBUG_SYNTH
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "DLS_SustainPedal: defer note off because sustain pedal is on\n"); */ }
#endif
}
/*----------------------------------------------------------------------------
* DLS_UpdatePhaseInc()
*----------------------------------------------------------------------------
* Calculate the oscillator phase increment for the next frame
*----------------------------------------------------------------------------
*/
static EAS_I32 DLS_UpdatePhaseInc (S_WT_VOICE *pWTVoice, const S_DLS_ARTICULATION *pDLSArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 pitchCents)
{
EAS_I32 temp;
/* start with base mod LFO modulation */
temp = pDLSArt->modLFOToPitch;
/* add mod wheel effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOCC1ToPitch * pChannel->modWheel) >> 7);
/* add channel pressure effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOChanPressToPitch * pChannel->channelPressure) >> 7);
/* add total mod LFO effect */
pitchCents += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue);
/* start with base vib LFO modulation */
temp = pDLSArt->vibLFOToPitch;
/* add mod wheel effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->vibLFOCC1ToPitch * pChannel->modWheel) >> 7);
/* add channel pressure effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->vibLFOChanPressToPitch * pChannel->channelPressure) >> 7);
/* add total vibrato LFO effect */
pitchCents += FMUL_15x15(temp, pWTVoice->vibLFO.lfoValue);
/* add EG2 effect */
pitchCents += FMUL_15x15(pDLSArt->eg2ToPitch, pWTVoice->eg2Value);
/* convert from cents to linear phase increment */
return EAS_Calculate2toX(pitchCents);
}
/*----------------------------------------------------------------------------
* DLS_UpdateGain()
*----------------------------------------------------------------------------
* Calculate the gain for the next frame
*----------------------------------------------------------------------------
*/
static EAS_I32 DLS_UpdateGain (S_WT_VOICE *pWTVoice, const S_DLS_ARTICULATION *pDLSArt, S_SYNTH_CHANNEL *pChannel, EAS_I32 gain, EAS_U8 velocity)
{
EAS_I32 temp;
/* start with base mod LFO modulation */
temp = pDLSArt->modLFOToGain;
/* add mod wheel effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOCC1ToGain * pChannel->modWheel) >> 7);
/* add channel pressure effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOChanPressToGain * pChannel->channelPressure) >> 7);
/* add total mod LFO effect */
gain += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue);
if (gain > 0)
gain = 0;
/* convert to linear gain including EG1 */
if (pWTVoice->eg1State != eEnvelopeStateAttack)
{
gain = (DLS_GAIN_FACTOR * gain) >> DLS_GAIN_SHIFT;
/*lint -e{702} use shift for performance */
#if 1
gain += (pWTVoice->eg1Value - 32767) >> 1;
gain = EAS_LogToLinear16(gain);
#else
gain = EAS_LogToLinear16(gain);
temp = EAS_LogToLinear16((pWTVoice->eg1Value - 32767) >> 1);
gain = FMUL_15x15(gain, temp);
#endif
}
else
{
gain = (DLS_GAIN_FACTOR * gain) >> DLS_GAIN_SHIFT;
gain = EAS_LogToLinear16(gain);
gain = FMUL_15x15(gain, pWTVoice->eg1Value);
}
/* include MIDI channel gain */
gain = FMUL_15x15(gain, pChannel->staticGain);
/* include velocity */
if (pDLSArt->filterQandFlags & FLAG_DLS_VELOCITY_SENSITIVE)
{
temp = velocity << 8;
temp = FMUL_15x15(temp, temp);
gain = FMUL_15x15(gain, temp);
}
/* return gain */
return gain;
}
/*----------------------------------------------------------------------------
* DLS_UpdateFilter()
*----------------------------------------------------------------------------
* Update the Filter parameters
*----------------------------------------------------------------------------
*/
static void DLS_UpdateFilter (S_SYNTH_VOICE *pVoice, S_WT_VOICE *pWTVoice, S_WT_INT_FRAME *pIntFrame, S_SYNTH_CHANNEL *pChannel, const S_DLS_ARTICULATION *pDLSArt)
{
EAS_I32 cutoff;
EAS_I32 temp;
/* no need to calculate filter coefficients if it is bypassed */
if (pDLSArt->filterCutoff == DEFAULT_DLS_FILTER_CUTOFF_FREQUENCY)
{
pIntFrame->frame.k = 0;
return;
}
/* start with base cutoff frequency */
cutoff = pDLSArt->filterCutoff;
/* get base mod LFO modulation */
temp = pDLSArt->modLFOToFc;
/* add mod wheel effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOCC1ToFc * pChannel->modWheel) >> 7);
/* add channel pressure effect */
/*lint -e{702} use shift for performance */
temp += ((pDLSArt->modLFOChanPressToFc* pChannel->channelPressure) >> 7);
/* add total mod LFO effect */
cutoff += FMUL_15x15(temp, pWTVoice->modLFO.lfoValue);
/* add EG2 effect */
cutoff += FMUL_15x15(pWTVoice->eg2Value, pDLSArt->eg2ToFc);
/* add velocity effect */
/*lint -e{702} use shift for performance */
cutoff += (pVoice->velocity * pDLSArt->velToFc) >> 7;
/* add velocity effect */
/*lint -e{702} use shift for performance */
cutoff += (pVoice->note * pDLSArt->keyNumToFc) >> 7;
/* subtract the A5 offset and the sampling frequency */
cutoff -= FILTER_CUTOFF_FREQ_ADJUST + A5_PITCH_OFFSET_IN_CENTS;
/* limit the cutoff frequency */
if (cutoff > FILTER_CUTOFF_MAX_PITCH_CENTS)
cutoff = FILTER_CUTOFF_MAX_PITCH_CENTS;
else if (cutoff < FILTER_CUTOFF_MIN_PITCH_CENTS)
cutoff = FILTER_CUTOFF_MIN_PITCH_CENTS;
WT_SetFilterCoeffs(pIntFrame, cutoff, pDLSArt->filterQandFlags & FILTER_Q_MASK);
}
/*----------------------------------------------------------------------------
* DLS_StartVoice()
*----------------------------------------------------------------------------
* Start up a DLS voice
*----------------------------------------------------------------------------
*/
EAS_RESULT DLS_StartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_U16 regionIndex)
{
S_WT_VOICE *pWTVoice;
const S_DLS_REGION *pDLSRegion;
const S_DLS_ARTICULATION *pDLSArt;
S_SYNTH_CHANNEL *pChannel;
#ifdef _DEBUG_SYNTH
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_INFO, "DLS_StartVoice: Voice %ld; Region %d\n", (EAS_I32) (pVoice - pVoiceMgr->voices), regionIndex); */ }
#endif
pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
pChannel = &pSynth->channels[pVoice->channel & 15];
pDLSRegion = &pSynth->pDLS->pDLSRegions[regionIndex & REGION_INDEX_MASK];
pWTVoice->artIndex = pDLSRegion->wtRegion.artIndex;
pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex];
/* initialize the envelopes */
pWTVoice->eg1State = eEnvelopeStateInit;
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWTVoice->eg1State);
pWTVoice->eg2State = eEnvelopeStateInit;
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWTVoice->eg2State);
/* initialize the LFOs */
pWTVoice->modLFO.lfoValue = 0;
pWTVoice->modLFO.lfoPhase = pDLSArt->modLFO.lfoDelay;
pWTVoice->vibLFO.lfoValue = 0;
pWTVoice->vibLFO.lfoPhase = pDLSArt->vibLFO.lfoDelay;
/* initalize the envelopes and calculate initial gain */
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWTVoice->eg1State);
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWTVoice->eg2State);
pVoice->gain = (EAS_I16) DLS_UpdateGain(pWTVoice, pDLSArt, pChannel, pDLSRegion->wtRegion.gain, pVoice->velocity);
#if (NUM_OUTPUT_CHANNELS == 2)
EAS_CalcPanControl((EAS_INT) pChannel->pan - 64 + (EAS_INT) pDLSArt->pan, &pWTVoice->gainLeft, &pWTVoice->gainRight);
#endif
/* initialize the filter states */
pWTVoice->filter.z1 = 0;
pWTVoice->filter.z2 = 0;
/* initialize the oscillator */
pWTVoice->phaseAccum = (EAS_U32) pSynth->pDLS->pDLSSamples + pSynth->pDLS->pDLSSampleOffsets[pDLSRegion->wtRegion.waveIndex];
if (pDLSRegion->wtRegion.region.keyGroupAndFlags & REGION_FLAG_IS_LOOPED)
{
pWTVoice->loopStart = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopStart;
pWTVoice->loopEnd = pWTVoice->phaseAccum + pDLSRegion->wtRegion.loopEnd - 1;
}
else
pWTVoice->loopStart = pWTVoice->loopEnd = pWTVoice->phaseAccum + pSynth->pDLS->pDLSSampleLen[pDLSRegion->wtRegion.waveIndex] - 1;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* DLS_UpdateVoice()
*----------------------------------------------------------------------------
* Purpose:
* Synthesize a block of samples for the given voice.
* Use linear interpolation.
*
* Inputs:
* pEASData - pointer to overall EAS data structure
*
* Outputs:
* number of samples actually written to buffer
*
* Side Effects:
* - samples are added to the presently free buffer
*
*----------------------------------------------------------------------------
*/
EAS_BOOL DLS_UpdateVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_I32 *pMixBuffer, EAS_I32 numSamples)
{
S_WT_VOICE *pWTVoice;
S_SYNTH_CHANNEL *pChannel;
const S_DLS_REGION *pDLSRegion;
const S_DLS_ARTICULATION *pDLSArt;
S_WT_INT_FRAME intFrame;
EAS_I32 temp;
EAS_BOOL done = EAS_FALSE;
/* establish pointers to critical data */
pWTVoice = &pVoiceMgr->wtVoices[voiceNum];
pDLSRegion = &pSynth->pDLS->pDLSRegions[pVoice->regionIndex & REGION_INDEX_MASK];
pChannel = &pSynth->channels[pVoice->channel & 15];
pDLSArt = &pSynth->pDLS->pDLSArticulations[pWTVoice->artIndex];
/* update the envelopes */
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg1, &pWTVoice->eg1Value, &pWTVoice->eg1Increment, &pWTVoice->eg1State);
DLS_UpdateEnvelope(pVoice, pChannel, &pDLSArt->eg2, &pWTVoice->eg2Value, &pWTVoice->eg2Increment, &pWTVoice->eg2State);
/* update the LFOs using the EAS synth function */
WT_UpdateLFO(&pWTVoice->modLFO, pDLSArt->modLFO.lfoFreq);
WT_UpdateLFO(&pWTVoice->vibLFO, pDLSArt->vibLFO.lfoFreq);
/* calculate base frequency */
temp = pDLSArt->tuning + pChannel->staticPitch + pDLSRegion->wtRegion.tuning +
(((EAS_I32) pVoice->note * (EAS_I32) pDLSArt->keyNumToPitch) >> 7);
/* don't transpose rhythm channel */
if ((pChannel ->channelFlags & CHANNEL_FLAG_RHYTHM_CHANNEL) == 0)
temp += pSynth->globalTranspose * 100;
/* calculate phase increment including modulation effects */
intFrame.frame.phaseIncrement = DLS_UpdatePhaseInc(pWTVoice, pDLSArt, pChannel, temp);
/* calculate gain including modulation effects */
intFrame.frame.gainTarget = DLS_UpdateGain(pWTVoice, pDLSArt, pChannel, pDLSRegion->wtRegion.gain, pVoice->velocity);
intFrame.prevGain = pVoice->gain;
DLS_UpdateFilter(pVoice, pWTVoice, &intFrame, pChannel, pDLSArt);
/* call into engine to generate samples */
intFrame.pAudioBuffer = pVoiceMgr->voiceBuffer;
intFrame.pMixBuffer = pMixBuffer;
intFrame.numSamples = numSamples;
if (numSamples < 0)
return EAS_FALSE;
/* check for end of sample */
if ((pWTVoice->loopStart != WT_NOISE_GENERATOR) && (pWTVoice->loopStart == pWTVoice->loopEnd))
done = WT_CheckSampleEnd(pWTVoice, &intFrame, EAS_FALSE);
WT_ProcessVoice(pWTVoice, &intFrame);
/* clear flag */
pVoice->voiceFlags &= ~VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET;
/* if the update interval has elapsed, then force the current gain to the next
* gain since we never actually reach the next gain when ramping -- we just get
* very close to the target gain.
*/
pVoice->gain = (EAS_I16) intFrame.frame.gainTarget;
/* if voice has finished, set flag for voice manager */
if ((pVoice->voiceState != eVoiceStateStolen) && (pWTVoice->eg1State == eEnvelopeStateMuted))
done = EAS_TRUE;
return done;
}
/*----------------------------------------------------------------------------
* DLS_UpdateEnvelope()
*----------------------------------------------------------------------------
* Purpose:
* Synthesize a block of samples for the given voice.
* Use linear interpolation.
*
* Inputs:
* pEASData - pointer to overall EAS data structure
*
* Outputs:
* number of samples actually written to buffer
*
* Side Effects:
* - samples are added to the presently free buffer
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pChannel) pChannel not used in this instance */
static void DLS_UpdateEnvelope (S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, const S_DLS_ENVELOPE *pEnvParams, EAS_I16 *pValue, EAS_I16 *pIncrement, EAS_U8 *pState)
{
EAS_I32 temp;
switch (*pState)
{
/* initial state */
case eEnvelopeStateInit:
*pState = eEnvelopeStateDelay;
*pValue = 0;
*pIncrement = pEnvParams->delayTime;
if (*pIncrement != 0)
return;
/*lint -e{825} falls through to next case */
case eEnvelopeStateDelay:
if (*pIncrement)
{
*pIncrement = *pIncrement - 1;
return;
}
/* calculate attack rate */
*pState = eEnvelopeStateAttack;
if (pEnvParams->attackTime != ZERO_TIME_IN_CENTS)
{
/*lint -e{702} use shift for performance */
temp = pEnvParams->attackTime + ((pEnvParams->velToAttack * pVoice->velocity) >> 7);
*pIncrement = ConvertRate(temp);
return;
}
*pValue = SYNTH_FULL_SCALE_EG1_GAIN;
/*lint -e{825} falls through to next case */
case eEnvelopeStateAttack:
if (*pValue < SYNTH_FULL_SCALE_EG1_GAIN)
{
temp = *pValue + *pIncrement;
*pValue = (EAS_I16) (temp < SYNTH_FULL_SCALE_EG1_GAIN ? temp : SYNTH_FULL_SCALE_EG1_GAIN);
return;
}
/* calculate hold time */
*pState = eEnvelopeStateHold;
if (pEnvParams->holdTime != ZERO_TIME_IN_CENTS)
{
/*lint -e{702} use shift for performance */
temp = pEnvParams->holdTime + ((pEnvParams->keyNumToHold * pVoice->note) >> 7);
*pIncrement = ConvertDelay(temp);
return;
}
else
*pIncrement = 0;
/*lint -e{825} falls through to next case */
case eEnvelopeStateHold:
if (*pIncrement)
{
*pIncrement = *pIncrement - 1;
return;
}
/* calculate decay rate */
*pState = eEnvelopeStateDecay;
if (pEnvParams->decayTime != ZERO_TIME_IN_CENTS)
{
/*lint -e{702} use shift for performance */
temp = pEnvParams->decayTime + ((pEnvParams->keyNumToDecay * pVoice->note) >> 7);
*pIncrement = ConvertRate(temp);
return;
}
// *pValue = pEnvParams->sustainLevel;
/*lint -e{825} falls through to next case */
case eEnvelopeStateDecay:
if (*pValue > pEnvParams->sustainLevel)
{
temp = *pValue - *pIncrement;
*pValue = (EAS_I16) (temp > pEnvParams->sustainLevel ? temp : pEnvParams->sustainLevel);
return;
}
*pState = eEnvelopeStateSustain;
*pValue = pEnvParams->sustainLevel;
/*lint -e{825} falls through to next case */
case eEnvelopeStateSustain:
return;
case eEnvelopeStateRelease:
temp = *pValue - *pIncrement;
if (temp <= 0)
{
*pState = eEnvelopeStateMuted;
*pValue = 0;
}
else
*pValue = (EAS_I16) temp;
break;
case eEnvelopeStateMuted:
*pValue = 0;
return;
default:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_ERROR, "Envelope in invalid state %d\n", *pState); */ }
break;
}
}

View File

@@ -0,0 +1,41 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_dlssynth.h
*
* Contents and purpose:
* Implements the Mobile DLS synthesizer.
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 143 $
* $Date: 2006-07-17 14:09:35 -0700 (Mon, 17 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_DLSSYNTH_H
#define _EAS_DLSSYNTH_H
/* prototypes */
void DLS_MuteVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum);
void DLS_ReleaseVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum);
void DLS_SustainPedal (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, EAS_I32 voiceNum);
EAS_RESULT DLS_StartVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_U16 regionIndex);
EAS_BOOL DLS_UpdateVoice (S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_I32 *pMixBuffer, EAS_I32 numSamples);
#endif

View File

@@ -0,0 +1,61 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_effects.h
*
* Contents and purpose:
* Defines a generic effects interface.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_EFFECTS_H
#define _EAS_EFFECTS_H
#include "eas_types.h"
typedef struct
{
EAS_RESULT (*pfInit)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData);
void (*pfProcess)(EAS_VOID_PTR pInstData, EAS_PCM *in, EAS_PCM *out, EAS_I32 numSamples);
EAS_RESULT (*pfShutdown)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (*pFGetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
EAS_RESULT (*pFSetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
} S_EFFECTS_INTERFACE;
typedef struct
{
EAS_RESULT (*pfInit)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR *pInstData);
void (*pfProcess)(EAS_VOID_PTR pInstData, EAS_I32 *in, EAS_I32 *out, EAS_I32 numSamples);
EAS_RESULT (*pfShutdown)(EAS_DATA_HANDLE pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (*pFGetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
EAS_RESULT (*pFSetParam)(EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
} S_EFFECTS32_INTERFACE;
/* mixer instance data */
typedef struct
{
S_EFFECTS_INTERFACE *effect;
EAS_VOID_PTR effectData;
} S_EFFECTS_MODULE;
#endif /* end _EAS_EFFECTS_H */

View File

@@ -0,0 +1,96 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_flog2.c
*
* Contents and purpose:
* Fixed point square root
*
*
* Copyright (c) 2006 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision$
* $Date$
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
#include "eas_math.h"
#define MANTISSA_SHIFT 27
#define MANTISSA_MASK 0x0000000f
#define MANTISSA_LSB_SHIFT 7
#define MANTISSA_LSB_MASK 0x000fffff
#define LOG_EXPONENT_SHIFT 10
#define INTERPOLATION_SHIFT 20
#define MAX_NEGATIVE (-2147483647-1)
/* log lookup table */
static const EAS_U16 eas_log2_table[] =
{
0, 90, 174, 254, 330, 402, 470, 536,
599, 659, 717, 773, 827, 879, 929, 977,
1024
};
/*----------------------------------------------------------------------------
* EAS_flog2()
*----------------------------------------------------------------------------
* Purpose:
* Calculates the log2 of a 32-bit fixed point value
*
* Inputs:
* n = value of interest
*
* Outputs:
* returns the log2 of n
*
*----------------------------------------------------------------------------
*/
EAS_I32 EAS_flog2 (EAS_U32 n)
{
EAS_U32 exp;
EAS_U32 interp;
/* check for error condition */
if (n == 0)
return MAX_NEGATIVE;
/* find exponent */
for (exp = 31; exp > 0; exp--)
{
/* shift until we get a 1 bit in bit 31 */
if ((n & (EAS_U32) MAX_NEGATIVE) != 0)
break;
n <<= 1;
}
/*lint -e{701} use shift for performance */
exp <<= LOG_EXPONENT_SHIFT;
/* get the least significant bits for interpolation */
interp = (n >> MANTISSA_LSB_SHIFT) & MANTISSA_LSB_MASK;
/* get the most significant bits for mantissa lookup */
n = (n >> MANTISSA_SHIFT) & MANTISSA_MASK;
/* interpolate mantissa */
interp = ((eas_log2_table[n+1] - eas_log2_table[n]) * interp) >> INTERPOLATION_SHIFT;
exp += eas_log2_table[n] + interp;
return (EAS_I32) exp;
}

View File

@@ -0,0 +1,54 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_ima_tables.c
*
* Contents and purpose:
* Contains the constant tables for IMA encode/decode
*
* Copyright (c) 2005 Sonic Network Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 760 $
* $Date: 2007-07-17 23:09:36 -0700 (Tue, 17 Jul 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
/*----------------------------------------------------------------------------
* ADPCM decode tables
*----------------------------------------------------------------------------
*/
const EAS_I16 imaIndexTable[16] =
{
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8
};
const EAS_I16 imaStepSizeTable[89] =
{
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
};

View File

@@ -0,0 +1,368 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_imaadpcm.c
*
* Contents and purpose:
* Implements the IMA ADPCM decoder
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 847 $
* $Date: 2007-08-27 21:30:08 -0700 (Mon, 27 Aug 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_data.h"
#include "eas_host.h"
#include "eas_pcm.h"
#include "eas_math.h"
#include "eas_report.h"
// #define _DEBUG_IMA_ADPCM_LOCATE
/*----------------------------------------------------------------------------
* externs
*----------------------------------------------------------------------------
*/
extern const EAS_I16 imaIndexTable[];
extern const EAS_I16 imaStepSizeTable[];
/*----------------------------------------------------------------------------
* prototypes
*----------------------------------------------------------------------------
*/
static EAS_RESULT IMADecoderInit (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
static EAS_RESULT IMADecoderSample (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
static void IMADecoderADPCM (S_DECODER_STATE *pState, EAS_U8 nibble);
static EAS_RESULT IMADecoderLocate (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 time);
/*----------------------------------------------------------------------------
* IMA ADPCM Decoder interface
*----------------------------------------------------------------------------
*/
const S_DECODER_INTERFACE IMADecoder =
{
IMADecoderInit,
IMADecoderSample,
IMADecoderLocate
};
/*----------------------------------------------------------------------------
* IMADecoderInit()
*----------------------------------------------------------------------------
* Purpose:
* Initializes the IMA ADPCM decoder
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pEASData) common decoder interface - pEASData not used */
static EAS_RESULT IMADecoderInit (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState)
{
pState->decoderL.step = 0;
pState->decoderR.step = 0;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* IMADecoderSample()
*----------------------------------------------------------------------------
* Purpose:
* Decodes an IMA ADPCM sample
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT IMADecoderSample (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState)
{
EAS_RESULT result;
EAS_I16 sTemp;
/* if high nibble, decode */
if (pState->hiNibble)
{
IMADecoderADPCM(&pState->decoderL, (EAS_U8)(pState->srcByte >> 4));
pState->hiNibble = EAS_FALSE;
}
/* low nibble, need to fetch another byte */
else
{
/* check for loop */
if ((pState->bytesLeft == 0) && (pState->loopSamples != 0))
{
/* seek to start of loop */
if ((result = EAS_HWFileSeek(pEASData->hwInstData, pState->fileHandle, (EAS_I32) (pState->startPos + pState->loopLocation))) != EAS_SUCCESS)
return result;
pState->bytesLeft = pState->byteCount = (EAS_I32) pState->bytesLeftLoop;
pState->blockCount = 0;
pState->flags &= ~PCM_FLAGS_EMPTY;
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "IMADecoderSample: Rewind file to %d, bytesLeft = %d\n", pState->startPos, pState->bytesLeft); */ }
}
/* if start of block, fetch new predictor and step index */
if ((pState->blockSize != 0) && (pState->blockCount == 0) && (pState->bytesLeft != 0))
{
/* get predicted sample for left channel */
if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_SUCCESS)
return result;
#ifdef _DEBUG_IMA_ADPCM
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Predictor: Was %d, now %d\n", pState->decoderL.acc, sTemp); */ }
#endif
pState->decoderL.acc = pState->decoderL.x1 = sTemp;
/* get step index for left channel - upper 8 bits are reserved */
if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_SUCCESS)
return result;
#ifdef _DEBUG_IMA_ADPCM
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Step: Was %d, now %d\n", pState->decoderL.step, sTemp); */ }
#endif
pState->decoderL.step = sTemp & 0xff;
if (pState->flags & PCM_FLAGS_STEREO)
{
/* get predicted sample for right channel */
if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_SUCCESS)
return result;
pState->decoderR.acc = pState->decoderR.x1 = sTemp;
/* get step index for right channel - upper 8 bits are reserved */
if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_SUCCESS)
return result;
#ifdef _DEBUG_IMA_ADPCM
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Step: Was %d, now %d\n", pState->decoderR.step, sTemp); */ }
#endif
pState->decoderR.step = sTemp & 0xff;
pState->blockCount = pState->blockSize - 8;
pState->bytesLeft -= 8;
}
else
{
pState->blockCount = pState->blockSize - 4;
pState->bytesLeft -= 4;
}
}
else
{
/* get another ADPCM data pair */
if (pState->bytesLeft)
{
if ((result = EAS_HWGetByte(pEASData->hwInstData, pState->fileHandle, &pState->srcByte)) != EAS_SUCCESS)
return result;
/* decode the low nibble */
pState->bytesLeft--;
pState->blockCount--;
IMADecoderADPCM(&pState->decoderL, (EAS_U8)(pState->srcByte & 0x0f));
if (pState->flags & PCM_FLAGS_STEREO)
IMADecoderADPCM(&pState->decoderR, (EAS_U8)(pState->srcByte >> 4));
else
pState->hiNibble = EAS_TRUE;
}
/* out of ADPCM data, generate enough samples to fill buffer */
else
{
pState->decoderL.x1 = pState->decoderL.x0;
pState->decoderR.x1 = pState->decoderR.x0;
}
}
}
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* IMADecoderADPCM()
*----------------------------------------------------------------------------
* Purpose:
* Decodes an IMA ADPCM sample
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static void IMADecoderADPCM (S_DECODER_STATE *pState, EAS_U8 nibble)
{
EAS_INT delta;
EAS_INT stepSize;
/* get stepsize from table */
stepSize = imaStepSizeTable[pState->step];
/* delta = (abs(delta) + 0.5) * step / 4 */
delta = 0;
if (nibble & 4)
delta += stepSize;
if (nibble & 2)
/*lint -e{702} use shift for performance */
delta += stepSize >> 1;
if (nibble & 1)
/*lint -e{702} use shift for performance */
delta += stepSize >> 2;
/*lint -e{702} use shift for performance */
delta += stepSize >> 3;
/* integrate the delta */
if (nibble & 8)
pState->acc -= delta;
else
pState->acc += delta;
/* saturate */
if (pState->acc > 32767)
pState->acc = 32767;
if (pState->acc < -32768)
pState->acc = -32768;
pState->x1 = (EAS_PCM) pState->acc;
/* compute new step size */
pState->step += imaIndexTable[nibble];
if (pState->step < 0)
pState->step = 0;
if (pState->step > 88)
pState->step = 88;
#ifdef _DEBUG_IMA_ADPCM
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "In=%u, Pred=%d, Step=%d\n", nibble, pState->acc, imaStepSizeTable[pState->step]); */ }
#endif
}
/*----------------------------------------------------------------------------
* IMADecoderLocate()
*----------------------------------------------------------------------------
* Locate in an IMA ADPCM stream
*----------------------------------------------------------------------------
*/
static EAS_RESULT IMADecoderLocate (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 time)
{
EAS_RESULT result;
EAS_I32 temp;
EAS_I32 samplesPerBlock;
EAS_I32 secs, msecs;
/* no need to calculate if time is zero */
if (time == 0)
temp = 0;
/* not zero */
else
{
/* can't seek if not a blocked file */
if (pState->blockSize == 0)
return EAS_ERROR_FEATURE_NOT_AVAILABLE;
/* calculate number of samples per block */
if (pState->flags & PCM_FLAGS_STEREO)
samplesPerBlock = pState->blockSize - 7;
else
samplesPerBlock = (pState->blockSize << 1) - 7;
/* break down into secs and msecs */
secs = time / 1000;
msecs = time - (secs * 1000);
/* calculate sample number fraction from msecs */
temp = (msecs * pState->sampleRate);
temp = (temp >> 10) + ((temp * 49) >> 21);
/* add integer sample count */
temp += secs * pState->sampleRate;
#ifdef _DEBUG_IMA_ADPCM_LOCATE
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x2380b977, 0x00000006 , time, temp);
#endif
/* for looped samples, calculate position in the loop */
if ((temp > pState->byteCount) && (pState->loopSamples != 0))
{
EAS_I32 numBlocks;
EAS_I32 samplesPerLoop;
EAS_I32 samplesInLastBlock;
numBlocks = (EAS_I32) (pState->loopStart / pState->blockSize);
samplesInLastBlock = (EAS_I32) pState->loopStart - (numBlocks * pState->blockSize);
if (samplesInLastBlock)
{
if (pState->flags & PCM_FLAGS_STEREO)
samplesInLastBlock = samplesInLastBlock - 7;
else
/*lint -e{703} use shift for performance */
samplesInLastBlock = (samplesInLastBlock << 1) - 7;
}
samplesPerLoop = numBlocks * samplesPerBlock + samplesInLastBlock;
temp = temp % samplesPerLoop;
#ifdef _DEBUG_IMA_ADPCM_LOCATE
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x2380b977, 0x00000007 , numBlocks, samplesPerLoop, samplesInLastBlock, temp);
#endif
}
/* find start of block for requested sample */
temp = (temp / samplesPerBlock) * pState->blockSize;
#ifdef _DEBUG_IMA_ADPCM_LOCATE
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x2380b977, 0x00000008 , temp);
#endif
}
/* seek to new location */
if ((result = EAS_PESeek(pEASData, pState, &temp)) != EAS_SUCCESS)
return result;
#ifdef _DEBUG_IMA_ADPCM_LOCATE
EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x2380b977, 0x00000009 , pState->bytesLeft);
#endif
/* reset state */
pState->blockCount = 0;
pState->hiNibble = EAS_FALSE;
if ((pState->state != EAS_STATE_PAUSING) && (pState->state != EAS_STATE_PAUSED))
pState->state = EAS_STATE_READY;
return EAS_SUCCESS;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_imelodydata.c
*
* Contents and purpose:
* SMF File Parser
*
* This file contains data definitions for the SMF parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
#include "eas_imelodydata.h"
/*----------------------------------------------------------------------------
*
* eas_iMelodyData
*
* Static memory allocation for iMelody parser
*----------------------------------------------------------------------------
*/
S_IMELODY_DATA eas_iMelodyData;

View File

@@ -0,0 +1,74 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_imelodydata.h
*
* Contents and purpose:
* SMF File Parser
*
* This file contains data declarations for the iMelody parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 778 $
* $Date: 2007-07-23 16:45:17 -0700 (Mon, 23 Jul 2007) $
*----------------------------------------------------------------------------
*/
#ifndef EAS_IMELODYDATA_H
#define EAS_IMELODYDATA_H
#include "eas_data.h"
/* maximum line size as specified in iMelody V1.2 spec */
#define MAX_LINE_SIZE 75
/*----------------------------------------------------------------------------
*
* S_IMELODY_DATA
*
* This structure contains the state data for the iMelody parser
*----------------------------------------------------------------------------
*/
typedef struct
{
EAS_FILE_HANDLE fileHandle; /* file handle */
S_SYNTH *pSynth; /* pointer to synth */
EAS_I32 fileOffset; /* offset to start of data */
EAS_I32 time; /* current time in 256ths of a msec */
EAS_I32 tickBase; /* basline length of 32nd note in 256th of a msec */
EAS_I32 tick; /* actual length of 32nd note in 256th of a msec */
EAS_I32 restTicks; /* ticks to rest after current note */
EAS_I32 startLine; /* file offset at start of line (for repeats) */
EAS_I32 repeatOffset; /* file offset to start of repeat section */
EAS_I32 repeatTime; /* time at start of repeat section */
S_METADATA_CB metadata; /* metadata callback */
EAS_I16 repeatCount; /* repeat counter */
EAS_U8 state; /* current state EAS_STATE_XXXX */
EAS_U8 style; /* from STYLE */
EAS_U8 index; /* index into buffer */
EAS_U8 octave; /* octave prefix */
EAS_U8 volume; /* current volume */
EAS_U8 note; /* MIDI note number */
EAS_I8 noteModifier; /* sharp or flat */
EAS_I8 buffer[MAX_LINE_SIZE+1]; /* buffer for ASCII data */
} S_IMELODY_DATA;
#endif

View File

@@ -0,0 +1,168 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_math.c
*
* Contents and purpose:
* Contains common math routines for the various audio engines.
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 586 $
* $Date: 2007-03-08 20:33:04 -0800 (Thu, 08 Mar 2007) $
*----------------------------------------------------------------------------
*/
#include "eas.h"
#include "eas_math.h"
/* anything less than this converts to a fraction too small to represent in 32-bits */
#define MIN_CENTS -18000
/*----------------------------------------------------------------------------
* EAS_Calculate2toX()
*----------------------------------------------------------------------------
* Purpose:
* Calculate 2^x
*
* Inputs:
* nCents - measured in cents
* psEASData - pointer to overall EAS data structure
*
* Outputs:
* nResult - int.frac result (where frac has NUM_DENTS_FRAC_BITS)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_I32 EAS_Calculate2toX (EAS_I32 nCents)
{
EAS_I32 nDents;
EAS_I32 nExponentInt, nExponentFrac;
EAS_I32 nTemp1, nTemp2;
EAS_I32 nResult;
/* check for minimum value */
if (nCents < MIN_CENTS)
return 0;
/* for the time being, convert cents to dents */
nDents = FMUL_15x15(nCents, CENTS_TO_DENTS);
nExponentInt = GET_DENTS_INT_PART(nDents);
nExponentFrac = GET_DENTS_FRAC_PART(nDents);
/*
implement 2^(fracPart) as a power series
*/
nTemp1 = GN2_TO_X2 + MULT_DENTS_COEF(nExponentFrac, GN2_TO_X3);
nTemp2 = GN2_TO_X1 + MULT_DENTS_COEF(nExponentFrac, nTemp1);
nTemp1 = GN2_TO_X0 + MULT_DENTS_COEF(nExponentFrac, nTemp2);
/*
implement 2^(intPart) as
a left shift for intPart >= 0 or
a left shift for intPart < 0
*/
if (nExponentInt >= 0)
{
/* left shift for positive exponents */
/*lint -e{703} <avoid multiply for performance>*/
nResult = nTemp1 << nExponentInt;
}
else
{
/* right shift for negative exponents */
nExponentInt = -nExponentInt;
nResult = nTemp1 >> nExponentInt;
}
return nResult;
}
/*----------------------------------------------------------------------------
* EAS_LogToLinear16()
*----------------------------------------------------------------------------
* Purpose:
* Transform log value to linear gain multiplier using piece-wise linear
* approximation
*
* Inputs:
* nGain - log scale value in 20.10 format. Even though gain is normally
* stored in 6.10 (16-bit) format we use 32-bit numbers here to eliminate
* the need for saturation checking when combining gain values.
*
* Outputs:
* Returns a 16-bit linear value approximately equal to 2^(nGain/1024)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_U16 EAS_LogToLinear16 (EAS_I32 nGain)
{
EAS_INT nExp;
EAS_U16 nTemp;
/* bias to positive */
nGain += 32767;
/* check for infinite attenuation */
if (nGain < 0)
return 0;
/* extract the exponent */
nExp = 31 - (nGain >> 10);
/* check for maximum output */
if (nExp < 0)
return 0x7fff;
/* extract mantissa and restore implied 1 bit */
nTemp = (EAS_U16)((((nGain & 0x3ff) << 4) | 0x4000) >> nExp);
/* use shift to approximate power-of-2 operation */
return nTemp;
}
/*----------------------------------------------------------------------------
* EAS_VolumeToGain()
*----------------------------------------------------------------------------
* Purpose:
* Transform volume control in 1dB increments to gain multiplier
*
* Inputs:
* volume - 100 = 0dB, 99 = -1dB, 0 = -inf
*
* Outputs:
* Returns a 16-bit linear value
*----------------------------------------------------------------------------
*/
EAS_I16 EAS_VolumeToGain (EAS_INT volume)
{
/* check for limits */
if (volume <= 0)
return 0;
if (volume >= 100)
return 0x7fff;
/*lint -e{702} use shift instead of division */
return (EAS_I16) EAS_Calculate2toX((((volume - EAS_MAX_VOLUME) * 204099) >> 10) - 1);
}

View File

@@ -0,0 +1,412 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_math.h
*
* Contents and purpose:
* Contains common math routines for the various audio engines.
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 584 $
* $Date: 2007-03-08 09:49:24 -0800 (Thu, 08 Mar 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MATH_H
#define _EAS_MATH_H
/** coefs for pan, generates sin, cos */
#define COEFF_PAN_G2 -27146 /* -0.82842712474619 = 2 - 4/sqrt(2) */
#define COEFF_PAN_G0 23170 /* 0.707106781186547 = 1/sqrt(2) */
/*
coefficients for approximating
2^x = gn2toX0 + gn2toX1*x + gn2toX2*x^2 + gn2toX3*x^3
where x is a int.frac number representing number of octaves.
Actually, we approximate only the 2^(frac) using the power series
and implement the 2^(int) as a shift, so that
2^x == 2^(int.frac) == 2^(int) * 2^(fract)
== (gn2toX0 + gn2toX1*x + gn2toX2*x^2 + gn2toX3*x^3) << (int)
The gn2toX.. were generated using a best fit for a 3rd
order polynomial, instead of taking the coefficients from
a truncated Taylor (or Maclaurin?) series.
*/
#define GN2_TO_X0 32768 /* 1 */
#define GN2_TO_X1 22833 /* 0.696807861328125 */
#define GN2_TO_X2 7344 /* 0.22412109375 */
#define GN2_TO_X3 2588 /* 0.0789794921875 */
/*----------------------------------------------------------------------------
* Fixed Point Math
*----------------------------------------------------------------------------
* These macros are used for fixed point multiplies. If the processor
* supports fixed point multiplies, replace these macros with inline
* assembly code to improve performance.
*----------------------------------------------------------------------------
*/
/* Fixed point multiply 0.15 x 0.15 = 0.15 returned as 32-bits */
#define FMUL_15x15(a,b) \
/*lint -e(704) <avoid multiply for performance>*/ \
(((EAS_I32)(a) * (EAS_I32)(b)) >> 15)
/* Fixed point multiply 0.7 x 0.7 = 0.15 returned as 32-bits */
#define FMUL_7x7(a,b) \
/*lint -e(704) <avoid multiply for performance>*/ \
(((EAS_I32)(a) * (EAS_I32)(b) ) << 1)
/* Fixed point multiply 0.8 x 0.8 = 0.15 returned as 32-bits */
#define FMUL_8x8(a,b) \
/*lint -e(704) <avoid multiply for performance>*/ \
(((EAS_I32)(a) * (EAS_I32)(b) ) >> 1)
/* Fixed point multiply 0.8 x 1.15 = 0.15 returned as 32-bits */
#define FMUL_8x15(a,b) \
/*lint -e(704) <avoid divide for performance>*/ \
(((EAS_I32)((a) << 7) * (EAS_I32)(b)) >> 15)
/* macros for fractional phase accumulator */
/*
Note: changed the _U32 to _I32 on 03/14/02. This should not
affect the phase calculations, and should allow us to reuse these
macros for other audio sample related math.
*/
#define HARDWARE_BIT_WIDTH 32
#define NUM_PHASE_INT_BITS 1
#define NUM_PHASE_FRAC_BITS 15
#define PHASE_FRAC_MASK (EAS_U32) ((0x1L << NUM_PHASE_FRAC_BITS) -1)
#define GET_PHASE_INT_PART(x) (EAS_U32)((EAS_U32)(x) >> NUM_PHASE_FRAC_BITS)
#define GET_PHASE_FRAC_PART(x) (EAS_U32)((EAS_U32)(x) & PHASE_FRAC_MASK)
#define DEFAULT_PHASE_FRAC 0
#define DEFAULT_PHASE_INT 0
/*
Linear interpolation calculates:
output = (1-frac) * sample[n] + (frac) * sample[n+1]
where conceptually 0 <= frac < 1
For a fixed point implementation, frac is actually an integer value
with an implied binary point one position to the left. The value of
one (unity) is given by PHASE_ONE
one half and one quarter are useful for 4-point linear interp.
*/
#define PHASE_ONE (EAS_I32) (0x1L << NUM_PHASE_FRAC_BITS)
/*
Multiply the signed audio sample by the unsigned fraction.
- a is the signed audio sample
- b is the unsigned fraction (cast to signed int as long as coef
uses (n-1) or less bits, where n == hardware bit width)
*/
#define MULT_AUDIO_COEF(audio,coef) /*lint -e704 <avoid divide for performance>*/ \
(EAS_I32)( \
( \
((EAS_I32)(audio)) * ((EAS_I32)(coef)) \
) \
>> NUM_PHASE_FRAC_BITS \
) \
/* lint +704 <restore checking>*/
/* wet / dry calculation macros */
#define NUM_WET_DRY_FRAC_BITS 7 // 15
#define NUM_WET_DRY_INT_BITS 9 // 1
/* define a 1.0 */
#define WET_DRY_ONE (EAS_I32) ((0x1L << NUM_WET_DRY_FRAC_BITS))
#define WET_DRY_MINUS_ONE (EAS_I32) (~WET_DRY_ONE)
#define WET_DRY_FULL_SCALE (EAS_I32) (WET_DRY_ONE - 1)
#define MULT_AUDIO_WET_DRY_COEF(audio,coef) /*lint -e(702) <avoid divide for performance>*/ \
(EAS_I32)( \
( \
((EAS_I32)(audio)) * ((EAS_I32)(coef)) \
) \
>> NUM_WET_DRY_FRAC_BITS \
)
/* Envelope 1 (EG1) calculation macros */
#define NUM_EG1_INT_BITS 1
#define NUM_EG1_FRAC_BITS 15
/* the max positive gain used in the synth for EG1 */
/* SYNTH_FULL_SCALE_EG1_GAIN must match the value in the dls2eas
converter, otherwise, the values we read from the .eas file are bogus. */
#define SYNTH_FULL_SCALE_EG1_GAIN (EAS_I32) ((0x1L << NUM_EG1_FRAC_BITS) -1)
/* define a 1.0 */
#define EG1_ONE (EAS_I32) ((0x1L << NUM_EG1_FRAC_BITS))
#define EG1_MINUS_ONE (EAS_I32) (~SYNTH_FULL_SCALE_EG1_GAIN)
#define EG1_HALF (EAS_I32) (EG1_ONE/2)
#define EG1_MINUS_HALF (EAS_I32) (EG1_MINUS_ONE/2)
/*
We implement the EG1 using a linear gain value, which means that the
attack segment is handled by incrementing (adding) the linear gain.
However, EG1 treats the Decay, Sustain, and Release differently than
the Attack portion. For Decay, Sustain, and Release, the gain is
linear on dB scale, which is equivalent to exponential damping on
a linear scale. Because we use a linear gain for EG1, we implement
the Decay and Release as multiplication (instead of incrementing
as we did for the attack segment).
Therefore, we need the following macro to implement the multiplication
(i.e., exponential damping) during the Decay and Release segments of
the EG1
*/
#define MULT_EG1_EG1(gain,damping) /*lint -e(704) <avoid divide for performance>*/ \
(EAS_I32)( \
( \
((EAS_I32)(gain)) * ((EAS_I32)(damping)) \
) \
>> NUM_EG1_FRAC_BITS \
)
// Use the following macro specifically for the filter, when multiplying
// the b1 coefficient. The 0 <= |b1| < 2, which therefore might overflow
// in certain conditions because we store b1 as a 1.15 value.
// Instead, we could store b1 as b1p (b1' == b1 "prime") where
// b1p == b1/2, thus ensuring no potential overflow for b1p because
// 0 <= |b1p| < 1
// However, during the filter calculation, we must account for the fact
// that we are using b1p instead of b1, and thereby multiply by
// an extra factor of 2. Rather than multiply by an extra factor of 2,
// we can instead shift the result right by one less, hence the
// modified shift right value of (NUM_EG1_FRAC_BITS -1)
#define MULT_EG1_EG1_X2(gain,damping) /*lint -e(702) <avoid divide for performance>*/ \
(EAS_I32)( \
( \
((EAS_I32)(gain)) * ((EAS_I32)(damping)) \
) \
>> (NUM_EG1_FRAC_BITS -1) \
)
#define SATURATE_EG1(x) /*lint -e{734} saturation operation */ \
((EAS_I32)(x) > SYNTH_FULL_SCALE_EG1_GAIN) ? (SYNTH_FULL_SCALE_EG1_GAIN) : \
((EAS_I32)(x) < EG1_MINUS_ONE) ? (EG1_MINUS_ONE) : (x);
/* use "digital cents" == "dents" instead of cents */
/* we coudl re-use the phase frac macros, but if we do,
we must change the phase macros to cast to _I32 instead of _U32,
because using a _U32 cast causes problems when shifting the exponent
for the 2^x calculation, because right shift a negative values MUST
be sign extended, or else the 2^x calculation is wrong */
/* use "digital cents" == "dents" instead of cents */
#define NUM_DENTS_FRAC_BITS 12
#define NUM_DENTS_INT_BITS (HARDWARE_BIT_WIDTH - NUM_DENTS_FRAC_BITS)
#define DENTS_FRAC_MASK (EAS_I32) ((0x1L << NUM_DENTS_FRAC_BITS) -1)
#define GET_DENTS_INT_PART(x) /*lint -e(704) <avoid divide for performance>*/ \
(EAS_I32)((EAS_I32)(x) >> NUM_DENTS_FRAC_BITS)
#define GET_DENTS_FRAC_PART(x) (EAS_I32)((EAS_I32)(x) & DENTS_FRAC_MASK)
#define DENTS_ONE (EAS_I32) (0x1L << NUM_DENTS_FRAC_BITS)
/* use CENTS_TO_DENTS to convert a value in cents to dents */
#define CENTS_TO_DENTS (EAS_I32) (DENTS_ONE * (0x1L << NUM_EG1_FRAC_BITS) / 1200L) \
/*
For gain, the LFO generates a value that modulates in terms
of dB. However, we use a linear gain value, so we must convert
the LFO value in dB to a linear gain. Normally, we would use
linear gain = 10^x, where x = LFO value in dB / 20.
Instead, we implement 10^x using our 2^x approximation.
because
10^x = 2^(log2(10^x)) = 2^(x * log2(10))
so we need to multiply by log2(10) which is just a constant.
Ah, but just wait -- our 2^x actually doesn't exactly implement
2^x, but it actually assumes that the input is in cents, and within
the 2^x approximation converts its input from cents to octaves
by dividing its input by 1200.
So, in order to convert the LFO gain value in dB to something
that our existing 2^x approximation can use, multiply the LFO gain
by log2(10) * 1200 / 20
The divide by 20 helps convert dB to linear gain, and we might
as well incorporate that operation into this conversion.
Of course, we need to keep some fractional bits, so multiply
the constant by NUM_EG1_FRAC_BITS
*/
/* use LFO_GAIN_TO_CENTS to convert the LFO gain value to cents */
#if 0
#define DOUBLE_LOG2_10 (double) (3.32192809488736) /* log2(10) */
#define DOUBLE_LFO_GAIN_TO_CENTS (double) \
( \
(DOUBLE_LOG2_10) * \
1200.0 / \
20.0 \
)
#define LFO_GAIN_TO_CENTS (EAS_I32) \
( \
DOUBLE_LFO_GAIN_TO_CENTS * \
(0x1L << NUM_EG1_FRAC_BITS) \
)
#endif
#define LFO_GAIN_TO_CENTS (EAS_I32) (1671981156L >> (23 - NUM_EG1_FRAC_BITS))
#define MULT_DENTS_COEF(dents,coef) /*lint -e704 <avoid divide for performance>*/ \
(EAS_I32)( \
( \
((EAS_I32)(dents)) * ((EAS_I32)(coef)) \
) \
>> NUM_DENTS_FRAC_BITS \
) \
/* lint +e704 <restore checking>*/
/* we use 16-bits in the PC per audio sample */
#define BITS_PER_AUDIO_SAMPLE 16
/* we define 1 as 1.0 - 1 LSbit */
#define DISTORTION_ONE (EAS_I32)((0x1L << (BITS_PER_AUDIO_SAMPLE-1)) -1)
#define DISTORTION_MINUS_ONE (EAS_I32)(~DISTORTION_ONE)
/* drive coef is given as int.frac */
#define NUM_DRIVE_COEF_INT_BITS 1
#define NUM_DRIVE_COEF_FRAC_BITS 4
#define MULT_AUDIO_DRIVE(audio,drive) /*lint -e(702) <avoid divide for performance>*/ \
(EAS_I32) ( \
( \
((EAS_I32)(audio)) * ((EAS_I32)(drive)) \
) \
>> NUM_DRIVE_COEF_FRAC_BITS \
)
#define MULT_AUDIO_AUDIO(audio1,audio2) /*lint -e(702) <avoid divide for performance>*/ \
(EAS_I32) ( \
( \
((EAS_I32)(audio1)) * ((EAS_I32)(audio2)) \
) \
>> (BITS_PER_AUDIO_SAMPLE-1) \
)
#define SATURATE(x) \
((((EAS_I32)(x)) > DISTORTION_ONE) ? (DISTORTION_ONE) : \
(((EAS_I32)(x)) < DISTORTION_MINUS_ONE) ? (DISTORTION_MINUS_ONE) : ((EAS_I32)(x)));
/*----------------------------------------------------------------------------
* EAS_Calculate2toX()
*----------------------------------------------------------------------------
* Purpose:
* Calculate 2^x
*
* Inputs:
* nCents - measured in cents
*
* Outputs:
* nResult - int.frac result (where frac has NUM_DENTS_FRAC_BITS)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_I32 EAS_Calculate2toX (EAS_I32 nCents);
/*----------------------------------------------------------------------------
* EAS_LogToLinear16()
*----------------------------------------------------------------------------
* Purpose:
* Transform log value to linear gain multiplier using piece-wise linear
* approximation
*
* Inputs:
* nGain - log scale value in 20.10 format. Even though gain is normally
* stored in 6.10 (16-bit) format we use 32-bit numbers here to eliminate
* the need for saturation checking when combining gain values.
*
* Outputs:
* Returns a 16-bit linear value approximately equal to 2^(nGain/1024)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_U16 EAS_LogToLinear16 (EAS_I32 nGain);
/*----------------------------------------------------------------------------
* EAS_VolumeToGain()
*----------------------------------------------------------------------------
* Purpose:
* Transform volume control in 1dB increments to gain multiplier
*
* Inputs:
* volume - 100 = 0dB, 99 = -1dB, 0 = -inf
*
* Outputs:
* Returns a 16-bit linear value
*----------------------------------------------------------------------------
*/
EAS_I16 EAS_VolumeToGain (EAS_INT volume);
/*----------------------------------------------------------------------------
* EAS_fsqrt()
*----------------------------------------------------------------------------
* Purpose:
* Calculates the square root of a 32-bit fixed point value
*
* Inputs:
* n = value of interest
*
* Outputs:
* returns the square root of n
*
*----------------------------------------------------------------------------
*/
EAS_U16 EAS_fsqrt (EAS_U32 n);
/*----------------------------------------------------------------------------
* EAS_flog2()
*----------------------------------------------------------------------------
* Purpose:
* Calculates the log2 of a 32-bit fixed point value
*
* Inputs:
* n = value of interest
*
* Outputs:
* returns the log2 of n
*
*----------------------------------------------------------------------------
*/
EAS_I32 EAS_flog2 (EAS_U32 n);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,295 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_mdls.h
*
* Contents and purpose:
* Declarations, interfaces, and prototypes for eas_mdls.c
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MDLS_H
#define _EAS_MDLS_H
/*------------------------------------
* includes
*------------------------------------
*/
#include "eas_data.h"
/*------------------------------------
* Some defines for dls.h
*------------------------------------
*/
#ifndef DWORD
#define DWORD EAS_I32
#define FAR
#define SHORT EAS_I16
#define USHORT EAS_U16
#define LONG EAS_I32
#define ULONG EAS_U32
#endif
/* GUID struct (call it DLSID in case GUID is defined elsewhere) */
typedef struct
{
EAS_U32 Data1;
EAS_U16 Data2;
EAS_U16 Data3;
EAS_U8 Data4[8];
} DLSID;
#define DEFINE_DLSID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) const DLSID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
/*------------------------------------
* defines
*------------------------------------
*/
/* maximum sample memory for DLS query support */
#ifndef MAX_DLS_MEMORY
#define MAX_DLS_MEMORY 65536
#endif
/* size of conditional chunk stack */
#ifndef CDL_STACK_SIZE
#define CDL_STACK_SIZE 8
#endif
/* size of read buffer for sample conversion */
#ifndef SAMPLE_CONVERT_CHUNK_SIZE
#define SAMPLE_CONVERT_CHUNK_SIZE 32
#endif
#define ZERO_TIME_IN_CENTS -32768
/* Pan calculation macros */
#define PAN_CONVERSION_FACTOR 4129
#define MAX_PAN_VALUE 63
#define MIN_PAN_VALUE -63
/* multiplier to convert time cents to 10-bit fraction log for EAS_LogToLinear16 */
#define TIME_CENTS_TO_LOG2 27962
/* conversion factor sustain level from percent to exponent for LogToLinear16 */
#define SUSTAIN_LOG_CONVERSION_FACTOR 536871
#define SUSTAIN_LOG_CONVERSION_SHIFT 15
/* conversion factor sustain level from percent to EG full scale */
#define SUSTAIN_LINEAR_CONVERSION_FACTOR 1073709
/* conversion factor to convert frame period to decay rate */
#define DECAY_CONVERSION_FACTOR -16
/*----------------------------------------------------------------------------
* These macros define the various characteristics of the defined sample rates
*----------------------------------------------------------------------------
* DLS_ATTACK_TIME_CONVERT log offset for conversion from time cents to attack rate
* DLS_LFO_FREQUENCY_CONVERT pitch-cents offset for LFO frequency conversion
*----------------------------------------------------------------------------
*/
#if defined (_SAMPLE_RATE_8000)
#define DLS_RATE_CONVERT -9559
#define DLS_LFO_FREQUENCY_CONVERT 5921
#elif defined (_SAMPLE_RATE_16000)
#define DLS_RATE_CONVERT -9559
#define DLS_LFO_FREQUENCY_CONVERT 5921
#elif defined (_SAMPLE_RATE_20000)
#define DLS_RATE_CONVERT -8745
#define DLS_LFO_FREQUENCY_CONVERT 5108
#elif defined (_SAMPLE_RATE_22050)
#define DLS_RATE_CONVERT -8914
#define DLS_LFO_FREQUENCY_CONVERT 5277
#elif defined (_SAMPLE_RATE_24000)
#define DLS_RATE_CONVERT -9061
#define DLS_LFO_FREQUENCY_CONVERT 5423
#elif defined (_SAMPLE_RATE_32000)
#define DLS_RATE_CONVERT -9559
#define DLS_LFO_FREQUENCY_CONVERT 5921
#elif defined (_SAMPLE_RATE_44100)
#define DLS_RATE_CONVERT -8914
#define DLS_LFO_FREQUENCY_CONVERT 5277
#elif defined (_SAMPLE_RATE_48000)
#define DLS_RATE_CONVERT -9061
#define DLS_LFO_FREQUENCY_CONVERT 5423
#else
#error "_SAMPLE_RATE_XXXXX must be defined to valid rate"
#endif
/*
* FILTER_Q_CONVERSION_FACTOR convers the 0.1dB steps in the DLS
* file to our internal 0.75 dB steps. The value is calculated
* as follows:
*
* 32768 / (10 * <step-size in dB>)
*
* FILTER_RESONANCE_NUM_ENTRIES is the number of entries in the table
*/
#define FILTER_Q_CONVERSION_FACTOR 4369
#define FILTER_RESONANCE_NUM_ENTRIES 31
/*
* Multiplier to convert DLS gain units (10ths of a dB) to a
* power-of-two exponent for conversion to linear gain using our
* piece-wise linear approximator. Note that we ignore the lower
* 16-bits of the DLS gain value. The result is a 10-bit fraction
* that works with the EAS_LogToLinear16 function.
*
* DLS_GAIN_FACTOR = (2^18) / (200 * log10(2))
*/
#define DLS_GAIN_FACTOR 4354
#define DLS_GAIN_SHIFT 8
/*
* Reciprocal of 10 for quick divide by 10's
*
* DLS_GAIN_FACTOR = (2^18) / (200 * log10(2))
*/
#define DLS_DIV_10_FACTOR 3277
#define DLS_DIV_10_SHIFT 16
/*
* Multiplier to convert DLS time cents units to a power-of-two
* exponent for conversion to absolute time units using our
* piece-wise linear approximator.
*
* DLS_TIME_FACTOR = (2^22) / 1200
*/
#define DLS_TIME_FACTOR 3495
#define DLS_TIME_SHIFT 22
/* LFO limits */
#define MAX_LFO_FREQUENCY_IN_HERTZ 20
#define MIN_LFO_FREQUENCY_IN_HERTZ 0.1
#define MAX_LFO_FREQUENCY_IN_PITCHCENTS 1549
#define MIN_LFO_FREQUENCY_IN_PITCHCENTS -7624
#define MAX_LFO_AMPLITUDE_DEPTH 12 /* in dB, DLS2.1 p 31*/
#define MIN_LFO_AMPLITUDE_DEPTH -12 /* in dB, DLS2.1 p 31*/
/* add to pitch cents before pow(2.0, n) to convert to frequency */
#define ABSOLUTE_PITCH_BIAS 238395828
#define A5_PITCH_OFFSET 6900
/*
CHUNK_TYPE is a macro that converts the 4 input args into a 32-bit int
where
argument a is placed at the MSB location and
argument d is placed at the LSB location.
This is useful for determining the DLS chunk types
*/
#define CHUNK_TYPE(a,b,c,d) ( \
( ((EAS_U32)(a) & 0xFF) << 24 ) \
+ ( ((EAS_U32)(b) & 0xFF) << 16 ) \
+ ( ((EAS_U32)(c) & 0xFF) << 8 ) \
+ ( ((EAS_U32)(d) & 0xFF) ) )
#define CHUNK_RIFF CHUNK_TYPE('R','I','F','F')
#define CHUNK_DLS CHUNK_TYPE('D','L','S',' ')
#define CHUNK_CDL CHUNK_TYPE('c','d','l',' ')
#define CHUNK_VERS CHUNK_TYPE('v','e','r','s')
#define CHUNK_DLID CHUNK_TYPE('d','l','i','d')
#define CHUNK_LIST CHUNK_TYPE('L','I','S','T')
#define CHUNK_COLH CHUNK_TYPE('c','o','l','h')
#define CHUNK_LINS CHUNK_TYPE('l','i','n','s')
#define CHUNK_PTBL CHUNK_TYPE('p','t','b','l')
#define CHUNK_WVPL CHUNK_TYPE('w','v','p','l')
#define CHUNK_INFO CHUNK_TYPE('I','N','F','O')
#define CHUNK_INAM CHUNK_TYPE('I','N','A','M')
#define CHUNK_INS CHUNK_TYPE('i','n','s',' ')
#define CHUNK_INSH CHUNK_TYPE('i','n','s','h')
#define CHUNK_LRGN CHUNK_TYPE('l','r','g','n')
#define CHUNK_RGN CHUNK_TYPE('r','g','n',' ')
#define CHUNK_RGN2 CHUNK_TYPE('r','g','n','2')
#define CHUNK_RGNH CHUNK_TYPE('r','g','n','h')
#define CHUNK_WSMP CHUNK_TYPE('w','s','m','p')
#define CHUNK_WLNK CHUNK_TYPE('w','l','n','k')
#define CHUNK_LART CHUNK_TYPE('l','a','r','t')
#define CHUNK_LAR2 CHUNK_TYPE('l','a','r','2')
#define CHUNK_ART1 CHUNK_TYPE('a','r','t','1')
#define CHUNK_ART2 CHUNK_TYPE('a','r','t','2')
#define CHUNK_WAVE CHUNK_TYPE('w','a','v','e')
#define CHUNK_FMT CHUNK_TYPE('f','m','t',' ')
#define CHUNK_DATA CHUNK_TYPE('d','a','t','a')
#define CHUNK_DMPR CHUNK_TYPE('d','m','p','r')
#define WAVE_FORMAT_PCM 0x0001 /* Microsoft PCM format, see DLS2.1 p60 */
#define WAVE_FORMAT_EXTENSIBLE 0xffff
/* defines for wave table structures */
/* initialize each articulation structure to a harmless state */
/* change art values after we've determined EAS internals */
#define DEFAULT_DLS_FILTER_CUTOFF_FREQUENCY 0x7FFF /* DLS2.1, p 31 means leave filter off */
/**********/
/* define the waves that we expect to generate instead of store */
/* NOTE: our comparison routine converts the input string
to lowercase, so the following comparison values should all
be in lowercase.
*/
#define STRING_NOISE "noise"
/*------------------------------------
* type definitions
*------------------------------------
*/
#ifdef _STANDALONE_CONVERTER
typedef struct s_dls_params
{
EAS_INT sampleRate;
EAS_INT samplesPerFrame;
EAS_INT bitDepth;
double ditherLevel;
double ditherFilterCoeff;
EAS_BOOL compatibility;
EAS_BOOL encodeADPCM;
} S_DLS_PARAMS;
#endif
/* function prototypes */
EAS_RESULT DLSParser (EAS_HW_DATA_HANDLE hwInstData, EAS_FILE_HANDLE fileHandle, EAS_I32 offset, S_DLS **pDLS);
EAS_RESULT DLSCleanup (EAS_HW_DATA_HANDLE hwInstData, S_DLS *pDLS);
void DLSAddRef (S_DLS *pDLS);
EAS_I16 ConvertDelay (EAS_I32 timeCents);
EAS_I16 ConvertRate (EAS_I32 timeCents);
#ifdef _STANDALONE_CONVERTER
void DLSConvParams (S_DLS_PARAMS *pParams, EAS_BOOL set);
#endif
#endif

View File

@@ -0,0 +1,569 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_midi.c
*
* Contents and purpose:
* This file implements the MIDI stream parser. It is called by eas_smf.c to parse MIDI messages
* that are streamed out of the file. It can also parse live MIDI streams.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 794 $
* $Date: 2007-08-01 00:08:48 -0700 (Wed, 01 Aug 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_data.h"
#include "eas_report.h"
#include "eas_miditypes.h"
#include "eas_midi.h"
#include "eas_vm_protos.h"
#include "eas_parser.h"
#ifdef JET_INTERFACE
#include "jet_data.h"
#endif
/* state enumerations for ProcessSysExMessage */
typedef enum
{
eSysEx,
eSysExUnivNonRealTime,
eSysExUnivNrtTargetID,
eSysExGMControl,
eSysExUnivRealTime,
eSysExUnivRtTargetID,
eSysExDeviceControl,
eSysExMasterVolume,
eSysExMasterVolLSB,
eSysExSPMIDI,
eSysExSPMIDIchan,
eSysExSPMIDIMIP,
eSysExMfgID1,
eSysExMfgID2,
eSysExMfgID3,
eSysExEnhancer,
eSysExEnhancerSubID,
eSysExEnhancerFeedback1,
eSysExEnhancerFeedback2,
eSysExEnhancerDrive,
eSysExEnhancerWet,
eSysExEOX,
eSysExIgnore
} E_SYSEX_STATES;
/* local prototypes */
static EAS_RESULT ProcessMIDIMessage (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_INT parserMode);
static EAS_RESULT ProcessSysExMessage (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_U8 c, EAS_INT parserMode);
/*----------------------------------------------------------------------------
* EAS_InitMIDIStream()
*----------------------------------------------------------------------------
* Purpose:
* Initializes the MIDI stream state for parsing.
*
* Inputs:
*
* Outputs:
* returns EAS_RESULT (EAS_SUCCESS is OK)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
void EAS_InitMIDIStream (S_MIDI_STREAM *pMIDIStream)
{
pMIDIStream->byte3 = EAS_FALSE;
pMIDIStream->pending = EAS_FALSE;
pMIDIStream->runningStatus = 0;
pMIDIStream->status = 0;
}
/*----------------------------------------------------------------------------
* EAS_ParseMIDIStream()
*----------------------------------------------------------------------------
* Purpose:
* Parses a MIDI input stream character by character. Characters are pushed (rather than pulled)
* so the interface works equally well for both file and stream I/O.
*
* Inputs:
* c - character from MIDI stream
*
* Outputs:
* returns EAS_RESULT (EAS_SUCCESS is OK)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_ParseMIDIStream (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_U8 c, EAS_INT parserMode)
{
/* check for new status byte */
if (c & 0x80)
{
/* save new running status */
if (c < 0xf8)
{
pMIDIStream->runningStatus = c;
pMIDIStream->byte3 = EAS_FALSE;
/* deal with SysEx */
if ((c == 0xf7) || (c == 0xf0))
{
if (parserMode == eParserModeMetaData)
return EAS_SUCCESS;
return ProcessSysExMessage(pEASData, pSynth, pMIDIStream, c, parserMode);
}
/* inform the file parser that we're in the middle of a message */
if ((c < 0xf4) || (c > 0xf6))
pMIDIStream->pending = EAS_TRUE;
}
/* real-time message - ignore it */
return EAS_SUCCESS;
}
/* 3rd byte of a 3-byte message? */
if (pMIDIStream->byte3)
{
pMIDIStream->d2 = c;
pMIDIStream->byte3 = EAS_FALSE;
pMIDIStream->pending = EAS_FALSE;
if (parserMode == eParserModeMetaData)
return EAS_SUCCESS;
return ProcessMIDIMessage(pEASData, pSynth, pMIDIStream, parserMode);
}
/* check for status received */
if (pMIDIStream->runningStatus)
{
/* save new status and data byte */
pMIDIStream->status = pMIDIStream->runningStatus;
/* check for 3-byte messages */
if (pMIDIStream->status < 0xc0)
{
pMIDIStream->d1 = c;
pMIDIStream->pending = EAS_TRUE;
pMIDIStream->byte3 = EAS_TRUE;
return EAS_SUCCESS;
}
/* check for 2-byte messages */
if (pMIDIStream->status < 0xe0)
{
pMIDIStream->d1 = c;
pMIDIStream->pending = EAS_FALSE;
if (parserMode == eParserModeMetaData)
return EAS_SUCCESS;
return ProcessMIDIMessage(pEASData, pSynth, pMIDIStream, parserMode);
}
/* check for more 3-bytes message */
if (pMIDIStream->status < 0xf0)
{
pMIDIStream->d1 = c;
pMIDIStream->pending = EAS_TRUE;
pMIDIStream->byte3 = EAS_TRUE;
return EAS_SUCCESS;
}
/* SysEx message? */
if (pMIDIStream->status == 0xF0)
{
if (parserMode == eParserModeMetaData)
return EAS_SUCCESS;
return ProcessSysExMessage(pEASData, pSynth, pMIDIStream, c, parserMode);
}
/* remaining messages all clear running status */
pMIDIStream->runningStatus = 0;
/* F2 is 3-byte message */
if (pMIDIStream->status == 0xf2)
{
pMIDIStream->byte3 = EAS_TRUE;
return EAS_SUCCESS;
}
}
/* no status byte received, provide a warning, but we should be able to recover */
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_WARNING, "Received MIDI data without a valid status byte: %d\n",c); */ }
pMIDIStream->pending = EAS_FALSE;
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* ProcessMIDIMessage()
*----------------------------------------------------------------------------
* Purpose:
* This function processes a typical MIDI message. All of the data has been received, just need
* to take appropriate action.
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ProcessMIDIMessage (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_INT parserMode)
{
EAS_U8 channel;
channel = pMIDIStream->status & 0x0f;
switch (pMIDIStream->status & 0xf0)
{
case 0x80:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"NoteOff: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
if (parserMode <= eParserModeMute)
VMStopNote(pEASData->pVoiceMgr, pSynth, channel, pMIDIStream->d1, pMIDIStream->d2);
break;
case 0x90:
if (pMIDIStream->d2)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"NoteOn: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
pMIDIStream->flags |= MIDI_FLAG_FIRST_NOTE;
if (parserMode == eParserModePlay)
VMStartNote(pEASData->pVoiceMgr, pSynth, channel, pMIDIStream->d1, pMIDIStream->d2);
}
else
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"NoteOff: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
if (parserMode <= eParserModeMute)
VMStopNote(pEASData->pVoiceMgr, pSynth, channel, pMIDIStream->d1, pMIDIStream->d2);
}
break;
case 0xa0:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"PolyPres: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
break;
case 0xb0:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"Control: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
if (parserMode <= eParserModeMute)
VMControlChange(pEASData->pVoiceMgr, pSynth, channel, pMIDIStream->d1, pMIDIStream->d2);
#ifdef JET_INTERFACE
if (pMIDIStream->jetData & MIDI_FLAGS_JET_CB)
{
JET_Event(pEASData, pMIDIStream->jetData & (JET_EVENT_SEG_MASK | JET_EVENT_TRACK_MASK),
channel, pMIDIStream->d1, pMIDIStream->d2);
}
#endif
break;
case 0xc0:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"Program: %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1); */ }
if (parserMode <= eParserModeMute)
VMProgramChange(pEASData->pVoiceMgr, pSynth, channel, pMIDIStream->d1);
break;
case 0xd0:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"ChanPres: %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1); */ }
if (parserMode <= eParserModeMute)
VMChannelPressure(pSynth, channel, pMIDIStream->d1);
break;
case 0xe0:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"PBend: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
if (parserMode <= eParserModeMute)
VMPitchBend(pSynth, channel, pMIDIStream->d1, pMIDIStream->d2);
break;
default:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL,"Unknown: %02x %02x %02x\n",
pMIDIStream->status, pMIDIStream->d1, pMIDIStream->d2); */ }
}
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* ProcessSysExMessage()
*----------------------------------------------------------------------------
* Purpose:
* Process a SysEx character byte from the MIDI stream. Since we cannot
* simply wait for the next character to arrive, we are forced to save
* state after each character. It would be easier to parse at the file
* level, but then we lose the nice feature of being able to support
* these messages in a real-time MIDI stream.
*
* Inputs:
* pEASData - pointer to synthesizer instance data
* c - character to be processed
* locating - if true, the sequencer is relocating to a new position
*
* Outputs:
*
*
* Side Effects:
*
* Notes:
* These are the SysEx messages we can receive:
*
* SysEx messages
* { f0 7e 7f 09 01 f7 } GM 1 On
* { f0 7e 7f 09 02 f7 } GM 1/2 Off
* { f0 7e 7f 09 03 f7 } GM 2 On
* { f0 7f 7f 04 01 lsb msb } Master Volume
* { f0 7f 7f 0b 01 ch mip [ch mip ...] f7 } SP-MIDI
* { f0 00 01 3a 04 01 fdbk1 fdbk2 drive wet dry f7 } Enhancer
*
*----------------------------------------------------------------------------
*/
static EAS_RESULT ProcessSysExMessage (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_U8 c, EAS_INT parserMode)
{
/* check for start byte */
if (c == 0xf0)
{
pMIDIStream->sysExState = eSysEx;
}
/* check for end byte */
else if (c == 0xf7)
{
/* if this was a MIP message, update the MIP table */
if ((pMIDIStream->sysExState == eSysExSPMIDIchan) && (parserMode != eParserModeMetaData))
VMUpdateMIPTable(pEASData->pVoiceMgr, pSynth);
pMIDIStream->sysExState = eSysExIgnore;
}
/* process SysEx message */
else
{
switch (pMIDIStream->sysExState)
{
case eSysEx:
/* first byte, determine message class */
switch (c)
{
case 0x7e:
pMIDIStream->sysExState = eSysExUnivNonRealTime;
break;
case 0x7f:
pMIDIStream->sysExState = eSysExUnivRealTime;
break;
case 0x00:
pMIDIStream->sysExState = eSysExMfgID1;
break;
default:
pMIDIStream->sysExState = eSysExIgnore;
break;
}
break;
/* process GM message */
case eSysExUnivNonRealTime:
if (c == 0x7f)
pMIDIStream->sysExState = eSysExUnivNrtTargetID;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExUnivNrtTargetID:
if (c == 0x09)
pMIDIStream->sysExState = eSysExGMControl;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExGMControl:
if ((c == 1) || (c == 3))
{
/* GM 1 or GM2 On, reset synth */
if (parserMode != eParserModeMetaData)
{
pMIDIStream->flags |= MIDI_FLAG_GM_ON;
VMReset(pEASData->pVoiceMgr, pSynth, EAS_FALSE);
VMInitMIPTable(pSynth);
}
pMIDIStream->sysExState = eSysExEOX;
}
else
pMIDIStream->sysExState = eSysExIgnore;
break;
/* Process Master Volume and SP-MIDI */
case eSysExUnivRealTime:
if (c == 0x7f)
pMIDIStream->sysExState = eSysExUnivRtTargetID;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExUnivRtTargetID:
if (c == 0x04)
pMIDIStream->sysExState = eSysExDeviceControl;
else if (c == 0x0b)
pMIDIStream->sysExState = eSysExSPMIDI;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
/* process master volume */
case eSysExDeviceControl:
if (c == 0x01)
pMIDIStream->sysExState = eSysExMasterVolume;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExMasterVolume:
/* save LSB */
pMIDIStream->d1 = c;
pMIDIStream->sysExState = eSysExMasterVolLSB;
break;
case eSysExMasterVolLSB:
if (parserMode != eParserModeMetaData)
{
EAS_I32 gain = ((EAS_I32) c << 8) | ((EAS_I32) pMIDIStream->d1 << 1);
gain = (gain * gain) >> 15;
VMSetVolume(pSynth, (EAS_U16) gain);
}
pMIDIStream->sysExState = eSysExEOX;
break;
/* process SP-MIDI MIP message */
case eSysExSPMIDI:
if (c == 0x01)
{
/* assume all channels are muted */
if (parserMode != eParserModeMetaData)
VMInitMIPTable(pSynth);
pMIDIStream->d1 = 0;
pMIDIStream->sysExState = eSysExSPMIDIchan;
}
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExSPMIDIchan:
if (c < NUM_SYNTH_CHANNELS)
{
pMIDIStream->d2 = c;
pMIDIStream->sysExState = eSysExSPMIDIMIP;
}
else
{
/* bad MIP message - unmute channels */
if (parserMode != eParserModeMetaData)
VMInitMIPTable(pSynth);
pMIDIStream->sysExState = eSysExIgnore;
}
break;
case eSysExSPMIDIMIP:
/* process MIP entry here */
if (parserMode != eParserModeMetaData)
VMSetMIPEntry(pEASData->pVoiceMgr, pSynth, pMIDIStream->d2, pMIDIStream->d1, c);
pMIDIStream->sysExState = eSysExSPMIDIchan;
/* if 16 channels received, update MIP table */
if (++pMIDIStream->d1 == NUM_SYNTH_CHANNELS)
{
if (parserMode != eParserModeMetaData)
VMUpdateMIPTable(pEASData->pVoiceMgr, pSynth);
pMIDIStream->sysExState = eSysExEOX;
}
break;
/* process Enhancer */
case eSysExMfgID1:
if (c == 0x01)
pMIDIStream->sysExState = eSysExMfgID1;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExMfgID2:
if (c == 0x3a)
pMIDIStream->sysExState = eSysExMfgID1;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExMfgID3:
if (c == 0x04)
pMIDIStream->sysExState = eSysExEnhancer;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExEnhancer:
if (c == 0x01)
pMIDIStream->sysExState = eSysExEnhancerSubID;
else
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExEnhancerSubID:
pMIDIStream->sysExState = eSysExEnhancerFeedback1;
break;
case eSysExEnhancerFeedback1:
pMIDIStream->sysExState = eSysExEnhancerFeedback2;
break;
case eSysExEnhancerFeedback2:
pMIDIStream->sysExState = eSysExEnhancerDrive;
break;
case eSysExEnhancerDrive:
pMIDIStream->sysExState = eSysExEnhancerWet;
break;
case eSysExEnhancerWet:
pMIDIStream->sysExState = eSysExEOX;
break;
case eSysExEOX:
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Expected F7, received %02x\n", c); */ }
pMIDIStream->sysExState = eSysExIgnore;
break;
case eSysExIgnore:
break;
default:
pMIDIStream->sysExState = eSysExIgnore;
break;
}
}
if (pMIDIStream->sysExState == eSysExIgnore)
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_DETAIL, "Ignoring SysEx byte %02x\n", c); */ }
return EAS_SUCCESS;
} /* end ProcessSysExMessage */

View File

@@ -0,0 +1,71 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_midi.h
*
* Contents and purpose:
* Prototypes for MIDI stream parsing functions
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MIDI_H
#define _EAS_MIDI_H
/*----------------------------------------------------------------------------
* EAS_InitMIDIStream()
*----------------------------------------------------------------------------
* Purpose:
* Initializes the MIDI stream state for parsing.
*
* Inputs:
*
* Outputs:
* returns EAS_RESULT (EAS_SUCCESS is OK)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
void EAS_InitMIDIStream (S_MIDI_STREAM *pMIDIStream);
/*----------------------------------------------------------------------------
* EAS_ParseMIDIStream()
*----------------------------------------------------------------------------
* Purpose:
* Parses a MIDI input stream character by character. Characters are pushed (rather than pulled)
* so the interface works equally well for both file and stream I/O.
*
* Inputs:
* c - character from MIDI stream
*
* Outputs:
* returns EAS_RESULT (EAS_SUCCESS is OK)
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_ParseMIDIStream (S_EAS_DATA *pEASData, S_SYNTH *pSynth, S_MIDI_STREAM *pMIDIStream, EAS_U8 c, EAS_INT parserMode);
#endif /* #define _EAS_MIDI_H */

View File

@@ -0,0 +1,64 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_midictrl.h
*
* Contents and purpose:
* MIDI controller definitions
*
* This header only contains declarations that are specific
* to this implementation.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MIDICTRL_H
#define _EAS_MIDICTRL_H
/* define controller types */
/*
Note that these controller types are specified in base 10 (decimal)
and not in hexadecimal. The above midi messages are specified
in hexadecimal.
*/
#define MIDI_CONTROLLER_BANK_SELECT 0
#define MIDI_CONTROLLER_BANK_SELECT_MSB 0
#define MIDI_CONTROLLER_MOD_WHEEL 1
#define MIDI_CONTROLLER_ENTER_DATA_MSB 6
#define MIDI_CONTROLLER_VOLUME 7
#define MIDI_CONTROLLER_PAN 10
#define MIDI_CONTROLLER_EXPRESSION 11
#define MIDI_CONTROLLER_BANK_SELECT_LSB 32
#define MIDI_CONTROLLER_ENTER_DATA_LSB 38 /* 0x26 */
#define MIDI_CONTROLLER_SUSTAIN_PEDAL 64
#define MIDI_CONTROLLER_SELECT_NRPN_LSB 98
#define MIDI_CONTROLLER_SELECT_NRPN_MSB 99
#define MIDI_CONTROLLER_SELECT_RPN_LSB 100 /* 0x64 */
#define MIDI_CONTROLLER_SELECT_RPN_MSB 101 /* 0x65 */
#define MIDI_CONTROLLER_ALL_SOUND_OFF 120
#define MIDI_CONTROLLER_RESET_CONTROLLERS 121
#define MIDI_CONTROLLER_ALL_NOTES_OFF 123
#define MIDI_CONTROLLER_OMNI_OFF 124
#define MIDI_CONTROLLER_OMNI_ON 125
#define MIDI_CONTROLLER_MONO_ON_POLY_OFF 126
#define MIDI_CONTROLLER_POLY_ON_MONO_OFF 127
#endif /* #ifndef _EAS_MIDICTRL_H */

View File

@@ -0,0 +1,34 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_mididata.c
*
* Contents and purpose:
* Data module for MIDI stream interface
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_miditypes.h"
S_INTERACTIVE_MIDI eas_MIDIData;

View File

@@ -0,0 +1,138 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_miditypes.h
*
* Contents and purpose:
* Contains declarations for the MIDI stream parser.
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 778 $
* $Date: 2007-07-23 16:45:17 -0700 (Mon, 23 Jul 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MIDITYPES_H
#define _EAS_MIDITYPES_H
#include "eas_data.h"
#include "eas_parser.h"
/*----------------------------------------------------------------------------
* S_MIDI_STREAM
*
* Maintains parser state for the MIDI stream parser
*
*----------------------------------------------------------------------------
*/
typedef struct s_midi_stream_tag
{
EAS_BOOL8 byte3; /* flag indicates 3rd byte expected */
EAS_BOOL8 pending; /* flag indicates more data expected */
EAS_U8 sysExState; /* maintains the SysEx state */
EAS_U8 runningStatus; /* last running status received */
EAS_U8 status; /* status byte */
EAS_U8 d1; /* first data byte */
EAS_U8 d2; /* second data byte */
EAS_U8 flags; /* flags - see below for definition */
#ifdef JET_INTERFACE
EAS_U32 jetData; /* JET data */
#endif
} S_MIDI_STREAM;
/* flags for S_MIDI_STREAM.flags */
#define MIDI_FLAG_GM_ON 0x01 /* GM System On message received */
#define MIDI_FLAG_FIRST_NOTE 0x02 /* first note received */
/* flags for S_MIDI_STREAM.jetFlags */
#define MIDI_FLAGS_JET_MUTE 0x00000001 /* track is muted */
#define MIDI_FLAGS_JET_CB 0x00000002 /* JET callback enabled */
/*----------------------------------------------------------------------------
*
* S_SMF_STREAM
*
* This structure contains data required to parse an SMF stream. For SMF0 files, there
* will be a single instance of this per file. For SMF1 files, there will be multiple instance,
* one for each separate stream in the file.
*
*----------------------------------------------------------------------------
*/
typedef struct s_smf_stream_tag
{
EAS_FILE_HANDLE fileHandle; /* host wrapper file handle */
EAS_U32 ticks; /* time of next event in stream */
EAS_I32 startFilePos; /* start location of track within file */
S_MIDI_STREAM midiStream; /* MIDI stream state */
} S_SMF_STREAM;
/*----------------------------------------------------------------------------
*
* S_SMF_DATA
*
* This structure contains the instance data required to parse an SMF stream.
*
*----------------------------------------------------------------------------
*/
typedef struct s_smf_data_tag
{
#ifdef _CHECKED_BUILD
EAS_U32 handleCheck; /* signature check for checked build */
#endif
S_SMF_STREAM *streams; /* pointer to individual streams in file */
S_SMF_STREAM *nextStream; /* pointer to next stream with event */
S_SYNTH *pSynth; /* pointer to synth */
EAS_FILE_HANDLE fileHandle; /* file handle */
S_METADATA_CB metadata; /* metadata callback */
EAS_I32 fileOffset; /* for embedded files */
EAS_I32 time; /* current time in milliseconds/256 */
EAS_U16 numStreams; /* actual number of streams */
EAS_U16 tickConv; /* current MIDI tick to msec conversion */
EAS_U16 ppqn; /* ticks per quarter note */
EAS_U8 state; /* current state EAS_STATE_XXXX */
EAS_U8 flags; /* flags - see definitions below */
} S_SMF_DATA;
#define SMF_FLAGS_CHASE_MODE 0x01 /* chase mode - skip to first note */
#define SMF_FLAGS_HAS_TIME_SIG 0x02 /* time signature encountered at time 0 */
#define SMF_FLAGS_HAS_TEMPO 0x04 /* tempo encountered at time 0 */
#define SMF_FLAGS_HAS_GM_ON 0x08 /* GM System On encountered at time 0 */
#define SMF_FLAGS_JET_STREAM 0x80 /* JET in use - keep strict timing */
/* combo flags indicate setup bar */
#define SMF_FLAGS_SETUP_BAR (SMF_FLAGS_HAS_TIME_SIG | SMF_FLAGS_HAS_TEMPO | SMF_FLAGS_HAS_GM_ON)
/*----------------------------------------------------------------------------
* Interactive MIDI structure
*----------------------------------------------------------------------------
*/
typedef struct s_interactive_midi_tag
{
#ifdef _CHECKED_BUILD
EAS_U32 handleCheck; /* signature check for checked build */
#endif
S_SYNTH *pSynth; /* pointer to synth */
S_MIDI_STREAM stream; /* stream data */
} S_INTERACTIVE_MIDI;
#endif /* #ifndef _EAS_MIDITYPES_H */

View File

@@ -0,0 +1,36 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_mixbuf.c
*
* Contents and purpose:
* Contains a data allocation for synthesizer
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
// includes
#include "eas_data.h"
#include "eas_mixer.h"
// globals
EAS_I32 eas_MixBuffer[BUFFER_SIZE_IN_MONO_SAMPLES * NUM_OUTPUT_CHANNELS];

View File

@@ -0,0 +1,464 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_mixer.c
*
* Contents and purpose:
* This file contains the critical components of the mix engine that
* must be optimized for best performance.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 706 $
* $Date: 2007-05-31 17:22:51 -0700 (Thu, 31 May 2007) $
*----------------------------------------------------------------------------
*/
//3 dls: This module is in the midst of being converted from a synth
//3 specific module to a general purpose mix engine
/*------------------------------------
* includes
*------------------------------------
*/
#include "eas_data.h"
#include "eas_host.h"
#include "eas_math.h"
#include "eas_mixer.h"
#include "eas_config.h"
#include "eas_report.h"
#ifdef _MAXIMIZER_ENABLED
EAS_I32 MaximizerProcess (EAS_VOID_PTR pInstData, EAS_I32 *pSrc, EAS_I32 *pDst, EAS_I32 numSamples);
#endif
/*------------------------------------
* defines
*------------------------------------
*/
/* need to boost stereo by ~3dB to compensate for the panner */
#define STEREO_3DB_GAIN_BOOST 512
/*----------------------------------------------------------------------------
* EAS_MixEngineInit()
*----------------------------------------------------------------------------
* Purpose:
* Prepares the mix engine for work, allocates buffers, locates effects modules, etc.
*
* Inputs:
* pEASData - instance data
* pInstData - pointer to variable to receive instance data handle
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_MixEngineInit (S_EAS_DATA *pEASData)
{
/* check Configuration Module for mix buffer allocation */
if (pEASData->staticMemoryModel)
pEASData->pMixBuffer = EAS_CMEnumData(EAS_CM_MIX_BUFFER);
else
pEASData->pMixBuffer = EAS_HWMalloc(pEASData->hwInstData, BUFFER_SIZE_IN_MONO_SAMPLES * NUM_OUTPUT_CHANNELS * sizeof(EAS_I32));
if (pEASData->pMixBuffer == NULL)
{
{ /* dpp: EAS_ReportEx(_EAS_SEVERITY_FATAL, "Failed to allocate mix buffer memory\n"); */ }
return EAS_ERROR_MALLOC_FAILED;
}
EAS_HWMemSet((void *)(pEASData->pMixBuffer), 0, BUFFER_SIZE_IN_MONO_SAMPLES * NUM_OUTPUT_CHANNELS * sizeof(EAS_I32));
return EAS_SUCCESS;
}
/*----------------------------------------------------------------------------
* EAS_MixEnginePrep()
*----------------------------------------------------------------------------
* Purpose:
* Performs prep before synthesize a buffer of audio, such as clearing
* audio buffers, etc.
*
* Inputs:
* psEASData - pointer to overall EAS data structure
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
void EAS_MixEnginePrep (S_EAS_DATA *pEASData, EAS_I32 numSamples)
{
/* clear the mix buffer */
#if (NUM_OUTPUT_CHANNELS == 2)
EAS_HWMemSet(pEASData->pMixBuffer, 0, numSamples * (EAS_I32) sizeof(long) * 2);
#else
EAS_HWMemSet(pEASData->pMixBuffer, 0, (EAS_I32) numSamples * (EAS_I32) sizeof(long));
#endif
/* need to clear other side-chain effect buffers (chorus & reverb) */
}
/*----------------------------------------------------------------------------
* EAS_MixEnginePost
*----------------------------------------------------------------------------
* Purpose:
* This routine does the post-processing after all voices have been
* synthesized. It calls any sweeteners and does the final mixdown to
* the output buffer.
*
* Inputs:
*
* Outputs:
*
* Notes:
*----------------------------------------------------------------------------
*/
void EAS_MixEnginePost (S_EAS_DATA *pEASData, EAS_I32 numSamples)
{
EAS_U16 gain;
//3 dls: Need to restore the mix engine metrics
/* calculate the gain multiplier */
#ifdef _MAXIMIZER_ENABLED
if (pEASData->effectsModules[EAS_MODULE_MAXIMIZER].effect)
{
EAS_I32 temp;
temp = MaximizerProcess(pEASData->effectsModules[EAS_MODULE_MAXIMIZER].effectData, pEASData->pMixBuffer, pEASData->pMixBuffer, numSamples);
temp = (temp * pEASData->masterGain) >> 15;
if (temp > 32767)
gain = 32767;
else
gain = (EAS_U16) temp;
}
else
gain = (EAS_U16) pEASData->masterGain;
#else
gain = (EAS_U16) pEASData->masterGain;
#endif
/* Not using all the gain bits for now
* Reduce the input to the compressor by 6dB to prevent saturation
*/
#ifdef _COMPRESSOR_ENABLED
if (pEASData->effectsModules[EAS_MODULE_COMPRESSOR].effectData)
gain = gain >> 5;
else
gain = gain >> 4;
#else
gain = gain >> 4;
#endif
/* convert 32-bit mix buffer to 16-bit output format */
#if (NUM_OUTPUT_CHANNELS == 2)
SynthMasterGain(pEASData->pMixBuffer, pEASData->pOutputAudioBuffer, gain, (EAS_U16) ((EAS_U16) numSamples * 2));
#else
SynthMasterGain(pEASData->pMixBuffer, pEASData->pOutputAudioBuffer, gain, (EAS_U16) numSamples);
#endif
#ifdef _ENHANCER_ENABLED
/* enhancer effect */
if (pEASData->effectsModules[EAS_MODULE_ENHANCER].effectData)
(*pEASData->effectsModules[EAS_MODULE_ENHANCER].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_ENHANCER].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
#ifdef _GRAPHIC_EQ_ENABLED
/* graphic EQ effect */
if (pEASData->effectsModules[EAS_MODULE_GRAPHIC_EQ].effectData)
(*pEASData->effectsModules[EAS_MODULE_GRAPHIC_EQ].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_GRAPHIC_EQ].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
#ifdef _COMPRESSOR_ENABLED
/* compressor effect */
if (pEASData->effectsModules[EAS_MODULE_COMPRESSOR].effectData)
(*pEASData->effectsModules[EAS_MODULE_COMPRESSOR].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_COMPRESSOR].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
#ifdef _WOW_ENABLED
/* WOW requires a 32-bit buffer, borrow the mix buffer and
* pass it as the destination buffer
*/
/*lint -e{740} temporarily passing a parameter through an existing I/F */
if (pEASData->effectsModules[EAS_MODULE_WOW].effectData)
(*pEASData->effectsModules[EAS_MODULE_WOW].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_WOW].effectData,
pEASData->pOutputAudioBuffer,
(EAS_PCM*) pEASData->pMixBuffer,
numSamples);
#endif
#ifdef _TONECONTROLEQ_ENABLED
/* ToneControlEQ effect */
if (pEASData->effectsModules[EAS_MODULE_TONECONTROLEQ].effectData)
(*pEASData->effectsModules[EAS_MODULE_TONECONTROLEQ].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_TONECONTROLEQ].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
#ifdef _REVERB_ENABLED
/* Reverb effect */
if (pEASData->effectsModules[EAS_MODULE_REVERB].effectData)
(*pEASData->effectsModules[EAS_MODULE_REVERB].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_REVERB].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
#ifdef _CHORUS_ENABLED
/* Chorus effect */
if (pEASData->effectsModules[EAS_MODULE_CHORUS].effectData)
(*pEASData->effectsModules[EAS_MODULE_CHORUS].effect->pfProcess)
(pEASData->effectsModules[EAS_MODULE_CHORUS].effectData,
pEASData->pOutputAudioBuffer,
pEASData->pOutputAudioBuffer,
numSamples);
#endif
}
#ifndef NATIVE_EAS_KERNEL
/*----------------------------------------------------------------------------
* SynthMasterGain
*----------------------------------------------------------------------------
* Purpose:
* Mixes down audio from 32-bit to 16-bit target buffer
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
void SynthMasterGain (long *pInputBuffer, EAS_PCM *pOutputBuffer, EAS_U16 nGain, EAS_U16 numSamples) {
/* loop through the buffer */
while (numSamples--) {
long s;
/* read a sample from the input buffer and add some guard bits */
s = *pInputBuffer++;
/* add some guard bits */
/*lint -e{704} <avoid divide for performance>*/
s = s >> 7;
/* apply master gain */
s *= (long) nGain;
/* shift to lower 16-bits */
/*lint -e{704} <avoid divide for performance>*/
s = s >> 9;
/* saturate */
s = SATURATE(s);
*pOutputBuffer++ = (EAS_PCM)s;
}
}
#endif
/*----------------------------------------------------------------------------
* EAS_MixEngineShutdown()
*----------------------------------------------------------------------------
* Purpose:
* Shuts down effects modules and deallocates memory
*
* Inputs:
* pEASData - instance data
* pInstData - instance data handle
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_MixEngineShutdown (S_EAS_DATA *pEASData)
{
/* check Configuration Module for static memory allocation */
if (!pEASData->staticMemoryModel && (pEASData->pMixBuffer != NULL))
EAS_HWFree(pEASData->hwInstData, pEASData->pMixBuffer);
return EAS_SUCCESS;
}
#ifdef UNIFIED_MIXER
#ifndef NATIVE_MIX_STREAM
/*----------------------------------------------------------------------------
* EAS_MixStream
*----------------------------------------------------------------------------
* Mix a 16-bit stream into a 32-bit buffer
*
* pInputBuffer 16-bit input buffer
* pMixBuffer 32-bit mix buffer
* numSamples number of samples to mix
* gainLeft initial gain left or mono
* gainRight initial gain right
* gainLeft left gain increment per sample
* gainRight right gain increment per sample
* flags bit 0 = stereo source
* bit 1 = stereo output
*----------------------------------------------------------------------------
*/
void EAS_MixStream (EAS_PCM *pInputBuffer, EAS_I32 *pMixBuffer, EAS_I32 numSamples, EAS_I32 gainLeft, EAS_I32 gainRight, EAS_I32 gainIncLeft, EAS_I32 gainIncRight, EAS_I32 flags)
{
EAS_I32 temp;
EAS_INT src, dest;
/* NOTE: There are a lot of optimizations that can be done
* in the native implementations based on register
* availability, etc. For example, it may make sense to
* break this down into 8 separate routines:
*
* 1. Mono source to mono output
* 2. Mono source to stereo output
* 3. Stereo source to mono output
* 4. Stereo source to stereo output
* 5. Mono source to mono output - no gain change
* 6. Mono source to stereo output - no gain change
* 7. Stereo source to mono output - no gain change
* 8. Stereo source to stereo output - no gain change
*
* Other possibilities include loop unrolling, skipping
* a gain calculation every 2 or 4 samples, etc.
*/
/* no gain change, use fast loops */
if ((gainIncLeft == 0) && (gainIncRight == 0))
{
switch (flags & (MIX_FLAGS_STEREO_SOURCE | MIX_FLAGS_STEREO_OUTPUT))
{
/* mono to mono */
case 0:
gainLeft >>= 15;
for (src = dest = 0; src < numSamples; src++, dest++)
{
pMixBuffer[dest] += (pInputBuffer[src] * gainLeft) >> NUM_MIXER_GUARD_BITS;
}
break;
/* mono to stereo */
case MIX_FLAGS_STEREO_OUTPUT:
gainLeft >>= 15;
gainRight >>= 15;
for (src = dest = 0; src < numSamples; src++, dest+=2)
{
pMixBuffer[dest] += (pInputBuffer[src] * gainLeft) >> NUM_MIXER_GUARD_BITS;
pMixBuffer[dest+1] += (pInputBuffer[src] * gainRight) >> NUM_MIXER_GUARD_BITS;
}
break;
/* stereo to mono */
case MIX_FLAGS_STEREO_SOURCE:
gainLeft >>= 15;
gainRight >>= 15;
for (src = dest = 0; src < numSamples; src+=2, dest++)
{
temp = (pInputBuffer[src] * gainLeft) >> NUM_MIXER_GUARD_BITS;
temp += ((pInputBuffer[src+1] * gainRight) >> NUM_MIXER_GUARD_BITS);
pMixBuffer[dest] += temp;
}
break;
/* stereo to stereo */
case MIX_FLAGS_STEREO_SOURCE | MIX_FLAGS_STEREO_OUTPUT:
gainLeft >>= 15;
gainRight >>= 15;
for (src = dest = 0; src < numSamples; src+=2, dest+=2)
{
pMixBuffer[dest] += (pInputBuffer[src] * gainLeft) >> NUM_MIXER_GUARD_BITS;
pMixBuffer[dest+1] += (pInputBuffer[src+1] * gainRight) >> NUM_MIXER_GUARD_BITS;
}
break;
}
}
/* gain change - do gain increment */
else
{
switch (flags & (MIX_FLAGS_STEREO_SOURCE | MIX_FLAGS_STEREO_OUTPUT))
{
/* mono to mono */
case 0:
for (src = dest = 0; src < numSamples; src++, dest++)
{
gainLeft += gainIncLeft;
pMixBuffer[dest] += (pInputBuffer[src] * (gainLeft >> 15)) >> NUM_MIXER_GUARD_BITS;
}
break;
/* mono to stereo */
case MIX_FLAGS_STEREO_OUTPUT:
for (src = dest = 0; src < numSamples; src++, dest+=2)
{
gainLeft += gainIncLeft;
gainRight += gainIncRight;
pMixBuffer[dest] += (pInputBuffer[src] * (gainLeft >> 15)) >> NUM_MIXER_GUARD_BITS;
pMixBuffer[dest+1] += (pInputBuffer[src] * (gainRight >> 15)) >> NUM_MIXER_GUARD_BITS;
}
break;
/* stereo to mono */
case MIX_FLAGS_STEREO_SOURCE:
for (src = dest = 0; src < numSamples; src+=2, dest++)
{
gainLeft += gainIncLeft;
gainRight += gainIncRight;
temp = (pInputBuffer[src] * (gainLeft >> 15)) >> NUM_MIXER_GUARD_BITS;
temp += ((pInputBuffer[src+1] * (gainRight >> 15)) >> NUM_MIXER_GUARD_BITS);
pMixBuffer[dest] += temp;
}
break;
/* stereo to stereo */
case MIX_FLAGS_STEREO_SOURCE | MIX_FLAGS_STEREO_OUTPUT:
for (src = dest = 0; src < numSamples; src+=2, dest+=2)
{
gainLeft += gainIncLeft;
gainRight += gainIncRight;
pMixBuffer[dest] += (pInputBuffer[src] * (gainLeft >> 15)) >> NUM_MIXER_GUARD_BITS;
pMixBuffer[dest+1] += (pInputBuffer[src+1] * (gainRight >> 15)) >> NUM_MIXER_GUARD_BITS;
}
break;
}
}
}
#endif
#endif

View File

@@ -0,0 +1,137 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_mixer.h
*
* Contents and purpose:
* This file contains the critical components of the mix engine that
* must be optimized for best performance.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 706 $
* $Date: 2007-05-31 17:22:51 -0700 (Thu, 31 May 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_MIXER_H
#define _EAS_MIXER_H
//3 dls: This module is in the midst of being converted from a synth
//3 specific module to a general purpose mix engine
#define MIX_FLAGS_STEREO_SOURCE 1
#define MIX_FLAGS_STEREO_OUTPUT 2
#define NUM_MIXER_GUARD_BITS 4
#include "eas_effects.h"
extern void SynthMasterGain( long *pInputBuffer, EAS_PCM *pOutputBuffer, EAS_U16 nGain, EAS_U16 nNumLoopSamples);
/*----------------------------------------------------------------------------
* EAS_MixEngineInit()
*----------------------------------------------------------------------------
* Purpose:
* Prepares the mix engine for work, allocates buffers, locates effects modules, etc.
*
* Inputs:
* pEASData - instance data
* pInstData - pointer to variable to receive instance data handle
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_MixEngineInit (EAS_DATA_HANDLE pEASData);
/*----------------------------------------------------------------------------
* EAS_MixEnginePrep()
*----------------------------------------------------------------------------
* Purpose:
* Performs prep before synthesize a buffer of audio, such as clearing
* audio buffers, etc.
*
* Inputs:
* psEASData - pointer to overall EAS data structure
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
void EAS_MixEnginePrep (EAS_DATA_HANDLE pEASData, EAS_I32 nNumSamplesToAdd);
/*----------------------------------------------------------------------------
* EAS_MixEnginePost
*----------------------------------------------------------------------------
* Purpose:
* This routine does the post-processing after all voices have been
* synthesized. It calls any sweeteners and does the final mixdown to
* the output buffer.
*
* Inputs:
*
* Outputs:
*
* Notes:
*----------------------------------------------------------------------------
*/
void EAS_MixEnginePost (EAS_DATA_HANDLE pEASData, EAS_I32 nNumSamplesToAdd);
/*----------------------------------------------------------------------------
* EAS_MixEngineShutdown()
*----------------------------------------------------------------------------
* Purpose:
* Shuts down effects modules and deallocates memory
*
* Inputs:
* pEASData - instance data
* pInstData - instance data handle
*
* Outputs:
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_MixEngineShutdown (EAS_DATA_HANDLE pEASData);
#ifdef UNIFIED_MIXER
/*----------------------------------------------------------------------------
* EAS_MixStream
*----------------------------------------------------------------------------
* Mix a 16-bit stream into a 32-bit buffer
*
* pInputBuffer 16-bit input buffer
* pMixBuffer 32-bit mix buffer
* numSamples number of samples to mix
* gainLeft initial gain left or mono
* gainRight initial gain right
* gainLeft left gain increment per sample
* gainRight right gain increment per sample
* flags bit 0 = stereo source
* bit 1 = stereo output
*----------------------------------------------------------------------------
*/
void EAS_MixStream (EAS_PCM *pInputBuffer, EAS_I32 *pMixBuffer, EAS_I32 numSamples, EAS_I32 gainLeft, EAS_I32 gainRight, EAS_I32 gainIncLeft, EAS_I32 gainIncRight, EAS_I32 flags);
#endif
#endif /* #ifndef _EAS_MIXER_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_otadata..c
*
* Contents and purpose:
* OTA Stream Parser data module for static memory model
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
#include "eas_otadata.h"
/*----------------------------------------------------------------------------
*
* eas_OTAData
*
* Static memory allocation for OTA parser
*----------------------------------------------------------------------------
*/
S_OTA_DATA eas_OTAData;

View File

@@ -0,0 +1,81 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_otadata.h
*
* Contents and purpose:
* OTA File Parser
*
* This file contains data declarations for the OTA parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef EAS_OTADATA_H
#define EAS_OTADATA_H
#include "eas_data.h"
/* definition for state flags */
#define OTA_FLAGS_UNICODE 0x01 /* unicode text */
/*----------------------------------------------------------------------------
*
* S_OTA_DATA
*
* This structure contains the state data for the OTA parser
*----------------------------------------------------------------------------
*/
typedef struct
{
EAS_I32 fileOffset; /* offset to location in file */
EAS_U8 patternLen; /* length of current pattern */
EAS_U8 dataByte; /* previous char from file */
EAS_U8 bitCount; /* bit count in char */
} S_OTA_LOC;
typedef struct
{
EAS_FILE_HANDLE fileHandle; /* file handle */
S_SYNTH *pSynth; /* synth handle */
EAS_I32 fileOffset; /* offset to start of data */
EAS_I32 time; /* current time in 256ths of a msec */
EAS_U32 tick; /* length of 32nd note in 256th of a msec */
EAS_U32 restTicks; /* ticks to rest after current note */
S_OTA_LOC patterns[4]; /* pattern locations */
S_OTA_LOC current; /* current location */
S_OTA_LOC restore; /* previous location */
S_METADATA_CB metadata; /* metadata callback */
EAS_U8 flags; /* bit flags */
EAS_U8 numPatterns; /* number of patterns left in song */
EAS_U8 currentPattern; /* current pattern for loop */
EAS_U8 note; /* MIDI note number */
EAS_U8 octave; /* octave modifier */
EAS_U8 style; /* from STYLE */
EAS_U8 velocity; /* current volume */
EAS_U8 state; /* current state EAS_STATE_XXXX */
EAS_U8 loopCount; /* loop count for pattern */
} S_OTA_DATA;
#endif

View File

@@ -0,0 +1,98 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_pan.c
*
* Contents and purpose:
* Calculates left and right gain multipliers based on a pan value from -63 to +63
*
* NOTES:
* The _CMX_PARSER and _MFI_PARSER preprocessor symbols determine
* whether the parser works for those particular file formats.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#include "eas_pan.h"
#include "eas_math.h"
/*----------------------------------------------------------------------------
* EAS_CalcPanControl()
*----------------------------------------------------------------------------
* Purpose:
* Assign the left and right gain values corresponding to the given pan value.
*
* This routine uses sin/cos approximations for an equal power curve:
*
* sin(x) = (2-4*c)*x^2 + c + x
* cos(x) = (2-4*c)*x^2 + c - x
*
* where c = 1/sqrt(2)
* using the a0 + x*(a1 + x*a2) approach
*
* Inputs:
* pan - pan value (-63 to + 63)
*
* Outputs:
* pGainLeft linear gain multiplier for left channel (15-bit fraction)
* pGainRight linear gain multiplier for left channel (15-bit fraction)
*
* Side Effects:
*----------------------------------------------------------------------------
*/
void EAS_CalcPanControl (EAS_INT pan, EAS_I16 *pGainLeft, EAS_I16 *pGainRight)
{
EAS_INT temp;
EAS_INT netAngle;
/* impose hard limit */
if (pan < -63)
netAngle = -63;
else if (pan > 63)
netAngle = 63;
else
netAngle = pan;
/*lint -e{701} <avoid multiply for performance reasons>*/
netAngle = netAngle << 8;
/* calculate sin */
temp = EG1_ONE + FMUL_15x15(COEFF_PAN_G2, netAngle);
temp = COEFF_PAN_G0 + FMUL_15x15(temp, netAngle);
if (temp > SYNTH_FULL_SCALE_EG1_GAIN)
temp = SYNTH_FULL_SCALE_EG1_GAIN;
else if (temp < 0)
temp = 0;
*pGainRight = (EAS_I16) temp;
/* calculate cos */
temp = -EG1_ONE + FMUL_15x15(COEFF_PAN_G2, netAngle);
temp = COEFF_PAN_G0 + FMUL_15x15(temp, netAngle);
if (temp > SYNTH_FULL_SCALE_EG1_GAIN)
temp = SYNTH_FULL_SCALE_EG1_GAIN;
else if (temp < 0)
temp = 0;
*pGainLeft = (EAS_I16) temp;
}

View File

@@ -0,0 +1,66 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_pan.h
*
* Contents and purpose:
* Calculates left and right gain multipliers based on a pan value from -63 to +63
*
* NOTES:
* The _CMX_PARSER and _MFI_PARSER preprocessor symbols determine
* whether the parser works for those particular file formats.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef EAS_PAN_H
#define _EAS_PAN_H
#include "eas_types.h"
/*----------------------------------------------------------------------------
* EAS_CalcPanControl()
*----------------------------------------------------------------------------
* Purpose:
* Assign the left and right gain values corresponding to the given pan value.
*
* This routine uses sin/cos approximations for an equal power curve:
*
* sin(x) = (2-4*c)*x^2 + c + x
* cos(x) = (2-4*c)*x^2 + c - x
*
* where c = 1/sqrt(2)
* using the a0 + x*(a1 + x*a2) approach
*
* Inputs:
* pan - pan value (-63 to + 63)
*
* Outputs:
* pGainLeft linear gain multiplier for left channel (15-bit fraction)
* pGainRight linear gain multiplier for left channel (15-bit fraction)
*
* Side Effects:
*----------------------------------------------------------------------------
*/
void EAS_CalcPanControl (EAS_INT pan, EAS_I16 *pGainLeft, EAS_I16 *pGainRight);
#endif

View File

@@ -0,0 +1,98 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_parser.h
*
* Contents and purpose:
* Interface declarations for the generic parser interface
*
* This header only contains declarations that are specific
* to this implementation.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 767 $
* $Date: 2007-07-19 13:47:31 -0700 (Thu, 19 Jul 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_PARSER_H
#define _EAS_PARSER_H
#include "eas_types.h"
/* metadata callback */
typedef struct s_metadata_cb_tag
{
EAS_METADATA_CBFUNC callback;
char *buffer;
EAS_VOID_PTR pUserData;
EAS_I32 bufferSize;
} S_METADATA_CB;
/* generic parser interface */
typedef struct
{
EAS_RESULT (* EAS_CONST pfCheckFileType)(struct s_eas_data_tag *pEASData, EAS_FILE_HANDLE fileHandle, EAS_VOID_PTR *ppHandle, EAS_I32 offset);
EAS_RESULT (* EAS_CONST pfPrepare)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (* EAS_CONST pfTime)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_U32 *pTime);
EAS_RESULT (* EAS_CONST pfEvent)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_INT parseMode);
EAS_RESULT (* EAS_CONST pfState)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_STATE *pState);
EAS_RESULT (* EAS_CONST pfClose)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (* EAS_CONST pfReset)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (* EAS_CONST pfPause)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (* EAS_CONST pfResume)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT (* EAS_CONST pfLocate)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 time, EAS_BOOL *pParserLocate);
EAS_RESULT (* EAS_CONST pfSetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
EAS_RESULT (* EAS_CONST pfGetData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
EAS_RESULT (* EAS_CONST pfGetMetaData)(struct s_eas_data_tag *pEASData, EAS_VOID_PTR pInstData, EAS_I32 *pMediaLength);
} S_FILE_PARSER_INTERFACE;
typedef enum
{
eParserModePlay,
eParserModeLocate,
eParserModeMute,
eParserModeMetaData
} E_PARSE_MODE;
typedef enum
{
PARSER_DATA_FILE_TYPE,
PARSER_DATA_PLAYBACK_RATE,
PARSER_DATA_TRANSPOSITION,
PARSER_DATA_VOLUME,
PARSER_DATA_SYNTH_HANDLE,
PARSER_DATA_METADATA_CB,
PARSER_DATA_DLS_COLLECTION,
PARSER_DATA_EAS_LIBRARY,
PARSER_DATA_POLYPHONY,
PARSER_DATA_PRIORITY,
PARSER_DATA_FORMAT,
PARSER_DATA_MEDIA_LENGTH,
PARSER_DATA_JET_CB,
PARSER_DATA_MUTE_FLAGS,
PARSER_DATA_SET_MUTE,
PARSER_DATA_CLEAR_MUTE,
PARSER_DATA_NOTE_COUNT,
PARSER_DATA_MAX_PCM_STREAMS,
PARSER_DATA_GAIN_OFFSET,
PARSER_DATA_PLAY_MODE
} E_PARSER_DATA;
#endif /* #ifndef _EAS_PARSER_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,359 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_pcm.h
*
* Contents and purpose:
* External function prototypes for eas_pcm.c module
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 847 $
* $Date: 2007-08-27 21:30:08 -0700 (Mon, 27 Aug 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_PCM_H
#define _EAS_PCM_H
/* default gain setting - roughly unity gain */
#define PCM_DEFAULT_GAIN_SETTING 0x6000
typedef struct s_pcm_state_tag *EAS_PCM_HANDLE;
typedef void (*EAS_PCM_CALLBACK) (EAS_DATA_HANDLE pEASData, EAS_VOID_PTR cbInstData, EAS_PCM_HANDLE pcmHandle, EAS_STATE state);
/* parameters for EAS_PEOpenStream */
typedef struct s_pcm_open_params_tag
{
EAS_FILE_HANDLE fileHandle;
EAS_I32 decoder;
EAS_U32 sampleRate;
EAS_I32 size;
EAS_U32 loopStart;
EAS_U32 loopSamples;
EAS_I32 blockSize;
EAS_U32 flags;
EAS_U32 envData;
EAS_I16 volume;
EAS_PCM_CALLBACK pCallbackFunc;
EAS_VOID_PTR cbInstData;
} S_PCM_OPEN_PARAMS;
/*----------------------------------------------------------------------------
* EAS_PEInit()
*----------------------------------------------------------------------------
* Purpose:
* Initializes the PCM engine
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEInit (EAS_DATA_HANDLE pEASData);
/*----------------------------------------------------------------------------
* EAS_PEShutdown()
*----------------------------------------------------------------------------
* Purpose:
* Shuts down the PCM engine
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEShutdown (EAS_DATA_HANDLE pEASData);
/*----------------------------------------------------------------------------
* EAS_PEOpenStream()
*----------------------------------------------------------------------------
* Purpose:
* Starts up a PCM playback
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEOpenStream (EAS_DATA_HANDLE pEASData, S_PCM_OPEN_PARAMS *pParams, EAS_PCM_HANDLE *pHandle);
/*----------------------------------------------------------------------------
* EAS_PEContinueStream()
*----------------------------------------------------------------------------
* Purpose:
* Continues a PCM stream
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEContinueStream (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle, EAS_I32 size);
/*----------------------------------------------------------------------------
* EAS_PEGetFileHandle()
*----------------------------------------------------------------------------
* Purpose:
* Returns the file handle of a stream
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEGetFileHandle (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle, EAS_FILE_HANDLE *pFileHandle);
/*----------------------------------------------------------------------------
* EAS_PERender()
*----------------------------------------------------------------------------
* Purpose:
* Render a buffer of PCM audio
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PERender (EAS_DATA_HANDLE pEASData, EAS_I32 numSamples);
/*----------------------------------------------------------------------------
* EAS_PEUpdateParams()
*----------------------------------------------------------------------------
* Purpose:
* Update the pitch and volume parameters using MIDI controls
*
* Inputs:
*
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEUpdateParams (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE pState, EAS_I16 pitch, EAS_I16 gainLeft, EAS_I16 gainRight);
/*----------------------------------------------------------------------------
* EAS_PELocate()
*----------------------------------------------------------------------------
* Purpose:
* This function seeks to the requested place in the file. Accuracy
* is dependent on the sample rate and block size.
*
* Inputs:
* pEASData - pointer to overall EAS data structure
* pState - stream handle
* time - media time in milliseconds
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PELocate (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE pState, EAS_I32 time);
/*----------------------------------------------------------------------------
* EAS_PEUpdateVolume()
*----------------------------------------------------------------------------
* Purpose:
* Update the volume parameters for a PCM stream
*
* Inputs:
* pEASData - pointer to EAS library instance data
* handle - pointer to S_PCM_STATE for this stream
* gainLeft - linear gain multipler in 1.15 fraction format
* gainRight - linear gain multipler in 1.15 fraction format
* initial - initial settings, set current gain
*
* Outputs:
*
*
* Side Effects:
*
* Notes
* In mono mode, leftGain controls the output gain and rightGain is ignored
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pEASData) reserved for future use */
EAS_RESULT EAS_PEUpdateVolume (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE pState, EAS_I16 volume);
/*----------------------------------------------------------------------------
* EAS_PEUpdatePitch()
*----------------------------------------------------------------------------
* Purpose:
* Update the pitch parameter for a PCM stream
*
* Inputs:
* pEASData - pointer to EAS library instance data
* pState - pointer to S_PCM_STATE for this stream
* pitch - new pitch value in pitch cents
*----------------------------------------------------------------------------
*/
/*lint -esym(715, pEASData) reserved for future use */
EAS_RESULT EAS_PEUpdatePitch (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE pState, EAS_I16 pitch);
/*----------------------------------------------------------------------------
* EAS_PEState()
*----------------------------------------------------------------------------
* Purpose:
* Returns the current state of the stream
*
* Inputs:
* pEASData - pointer to overall EAS data structure
* handle - pointer to file handle
* pState - pointer to variable to store state
*
* Outputs:
*
*
* Side Effects:
*
* Notes:
* This interface is also exposed in the internal library for use by the other modules.
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEState (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle, EAS_STATE *pState);
/*----------------------------------------------------------------------------
* EAS_PEClose()
*----------------------------------------------------------------------------
* Purpose:
* Close the file and clean up
*
* Inputs:
* pEASData - pointer to overall EAS data structure
* handle - pointer to file handle
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEClose (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle);
/*----------------------------------------------------------------------------
* EAS_PEReset()
*----------------------------------------------------------------------------
* Purpose:
* Reset the sequencer. Used for locating backwards in the file.
*
* Inputs:
* pEASData - pointer to overall EAS data structure
* handle - pointer to file handle
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEReset (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle);
/*----------------------------------------------------------------------------
* EAS_PEPause()
*----------------------------------------------------------------------------
* Purpose:
* Mute and pause rendering a PCM stream. Sets the gain target to zero and stops the playback
* at the end of the next audio frame.
*
* Inputs:
* pEASData - pointer to EAS library instance data
* handle - pointer to S_PCM_STATE for this stream
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEPause (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle);
/*----------------------------------------------------------------------------
* EAS_PEResume()
*----------------------------------------------------------------------------
* Purpose:
* Resume rendering a PCM stream. Sets the gain target back to its
* previous setting and restarts playback at the end of the next audio
* frame.
*
* Inputs:
* pEASData - pointer to EAS library instance data
* handle - pointer to S_PCM_STATE for this stream
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PEResume (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle);
/*----------------------------------------------------------------------------
* EAS_PERelease()
*----------------------------------------------------------------------------
* Purpose:
* Put the PCM stream envelope into release.
*
* Inputs:
* pEASData - pointer to EAS library instance data
* handle - pointer to S_PCM_STATE for this stream
*
* Outputs:
*
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PERelease (EAS_DATA_HANDLE pEASData, EAS_PCM_HANDLE handle);
#endif /* end _EAS_PCM_H */

View File

@@ -0,0 +1,35 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_pcmdata.c
*
* Contents and purpose:
* Contains the static data for the PCM engine.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_data.h"
/* static data allocation */
S_PCM_STATE eas_PCMData[MAX_PCM_STREAMS];

View File

@@ -0,0 +1,157 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_pcmdata.h
*
* Contents and purpose:
* Data declarations for the PCM engine
*
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 847 $
* $Date: 2007-08-27 21:30:08 -0700 (Mon, 27 Aug 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_PCMDATA_H
#define _EAS_PCMDATA_H
/* sets the maximum number of simultaneous PCM streams */
#ifndef MAX_PCM_STREAMS
#define MAX_PCM_STREAMS 16
#define PCM_STREAM_THRESHOLD (MAX_PCM_STREAMS - 4)
#endif
/* coefficents for high-pass filter in ADPCM */
#define INTEGRATOR_COEFFICIENT 100 /* coefficient for leaky integrator */
/* additional flags in S_PCM_STATE.flags used internal to module */
#define PCM_FLAGS_EMPTY 0x01000000 /* unsigned format */
/*----------------------------------------------------------------------------
* S_PCM_STATE
*
* Retains state information for PCM streams.
*----------------------------------------------------------------------------
*/
typedef struct s_decoder_state_tag
{
EAS_I32 output; /* last output for DC offset filter */
EAS_I32 acc; /* accumulator for DC offset filter */
EAS_I32 step; /* current ADPCM step size */
EAS_PCM x1; /* current generated sample */
EAS_PCM x0; /* previous generated sample */
} S_DECODER_STATE;
typedef enum
{
PCM_ENV_START = 0,
PCM_ENV_ATTACK,
PCM_ENV_DECAY,
PCM_ENV_SUSTAIN,
PCM_ENV_RELEASE,
PCM_ENV_END
} E_PCM_ENV_STATE;
typedef struct s_pcm_state_tag
{
#ifdef _CHECKED_BUILD
EAS_U32 handleCheck; /* signature check for checked build */
#endif
EAS_FILE_HANDLE fileHandle; /* pointer to input file */
EAS_PCM_CALLBACK pCallback; /* pointer to callback function */
EAS_VOID_PTR cbInstData; /* instance data for callback function */
struct s_decoder_interface_tag EAS_CONST * pDecoder; /* pointer to decoder interface */
EAS_STATE state; /* stream state */
EAS_I32 time; /* media time */
EAS_I32 startPos; /* start of PCM stream */
EAS_I32 loopLocation; /* file location where loop starts */
EAS_I32 byteCount; /* size of file */
EAS_U32 loopStart; /* loop start, offset in samples from startPos */
/* NOTE: For CMF, we use this to store total sample size */
EAS_U32 loopSamples; /* total loop length, in samples, 0 means no loop */
/* NOTE: For CMF, non-zero means looped */
EAS_U32 samplesInLoop; /* samples left in the loop to play back */
EAS_I32 samplesTilLoop; /* samples left to play until top of loop */
EAS_I32 bytesLeft; /* count of bytes left in stream */
EAS_I32 bytesLeftLoop; /* count of bytes left in stream, value at start of loop */
EAS_U32 phase; /* current phase for interpolator */
EAS_U32 basefreq; /* frequency multiplier */
EAS_U32 flags; /* stream flags */
EAS_U32 envData; /* envelope data (and LFO data) */
EAS_U32 envValue; /* current envelope value */
EAS_U32 envScale; /* current envelope scale */
EAS_U32 startOrder; /* start order index, first is 0, next is 1, etc. */
S_DECODER_STATE decoderL; /* left (mono) ADPCM state */
S_DECODER_STATE decoderR; /* right ADPCM state */
S_DECODER_STATE decoderLLoop; /* left (mono) ADPCM state, value at start of loop */
S_DECODER_STATE decoderRLoop; /* right ADPCM state, value at start of loop */
E_PCM_ENV_STATE envState; /* current envelope state */
EAS_I16 volume; /* volume for stream */
EAS_I16 pitch; /* relative pitch in cents - zero is unity playback */
EAS_I16 gainLeft; /* requested gain */
EAS_I16 gainRight; /* requested gain */
EAS_I16 currentGainLeft; /* current gain for anti-zipper filter */
EAS_I16 currentGainRight; /* current gain for anti-zipper filter */
EAS_U16 blockSize; /* block size for ADPCM decoder */
EAS_U16 blockCount; /* block counter for ADPCM decoder */
EAS_U16 sampleRate; /* input sample rate */
EAS_U8 srcByte; /* source byte */
EAS_U8 msBitCount; /* count keeps track of MS bits */
EAS_U8 msBitMask; /* mask keeps track of MS bits */
EAS_U8 msBitValue; /* value keeps track of MS bits */
EAS_U8 msBitCountLoop; /* count keeps track of MS bits, value at loop start */
EAS_U8 msBitMaskLoop; /* mask keeps track of MS bits, value at loop start */
EAS_U8 msBitValueLoop; /* value keeps track of MS bits, value at loop start */
EAS_BOOL8 hiNibble; /* indicates high/low nibble is next */
EAS_BOOL8 hiNibbleLoop; /* indicates high/low nibble is next, value loop start */
EAS_U8 rateShift; /* for playback rate greater than 1.0 */
} S_PCM_STATE;
/*----------------------------------------------------------------------------
* S_DECODER_INTERFACE
*
* Generic interface for audio decoders
*----------------------------------------------------------------------------
*/
typedef struct s_decoder_interface_tag
{
EAS_RESULT (* EAS_CONST pfInit)(EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
EAS_RESULT (* EAS_CONST pfDecodeSample)(EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
EAS_RESULT (* EAS_CONST pfLocate)(EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 time);
} S_DECODER_INTERFACE;
/* header chunk for SMAF ADPCM */
#define TAG_YAMAHA_ADPCM 0x4d776100
#define TAG_MASK 0xffffff00
#define TAG_RIFF_FILE 0x52494646
#define TAG_WAVE_CHUNK 0x57415645
#define TAG_FMT_CHUNK 0x666d7420
/*----------------------------------------------------------------------------
* EAS_PESeek
*----------------------------------------------------------------------------
* Purpose:
* Locate to a particular byte in a PCM stream
*----------------------------------------------------------------------------
*/
EAS_RESULT EAS_PESeek (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 *pLocation);
#endif /* _EAS_PCMDATA_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,34 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_reverbdata.c
*
* Contents and purpose:
* Contains the static data allocation for the Reverb effect
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 550 $
* $Date: 2007-02-02 09:37:03 -0800 (Fri, 02 Feb 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_reverbdata.h"
S_REVERB_OBJECT eas_ReverbData;

View File

@@ -0,0 +1,486 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_reverbdata.h
*
* Contents and purpose:
* Contains the prototypes for the Reverb effect.
*
*
* Copyright Sonic Network Inc. 2006
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 499 $
* $Date: 2006-12-11 16:07:20 -0800 (Mon, 11 Dec 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_REVERBDATA_H
#define _EAS_REVERBDATA_H
#include "eas_types.h"
#include "eas_audioconst.h"
/*------------------------------------
* defines
*------------------------------------
*/
/*
CIRCULAR() calculates the array index using modulo arithmetic.
The "trick" is that modulo arithmetic is simplified by masking
the effective address where the mask is (2^n)-1. This only works
if the buffer size is a power of two.
*/
#define CIRCULAR(base,offset,size) (EAS_U32)( \
( \
((EAS_I32)(base)) + ((EAS_I32)(offset)) \
) \
& size \
)
/* reverb parameters are updated every 2^(REVERB_UPDATE_PERIOD_IN_BITS) samples */
#if defined (_SAMPLE_RATE_8000)
#define REVERB_UPDATE_PERIOD_IN_BITS 5
#define REVERB_BUFFER_SIZE_IN_SAMPLES 2048
#elif defined (_SAMPLE_RATE_16000)
#define REVERB_UPDATE_PERIOD_IN_BITS 6
#define REVERB_BUFFER_SIZE_IN_SAMPLES 4096
#elif defined (_SAMPLE_RATE_22050)
#define REVERB_UPDATE_PERIOD_IN_BITS 7
#define REVERB_BUFFER_SIZE_IN_SAMPLES 4096
#elif defined (_SAMPLE_RATE_32000)
#define REVERB_UPDATE_PERIOD_IN_BITS 7
#define REVERB_BUFFER_SIZE_IN_SAMPLES 8192
#elif defined (_SAMPLE_RATE_44100)
#define REVERB_UPDATE_PERIOD_IN_BITS 8
#define REVERB_BUFFER_SIZE_IN_SAMPLES 8192
#elif defined (_SAMPLE_RATE_48000)
#define REVERB_UPDATE_PERIOD_IN_BITS 8
#define REVERB_BUFFER_SIZE_IN_SAMPLES 8192
#endif
// Define a mask for circular addressing, so that array index
// can wraparound and stay in array boundary of 0, 1, ..., (buffer size -1)
// The buffer size MUST be a power of two
#define REVERB_BUFFER_MASK (REVERB_BUFFER_SIZE_IN_SAMPLES -1)
#define REVERB_MAX_ROOM_TYPE 4 // any room numbers larger than this are invalid
#define REVERB_MAX_NUM_REFLECTIONS 5 // max num reflections per channel
/* synth parameters are updated every SYNTH_UPDATE_PERIOD_IN_SAMPLES */
#define REVERB_UPDATE_PERIOD_IN_SAMPLES (EAS_I32)(0x1L << REVERB_UPDATE_PERIOD_IN_BITS)
/*
calculate the update counter by bitwise ANDING with this value to
generate a 2^n modulo value
*/
#define REVERB_MODULO_UPDATE_PERIOD_IN_SAMPLES (EAS_I32)(REVERB_UPDATE_PERIOD_IN_SAMPLES -1)
/* synth parameters are updated every SYNTH_UPDATE_PERIOD_IN_SECONDS seconds */
#define REVERB_UPDATE_PERIOD_IN_SECONDS (REVERB_UPDATE_PERIOD_IN_SAMPLES / _OUTPUT_SAMPLE_RATE)
// xfade parameters
#define REVERB_XFADE_PERIOD_IN_SECONDS (100.0 / 1000.0) // xfade once every this many seconds
#define REVERB_XFADE_PERIOD_IN_SAMPLES (REVERB_XFADE_PERIOD_IN_SECONDS * _OUTPUT_SAMPLE_RATE)
#define REVERB_XFADE_PHASE_INCREMENT (EAS_I16)(65536 / ((EAS_I16)REVERB_XFADE_PERIOD_IN_SAMPLES/(EAS_I16)REVERB_UPDATE_PERIOD_IN_SAMPLES))
/**********/
/* the entire synth uses various flags in a bit field */
/* if flag is set, synth reset has been requested */
#define REVERB_FLAG_RESET_IS_REQUESTED 0x01 /* bit 0 */
#define MASK_REVERB_RESET_IS_REQUESTED 0x01
#define MASK_REVERB_RESET_IS_NOT_REQUESTED (EAS_U32)(~MASK_REVERB_RESET_IS_REQUESTED)
/*
by default, we always want to update ALL channel parameters
when we reset the synth (e.g., during GM ON)
*/
#define DEFAULT_REVERB_FLAGS 0x0
/* coefficients for generating sin, cos */
#define REVERB_PAN_G2 4294940151 /* -0.82842712474619 = 2 - 4/sqrt(2) */
/*
EAS_I32 nPanG1 = +1.0 for sin
EAS_I32 nPanG1 = -1.0 for cos
*/
#define REVERB_PAN_G0 23170 /* 0.707106781186547 = 1/sqrt(2) */
/*************************************************************/
// define the input injection points
#define GUARD 5 // safety guard of this many samples
#define MAX_AP_TIME (double) (20.0/1000.0) // delay time in milliseconds
#define MAX_DELAY_TIME (double) (65.0/1000.0) // delay time in milliseconds
#define MAX_AP_SAMPLES (int)(((double) MAX_AP_TIME) * ((double) _OUTPUT_SAMPLE_RATE))
#define MAX_DELAY_SAMPLES (int)(((double) MAX_DELAY_TIME) * ((double) _OUTPUT_SAMPLE_RATE))
#define AP0_IN 0
#define AP1_IN (AP0_IN + MAX_AP_SAMPLES + GUARD)
#define DELAY0_IN (AP1_IN + MAX_AP_SAMPLES + GUARD)
#define DELAY1_IN (DELAY0_IN + MAX_DELAY_SAMPLES + GUARD)
// Define the max offsets for the end points of each section
// i.e., we don't expect a given section's taps to go beyond
// the following limits
#define AP0_OUT (AP0_IN + MAX_AP_SAMPLES -1)
#define AP1_OUT (AP1_IN + MAX_AP_SAMPLES -1)
#define DELAY0_OUT (DELAY0_IN + MAX_DELAY_SAMPLES -1)
#define DELAY1_OUT (DELAY1_IN + MAX_DELAY_SAMPLES -1)
#define REVERB_DEFAULT_ROOM_NUMBER 1 // default preset number
#define DEFAULT_AP0_LENGTH (int)(((double) (17.0/1000.0)) * ((double) _OUTPUT_SAMPLE_RATE))
#define DEFAULT_AP0_GAIN 19400
#define DEFAULT_AP1_LENGTH (int)(((double) (16.5/1000.0)) * ((double) _OUTPUT_SAMPLE_RATE))
#define DEFAULT_AP1_GAIN -19400
#define REVERB_DEFAULT_WET 32767
#define REVERB_DEFAULT_DRY 0
#define EAS_REVERB_WET_MAX 32767
#define EAS_REVERB_WET_MIN 0
#define EAS_REVERB_DRY_MAX 32767
#define EAS_REVERB_DRY_MIN 0
/* parameters for each allpass */
typedef struct
{
EAS_U16 m_zApOut; // delay offset for ap out
EAS_I16 m_nApGain; // gain for ap
EAS_U16 m_zApIn; // delay offset for ap in
} S_ALLPASS_OBJECT;
/* parameters for each allpass */
typedef struct
{
EAS_PCM m_zLpf; // actual state variable, not a length
EAS_I16 m_nLpfFwd; // lpf forward gain
EAS_I16 m_nLpfFbk; // lpf feedback gain
EAS_U16 m_zDelay[REVERB_MAX_NUM_REFLECTIONS]; // delay offset for ap out
EAS_I16 m_nGain[REVERB_MAX_NUM_REFLECTIONS]; // gain for ap
} S_EARLY_REFLECTION_OBJECT;
//demo
typedef struct
{
EAS_I16 m_nLpfFbk;
EAS_I16 m_nLpfFwd;
EAS_I16 m_nEarly;
EAS_I16 m_nWet;
EAS_I16 m_nDry;
EAS_I16 m_nEarlyL_LpfFbk;
EAS_I16 m_nEarlyL_LpfFwd;
EAS_I16 m_nEarlyL_Delay0; //8
EAS_I16 m_nEarlyL_Gain0;
EAS_I16 m_nEarlyL_Delay1;
EAS_I16 m_nEarlyL_Gain1;
EAS_I16 m_nEarlyL_Delay2;
EAS_I16 m_nEarlyL_Gain2;
EAS_I16 m_nEarlyL_Delay3;
EAS_I16 m_nEarlyL_Gain3;
EAS_I16 m_nEarlyL_Delay4;
EAS_I16 m_nEarlyL_Gain4;
EAS_I16 m_nEarlyR_Delay0; //18
EAS_I16 m_nEarlyR_Gain0;
EAS_I16 m_nEarlyR_Delay1;
EAS_I16 m_nEarlyR_Gain1;
EAS_I16 m_nEarlyR_Delay2;
EAS_I16 m_nEarlyR_Gain2;
EAS_I16 m_nEarlyR_Delay3;
EAS_I16 m_nEarlyR_Gain3;
EAS_I16 m_nEarlyR_Delay4;
EAS_I16 m_nEarlyR_Gain4;
EAS_U16 m_nMaxExcursion; //28
EAS_I16 m_nXfadeInterval;
EAS_I16 m_nAp0_ApGain; //30
EAS_I16 m_nAp0_ApOut;
EAS_I16 m_nAp1_ApGain;
EAS_I16 m_nAp1_ApOut;
EAS_I16 m_rfu4;
EAS_I16 m_rfu5;
EAS_I16 m_rfu6;
EAS_I16 m_rfu7;
EAS_I16 m_rfu8;
EAS_I16 m_rfu9;
EAS_I16 m_rfu10; //43
} S_REVERB_PRESET;
typedef struct
{
S_REVERB_PRESET m_sPreset[REVERB_MAX_ROOM_TYPE]; //array of presets
} S_REVERB_PRESET_BANK;
/* parameters for each reverb */
typedef struct
{
/* controls entire reverb playback volume */
/* to conserve memory, use the MSB and ignore the LSB */
EAS_U8 m_nMasterVolume;
/* update counter keeps track of when synth params need updating */
/* only needs to be as large as REVERB_UPDATE_PERIOD_IN_SAMPLES */
EAS_I16 m_nUpdateCounter;
EAS_U16 m_nMinSamplesToAdd; /* ComputeReverb() generates this many samples */
EAS_U8 m_nFlags; /* misc flags/bit fields */
EAS_PCM *m_pOutputBuffer;
EAS_PCM *m_pInputBuffer;
EAS_U16 m_nNumSamplesInOutputBuffer;
EAS_U16 m_nNumSamplesInInputBuffer;
EAS_U16 m_nNumInputSamplesRead; // if m_nNumInputSamplesRead >= NumSamplesInInputBuffer
// then get a new input buffer
EAS_PCM *m_pNextInputSample;
EAS_U16 m_nBaseIndex; // base index for circular buffer
// reverb delay line offsets, allpass parameters, etc:
EAS_PCM m_nRevOutFbkR; // combine feedback reverb right out with dry left in
S_ALLPASS_OBJECT m_sAp0; // allpass 0 (left channel)
EAS_U16 m_zD0In; // delay offset for delay line D0 in
EAS_PCM m_nRevOutFbkL; // combine feedback reverb left out with dry right in
S_ALLPASS_OBJECT m_sAp1; // allpass 1 (right channel)
EAS_U16 m_zD1In; // delay offset for delay line D1 in
// delay output taps, notice criss cross order
EAS_U16 m_zD0Self; // self feeds forward d0 --> d0
EAS_U16 m_zD1Cross; // cross feeds across d1 --> d0
EAS_PCM m_zLpf0; // actual state variable, not a length
EAS_U16 m_zD1Self; // self feeds forward d1 --> d1
EAS_U16 m_zD0Cross; // cross feeds across d0 --> d1
EAS_PCM m_zLpf1; // actual state variable, not a length
EAS_I16 m_nSin; // gain for self taps
EAS_I16 m_nCos; // gain for cross taps
EAS_I16 m_nSinIncrement; // increment for gain
EAS_I16 m_nCosIncrement; // increment for gain
EAS_I16 m_nLpfFwd; // lpf forward gain (includes scaling for mixer)
EAS_I16 m_nLpfFbk; // lpf feedback gain
EAS_U16 m_nXfadeInterval; // update/xfade after this many samples
EAS_U16 m_nXfadeCounter; // keep track of when to xfade
EAS_I16 m_nPhase; // -1 <= m_nPhase < 1
// but during sin,cos calculations
// use m_nPhase/2
EAS_I16 m_nPhaseIncrement; // add this to m_nPhase each frame
EAS_I16 m_nNoise; // random noise sample
EAS_U16 m_nMaxExcursion; // the taps can excurse +/- this amount
EAS_BOOL m_bUseNoise; // if EAS_TRUE, use noise as input signal
EAS_BOOL m_bBypass; // if EAS_TRUE, then bypass reverb and copy input to output
EAS_I16 m_nCurrentRoom; // preset number for current room
EAS_I16 m_nNextRoom; // preset number for next room
EAS_I16 m_nWet; // gain for wet (processed) signal
EAS_I16 m_nDry; // gain for dry (unprocessed) signal
EAS_I16 m_nEarly; // gain for early (widen) signal
S_EARLY_REFLECTION_OBJECT m_sEarlyL; // left channel early reflections
S_EARLY_REFLECTION_OBJECT m_sEarlyR; // right channel early reflections
EAS_PCM m_nDelayLine[REVERB_BUFFER_SIZE_IN_SAMPLES]; // one large delay line for all reverb elements
S_REVERB_PRESET pPreset;
S_REVERB_PRESET_BANK m_sPreset;
//EAS_I8 preset;
} S_REVERB_OBJECT;
/*------------------------------------
* prototypes
*------------------------------------
*/
/*----------------------------------------------------------------------------
* ReverbUpdateXfade
*----------------------------------------------------------------------------
* Purpose:
* Update the xfade parameters as required
*
* Inputs:
* nNumSamplesToAdd - number of samples to write to buffer
*
* Outputs:
*
*
* Side Effects:
* - xfade parameters will be changed
*
*----------------------------------------------------------------------------
*/
EAS_RESULT ReverbUpdateXfade(S_REVERB_OBJECT* pReverbData, EAS_INT nNumSamplesToAdd);
/*----------------------------------------------------------------------------
* ReverbCalculateNoise
*----------------------------------------------------------------------------
* Purpose:
* Calculate a noise sample and limit its value
*
* Inputs:
* nMaxExcursion - noise value is limited to this value
* pnNoise - return new noise sample in this (not limited)
*
* Outputs:
* new limited noise value
*
* Side Effects:
* - *pnNoise noise value is updated
*
*----------------------------------------------------------------------------
*/
EAS_U16 ReverbCalculateNoise(EAS_U16 nMaxExcursion, EAS_I16 *pnNoise);
/*----------------------------------------------------------------------------
* ReverbCalculateSinCos
*----------------------------------------------------------------------------
* Purpose:
* Calculate a new sin and cosine value based on the given phase
*
* Inputs:
* nPhase - phase angle
* pnSin - input old value, output new value
* pnCos - input old value, output new value
*
* Outputs:
*
* Side Effects:
* - *pnSin, *pnCos are updated
*
*----------------------------------------------------------------------------
*/
EAS_RESULT ReverbCalculateSinCos(EAS_I16 nPhase, EAS_I16 *pnSin, EAS_I16 *pnCos);
/*----------------------------------------------------------------------------
* Reverb
*----------------------------------------------------------------------------
* Purpose:
* apply reverb to the given signal
*
* Inputs:
* nNu
* pnSin - input old value, output new value
* pnCos - input old value, output new value
*
* Outputs:
* number of samples actually reverberated
*
* Side Effects:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT Reverb(S_REVERB_OBJECT* pReverbData, EAS_INT nNumSamplesToAdd, EAS_PCM *pOutputBuffer, EAS_PCM *pInputBuffer);
/*----------------------------------------------------------------------------
* ReverbReadInPresets()
*----------------------------------------------------------------------------
* Purpose: sets global reverb preset bank to defaults
*
* Inputs:
*
* Outputs:
*
*----------------------------------------------------------------------------
*/
EAS_RESULT ReverbReadInPresets(S_REVERB_OBJECT* pReverbData);
/*----------------------------------------------------------------------------
* ReverbUpdateRoom
*----------------------------------------------------------------------------
* Purpose:
* Update the room's preset parameters as required
*
* Inputs:
*
* Outputs:
*
*
* Side Effects:
* - reverb paramters (fbk, fwd, etc) will be changed
* - m_nCurrentRoom := m_nNextRoom
*----------------------------------------------------------------------------
*/
EAS_RESULT ReverbUpdateRoom(S_REVERB_OBJECT* pReverbData);
#endif /* #ifndef _EAS_REVERBDATA_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,41 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_rtttldata.c
*
* Contents and purpose:
* RTTTL File Parser data module for static memory models
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
#include "eas_rtttldata.h"
/*----------------------------------------------------------------------------
*
* eas_RTTTLData
*
* Static memory allocation for RTTTL parser
*----------------------------------------------------------------------------
*/
S_RTTTL_DATA eas_RTTTLData;

View File

@@ -0,0 +1,70 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_rtttldata.h
*
* Contents and purpose:
* SMF File Parser
*
* This file contains data declarations for the RTTTL parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef EAS_RTTTLDATA_H
#define EAS_RTTTLDATA_H
#include "eas_data.h"
/* maximum line size as specified in iMelody V1.2 spec */
#define MAX_LINE_SIZE 75
/*----------------------------------------------------------------------------
*
* S_RTTTL_DATA
*
* This structure contains the state data for the iMelody parser
*----------------------------------------------------------------------------
*/
typedef struct
{
EAS_FILE_HANDLE fileHandle; /* file handle */
S_SYNTH *pSynth; /* synthesizer handle */
S_METADATA_CB metadata; /* metadata callback */
EAS_I32 fileOffset; /* offset to start of data */
EAS_I32 time; /* current time in 256ths of a msec */
EAS_I32 tick; /* length of 32nd note in 256th of a msec */
EAS_I32 restTicks; /* ticks to rest after current note */
EAS_I32 repeatOffset; /* file offset to start of repeat section */
EAS_U8 repeatCount; /* repeat counter */
EAS_I8 dataByte; /* storage for characters that are "put back" */
EAS_U8 state; /* current state EAS_STATE_XXXX */
EAS_I8 style; /* from STYLE */
EAS_U8 note; /* MIDI note number */
EAS_U8 octave; /* decault octave prefix */
EAS_I8 duration; /* default note duration */
} S_RTTTL_DATA;
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_smf.h
*
* Contents and purpose:
* SMF Type 0 and 1 File Parser
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SMF_H
#define _EAS_SMF_H
/* prototypes for private interface to SMF parser */
EAS_RESULT SMF_CheckFileType (S_EAS_DATA *pEASData, EAS_FILE_HANDLE fileHandle, EAS_VOID_PTR *ppHandle, EAS_I32 offset);
EAS_RESULT SMF_Prepare (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT SMF_Time (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_U32 *pTime);
EAS_RESULT SMF_Event (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_INT parserMode);
EAS_RESULT SMF_State (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_STATE *pState);
EAS_RESULT SMF_Close (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT SMF_Reset (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT SMF_Pause (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT SMF_Resume (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData);
EAS_RESULT SMF_SetData (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 value);
EAS_RESULT SMF_GetData (S_EAS_DATA *pEASData, EAS_VOID_PTR pInstData, EAS_I32 param, EAS_I32 *pValue);
EAS_RESULT SMF_ParseHeader (EAS_HW_DATA_HANDLE hwInstData, S_SMF_DATA *pSMFData);
#endif /* end _EAS_SMF_H */

View File

@@ -0,0 +1,66 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_smfdata.c
*
* Contents and purpose:
* SMF File Parser
*
* This file contains data definitions for the SMF parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 778 $
* $Date: 2007-07-23 16:45:17 -0700 (Mon, 23 Jul 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_miditypes.h"
#include "eas_smfdata.h"
/*----------------------------------------------------------------------------
*
* S_SMF_STREAM
*
* Static memory allocation for SMF parser
*----------------------------------------------------------------------------
*/
static S_SMF_STREAM eas_SMFStreams[MAX_SMF_STREAMS];
/*----------------------------------------------------------------------------
*
* eas_SMFData
*
* Static memory allocation for SMF parser
*----------------------------------------------------------------------------
*/
S_SMF_DATA eas_SMFData =
{
eas_SMFStreams, /* pointer to individual streams in file */
0, /* pointer to next stream with event */
0, /* pointer to synth */
0, /* file handle */
{ 0, 0, 0, 0}, /* metadata callback */
0, /* file offset */
0, /* current time in milliseconds/256 */
0, /* actual number of streams */
0, /* current MIDI tick to msec conversion */
0, /* ticks per quarter note */
0, /* current state EAS_STATE_XXXX */
0 /* flags */
};

View File

@@ -0,0 +1,66 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_smfdata.h
*
* Contents and purpose:
* SMF File Parser
*
* This file contains data definitions for the SMF parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 686 $
* $Date: 2007-05-03 14:10:54 -0700 (Thu, 03 May 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SMF_DATA_H
#define _EAS_SMF_DATA_H
#ifndef MAX_SMF_STREAMS
#define MAX_SMF_STREAMS 128
#endif
/* offsets in to the SMF file */
#define SMF_OFS_HEADER_SIZE 4
#define SMF_OFS_FILE_TYPE 8
#define SMF_OFS_NUM_TRACKS 10
/* size of chunk info (chunk ID + chunk size) */
#define SMF_CHUNK_INFO_SIZE 8
/* 'MTrk' track chunk ID */
#define SMF_CHUNK_TYPE_TRACK 0x4d54726bL
/* some useful meta-events */
#define SMF_META_TEXT 0x01
#define SMF_META_COPYRIGHT 0x02
#define SMF_META_SEQTRK_NAME 0x03
#define SMF_META_LYRIC 0x05
#define SMF_META_END_OF_TRACK 0x2f
#define SMF_META_TEMPO 0x51
#define SMF_META_TIME_SIGNATURE 0x58
/* default timebase (120BPM) */
#define SMF_DEFAULT_TIMEBASE 500000L
/* value for pSMFStream->ticks to signify end of track */
#define SMF_END_OF_TRACK 0xffffffff
#endif

View File

@@ -0,0 +1,406 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_sndlib.h
*
* Contents and purpose:
* Declarations for the sound library
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 550 $
* $Date: 2007-02-02 09:37:03 -0800 (Fri, 02 Feb 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SNDLIB_H
#define _EAS_SNDLIB_H
#include "eas_types.h"
#include "eas_synthcfg.h"
#ifdef _WT_SYNTH
#include "eas_wtengine.h"
#endif
/*----------------------------------------------------------------------------
* This is bit of a hack to allow us to keep the same structure
* declarations for the DLS parser. Normally, the data is located
* in read-only memory, but for DLS, we store the data in RW
* memory.
*----------------------------------------------------------------------------
*/
#ifndef SCNST
#define SCNST const
#endif
/*----------------------------------------------------------------------------
* sample size
*----------------------------------------------------------------------------
*/
#ifdef _16_BIT_SAMPLES
typedef EAS_I16 EAS_SAMPLE;
#else
typedef EAS_I8 EAS_SAMPLE;
#endif
/*----------------------------------------------------------------------------
* EAS Library ID - quick check for valid library and version
*----------------------------------------------------------------------------
*/
#define _EAS_LIBRARY_VERSION 0x01534145
#define NUM_PROGRAMS_IN_BANK 128
#define INVALID_REGION_INDEX 0xffff
/* this bit in region index indicates that region is for secondary synth */
#define FLAG_RGN_IDX_FM_SYNTH 0x8000
#define FLAG_RGN_IDX_DLS_SYNTH 0x4000
#define REGION_INDEX_MASK 0x3fff
/*----------------------------------------------------------------------------
* Generic region data structure
*
* This must be the first element in each region structure
*----------------------------------------------------------------------------
*/
typedef struct s_region_tag
{
EAS_U16 keyGroupAndFlags;
EAS_U8 rangeLow;
EAS_U8 rangeHigh;
} S_REGION;
/*
* Bit fields for m_nKeyGroupAndFlags
* Bits 0-2 are mode bits in FM synth
* Bits 8-11 are the key group
*/
#define REGION_FLAG_IS_LOOPED 0x01
#define REGION_FLAG_USE_WAVE_GENERATOR 0x02
#define REGION_FLAG_USE_ADPCM 0x04
#define REGION_FLAG_ONE_SHOT 0x08
#define REGION_FLAG_SQUARE_WAVE 0x10
#define REGION_FLAG_OFF_CHIP 0x20
#define REGION_FLAG_NON_SELF_EXCLUSIVE 0x40
#define REGION_FLAG_LAST_REGION 0x8000
/*----------------------------------------------------------------------------
* Envelope data structure
*----------------------------------------------------------------------------
*/
typedef struct s_envelope_tag
{
EAS_I16 attackTime;
EAS_I16 decayTime;
EAS_I16 sustainLevel;
EAS_I16 releaseTime;
} S_ENVELOPE;
/*----------------------------------------------------------------------------
* DLS envelope data structure
*----------------------------------------------------------------------------
*/
typedef struct s_dls_envelope_tag
{
EAS_I16 delayTime;
EAS_I16 attackTime;
EAS_I16 holdTime;
EAS_I16 decayTime;
EAS_I16 sustainLevel;
EAS_I16 releaseTime;
EAS_I16 velToAttack;
EAS_I16 keyNumToDecay;
EAS_I16 keyNumToHold;
} S_DLS_ENVELOPE;
/*----------------------------------------------------------------------------
* LFO data structure
*----------------------------------------------------------------------------
*/
typedef struct s_lfo_params_tag
{
EAS_I16 lfoFreq;
EAS_I16 lfoDelay;
} S_LFO_PARAMS;
/*----------------------------------------------------------------------------
* Articulation data structure
*----------------------------------------------------------------------------
*/
typedef struct s_articulation_tag
{
S_ENVELOPE eg1;
S_ENVELOPE eg2;
EAS_I16 lfoToPitch;
EAS_I16 lfoDelay;
EAS_I16 lfoFreq;
EAS_I16 eg2ToPitch;
EAS_I16 eg2ToFc;
EAS_I16 filterCutoff;
EAS_I8 lfoToGain;
EAS_U8 filterQ;
EAS_I8 pan;
} S_ARTICULATION;
/*----------------------------------------------------------------------------
* DLS articulation data structure
*----------------------------------------------------------------------------
*/
typedef struct s_dls_articulation_tag
{
S_LFO_PARAMS modLFO;
S_LFO_PARAMS vibLFO;
S_DLS_ENVELOPE eg1;
S_DLS_ENVELOPE eg2;
EAS_I16 eg1ShutdownTime;
EAS_I16 filterCutoff;
EAS_I16 modLFOToFc;
EAS_I16 modLFOCC1ToFc;
EAS_I16 modLFOChanPressToFc;
EAS_I16 eg2ToFc;
EAS_I16 velToFc;
EAS_I16 keyNumToFc;
EAS_I16 modLFOToGain;
EAS_I16 modLFOCC1ToGain;
EAS_I16 modLFOChanPressToGain;
EAS_I16 tuning;
EAS_I16 keyNumToPitch;
EAS_I16 vibLFOToPitch;
EAS_I16 vibLFOCC1ToPitch;
EAS_I16 vibLFOChanPressToPitch;
EAS_I16 modLFOToPitch;
EAS_I16 modLFOCC1ToPitch;
EAS_I16 modLFOChanPressToPitch;
EAS_I16 eg2ToPitch;
/* pad to 4-byte boundary */
EAS_U16 pad;
EAS_I8 pan;
EAS_U8 filterQandFlags;
#ifdef _REVERB
EAS_I16 reverbSend;
EAS_I16 cc91ToReverbSend;
#endif
#ifdef _CHORUS
EAS_I16 chorusSend;
EAS_I16 cc93ToChorusSend;
#endif
} S_DLS_ARTICULATION;
/* flags in filterQandFlags
* NOTE: Q is stored in bottom 5 bits
*/
#define FLAG_DLS_VELOCITY_SENSITIVE 0x80
#define FILTER_Q_MASK 0x1f
/*----------------------------------------------------------------------------
* Wavetable region data structure
*----------------------------------------------------------------------------
*/
typedef struct s_wt_region_tag
{
S_REGION region;
EAS_I16 tuning;
EAS_I16 gain;
EAS_U32 loopStart;
EAS_U32 loopEnd;
EAS_U16 waveIndex;
EAS_U16 artIndex;
} S_WT_REGION;
/*----------------------------------------------------------------------------
* DLS region data structure
*----------------------------------------------------------------------------
*/
typedef struct s_dls_region_tag
{
S_WT_REGION wtRegion;
EAS_U8 velLow;
EAS_U8 velHigh;
} S_DLS_REGION;
/*----------------------------------------------------------------------------
* FM synthesizer data structures
*----------------------------------------------------------------------------
*/
typedef struct s_fm_oper_tag
{
EAS_I16 tuning;
EAS_U8 attackDecay;
EAS_U8 velocityRelease;
EAS_U8 egKeyScale;
EAS_U8 sustain;
EAS_U8 gain;
EAS_U8 flags;
} S_FM_OPER;
/* defines for S_FM_OPER.m_nFlags */
#define FM_OPER_FLAG_MONOTONE 0x01
#define FM_OPER_FLAG_NO_VIBRATO 0x02
#define FM_OPER_FLAG_NOISE 0x04
#define FM_OPER_FLAG_LINEAR_VELOCITY 0x08
/* NOTE: The first two structure elements are common with S_WT_REGION
* and we will rely on that in the voice management code and must
* remain there unless the voice management code is revisited.
*/
typedef struct s_fm_region_tag
{
S_REGION region;
EAS_U8 vibTrem;
EAS_U8 lfoFreqDelay;
EAS_U8 feedback;
EAS_I8 pan;
S_FM_OPER oper[4];
} S_FM_REGION;
/*----------------------------------------------------------------------------
* Common data structures
*----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
* Program data structure
* Used for individual programs not stored as a complete bank.
*----------------------------------------------------------------------------
*/
typedef struct s_program_tag
{
EAS_U32 locale;
EAS_U16 regionIndex;
} S_PROGRAM;
/*----------------------------------------------------------------------------
* Bank data structure
*
* A bank always consists of 128 programs. If a bank is less than 128
* programs, it should be stored as a spare matrix in the pPrograms
* array.
*
* bankNum: MSB/LSB of MIDI bank select controller
* regionIndex: Index of first region in program
*----------------------------------------------------------------------------
*/
typedef struct s_bank_tag
{
EAS_U16 locale;
EAS_U16 regionIndex[NUM_PROGRAMS_IN_BANK];
} S_BANK;
/* defines for libFormat field
* bits 0-17 are the sample rate
* bit 18 is true if wavetable is present
* bit 19 is true if FM is present
* bit 20 is true if filter is enabled
* bit 21 is sample depth (0 = 8-bits, 1 = 16-bits)
* bits 22-31 are reserved
*/
#define LIBFORMAT_SAMPLE_RATE_MASK 0x0003ffff
#define LIB_FORMAT_TYPE_MASK 0x000c0000
#define LIB_FORMAT_WAVETABLE 0x00000000
#define LIB_FORMAT_FM 0x00040000
#define LIB_FORMAT_HYBRID 0x00080000
#define LIB_FORMAT_FILTER_ENABLED 0x00100000
#define LIB_FORMAT_16_BIT_SAMPLES 0x00200000
#ifdef DLS_SYNTHESIZER
/*----------------------------------------------------------------------------
* DLS data structure
*
* pDLSPrograms pointer to array of DLS programs
* pDLSRegions pointer to array of DLS regions
* pDLSArticulations pointer to array of DLS articulations
* pSampleLen pointer to array of sample lengths
* ppSamples pointer to array of sample pointers
* numDLSPrograms number of DLS programs
* numDLSRegions number of DLS regions
* numDLSArticulations number of DLS articulations
* numDLSSamples number of DLS samples
*----------------------------------------------------------------------------
*/
typedef struct s_eas_dls_tag
{
S_PROGRAM *pDLSPrograms;
S_DLS_REGION *pDLSRegions;
S_DLS_ARTICULATION *pDLSArticulations;
EAS_U32 *pDLSSampleLen;
EAS_U32 *pDLSSampleOffsets;
EAS_SAMPLE *pDLSSamples;
EAS_U16 numDLSPrograms;
EAS_U16 numDLSRegions;
EAS_U16 numDLSArticulations;
EAS_U16 numDLSSamples;
EAS_U8 refCount;
} S_DLS;
#endif
/*----------------------------------------------------------------------------
* Sound library data structure
*
* pBanks pointer to array of banks
* pPrograms pointer to array of programs
* pWTRegions pointer to array of wavetable regions
* pFMRegions pointer to array of FM regions
* pArticulations pointer to array of articulations
* pSampleLen pointer to array of sample lengths
* ppSamples pointer to array of sample pointers
* numBanks number of banks
* numPrograms number of individual program
* numRegions number of regions
* numArticulations number of articulations
* numSamples number of samples
*----------------------------------------------------------------------------
*/
typedef struct s_eas_sndlib_tag
{
SCNST EAS_U32 identifier;
SCNST EAS_U32 libAttr;
SCNST S_BANK *pBanks;
SCNST S_PROGRAM *pPrograms;
SCNST S_WT_REGION *pWTRegions;
SCNST S_ARTICULATION *pArticulations;
SCNST EAS_U32 *pSampleLen;
SCNST EAS_U32 *pSampleOffsets;
SCNST EAS_SAMPLE *pSamples;
SCNST S_FM_REGION *pFMRegions;
SCNST EAS_U16 numBanks;
SCNST EAS_U16 numPrograms;
SCNST EAS_U16 numWTRegions;
SCNST EAS_U16 numArticulations;
SCNST EAS_U16 numSamples;
SCNST EAS_U16 numFMRegions;
} S_EAS;
#endif

View File

@@ -0,0 +1,395 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_synth.h
*
* Contents and purpose:
* Declarations, interfaces, and prototypes for synth.
*
* Copyright Sonic Network Inc. 2004, 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 718 $
* $Date: 2007-06-08 16:43:16 -0700 (Fri, 08 Jun 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SYNTH_H
#define _EAS_SYNTH_H
#include "eas_types.h"
#include "eas_sndlib.h"
#ifdef _WT_SYNTH
#include "eas_wtsynth.h"
#endif
#ifdef _FM_SYNTH
#include "eas_fmsynth.h"
#endif
#ifndef NUM_OUTPUT_CHANNELS
#define NUM_OUTPUT_CHANNELS 2
#endif
#ifndef MAX_SYNTH_VOICES
#define MAX_SYNTH_VOICES 64
#endif
#ifndef MAX_VIRTUAL_SYNTHESIZERS
#define MAX_VIRTUAL_SYNTHESIZERS 4
#endif
/* defines */
#ifndef NUM_PRIMARY_VOICES
#define NUM_PRIMARY_VOICES MAX_SYNTH_VOICES
#elif !defined(NUM_SECONDARY_VOICES)
#define NUM_SECONDARY_VOICES (MAX_SYNTH_VOICES - NUM_PRIMARY_VOICES)
#endif
#if defined(EAS_WT_SYNTH)
#define NUM_WT_VOICES MAX_SYNTH_VOICES
/* FM on MCU */
#elif defined(EAS_FM_SYNTH)
#define NUM_FM_VOICES MAX_SYNTH_VOICES
/* wavetable drums on MCU, wavetable melodic on DSP */
#elif defined(EAS_SPLIT_WT_SYNTH)
#define NUM_WT_VOICES MAX_SYNTH_VOICES
/* wavetable drums and FM melodic on MCU */
#elif defined(EAS_HYBRID_SYNTH)
#define NUM_WT_VOICES NUM_PRIMARY_VOICES
#define NUM_FM_VOICES NUM_SECONDARY_VOICES
/* wavetable drums on MCU, FM melodic on DSP */
#elif defined(EAS_SPLIT_HYBRID_SYNTH)
#define NUM_WT_VOICES NUM_PRIMARY_VOICES
#define NUM_FM_VOICES NUM_SECONDARY_VOICES
/* FM synth on DSP */
#elif defined(EAS_SPLIT_FM_SYNTH)
#define NUM_FM_VOICES MAX_SYNTH_VOICES
#else
#error "Unrecognized architecture option"
#endif
#define NUM_SYNTH_CHANNELS 16
#define DEFAULT_SYNTH_VOICES MAX_SYNTH_VOICES
/* use the following values to specify unassigned channels or voices */
#define UNASSIGNED_SYNTH_CHANNEL NUM_SYNTH_CHANNELS
#define UNASSIGNED_SYNTH_VOICE MAX_SYNTH_VOICES
/* synth parameters are updated every SYNTH_UPDATE_PERIOD_IN_SAMPLES */
#define SYNTH_UPDATE_PERIOD_IN_SAMPLES (EAS_I32)(0x1L << SYNTH_UPDATE_PERIOD_IN_BITS)
/* stealing weighting factors */
#define NOTE_AGE_STEAL_WEIGHT 1
#define NOTE_GAIN_STEAL_WEIGHT 4
#define CHANNEL_POLY_STEAL_WEIGHT 12
#define CHANNEL_PRIORITY_STEAL_WEIGHT 2
#define NOTE_MATCH_PENALTY 128
#define SYNTH_PRIORITY_WEIGHT 8
/* default synth master volume */
#define DEFAULT_SYNTH_MASTER_VOLUME 0x7fff
#define DEFAULT_SYNTH_PRIORITY 5
/* default tuning values */
#define DEFAULT_PITCH_BEND_SENSITIVITY 200 /* 2 semitones */
#define DEFAULT_FINE_PITCH 0 /* 0 cents */
#define DEFAULT_COARSE_PITCH 0 /* 0 semitones */
/* default drum channel is 10, but is internally 9 due to unit offset */
#define DEFAULT_DRUM_CHANNEL 9
/* drum channel can simultaneously play this many voices at most */
#define DEFAULT_CHANNEL_POLYPHONY_LIMIT 2
/* default instrument is acoustic piano */
#define DEFAULT_MELODY_BANK_MSB 0x79
#define DEFAULT_RHYTHM_BANK_MSB 0x78
#define DEFAULT_MELODY_BANK_NUMBER (DEFAULT_MELODY_BANK_MSB << 8)
#define DEFAULT_RHYTHM_BANK_NUMBER (DEFAULT_RHYTHM_BANK_MSB << 8)
#define DEFAULT_SYNTH_PROGRAM_NUMBER 0
#define DEFAULT_PITCH_BEND 0x2000 /* 0x2000 == (0x40 << 7) | 0x00 */
#define DEFAULT_MOD_WHEEL 0
#define DEFAULT_CHANNEL_VOLUME 0x64
#define DEFAULT_PAN 0x40 /* decimal 64, center */
#ifdef _REVERB
#define DEFAULT_REVERB_SEND 40 /* some reverb */
#endif
#ifdef _CHORUS
#define DEFAULT_CHORUS_SEND 0 /* no chorus */
#endif
#define DEFAULT_EAS_FILTER_CUTOFF_FREQUENCY 0 /* EAS synth uses a different default */
#define DEFAULT_FILTER_RESONANCE 0
#define DEFAULT_EXPRESSION 0x7F
#define DEFAULT_CHANNEL_PRESSURE 0
#define DEFAULT_REGISTERED_PARAM 0x3FFF
#define DEFAULT_CHANNEL_STATIC_GAIN 0
#define DEFAULT_CHANNEL_STATIC_PITCH 0
#define DEFAULT_LFO_MOD_WHEEL_TO_PITCH_CENTS 50
#define DEFAULT_LFO_CHANNEL_PRESSURE_TO_PITCH_CENTS 50
#define DEFAULT_KEY_NUMBER 0x69
#define DEFAULT_VELOCITY 0x64
#define DEFAULT_REGION_INDEX 0
#define DEFAULT_ARTICULATION_INDEX 0
#define DEFAULT_VOICE_GAIN 0
#define DEFAULT_AGE 0
#define DEFAULT_SP_MIDI_PRIORITY 16
/* filter defines */
#define DEFAULT_FILTER_ZERO 0
#define FILTER_CUTOFF_MAX_PITCH_CENTS 1919
#define FILTER_CUTOFF_MIN_PITCH_CENTS -4467
#define A5_PITCH_OFFSET_IN_CENTS 6900
/*------------------------------------
* S_SYNTH_CHANNEL data structure
*------------------------------------
*/
/* S_SYNTH_CHANNEL.m_nFlags */
#define CHANNEL_FLAG_SUSTAIN_PEDAL 0x01
#define CHANNEL_FLAG_MUTE 0x02
#define CHANNEL_FLAG_UPDATE_CHANNEL_PARAMETERS 0x04
#define CHANNEL_FLAG_RHYTHM_CHANNEL 0x08
#define CHANNEL_FLAG_EXTERNAL_AUDIO 0x10
#define DEFAULT_CHANNEL_FLAGS 0
/* macros for extracting virtual synth and channel numbers */
#define GET_VSYNTH(a) ((a) >> 4)
#define GET_CHANNEL(a) ((a) & 15)
typedef struct s_synth_channel_tag
{
/* use static channel parameters to reduce MIPs */
/* parameters shared by multiple voices assigned to same channel */
EAS_I32 staticPitch; /* (pitch bend * pitch sens) + fine pitch */
EAS_I16 staticGain; /* (CC7 * CC11 * master vol)^2 */
EAS_U16 regionIndex; /* index of first region in program */
EAS_U16 bankNum; /* play programs from this bank */
EAS_I16 pitchBend; /* pitch wheel value */
EAS_I16 pitchBendSensitivity;
EAS_I16 registeredParam; /* currently selected registered param */
#if defined(_FM_SYNTH)
EAS_I16 lfoAmt; /* amount of LFO to apply to voice */
#endif
EAS_U8 programNum; /* play this instrument number */
EAS_U8 modWheel; /* CC1 */
EAS_U8 volume; /* CC7 */
EAS_U8 pan; /* CC10 */
EAS_U8 expression; /* CC11 */
/* the following parameters are controlled by RPNs */
EAS_I8 finePitch;
EAS_I8 coarsePitch;
EAS_U8 channelPressure; /* applied to all voices on a given channel */
EAS_U8 channelFlags; /* bit field channelFlags for */
/* CC64, SP-MIDI channel masking */
EAS_U8 pool; /* SPMIDI channel voice pool */
EAS_U8 mip; /* SPMIDI MIP setting */
#ifdef _REVERB
EAS_U8 reverbSend; /* CC91 */
#endif
#ifdef _CHORUS
EAS_U8 chorusSend; /* CC93 */
#endif
} S_SYNTH_CHANNEL;
/*------------------------------------
* S_SYNTH_VOICE data structure
*------------------------------------
*/
/* S_SYNTH_VOICE.m_nFlags */
#define VOICE_FLAG_UPDATE_VOICE_PARAMETERS 0x01
#define VOICE_FLAG_SUSTAIN_PEDAL_DEFER_NOTE_OFF 0x02
#define VOICE_FLAG_DEFER_MIDI_NOTE_OFF 0x04
#define VOICE_FLAG_NO_SAMPLES_SYNTHESIZED_YET 0x08
#define VOICE_FLAG_DEFER_MUTE 0x40
#define DEFAULT_VOICE_FLAGS 0
/* S_SYNTH_VOICE.m_eState */
typedef enum {
eVoiceStateFree = 0,
eVoiceStateStart,
eVoiceStatePlay,
eVoiceStateRelease,
eVoiceStateMuting,
eVoiceStateStolen,
eVoiceStateInvalid /* should never be in this state! */
} E_VOICE_STATE;
#define DEFAULT_VOICE_STATE eVoiceStateFree
typedef struct s_synth_voice_tag
{
/* These parameters are common to both wavetable and FM
* synthesizers. The voice manager should only access this data.
* Any other data should be manipulated by the code that is
* specific to that synthesizer and reflected back through the
* common state data available here.
*/
EAS_U16 regionIndex; /* index to wave and playback params */
EAS_I16 gain; /* current gain */
EAS_U16 age; /* large value means old note */
EAS_U16 nextRegionIndex; /* index to wave and playback params */
EAS_U8 voiceState; /* current voice state */
EAS_U8 voiceFlags; /* misc flags/bit fields */
EAS_U8 channel; /* this voice plays on this synth channel */
EAS_U8 note; /* 12 <= key number <= 108 */
EAS_U8 velocity; /* 0 <= velocity <= 127 */
EAS_U8 nextChannel; /* play stolen voice on this channel */
EAS_U8 nextNote; /* 12 <= key number <= 108 */
EAS_U8 nextVelocity; /* 0 <= velocity <= 127 */
} S_SYNTH_VOICE;
/*------------------------------------
* S_SYNTH data structure
*
* One instance for each MIDI stream
*------------------------------------
*/
/* S_SYNTH.m_nFlags */
#define SYNTH_FLAG_RESET_IS_REQUESTED 0x01
#define SYNTH_FLAG_SP_MIDI_ON 0x02
#define SYNTH_FLAG_UPDATE_ALL_CHANNEL_PARAMETERS 0x04
#define SYNTH_FLAG_DEFERRED_MIDI_NOTE_OFF_PENDING 0x08
#define DEFAULT_SYNTH_FLAGS SYNTH_FLAG_UPDATE_ALL_CHANNEL_PARAMETERS
typedef struct s_synth_tag
{
struct s_eas_data_tag *pEASData;
const S_EAS *pEAS;
#ifdef DLS_SYNTHESIZER
S_DLS *pDLS;
#endif
#ifdef EXTERNAL_AUDIO
EAS_EXT_PRG_CHG_FUNC cbProgChgFunc;
EAS_EXT_EVENT_FUNC cbEventFunc;
EAS_VOID_PTR *pExtAudioInstData;
#endif
S_SYNTH_CHANNEL channels[NUM_SYNTH_CHANNELS];
EAS_I32 totalNoteCount;
EAS_U16 maxPolyphony;
EAS_U16 numActiveVoices;
EAS_U16 masterVolume;
EAS_U8 channelsByPriority[NUM_SYNTH_CHANNELS];
EAS_U8 poolCount[NUM_SYNTH_CHANNELS];
EAS_U8 poolAlloc[NUM_SYNTH_CHANNELS];
EAS_U8 synthFlags;
EAS_I8 globalTranspose;
EAS_U8 vSynthNum;
EAS_U8 refCount;
EAS_U8 priority;
} S_SYNTH;
/*------------------------------------
* S_VOICE_MGR data structure
*
* One instance for each EAS library instance
*------------------------------------
*/
typedef struct s_voice_mgr_tag
{
S_SYNTH *pSynth[MAX_VIRTUAL_SYNTHESIZERS];
EAS_PCM voiceBuffer[SYNTH_UPDATE_PERIOD_IN_SAMPLES];
#ifdef _FM_SYNTH
EAS_PCM operMixBuffer[SYNTH_UPDATE_PERIOD_IN_SAMPLES];
S_FM_VOICE fmVoices[NUM_FM_VOICES];
#endif
#ifdef _WT_SYNTH
S_WT_VOICE wtVoices[NUM_WT_VOICES];
#endif
#ifdef _REVERB
EAS_PCM reverbSendBuffer[NUM_OUTPUT_CHANNELS * SYNTH_UPDATE_PERIOD_IN_SAMPLES];
#endif
#ifdef _CHORUS
EAS_PCM chorusSendBuffer[NUM_OUTPUT_CHANNELS * SYNTH_UPDATE_PERIOD_IN_SAMPLES];
#endif
S_SYNTH_VOICE voices[MAX_SYNTH_VOICES];
EAS_SNDLIB_HANDLE pGlobalEAS;
#ifdef DLS_SYNTHESIZER
S_DLS *pGlobalDLS;
#endif
#ifdef _SPLIT_ARCHITECTURE
EAS_FRAME_BUFFER_HANDLE pFrameBuffer;
#endif
#if defined(_SECONDARY_SYNTH) || defined(EAS_SPLIT_WT_SYNTH)
EAS_U16 maxPolyphonyPrimary;
EAS_U16 maxPolyphonySecondary;
#endif
EAS_I32 workload;
EAS_I32 maxWorkLoad;
EAS_U16 activeVoices;
EAS_U16 maxPolyphony;
EAS_U16 age;
/* limits the number of voice starts in a frame for split architecture */
#ifdef MAX_VOICE_STARTS
EAS_U16 numVoiceStarts;
#endif
} S_VOICE_MGR;
#endif /* #ifdef _EAS_SYNTH_H */

View File

@@ -0,0 +1,60 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_synth_protos.h
*
* Contents and purpose:
* Declarations, interfaces, and prototypes for synth.
*
* Copyright Sonic Network Inc. 2004
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 82 $
* $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SYNTH_PROTOS_H
#define _EAS_SYNTH_PROTOS_H
/* includes */
#include "eas_data.h"
#include "eas_sndlib.h"
#ifdef _SPLIT_ARCHITECTURE
typedef struct s_frame_interface_tag
{
EAS_BOOL (* EAS_CONST pfStartFrame)(EAS_FRAME_BUFFER_HANDLE pFrameBuffer);
EAS_BOOL (* EAS_CONST pfEndFrame)(EAS_FRAME_BUFFER_HANDLE pFrameBuffer, EAS_I32 *pMixBuffer, EAS_I16 masterGain);
} S_FRAME_INTERFACE;
#endif
/* generic synthesizer interface */
typedef struct
{
EAS_RESULT (* EAS_CONST pfInitialize)(S_VOICE_MGR *pVoiceMgr);
EAS_RESULT (* EAS_CONST pfStartVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_U16 regionIndex);
EAS_BOOL (* EAS_CONST pfUpdateVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum, EAS_I32 *pMixBuffer, EAS_I32 numSamples);
void (* EAS_CONST pfReleaseVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum);
void (* EAS_CONST pfMuteVoice)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, EAS_I32 voiceNum);
void (* EAS_CONST pfSustainPedal)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, S_SYNTH_VOICE *pVoice, S_SYNTH_CHANNEL *pChannel, EAS_I32 voiceNum);
void (* EAS_CONST pfUpdateChannel)(S_VOICE_MGR *pVoiceMgr, S_SYNTH *pSynth, EAS_U8 channel);
} S_SYNTH_INTERFACE;
#endif

View File

@@ -0,0 +1,70 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_synthcfg.h
*
* Contents and purpose:
* Defines for various synth configurations
*
* Copyright Sonic Network Inc. 2004, 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 664 $
* $Date: 2007-04-25 13:11:22 -0700 (Wed, 25 Apr 2007) $
*----------------------------------------------------------------------------
*/
#ifndef _EAS_SYNTHCFG_H
#define _EAS_SYNTHCFG_H
#if defined(EAS_WT_SYNTH)
#define _WT_SYNTH
/* FM on MCU */
#elif defined(EAS_FM_SYNTH)
#define _FM_SYNTH
/* wavetable drums and FM melodic on MCU */
#elif defined(EAS_HYBRID_SYNTH)
#define _WT_SYNTH
#define _FM_SYNTH
#define _SECONDARY_SYNTH
#define _HYBRID_SYNTH
/* wavetable drums on MCU, wavetable melodic on DSP */
#elif defined(EAS_SPLIT_WT_SYNTH)
#define _WT_SYNTH
#define _SPLIT_ARCHITECTURE
/* wavetable drums on MCU, FM melodic on DSP */
#elif defined(EAS_SPLIT_HYBRID_SYNTH)
#define _WT_SYNTH
#define _FM_SYNTH
#define _SECONDARY_SYNTH
#define _SPLIT_ARCHITECTURE
#define _HYBRID_SYNTH
/* FM synth on DSP */
#elif defined(EAS_SPLIT_FM_SYNTH)
#define _FM_SYNTH
#define _SPLIT_ARCHITECTURE
#else
#error "Unrecognized architecture option"
#endif
#endif

View File

@@ -0,0 +1,43 @@
/*----------------------------------------------------------------------------
*
* File:
* eas_tcdata.c
*
* Contents and purpose:
* ToneControl Parser data
*
* This file contains static data for the ToneControl parser.
*
* Copyright Sonic Network Inc. 2005
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*----------------------------------------------------------------------------
* Revision Control:
* $Revision: 547 $
* $Date: 2007-01-31 16:30:17 -0800 (Wed, 31 Jan 2007) $
*----------------------------------------------------------------------------
*/
#include "eas_types.h"
#include "eas_tcdata.h"
/*----------------------------------------------------------------------------
*
* eas_iMelodyData
*
* Static memory allocation for iMelody parser
*----------------------------------------------------------------------------
*/
S_TC_DATA eas_TCData;

Some files were not shown because too many files have changed in this diff Show More