//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // karoke::karoke //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ karoke::karoke(AudioUnit component) : AUEffectBase(component, false) { CreateElements(); CAStreamBasicDescription streamDescIn; streamDescIn.SetCanonical(NUM_INPUTS, false); // number of input channels streamDescIn.mSampleRate = GetSampleRate(); CAStreamBasicDescription streamDescOut; streamDescOut.SetCanonical(NUM_OUTPUTS, false); // number of output channels streamDescOut.mSampleRate = GetSampleRate(); Inputs().GetIOElement(0)->SetStreamFormat(streamDescIn); Outputs().GetIOElement(0)->SetStreamFormat(streamDescOut); Globals()->UseIndexedParameters(kNumberOfParameters); SetParameter(kParam_One, kDefaultValue_ParamOne ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif mLeftFilter = new FirFilter(200); mLeftFilter->setCoeffecients(lp_200, 200); mRightFilter = new FirFilter(200); mRightFilter->setCoeffecients(lp_200, 200); }
//----------------------------------------------------------------------------- // C700::C700 //----------------------------------------------------------------------------- C700::C700(AudioUnit component) : AUInstrumentBase(component, 0, 1) , mEfx(NULL) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); mEfx = new C700Kernel(); mEfx->SetPropertyNotifyFunc(PropertyNotifyFunc, this); mEfx->SetParameterSetFunc(ParameterSetFunc, this); //プリセット名テーブルを作成する mPresets = new AUPreset[NUM_PRESETS]; for (int i = 0; i < NUM_PRESETS; ++i) { const char *pname; pname = C700Kernel::GetPresetName(i); mPresets[i].presetNumber = i; CFMutableStringRef cfpname = CFStringCreateMutable(NULL, 64); mPresets[i].presetName = cfpname; CFStringAppendCString( cfpname, pname, kCFStringEncodingASCII ); } //デフォルト値を設定する for ( int i=0; i<kNumberOfParameters; i++ ) { Globals()->SetParameter(i, C700Kernel::GetParameterDefault(i) ); } #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher(this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // TremoloUnit::TremoloUnit //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TremoloUnit::TremoloUnit(AudioUnit component) : AUEffectBase(component) { // This method, defined in the AUBase superclass, ensures that the required audio unit // elements are created and initialized. CreateElements (); // Invokes the use of an STL vector for parameter access. // See AUBase/AUScopeElement.cpp Globals () -> UseIndexedParameters (kNumberOfParameters); // During instantiation, sets up the parameters according to their defaults. // The parameter defaults should correspond to the settings for the default preset. SetParameter ( kParameter_Frequency, kDefaultValue_Tremolo_Freq ); SetParameter ( kParameter_Depth, kDefaultValue_Tremolo_Depth ); SetParameter ( kParameter_Waveform, kDefaultValue_Tremolo_Waveform ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // RadioEffectUnit::RadioEffectUnit // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RadioEffectUnit::RadioEffectUnit(AudioUnit Component) : AUEffectBase(Component) { CreateElements(); if (!bGLocalized) { // Because we are in a component, we need to load our bundle by identifier so we can access our localized strings // It is important that the string passed here exactly matches that in the Info.plist Identifier string CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.epicgames.audiounit.radio") ); if (bundle != NULL) { kChebyshevPowerMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevPowerMultiplierName, CFSTR("Localizable"), bundle, CFSTR("")); kChebyshevPowerName = CFCopyLocalizedStringFromTableInBundle(kChebyshevPowerName, CFSTR("Localizable"), bundle, CFSTR("")); kChebyshevMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevMultiplierName, CFSTR("Localizable"), bundle, CFSTR("")); kChebyshevCubedMultiplierName = CFCopyLocalizedStringFromTableInBundle(kChebyshevCubedMultiplierName, CFSTR("Localizable"), bundle, CFSTR("")); } bGLocalized = TRUE; //so never pass the test again... } GFinalBandPassFilter.Initialize( 2000.0f, 400.0f, GetSampleRate() ); SetParameter(RadioParam_ChebyshevPowerMultiplier, kDefaultValue_ChebyshevPowerMultiplier ); SetParameter(RadioParam_ChebyshevPower, kDefaultValue_ChebyshevPower ); SetParameter(RadioParam_ChebyshevMultiplier, kDefaultValue_ChebyshevMultiplier ); SetParameter(RadioParam_ChebyshevCubedMultiplier, kDefaultValue_ChebyshevCubedMultiplier ); }
//_____________________________________________________________________________ // AUPannerBase::AUPannerBase(AudioComponentInstance inAudioUnit) : AUBase(inAudioUnit, 1, 1), mBypassEffect(false) { { CABundleLocker lock; if (!sLocalized) { CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.apple.audio.units.Components") ); if (bundle != NULL) { kPanner_Azimuth_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Azimuth_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); kPanner_Elevation_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Elevation_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); kPanner_Distance_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Distance_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); kPanner_CoordScale_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_CoordScale_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); kPanner_RefDistance_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_RefDistance_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); kPanner_Gain_Name = CFCopyLocalizedStringFromTableInBundle(kPanner_Gain_Name, CFSTR("AudioUnits"), bundle, CFSTR("")); } sLocalized = true; } } CreateElements(); SetParameter(kPannerParam_Azimuth, kPannerParamDefault_Azimuth); SetParameter(kPannerParam_Elevation, kPannerParamDefault_Elevation); SetParameter(kPannerParam_Distance, kPannerParamDefault_Distance); SetParameter(kPannerParam_CoordScale, kPannerParamDefault_CoordScale); SetParameter(kPannerParam_RefDistance, kPannerParamDefault_RefDistance); SetParameter(kPannerParam_Gain, kPannerParamDefault_Gain); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // AUPulseDetector::AUPulseDetector // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AUPulseDetector::AUPulseDetector(AudioUnit component) : AUEffectBase(component), mChildObject(NULL) { CreateElements(); CAStreamBasicDescription monoDesc; monoDesc.SetAUCanonical (1, false); monoDesc.mSampleRate = 44100.; GetOutput(0)->SetStreamFormat(monoDesc); GetInput(0)->SetStreamFormat(monoDesc); Globals()->UseIndexedParameters (5); Globals()->SetParameter (kPulseThreshold, kPulseThresholdDefault); Globals()->SetParameter (kPulseLength, kPulseLengthDefault); Globals()->SetParameter (kPulseRestTime, kPulseRestTimeDefault); Globals()->SetParameter (kDoPulseDetection, kDoPulseDetectionDefault); Globals()->SetParameter (kWritePulseStats, 0); mPulseTimeStats = new PulseTS[kPulseTSSize]; #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // SinSynth::SinSynth // // This synth has No inputs, One output //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SinSynth::SinSynth(AudioUnit inComponentInstance) : AUMonotimbralInstrumentBase(inComponentInstance, 0, 1) { CreateElements(); Globals()->UseIndexedParameters(1); // we're only defining one param Globals()->SetParameter (kGlobalVolumeParam, 1.0); }
AUPinkNoise::AUPinkNoise(AudioUnit component) : AUBase(component, 0, 1), mPink (NULL) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); SetParameter(kParam_Volume, kAudioUnitScope_Global, 0, kDefaultValue_Volume, 0); SetParameter(kParam_On, kAudioUnitScope_Global, 0, 1, 0); }
AKSampler_Plugin::AKSampler_Plugin(AudioUnit inComponentInstance) : AUInstrumentBase(inComponentInstance, 0, 1) // 0 inputs, 1 output , AKCoreSampler() { presetFolderPath = nil; presetName = nil; CreateElements(); Globals()->UseIndexedParameters(kNumberOfParams); initForTesting(); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ÇPROJECTNAMEÈ::ÇPROJECTNAMEÈ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ÇPROJECTNAMEÈ::ÇPROJECTNAMEÈ(AudioUnit component) : AUEffectBase(component) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); SetParameter(kParam_One, kDefaultValue_ParamOne ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif }
MT32Synth::MT32Synth(ComponentInstance inComponentInstance) : MusicDeviceBase(inComponentInstance, 0, 8) { CreateElements(); Globals()->SetParameter(kGlobalVolumeParam, 2.111); Globals()->SetParameter(kInstrumentParam, 0.0); Globals()->SetParameter(kReverbEnabledParam, 1.0); Globals()->SetParameter(kReverbGainParam, 1.0); synth = NULL; lastBufferData = NULL; }
AKFlanger_Plugin::AKFlanger_Plugin(AudioUnit inComponentInstance) : AUEffectBase(inComponentInstance) , AudioKitCore::ModulatedDelay(kFlanger) , feedback(kFlangerDefaultFeedback) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParams); SetParameter(kModFrequency, kAudioUnitScope_Global, 0, kFlangerDefaultModFreqHz, 0); SetParameter(kModDepth, kAudioUnitScope_Global, 0, kFlangerDefaultDepth, 0); SetParameter(kFeedback, kAudioUnitScope_Global, 0, kFlangerDefaultFeedback, 0); SetParameter(kDryWetMix, kAudioUnitScope_Global, 0, kFlangerDefaultMix, 0); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Tremolo::Tremolo //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tremolo::Tremolo(AudioUnit component) : AUEffectBase(component) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); SetParameter(kParameter_Frequency, kDefaultValue_Tremolo_Freq); SetParameter(kParameter_Depth, kDefaultValue_Tremolo_Depth); SetParameter(kParameter_Waveform, kDefaultValue_Tremolo_Waveform); SetAFactoryPresetAsCurrent(kPresets[kPreset_Default]); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher(this); #endif }
Convolver2::Convolver2(AudioUnit component) : AUEffectBase(component) { CreateElements(); Globals()->UseIndexedParameters(NUM_PARAMS); editor = NULL; core = new Convolver2Core(NUM_PARAMS, VERSION, DEF_PRODUCT); Float64 srate; if(DispatchGetProperty(kAudioUnitProperty_SampleRate, kAudioUnitScope_Global, 0, &srate) != kAudioUnitErr_InvalidProperty) { core->setParameter(PRM_SAMPLE_RATE, srate, true); } #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher(this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // FullBacano::FullBacano //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FullBacano::FullBacano (AudioUnit component) : AUEffectBase (component) { /* ofstream logFile; logFile.open ("debugLog.raw"); logFile << "Writing this to a file.\n"; logFile.close(); */ CreateElements (); Globals () -> UseIndexedParameters (kNumberOfParameters); SetParameter ( // 1 kParameter_Frequency, kDefaultValue_FullBacano_Freq ); SetParameter ( // 2 kParameter_Bacaneria, kDefaultValue_FullBacano_Bacaneria ); SetParameter ( // 2 kParameter_Ganancia, kDefaultValue_FullBacano_Ganancia ); SetParameter ( // 3 kParameter_LaMondaEnElVolco, kDefaultValue_FullBacano_LaMondaEnElVolco ); // code for setting default values for the audio unit parameters SetAFactoryPresetAsCurrent ( // 1 kPresets [kPreset_Default] ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // SampleEffectUnit::SampleEffectUnit // //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SampleEffectUnit::SampleEffectUnit(AudioUnit component) : AUEffectBase(component) { CreateElements(); if (!sLocalized) { // Because we are in a component, we need to load our bundle by identifier so we can access our localized strings // It is important that the string passed here exactly matches that in the Info.plist Identifier string CFBundleRef bundle = CFBundleGetBundleWithIdentifier( CFSTR("com.acme.audiounit.passthrough") ); if (bundle != NULL) { for (int i = 0; i < kNumberPresets; i++ ) { kPresets[i].presetName = CFCopyLocalizedStringFromTableInBundle( kPresets[i].presetName, // string to localize CFSTR("Localizable"), // strings file to search bundle, // bundle to search CFSTR("")); // no comment } kParameterValueStringsOne = CFCopyLocalizedStringFromTableInBundle(kParameterValueStringsOne, CFSTR("Localizable"), bundle, CFSTR("")); kParameterValueStringsTwo = CFCopyLocalizedStringFromTableInBundle(kParameterValueStringsTwo, CFSTR("Localizable"), bundle, CFSTR("")); kParameterValueStringsThree = CFCopyLocalizedStringFromTableInBundle(kParameterValueStringsThree, CFSTR("Localizable"), bundle, CFSTR("")); kParameterOneName = CFCopyLocalizedStringFromTableInBundle(kParameterOneName, CFSTR("Localizable"), bundle, CFSTR("")); kParameterTwoName = CFCopyLocalizedStringFromTableInBundle(kParameterTwoName, CFSTR("Localizable"), bundle, CFSTR("")); kParameterThree_IndexedName = CFCopyLocalizedStringFromTableInBundle(kParameterThree_IndexedName, CFSTR("Localizable"), bundle, CFSTR("")); kParameterFourName = CFCopyLocalizedStringFromTableInBundle(kParameterFourName, CFSTR("Localizable"), bundle, CFSTR("")); } sLocalized = true; //so never pass the test again... } // example of setting up params... SetParameter(kParam_One, kDefaultValue_ParamOne ); SetParameter(kParam_Two, kDefaultValue_ParamTwo ); SetParameter(kParam_Three_Indexed, kDefaultValue_ParamThree_Indexed ); SetParameter(kParam_Four, kDefaultValue_ParamFour ); SetAFactoryPresetAsCurrent (kPresets[kPresetDefaultIndex]); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // TremoloUnit::TremoloUnit //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // The constructor for new TremoloUnit audio units TremoloUnit::TremoloUnit (AudioUnit component) : AUEffectBase (component) { // This method, defined in the AUBase superclass, ensures that the required audio unit // elements are created and initialized. CreateElements (); // Invokes the use of an STL vector for parameter access. // See AUBase/AUScopeElement.cpp Globals () -> UseIndexedParameters (kNumberOfParameters); // During instantiation, sets up the parameters according to their defaults. // The parameter defaults should correspond to the settings for the default preset. SetParameter ( kParameter_Frequency, kDefaultValue_Tremolo_Freq ); SetParameter ( kParameter_Depth, kDefaultValue_Tremolo_Depth ); SetParameter ( kParameter_Waveform, kDefaultValue_Tremolo_Waveform ); // Also during instantiation, sets the preset menu to indicate the default preset, // which corresponds to the default parameters. It's possible to set this so a // fresh audio unit indicates the wrong preset, so be careful to get it right. SetAFactoryPresetAsCurrent ( kPresets [kPreset_Default] ); #if AU_DEBUG_DISPATCHER mDebugDispatcher = new AUDebugDispatcher (this); #endif }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // HSPad::HSPad // // This synth has No inputs, One output //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HSPad::HSPad(ComponentInstance inComponentInstance) : AUMonotimbralInstrumentBase(inComponentInstance, 0, 1) { CreateElements(); Globals()->UseIndexedParameters(kNumberOfParameters); Globals()->SetParameter(kParameter_Volume, kDefaultValue_Volume); Globals()->SetParameter(kParameter_HarmonicsAmount, kDefaultValue_HarmonicsAmount); Globals()->SetParameter(kParameter_HarmonicsCurveSteepness, kDefaultValue_HarmonicsCurveSteepness); Globals()->SetParameter(kParameter_HarmonicsBalance, kDefaultValue_HarmonicsBalance); Globals()->SetParameter(kParameter_HarmonicBandwidth, kDefaultValue_HarmonicBandwidth); Globals()->SetParameter(kParameter_HarmonicProfile, kDefaultValue_HarmonicProfile); Globals()->SetParameter(kParameter_TouchSensitivity, kDefaultValue_TouchSensitivity); Globals()->SetParameter(kParameter_AttackTime, kDefaultValue_AttackTime); Globals()->SetParameter(kParameter_ReleaseTime, kDefaultValue_ReleaseTime); parameterListener = 0; wavetable = 0; }
ElCAJAS::ElCAJAS(AudioUnit component) : AUEffectBase(component), c_jar(NULL), c_error(JARInsert::kNoErr) { CreateElements(); }