-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Recipes #142
New Recipes #142
Conversation
Added Additional Packages category with their respective demos: Controls, Flow, Keyboard, Piano Roll, Synthesis Toolkit, & Waveform Added Arpeggiator recipe (using Sequencer) Added SpriteKit Audio recipe Added DunneAudioKit Synth recipe (in WIP) Added Input Device Demo recipe (already in project but unlinked) Added parameters to Instrument SFZ Added info button Reordered categories
Added New Recipes
Add STK + MIDIKit Recipe
Update LaunchScreen
.alert("AudioKit Cookbook", isPresented: $showingInfo) { | ||
Button("OK", role: .cancel) { } | ||
} message: { | ||
Text("AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.\n\nMost of the examples that were inside of AudioKit are now in this application.\n\nIn addition to the resources found here, there are various open-source example projects on GitHub and YouTube created by AudioKit contributors.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 200 characters or less: currently 340 characters (line_length)
} | ||
} | ||
var body: some View { | ||
GeometryReader { proxy in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "proxy" in a closure should be replaced with _. (unused_closure_parameter)
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'y' (identifier_name)
@State var modulation: Float = 0 | ||
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
.alert("AudioKit Cookbook", isPresented: $showingInfo) { | ||
Button("OK", role: .cancel) { } | ||
} message: { | ||
Text("AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.\n\nMost of the examples that were inside of AudioKit are now in this application.\n\nIn addition to the resources found here, there are various open-source example projects on GitHub and YouTube created by AudioKit contributors.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 200 characters or less: currently 340 characters (line_length)
} | ||
} | ||
var body: some View { | ||
GeometryReader { proxy in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "proxy" in a closure should be replaced with _. (unused_closure_parameter)
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'y' (identifier_name)
@State var modulation: Float = 0 | ||
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
} | ||
|
||
var randomWires: Set<Wire> = [] | ||
for n in 0 ..< 50 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'n' (identifier_name)
/// Bit of a stress test to show how Flow performs with more nodes. | ||
func randomPatch() -> Patch { | ||
var randomNodes: [Node] = [] | ||
for n in 0 ..< 50 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'n' (identifier_name)
.alert("AudioKit Cookbook", isPresented: $showingInfo) { | ||
Button("OK", role: .cancel) { } | ||
} message: { | ||
Text("AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.\n\nMost of the examples that were inside of AudioKit are now in this application.\n\nIn addition to the resources found here, there are various open-source example projects on GitHub and YouTube created by AudioKit contributors.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 200 characters or less: currently 340 characters (line_length)
} | ||
} | ||
var body: some View { | ||
GeometryReader { proxy in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "proxy" in a closure should be replaced with _. (unused_closure_parameter)
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'y' (identifier_name)
@State var modulation: Float = 0 | ||
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
/// Bit of a stress test to show how Flow performs with more nodes. | ||
func randomPatch() -> Patch { | ||
var randomNodes: [Node] = [] | ||
for n in 0 ..< 50 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'n' (identifier_name)
|
||
@State var model = PianoRollModel(notes: [ | ||
PianoRollNote(start: 1, length: 2, pitch: 3), | ||
PianoRollNote(start: 5, length: 1, pitch: 4), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
let indicatorSize = 10.0 | ||
|
||
var body: some View { | ||
GeometryReader { gp in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'gp' (identifier_name)
return try! AVAudioFile(forReading: url) | ||
} | ||
|
||
func clamp(_ x: Double, _ inf: Double, _ sup: Double) -> Double { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
|
||
func getFile() -> AVAudioFile { | ||
let url = Bundle.module.url(forResource: "Samples/Piano", withExtension: "mp3")! | ||
return try! AVAudioFile(forReading: url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force Try Violation: Force tries should be avoided. (force_try)
.alert("AudioKit Cookbook", isPresented: $showingInfo) { | ||
Button("OK", role: .cancel) { } | ||
} message: { | ||
Text("AudioKit is an audio synthesis, processing, and analysis platform for iOS, macOS, and tvOS.\n\nMost of the examples that were inside of AudioKit are now in this application.\n\nIn addition to the resources found here, there are various open-source example projects on GitHub and YouTube created by AudioKit contributors.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 200 characters or less: currently 340 characters (line_length)
} | ||
} | ||
var body: some View { | ||
GeometryReader { proxy in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "proxy" in a closure should be replaced with _. (unused_closure_parameter)
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 | ||
@State var y: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'y' (identifier_name)
@State var modulation: Float = 0 | ||
@State var radius: Float = 0 | ||
@State var angle: Float = 0 | ||
@State var x: Float = 0.5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
Color.clear : Color(red: 0.9, green: 0.9, blue: 0.9)) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
struct ArpeggiatorView: View { | ||
@StateObject var conductor = ArpeggiatorConductor() | ||
@Environment(\.colorScheme) var colorScheme | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
sequencer.length = 0.25 | ||
sequencer.loopEnabled = true | ||
sequencer.add(noteNumber: 60, position: 0.0, duration: 0.24) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} catch { | ||
Log("Could not load instrument") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
engine.output = PeakLimiter(Mixer(instrument, midiCallback), attackTime: 0.001, decayTime: 0.001, preGain: 0) | ||
|
||
do { | ||
if let fileURL = Bundle.main.url(forResource: "Sounds/Sampler Instruments/sawPiano1", withExtension: "exs") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 121 characters (line_length)
} | ||
|
||
var randomWires: Set<Wire> = [] | ||
for n in 0 ..< 50 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'n' (identifier_name)
/// Bit of a stress test to show how Flow performs with more nodes. | ||
func randomPatch() -> Patch { | ||
var randomNodes: [Node] = [] | ||
for n in 0 ..< 50 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'n' (identifier_name)
|
||
@State var model = PianoRollModel(notes: [ | ||
PianoRollNote(start: 1, length: 2, pitch: 3), | ||
PianoRollNote(start: 5, length: 1, pitch: 4), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Comma Violation: Collection literals should not have trailing commas. (trailing_comma)
let indicatorSize = 10.0 | ||
|
||
var body: some View { | ||
GeometryReader { gp in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'gp' (identifier_name)
return try! AVAudioFile(forReading: url) | ||
} | ||
|
||
func clamp(_ x: Double, _ inf: Double, _ sup: Double) -> Double { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'x' (identifier_name)
} | ||
|
||
engine.output = PeakLimiter(Mixer(instrument, midiCallback), attackTime: 0.001, decayTime: 0.001, preGain: 0) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
self.fireTimer() | ||
} else if status == 128 { //Note Off | ||
//all notes off | ||
for i in 0...127 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'i' (identifier_name)
if status == 144 { //Note On | ||
self.fireTimer() | ||
} else if status == 128 { //Note Off | ||
//all notes off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
midiCallback = CallbackInstrument { status, note, vel in | ||
if status == 144 { //Note On | ||
self.fireTimer() | ||
} else if status == 128 { //Note Off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment Spacing Violation: Prefer at least one space after slashes for comments. (comment_spacing)
Color.clear : Color(red: 0.9, green: 0.9, blue: 0.9)) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Newline Violation: Files should have a single trailing newline. (trailing_newline)
struct ArpeggiatorView: View { | ||
@StateObject var conductor = ArpeggiatorConductor() | ||
@Environment(\.colorScheme) var colorScheme | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
sequencer.length = 0.25 | ||
sequencer.loopEnabled = true | ||
sequencer.add(noteNumber: 60, position: 0.0, duration: 0.24) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} catch { | ||
Log("Could not load instrument") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
engine.output = PeakLimiter(Mixer(instrument, midiCallback), attackTime: 0.001, decayTime: 0.001, preGain: 0) | ||
|
||
do { | ||
if let fileURL = Bundle.main.url(forResource: "Sounds/Sampler Instruments/sawPiano1", withExtension: "exs") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 121 characters (line_length)
|
||
init() { | ||
|
||
midiCallback = CallbackInstrument { status, note, vel in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused Closure Parameter Violation: Unused parameter "note" in a closure should be replaced with _. (unused_closure_parameter)
Unused Closure Parameter Violation: Unused parameter "vel" in a closure should be replaced with _. (unused_closure_parameter)
} | ||
|
||
init() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing Whitespace Violation: Lines should not have trailing whitespace. (trailing_whitespace)
|
||
//remove notes from an array | ||
for i in heldNotes { | ||
if i == mynote { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Where Violation: where
clauses are preferred over a single if
inside a for
. (for_where)
let mynote = pitch.intValue | ||
|
||
//remove notes from an array | ||
for i in heldNotes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'i' (identifier_name)
|
||
do { | ||
try midiManager.addInputConnection( | ||
to: .allOutputs, // no need to specify if we're using .allEndpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super trivial detail, but the comment was probably made before a MIDIKit API change from .allEndpoints
to .allOutputs
. Could just update the comment to avoid any confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing it! It's fixed now: 3b8f606
Added Additional Packages category with their respective demos: Controls, Flow, Keyboard, Piano Roll, Synthesis Toolkit, & Waveform
Added Arpeggiator recipe (using Sequencer)
Added SpriteKit Audio recipe
Added DunneAudioKit Synth recipe (in WIP)
Added Polyphonic STK + MIDIKit recipe (in WIP)
Added Input Device Demo recipe (already in project but unlinked)
Added parameters to Instrument SFZ
Added info button
Reordered categories