mirror of
https://github.com/airwindows/airwindows.git
synced 2026-05-21 06:46:21 -06:00
270 lines
No EOL
9.4 KiB
C++
Executable file
270 lines
No EOL
9.4 KiB
C++
Executable file
/*
|
|
* File: kWoodRoom.h
|
|
*
|
|
* Version: 1.0
|
|
*
|
|
* Created: 11/1/25
|
|
*
|
|
* Copyright: Copyright © 2025 Airwindows, Airwindows uses the MIT license
|
|
*
|
|
* Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
|
|
* consideration of your agreement to the following terms, and your use, installation, modification
|
|
* or redistribution of this Apple software constitutes acceptance of these terms. If you do
|
|
* not agree with these terms, please do not use, install, modify or redistribute this Apple
|
|
* software.
|
|
*
|
|
* In consideration of your agreement to abide by the following terms, and subject to these terms,
|
|
* Apple grants you a personal, non-exclusive license, under Apple's copyrights in this
|
|
* original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the
|
|
* Apple Software, with or without modifications, in source and/or binary forms; provided that if you
|
|
* redistribute the Apple Software in its entirety and without modifications, you must retain this
|
|
* notice and the following text and disclaimers in all such redistributions of the Apple Software.
|
|
* Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to
|
|
* endorse or promote products derived from the Apple Software without specific prior written
|
|
* permission from Apple. Except as expressly stated in this notice, no other rights or
|
|
* licenses, express or implied, are granted by Apple herein, including but not limited to any
|
|
* patent rights that may be infringed by your derivative works or by other works in which the
|
|
* Apple Software may be incorporated.
|
|
*
|
|
* The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR
|
|
* IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY
|
|
* AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE
|
|
* OR IN COMBINATION WITH YOUR PRODUCTS.
|
|
*
|
|
* IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
|
|
* REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER
|
|
* UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN
|
|
* IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
*/
|
|
#include "AUEffectBase.h"
|
|
#include "kWoodRoomVersion.h"
|
|
|
|
#if AU_DEBUG_DISPATCHER
|
|
#include "AUDebugDispatcher.h"
|
|
#endif
|
|
|
|
|
|
#ifndef __kWoodRoom_h__
|
|
#define __kWoodRoom_h__
|
|
|
|
|
|
#pragma mark ____kWoodRoom Parameters
|
|
|
|
// parameters
|
|
static const float kDefaultValue_ParamA = 0.5;
|
|
static const float kDefaultValue_ParamB = 0.5;
|
|
static const float kDefaultValue_ParamC = 0.25;
|
|
static const float kDefaultValue_ParamD = 0.5;
|
|
static const float kDefaultValue_ParamE = 0.5;
|
|
static const float kDefaultValue_ParamF = 0.5;
|
|
|
|
static CFStringRef kParameterAName = CFSTR("Regen");
|
|
static CFStringRef kParameterBName = CFSTR("Derez");
|
|
static CFStringRef kParameterCName = CFSTR("Filter");
|
|
static CFStringRef kParameterDName = CFSTR("EarlyRf");
|
|
static CFStringRef kParameterEName = CFSTR("Positin");
|
|
static CFStringRef kParameterFName = CFSTR("Dry/Wet");
|
|
|
|
enum {
|
|
kParam_A =0,
|
|
kParam_B =1,
|
|
kParam_C =2,
|
|
kParam_D =3,
|
|
kParam_E =4,
|
|
kParam_F =5,
|
|
//Add your parameters here...
|
|
kNumberOfParameters=6
|
|
};
|
|
|
|
const int d3A = 581; const int d3B = 831; const int d3C = 832;
|
|
const int d3D = 574; const int d3E = 598; const int d3F = 685;
|
|
const int d3G = 499; const int d3H = 573; const int d3I = 655;
|
|
#define THREEBYTHREE true
|
|
const int d6A = 154; const int d6B = 832; const int d6C = 109; const int d6D = 685; const int d6E = 33; const int d6F = 12; const int d6G = 27; const int d6H = 30; const int d6I = 339; const int d6J = 499; const int d6K = 296; const int d6L = 169; const int d6M = 169; const int d6N = 831; const int d6O = 15; const int d6P = 411; const int d6Q = 238; const int d6R = 68; const int d6S = 0; const int d6T = 8; const int d6U = 655; const int d6V = 581; const int d6W = 465; const int d6X = 173; const int d6Y = 3; const int d6ZA = 96; const int d6ZB = 573; const int d6ZC = 243; const int d6ZD = 30; const int d6ZE = 188; const int d6ZF = 291; const int d6ZG = 11; const int d6ZH = 372; const int d6ZI = 574; const int d6ZJ = 100; const int d6ZK = 598; //1 to 90 ms, 249 seat club
|
|
#define SIXBYSIX true // 249seat154832109x6 on 2025-10-31 kWoodRoom
|
|
const int early[] = {0, 3, 8, 11, 12, 15, 27, 30, 30, 33, 68, 96, 100, 109, 154, 169, 169, 173, 188, 238, 243, 291, 296, 339, 372, 411, 465, 499, 573, 574, 581, 598, 655, 685, 831, 832};
|
|
|
|
#pragma mark ____kWoodRoom
|
|
class kWoodRoom : public AUEffectBase
|
|
{
|
|
public:
|
|
kWoodRoom(AudioUnit component);
|
|
#if AU_DEBUG_DISPATCHER
|
|
virtual ~kWoodRoom () { delete mDebugDispatcher; }
|
|
#endif
|
|
|
|
virtual ComponentResult Reset(AudioUnitScope inScope, AudioUnitElement inElement);
|
|
|
|
virtual OSStatus ProcessBufferLists(AudioUnitRenderActionFlags & ioActionFlags,
|
|
const AudioBufferList & inBuffer, AudioBufferList & outBuffer,
|
|
UInt32 inFramesToProcess);
|
|
virtual UInt32 SupportedNumChannels(const AUChannelInfo ** outInfo);
|
|
|
|
virtual ComponentResult GetParameterValueStrings(AudioUnitScope inScope,
|
|
AudioUnitParameterID inParameterID,
|
|
CFArrayRef * outStrings);
|
|
|
|
virtual ComponentResult GetParameterInfo(AudioUnitScope inScope,
|
|
AudioUnitParameterID inParameterID,
|
|
AudioUnitParameterInfo &outParameterInfo);
|
|
|
|
virtual ComponentResult GetPropertyInfo(AudioUnitPropertyID inID,
|
|
AudioUnitScope inScope,
|
|
AudioUnitElement inElement,
|
|
UInt32 & outDataSize,
|
|
Boolean & outWritable );
|
|
|
|
virtual ComponentResult GetProperty(AudioUnitPropertyID inID,
|
|
AudioUnitScope inScope,
|
|
AudioUnitElement inElement,
|
|
void * outData);
|
|
|
|
virtual ComponentResult Initialize();
|
|
virtual bool SupportsTail () { return true; }
|
|
virtual Float64 GetTailTime() {return (1.0/GetSampleRate())*0.0;} //in SECONDS! gsr * a number = in samples
|
|
virtual Float64 GetLatency() {return (1.0/GetSampleRate())*0.0;} // in SECONDS! gsr * a number = in samples
|
|
|
|
/*! @method Version */
|
|
virtual ComponentResult Version() { return kkWoodRoomVersion; }
|
|
|
|
private:
|
|
double a3AL[d3A+5];
|
|
double a3BL[d3B+5];
|
|
double a3CL[d3C+5];
|
|
double a3DL[d3D+5];
|
|
double a3EL[d3E+5];
|
|
double a3FL[d3F+5];
|
|
double a3GL[d3G+5];
|
|
double a3HL[d3H+5];
|
|
double a3IL[d3I+5];
|
|
double a3AR[d3A+5];
|
|
double a3BR[d3B+5];
|
|
double a3CR[d3C+5];
|
|
double a3DR[d3D+5];
|
|
double a3ER[d3E+5];
|
|
double a3FR[d3F+5];
|
|
double a3GR[d3G+5];
|
|
double a3HR[d3H+5];
|
|
double a3IR[d3I+5];
|
|
int c3AL,c3AR,c3BL,c3BR,c3CL,c3CR,c3DL,c3DR,c3EL,c3ER;
|
|
int c3FL,c3FR,c3GL,c3GR,c3HL,c3HR,c3IL,c3IR;
|
|
|
|
double a6AL[d6A+5];
|
|
double a6BL[d6B+5];
|
|
double a6CL[d6C+5];
|
|
double a6DL[d6D+5];
|
|
double a6EL[d6E+5];
|
|
double a6FL[d6F+5];
|
|
double a6GL[d6G+5];
|
|
double a6HL[d6H+5];
|
|
double a6IL[d6I+5];
|
|
double a6JL[d6J+5];
|
|
double a6KL[d6K+5];
|
|
double a6LL[d6L+5];
|
|
double a6ML[d6M+5];
|
|
double a6NL[d6N+5];
|
|
double a6OL[d6O+5];
|
|
double a6PL[d6P+5];
|
|
double a6QL[d6Q+5];
|
|
double a6RL[d6R+5];
|
|
double a6SL[d6S+5];
|
|
double a6TL[d6T+5];
|
|
double a6UL[d6U+5];
|
|
double a6VL[d6V+5];
|
|
double a6WL[d6W+5];
|
|
double a6XL[d6X+5];
|
|
double a6YL[d6Y+5];
|
|
double a6ZAL[d6ZA+5];
|
|
double a6ZBL[d6ZB+5];
|
|
double a6ZCL[d6ZC+5];
|
|
double a6ZDL[d6ZD+5];
|
|
double a6ZEL[d6ZE+5];
|
|
double a6ZFL[d6ZF+5];
|
|
double a6ZGL[d6ZG+5];
|
|
double a6ZHL[d6ZH+5];
|
|
double a6ZIL[d6ZI+5];
|
|
double a6ZJL[d6ZJ+5];
|
|
double a6ZKL[d6ZK+5];
|
|
double a6AR[d6A+5];
|
|
double a6BR[d6B+5];
|
|
double a6CR[d6C+5];
|
|
double a6DR[d6D+5];
|
|
double a6ER[d6E+5];
|
|
double a6FR[d6F+5];
|
|
double a6GR[d6G+5];
|
|
double a6HR[d6H+5];
|
|
double a6IR[d6I+5];
|
|
double a6JR[d6J+5];
|
|
double a6KR[d6K+5];
|
|
double a6LR[d6L+5];
|
|
double a6MR[d6M+5];
|
|
double a6NR[d6N+5];
|
|
double a6OR[d6O+5];
|
|
double a6PR[d6P+5];
|
|
double a6QR[d6Q+5];
|
|
double a6RR[d6R+5];
|
|
double a6SR[d6S+5];
|
|
double a6TR[d6T+5];
|
|
double a6UR[d6U+5];
|
|
double a6VR[d6V+5];
|
|
double a6WR[d6W+5];
|
|
double a6XR[d6X+5];
|
|
double a6YR[d6Y+5];
|
|
double a6ZAR[d6ZA+5];
|
|
double a6ZBR[d6ZB+5];
|
|
double a6ZCR[d6ZC+5];
|
|
double a6ZDR[d6ZD+5];
|
|
double a6ZER[d6ZE+5];
|
|
double a6ZFR[d6ZF+5];
|
|
double a6ZGR[d6ZG+5];
|
|
double a6ZHR[d6ZH+5];
|
|
double a6ZIR[d6ZI+5];
|
|
double a6ZJR[d6ZJ+5];
|
|
double a6ZKR[d6ZK+5];
|
|
int c6AL,c6BL,c6CL,c6DL,c6EL,c6FL,c6GL,c6HL,c6IL;
|
|
int c6JL,c6KL,c6LL,c6ML,c6NL,c6OL,c6PL,c6QL,c6RL;
|
|
int c6SL,c6TL,c6UL,c6VL,c6WL,c6XL,c6YL,c6ZAL,c6ZBL;
|
|
int c6ZCL,c6ZDL,c6ZEL,c6ZFL,c6ZGL,c6ZHL,c6ZIL,c6ZJL,c6ZKL;
|
|
int c6AR,c6BR,c6CR,c6DR,c6ER,c6FR,c6GR,c6HR,c6IR;
|
|
int c6JR,c6KR,c6LR,c6MR,c6NR,c6OR,c6PR,c6QR,c6RR;
|
|
int c6SR,c6TR,c6UR,c6VR,c6WR,c6XR,c6YR,c6ZAR,c6ZBR;
|
|
int c6ZCR,c6ZDR,c6ZER,c6ZFR,c6ZGR,c6ZHR,c6ZIR,c6ZJR,c6ZKR;
|
|
double f6AL,f6BL,f6CL,f6DL,f6EL,f6FL;
|
|
double f6FR,f6LR,f6RR,f6XR,f6ZER,f6ZKR;
|
|
double avg6L,avg6R;
|
|
|
|
enum {
|
|
bez_AL,
|
|
bez_AR,
|
|
bez_BL,
|
|
bez_BR,
|
|
bez_CL,
|
|
bez_CR,
|
|
bez_InL,
|
|
bez_InR,
|
|
bez_UnInL,
|
|
bez_UnInR,
|
|
bez_SampL,
|
|
bez_SampR,
|
|
bez_AvgInSampL,
|
|
bez_AvgInSampR,
|
|
bez_AvgOutSampL,
|
|
bez_AvgOutSampR,
|
|
bez_cycle,
|
|
bez_total
|
|
}; //the new undersampling. bez signifies the bezier curve reconstruction
|
|
double bez[bez_total];
|
|
|
|
double bezF[bez_total];
|
|
|
|
uint32_t fpdL;
|
|
uint32_t fpdR;
|
|
};
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
#endif |