Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ playground.xcworkspace
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
AUInstrument.xcodeproj/xcshareddata/
67 changes: 49 additions & 18 deletions AUInstrument.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
07DBB1E31CCB0A8000D68648 /* DSPKernel.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 07DBB1E01CCB0A8000D68648 /* DSPKernel.hpp */; };
07DBB1E41CCB0A8000D68648 /* DSPKernel.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07DBB1E11CCB0A8000D68648 /* DSPKernel.mm */; };
07DBB1E71CCB0A9000D68648 /* Oscillator.h in Headers */ = {isa = PBXBuildFile; fileRef = 07DBB1E51CCB0A9000D68648 /* Oscillator.h */; };
07DBB1E81CCB0A9000D68648 /* Oscillator.m in Sources */ = {isa = PBXBuildFile; fileRef = 07DBB1E61CCB0A9000D68648 /* Oscillator.m */; };
07DBB1E81CCB0A9000D68648 /* Oscillator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07DBB1E61CCB0A9000D68648 /* Oscillator.mm */; };
07DBB1ED1CCB0AA900D68648 /* WaveSynthAU.h in Headers */ = {isa = PBXBuildFile; fileRef = 07DBB1E91CCB0AA900D68648 /* WaveSynthAU.h */; settings = {ATTRIBUTES = (Public, ); }; };
07DBB1EE1CCB0AA900D68648 /* WaveSynthAU.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07DBB1EA1CCB0AA900D68648 /* WaveSynthAU.mm */; };
07F092DA1CCEB48E00794E34 /* AudioEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = 07DBB1D21CCB0A6200D68648 /* AudioEngine.m */; };
Expand Down Expand Up @@ -119,7 +119,7 @@
07DBB1E01CCB0A8000D68648 /* DSPKernel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = DSPKernel.hpp; path = DSPKernel/DSPKernel.hpp; sourceTree = "<group>"; };
07DBB1E11CCB0A8000D68648 /* DSPKernel.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DSPKernel.mm; path = DSPKernel/DSPKernel.mm; sourceTree = "<group>"; };
07DBB1E51CCB0A9000D68648 /* Oscillator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Oscillator.h; path = WaveSynthFramework/Oscillator/Oscillator.h; sourceTree = SOURCE_ROOT; };
07DBB1E61CCB0A9000D68648 /* Oscillator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Oscillator.m; path = WaveSynthFramework/Oscillator/Oscillator.m; sourceTree = SOURCE_ROOT; };
07DBB1E61CCB0A9000D68648 /* Oscillator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Oscillator.mm; path = WaveSynthFramework/Oscillator/Oscillator.mm; sourceTree = SOURCE_ROOT; };
07DBB1E91CCB0AA900D68648 /* WaveSynthAU.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveSynthAU.h; sourceTree = "<group>"; };
07DBB1EA1CCB0AA900D68648 /* WaveSynthAU.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WaveSynthAU.mm; sourceTree = "<group>"; };
07FC1E851CC09D2D00C4AD6B /* AUInstrument.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AUInstrument.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -205,7 +205,7 @@
isa = PBXGroup;
children = (
07DBB1E51CCB0A9000D68648 /* Oscillator.h */,
07DBB1E61CCB0A9000D68648 /* Oscillator.m */,
07DBB1E61CCB0A9000D68648 /* Oscillator.mm */,
);
name = Oscillator;
sourceTree = "<group>";
Expand Down Expand Up @@ -249,6 +249,7 @@
07FC1E861CC09D2D00C4AD6B /* Products */,
);
sourceTree = "<group>";
usesTabs = 0;
};
07FC1E861CC09D2D00C4AD6B /* Products */ = {
isa = PBXGroup;
Expand Down Expand Up @@ -383,7 +384,7 @@
07FC1E7D1CC09D2C00C4AD6B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0730;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = "Eric George";
TargetAttributes = {
075D4EFE1CCB232D001D95E4 = {
Expand All @@ -399,7 +400,7 @@
};
buildConfigurationList = 07FC1E801CC09D2C00C4AD6B /* Build configuration list for PBXProject "AUInstrument" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -464,7 +465,7 @@
075F69C51CCD907C00C7E651 /* MIDIEvent.m in Sources */,
07FD040E1CCC6EEB00BA14BB /* WaveSynthProc.mm in Sources */,
0765D8911CCF07B200DE7A19 /* WaveSynthAUViewController.m in Sources */,
07DBB1E81CCB0A9000D68648 /* Oscillator.m in Sources */,
07DBB1E81CCB0A9000D68648 /* Oscillator.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -533,7 +534,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = WaveSynthExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = AUInstrument.WaveSynthExtension;
Expand All @@ -546,7 +547,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = WaveSynthExtension/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = AUInstrument.WaveSynthExtension;
Expand All @@ -560,9 +561,9 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -572,6 +573,8 @@
PRODUCT_BUNDLE_IDENTIFIER = WaveSynthFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -582,9 +585,9 @@
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand All @@ -594,6 +597,8 @@
PRODUCT_BUNDLE_IDENTIFIER = WaveSynthFramework;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -603,27 +608,40 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = FUJX4L72NH;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -637,7 +655,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -649,35 +667,48 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = FUJX4L72NH;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -690,7 +721,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AUInstrument/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = AUInstrument;
Expand All @@ -703,7 +734,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AUInstrument/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = AUInstrument;
Expand Down
10 changes: 5 additions & 5 deletions AUInstrument/Audio Engine/AudioEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ - (void) setupAUWithComponentDescription:(AudioComponentDescription)componentDes
options:kAudioComponentInstantiation_LoadOutOfProcess
completionHandler:^ (AVAudioUnit * __nullable audioUnit, NSError * __nullable error)
{
_synthNode = audioUnit;
self.synth = _synthNode.audioUnit;
self.synthAU = _synthNode.AUAudioUnit;
self->_synthNode = audioUnit;
self.synth = self->_synthNode.audioUnit;
self.synthAU = self->_synthNode.AUAudioUnit;

[_engine attachNode:_synthNode];
[self->_engine attachNode:self->_synthNode];

AVAudioFormat *stereoFormat = [[AVAudioFormat alloc] initStandardFormatWithSampleRate:hardwareFormat.sampleRate channels:2];
[_engine connect:_synthNode to:[_engine mainMixerNode] format:stereoFormat];
[self->_engine connect:self->_synthNode to:[self->_engine mainMixerNode] format:stereoFormat];

[self startEngine];

Expand Down
2 changes: 1 addition & 1 deletion AUInstrument/MIDI/MIDIConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef MIDIConstants_h
#define MIDIConstants_h

typedef NS_ENUM(NSUInteger, MIDIMessageType)
typedef NS_ENUM(NSUInteger, myMIDIMessageType)
{
/* Note off */
MIDIMessageType_NoteOff = 0x80,
Expand Down
6 changes: 3 additions & 3 deletions AUInstrument/MIDI/MIDILogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

@import CoreMIDI;

void printDevices();
void printSources();
void printDestinations();
void printDevices(void);
void printSources(void);
void printDestinations(void);

void LogMidiEventToConsole(uint8_t status,
uint8_t channel,
Expand Down
10 changes: 6 additions & 4 deletions AUInstrument/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ - (void) connectParametersToControls

_volumeParameter = [parameterTree valueForKey:volumeParamKey];

__weak __typeof(self) weakSelf = self;
_parameterObserverToken = [parameterTree tokenByAddingParameterObserver:^(AUParameterAddress address, AUValue value) {
dispatch_sync(dispatch_get_main_queue(), ^{
if (address == _volumeParameter.address)
{
[self updateVolume];
__strong __typeof(weakSelf) Self = weakSelf;
if (Self) {
if (address == Self->_volumeParameter.address) {
[Self updateVolume];
}
}

});
}];

Expand Down
Loading