Skip to content

Commit

Permalink
Merge pull request #140 from NickCulbertson/NewRecipes
Browse files Browse the repository at this point in the history
Add STK + MIDIKit Recipe
  • Loading branch information
NickCulbertson authored Dec 8, 2023
2 parents 51a1655 + d2c0f18 commit d2da7bd
Show file tree
Hide file tree
Showing 12 changed files with 270 additions and 77 deletions.
17 changes: 17 additions & 0 deletions Cookbook/Cookbook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
5A7F40462B21FD06000A28F9 /* Waveform in Frameworks */ = {isa = PBXBuildFile; productRef = 5A7F40452B21FD06000A28F9 /* Waveform */; };
5A7F40492B21FE34000A28F9 /* PianoRoll in Frameworks */ = {isa = PBXBuildFile; productRef = 5A7F40482B21FE34000A28F9 /* PianoRoll */; };
5A7F404C2B220667000A28F9 /* STKAudioKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5A7F404B2B220667000A28F9 /* STKAudioKit */; };
5A7F40572B22774A000A28F9 /* MIDIKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5A7F40562B22774A000A28F9 /* MIDIKit */; };
C446DE542528D8E700138D0A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C446DE522528D8E700138D0A /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

Expand All @@ -40,6 +41,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5A7F40572B22774A000A28F9 /* MIDIKit in Frameworks */,
5A7F404C2B220667000A28F9 /* STKAudioKit in Frameworks */,
5A7F40432B21F314000A28F9 /* Flow in Frameworks */,
5A7F40492B21FE34000A28F9 /* PianoRoll in Frameworks */,
Expand Down Expand Up @@ -133,6 +135,7 @@
5A7F40452B21FD06000A28F9 /* Waveform */,
5A7F40482B21FE34000A28F9 /* PianoRoll */,
5A7F404B2B220667000A28F9 /* STKAudioKit */,
5A7F40562B22774A000A28F9 /* MIDIKit */,
);
productName = Cookbook;
productReference = C446DE442528D8E600138D0A /* Cookbook.app */;
Expand Down Expand Up @@ -166,6 +169,7 @@
5A7F40442B21FD06000A28F9 /* XCRemoteSwiftPackageReference "Waveform" */,
5A7F40472B21FE34000A28F9 /* XCRemoteSwiftPackageReference "PianoRoll" */,
5A7F404A2B220667000A28F9 /* XCRemoteSwiftPackageReference "STKAudioKit" */,
5A7F40552B22774A000A28F9 /* XCRemoteSwiftPackageReference "MIDIKit" */,
);
productRefGroup = C446DE452528D8E600138D0A /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -431,6 +435,14 @@
minimumVersion = 5.5.4;
};
};
5A7F40552B22774A000A28F9 /* XCRemoteSwiftPackageReference "MIDIKit" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/orchetect/MIDIKit";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.9.4;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
Expand Down Expand Up @@ -458,6 +470,11 @@
package = 5A7F404A2B220667000A28F9 /* XCRemoteSwiftPackageReference "STKAudioKit" */;
productName = STKAudioKit;
};
5A7F40562B22774A000A28F9 /* MIDIKit */ = {
isa = XCSwiftPackageProductDependency;
package = 5A7F40552B22774A000A28F9 /* XCRemoteSwiftPackageReference "MIDIKit" */;
productName = MIDIKit;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = C446DE3C2528D8E600138D0A /* Project object */;
Expand Down
23 changes: 12 additions & 11 deletions Cookbook/CookbookCommon/Sources/CookbookCommon/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Operations") {
Group {
Expand All @@ -59,7 +59,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Physical Models") {
Group {
Expand All @@ -75,7 +75,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Effects") {
Group {
Expand Down Expand Up @@ -109,7 +109,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Distortion") {
Group {
Expand All @@ -122,7 +122,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Reverb") {
Group {
Expand All @@ -136,7 +136,7 @@ struct MasterView: View {
}
}
}

DisclosureGroup("Filters") {
Group {
NavigationLink("Band Pass Butterworth Filter",
Expand Down Expand Up @@ -172,7 +172,7 @@ struct MasterView: View {
NavigationLink("Tone Complement Filter", destination: ToneComplementFilterView())
}
}

Group {
DisclosureGroup("Oscillators") {
Group {
Expand All @@ -185,15 +185,15 @@ struct MasterView: View {
NavigationLink("Waveform Morphing", destination: MorphingOscillatorView())
}
}

DisclosureGroup("Audio Player") {
Group {
NavigationLink("Completion Handler", destination: AudioPlayerCompletionHandler())
NavigationLink("Multi Segment Player", destination: MultiSegmentPlayerView())
NavigationLink("Playlist", destination: PlaylistView())
}
}

Group {
DisclosureGroup("Additional Packages") {
Group {
Expand All @@ -206,7 +206,7 @@ struct MasterView: View {
}
}
}

Group {
DisclosureGroup("Uncategorized Demos") {
Group {
Expand All @@ -216,7 +216,7 @@ struct MasterView: View {
}
}
}

DisclosureGroup("WIP") {
Group {
NavigationLink("Base Tap Demo", destination: BaseTapDemoView())
Expand All @@ -225,6 +225,7 @@ struct MasterView: View {
NavigationLink("Input Device Demo", destination: InputDeviceDemoView())
NavigationLink("MIDI Port Test", destination: MIDIPortTestView())
NavigationLink("Polyphonic Oscillator", destination: PolyphonicOscillatorView())
NavigationLink("Polyphonic STK + MIDIKit", destination: PolyphonicSTKView())
NavigationLink("Roland Tb303 Filter", destination: RolandTB303FilterView())
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ struct ArpeggiatorView: View {
@Environment(\.colorScheme) var colorScheme

var body: some View {
VStack{
NodeOutputView(conductor.instrument)
HStack {
CookbookKnob(text: "BPM", parameter: $conductor.tempo, range: 20.0...250.0)
CookbookKnob(text: "Length", parameter: $conductor.noteLength, range: 0.0...1.0)
}
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
NodeOutputView(conductor.instrument)
HStack {
CookbookKnob(text: "BPM", parameter: $conductor.tempo, range: 20.0...250.0)
CookbookKnob(text: "Length", parameter: $conductor.noteLength, range: 0.0...1.0)
}
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
.cookbookNavBarTitle("Arpeggiator")
.onAppear {
conductor.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ struct AudioKit3DView: View {
.onDisappear {
viewModel.conductor.stop()
}
.background(colorScheme == .dark ?
Color.clear : Color(red: 0.9, green: 0.9, blue: 0.9))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,28 @@ struct InstrumentSFZView: View {
@Environment(\.colorScheme) var colorScheme

var body: some View {
VStack{
HStack {
ForEach(0...7, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(8...15, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(16...23, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(24...30, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
}
HStack {
ForEach(0...7, id: \.self) {
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(8...15, id: \.self) {
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(16...23, id: \.self) {
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(24...30, id: \.self) {
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
.cookbookNavBarTitle("Instrument SFZ")
.onAppear {
conductor.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ struct SpriteKitAudioView: View {
VStack {
SpriteView(scene: scene).frame(maxWidth: .infinity, maxHeight: .infinity).ignoresSafeArea()
}
.cookbookNavBarTitle("SpriteKit Audio")
.onAppear {
conductor.start()
}.onDisappear {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,20 @@ struct DunneSynthView: View {
@Environment(\.colorScheme) var colorScheme

var body: some View {
VStack{
NodeOutputView(conductor.instrument)
HStack {
ForEach(0...6, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(7...13, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
}
NodeOutputView(conductor.instrument)
HStack {
ForEach(0...6, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
HStack {
ForEach(7...13, id: \.self){
ParameterRow(param: conductor.instrument.parameters[$0])
}
}.padding(5)
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
.cookbookNavBarTitle("Dunne Synth")
.onAppear {
conductor.start()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ struct InputDeviceDemoView: View {
})
.keyboardShortcut(.space, modifiers: [])
}
.cookbookNavBarTitle("Input Device Demo")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ struct MIDIPortTestView: View {
}
}
}
.cookbookNavBarTitle("MIDI Port Test")
.onAppear {
conductor.start()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,19 @@ struct PolyphonicOscillatorView: View {
@Environment(\.colorScheme) var colorScheme

var body: some View {
VStack {
if conductor.engine.output != nil {
NodeOutputView(conductor.engine.output!)
}
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)

}.cookbookNavBarTitle("Polyphonic Oscillator")
.onAppear {
conductor.start()
}
.onDisappear {
conductor.stop()
}
.background(colorScheme == .dark ?
Color.clear : Color(red: 0.9, green: 0.9, blue: 0.9))
if conductor.engine.output != nil {
NodeOutputView(conductor.engine.output!)
}
CookbookKeyboard(noteOn: conductor.noteOn,
noteOff: conductor.noteOff)
.cookbookNavBarTitle("Polyphonic Oscillator")
.onAppear {
conductor.start()
}
.onDisappear {
conductor.stop()
}
.background(colorScheme == .dark ?
Color.clear : Color(red: 0.9, green: 0.9, blue: 0.9))
}
}
Loading

0 comments on commit d2da7bd

Please sign in to comment.