Skip to content

Commit

Permalink
Ableton Link Tempo Synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
aure committed Jul 16, 2018
1 parent 56fbd8b commit 360f7e4
Show file tree
Hide file tree
Showing 8 changed files with 621 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -66,3 +66,6 @@ fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
/Podfile.lock

AudioKitSynthOne/Link/include
AudioKitSynthOne/Link/lib
46 changes: 46 additions & 0 deletions AudioKitSynthOne.xcodeproj/project.pbxproj
Expand Up @@ -73,6 +73,8 @@
C435C58420C530C900DAECCD /* S1NoteState.mm in Sources */ = {isa = PBXBuildFile; fileRef = C435C56D20C530C900DAECCD /* S1NoteState.mm */; };
C435C58520C530C900DAECCD /* S1AudioUnit.mm in Sources */ = {isa = PBXBuildFile; fileRef = C435C57020C530C900DAECCD /* S1AudioUnit.mm */; };
C435C58920C530C900DAECCD /* S1DSPKernel.mm in Sources */ = {isa = PBXBuildFile; fileRef = C435C57620C530C900DAECCD /* S1DSPKernel.mm */; };
C43A13AE20FC4C7C009E2B30 /* ABLLinkManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C43A13AD20FC4C7C009E2B30 /* ABLLinkManager.swift */; };
C43A13B520FC4C92009E2B30 /* libABLLink.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C43A13B020FC4C92009E2B30 /* libABLLink.a */; };
C47FB3C31F36694300EF2F01 /* RateKnob.swift in Sources */ = {isa = PBXBuildFile; fileRef = C47FB3C21F36694300EF2F01 /* RateKnob.swift */; };
C4B490E720C649D900FD565A /* S1DSPKernel+destroy.mm in Sources */ = {isa = PBXBuildFile; fileRef = C4B490E520C649D900FD565A /* S1DSPKernel+destroy.mm */; };
C4B490E920C64AC600FD565A /* S1DSPKernel+MIDI.mm in Sources */ = {isa = PBXBuildFile; fileRef = C4B490E820C64AC600FD565A /* S1DSPKernel+MIDI.mm */; };
Expand Down Expand Up @@ -302,6 +304,11 @@
C435C57720C530C900DAECCD /* S1DSPKernel.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = S1DSPKernel.hpp; sourceTree = "<group>"; };
C435C58C20C5336600DAECCD /* S1Rate.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = S1Rate.hpp; sourceTree = "<group>"; };
C435C58D20C5336600DAECCD /* AKSynthOneRate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AKSynthOneRate.h; sourceTree = "<group>"; };
C43A13AD20FC4C7C009E2B30 /* ABLLinkManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ABLLinkManager.swift; sourceTree = "<group>"; };
C43A13B020FC4C92009E2B30 /* libABLLink.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libABLLink.a; sourceTree = "<group>"; };
C43A13B220FC4C92009E2B30 /* ABLLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABLLink.h; sourceTree = "<group>"; };
C43A13B320FC4C92009E2B30 /* ABLLinkUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABLLinkUtils.h; sourceTree = "<group>"; };
C43A13B420FC4C92009E2B30 /* ABLLinkSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABLLinkSettingsViewController.h; sourceTree = "<group>"; };
C47FB3C21F36694300EF2F01 /* RateKnob.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RateKnob.swift; sourceTree = "<group>"; };
C4B490E520C649D900FD565A /* S1DSPKernel+destroy.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "S1DSPKernel+destroy.mm"; sourceTree = "<group>"; };
C4B490E820C64AC600FD565A /* S1DSPKernel+MIDI.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "S1DSPKernel+MIDI.mm"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -428,6 +435,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C43A13B520FC4C92009E2B30 /* libABLLink.a in Frameworks */,
48C3EE7437FA1B1E7916844E /* Pods_AudioKitSynthOne.framework in Frameworks */,
C4B9C02B201D54D400D9833D /* AudioToolbox.framework in Frameworks */,
);
Expand Down Expand Up @@ -754,6 +762,34 @@
path = Rate;
sourceTree = "<group>";
};
C43A13AC20FC4B3A009E2B30 /* Link */ = {
isa = PBXGroup;
children = (
C43A13AD20FC4C7C009E2B30 /* ABLLinkManager.swift */,
C43A13B120FC4C92009E2B30 /* include */,
C43A13AF20FC4C92009E2B30 /* lib */,
);
path = Link;
sourceTree = "<group>";
};
C43A13AF20FC4C92009E2B30 /* lib */ = {
isa = PBXGroup;
children = (
C43A13B020FC4C92009E2B30 /* libABLLink.a */,
);
path = lib;
sourceTree = "<group>";
};
C43A13B120FC4C92009E2B30 /* include */ = {
isa = PBXGroup;
children = (
C43A13B220FC4C92009E2B30 /* ABLLink.h */,
C43A13B320FC4C92009E2B30 /* ABLLinkUtils.h */,
C43A13B420FC4C92009E2B30 /* ABLLinkSettingsViewController.h */,
);
path = include;
sourceTree = "<group>";
};
C4B490FF20C7C5C500FD565A /* Sequencer */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -988,6 +1024,7 @@
C4B491A520C7C95900FD565A /* Generators */,
C4B4917520C7C75500FD565A /* Header */,
C4B4911620C7C62A00FD565A /* Keyboard */,
C43A13AC20FC4B3A009E2B30 /* Link */,
C435C52620C52D2E00DAECCD /* MIDI */,
C4B4916320C7C72900FD565A /* Manager */,
C4B4915C20C7C72900FD565A /* Navigation */,
Expand Down Expand Up @@ -1251,6 +1288,7 @@
C4B4919920C7C81200FD565A /* MailingListViewController.swift in Sources */,
C4B4916920C7C72A00FD565A /* ChildPanel.swift in Sources */,
C435C57B20C530C900DAECCD /* AEWeakRetainingProxy.m in Sources */,
C43A13AE20FC4C7C009E2B30 /* ABLLinkManager.swift in Sources */,
C4B491B520C7D19F00FD565A /* TempoStepper.swift in Sources */,
C435C58220C530C900DAECCD /* AEMainThreadEndpoint.m in Sources */,
C4F7ECB71F244A510011B119 /* KnobStyleKit.swift in Sources */,
Expand Down Expand Up @@ -1593,6 +1631,10 @@
INFOPLIST_FILE = AudioKitSynthOne/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/AudioKitSynthOne/Link/lib",
);
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.audiokitpro.AudioKitSynthOne;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1621,6 +1663,10 @@
INFOPLIST_FILE = AudioKitSynthOne/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/AudioKitSynthOne/Link/lib",
);
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.audiokitpro.AudioKitSynthOne;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
9 changes: 5 additions & 4 deletions AudioKitSynthOne/Base.lproj/Main.storyboard
Expand Up @@ -200,7 +200,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="OxM-Pu-Zba" customClass="SynthButton" customModule="AudioKitSynthOne" customModuleProvider="target">
<rect key="frame" x="224" y="7" width="69" height="29"/>
<rect key="frame" x="289" y="7" width="69" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<fontDescription key="fontDescription" name="AvenirNextCondensed-Regular" family="Avenir Next Condensed" pointSize="16"/>
Expand All @@ -213,7 +213,7 @@
</state>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Z4W-Gh-RiQ" customClass="SynthButton" customModule="AudioKitSynthOne" customModuleProvider="target">
<rect key="frame" x="166" y="7" width="50" height="29"/>
<rect key="frame" x="231" y="7" width="50" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<fontDescription key="fontDescription" name="AvenirNextCondensed-Regular" family="Avenir Next Condensed" pointSize="16"/>
Expand All @@ -230,8 +230,8 @@
</segue>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xv6-Gi-7B2" customClass="SynthButton" customModule="AudioKitSynthOne" customModuleProvider="target">
<rect key="frame" x="300" y="7" width="50" height="29"/>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xv6-Gi-7B2" customClass="AKLinkButton" customModule="AudioKitSynthOne" customModuleProvider="target">
<rect key="frame" x="167" y="7" width="50" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<fontDescription key="fontDescription" name="AvenirNextCondensed-Regular" family="Avenir Next Condensed" pointSize="16"/>
Expand Down Expand Up @@ -275,6 +275,7 @@
<outlet property="keyboardBottomConstraint" destination="ChZ-wF-sPF" id="i5l-NZ-wLj"/>
<outlet property="keyboardToggle" destination="O7h-tw-s2d" id="4MG-Tz-Df0"/>
<outlet property="keyboardView" destination="kQD-gK-cOc" id="qex-X3-Wi8"/>
<outlet property="linkButton" destination="xv6-Gi-7B2" id="lkM-xb-iza"/>
<outlet property="midiButton" destination="C9j-zW-Pky" id="Xwb-TL-joD"/>
<outlet property="midiLearnToggle" destination="VNg-MV-vHn" id="cjB-sS-aDd"/>
<outlet property="modWheelPad" destination="SJO-uT-R2c" id="CgQ-Uz-iwX"/>
Expand Down
5 changes: 5 additions & 0 deletions AudioKitSynthOne/DSP/AudioKitSynthOne-Bridging-Header.h
Expand Up @@ -12,3 +12,8 @@
#import "S1Parameter.h"
#import "AKSynthOneRate.h"
#import "Audiobus.h"

#include "ABLLink.h"
#include "ABLLinkUtils.h"
#include "ABLLinkSettingsViewController.h"

6 changes: 6 additions & 0 deletions AudioKitSynthOne/Generators/GeneratorsPanelController.swift
Expand Up @@ -112,6 +112,12 @@ class GeneratorsPanelController: PanelController {

// Setup Audio Plot Display
setupAudioPlot()

// Subscribe tempo change events
ABLLinkManager.shared.add(listener: .tempo({ bpm, quantum in
self.tempoStepper.value = bpm
self.conductor.synth.setSynthParameter(.arpRate, bpm)
}))
}

func setupAudioPlot() {
Expand Down

0 comments on commit 360f7e4

Please sign in to comment.