Skip to content

Commit 3c3ae0f

Browse files
committed
swift formatting
1 parent 3dfb80b commit 3c3ae0f

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

Sources/DevoloopAudioKit/DynaRageCompressor.swift

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
// Copyright AudioKit. All Rights Reserved.
22

3-
import AVFoundation
43
import AudioKit
54
import AudioKitEX
5+
import AVFoundation
66
import CAudioKitEX
77

88
/// DynaRage Tube Compressor | Based on DynaRage Tube Compressor RE for Reason
99
/// by Devoloop Srls
1010
///
1111
public class DynaRageCompressor: Node {
12-
1312
let input: Node
14-
13+
1514
/// Connected nodes
1615
public var connections: [Node] { [input] }
1716

1817
/// Underlying AVAudioNode
1918
public var avAudioNode = instantiate(effect: "dyrc")
20-
19+
2120
// MARK: - Parameters
2221

2322
/// Specification details for ratio
@@ -27,7 +26,8 @@ public class DynaRageCompressor: Node {
2726
address: akGetParameterAddress("DynaRageCompressorParameterRatio"),
2827
defaultValue: 1,
2928
range: 1.0 ... 20.0,
30-
unit: .generic)
29+
unit: .generic
30+
)
3131

3232
/// Ratio to compress with, a value > 1 will compress
3333
@Parameter(ratioDef) public var ratio: AUValue
@@ -39,7 +39,8 @@ public class DynaRageCompressor: Node {
3939
address: akGetParameterAddress("DynaRageCompressorParameterThreshold"),
4040
defaultValue: 0.0,
4141
range: -100.0 ... 0.0,
42-
unit: .decibels)
42+
unit: .decibels
43+
)
4344

4445
/// Threshold (in dB) 0 = max
4546
@Parameter(thresholdDef) public var threshold: AUValue
@@ -51,7 +52,8 @@ public class DynaRageCompressor: Node {
5152
address: akGetParameterAddress("DynaRageCompressorParameterAttackDuration"),
5253
defaultValue: 0.1,
5354
range: 0.1 ... 500.0,
54-
unit: .seconds)
55+
unit: .seconds
56+
)
5557

5658
/// Attack dration
5759
@Parameter(attackDurationDef) public var attackDuration: AUValue
@@ -63,7 +65,8 @@ public class DynaRageCompressor: Node {
6365
address: akGetParameterAddress("DynaRageCompressorParameterReleaseDuration"),
6466
defaultValue: 0.1,
6567
range: 1.0 ... 20.0,
66-
unit: .seconds)
68+
unit: .seconds
69+
)
6770

6871
/// Release duration
6972
@Parameter(releaseDurationDef) public var releaseDuration: AUValue
@@ -75,7 +78,8 @@ public class DynaRageCompressor: Node {
7578
address: akGetParameterAddress("DynaRageCompressorParameterRage"),
7679
defaultValue: 0.1,
7780
range: 0.1 ... 20.0,
78-
unit: .generic)
81+
unit: .generic
82+
)
7983

8084
/// Rage Amount
8185
@Parameter(rageDef) public var rage: AUValue
@@ -87,7 +91,8 @@ public class DynaRageCompressor: Node {
8791
address: akGetParameterAddress("DynaRageCompressorParameterRageEnabled"),
8892
defaultValue: 1.0,
8993
range: 0.0 ... 1.0,
90-
unit: .boolean)
94+
unit: .boolean
95+
)
9196

9297
/// Rage ON/OFF Switch
9398
@Parameter(rageEnabledDef) public var rageEnabled: Bool
@@ -113,9 +118,9 @@ public class DynaRageCompressor: Node {
113118
rageEnabled: Bool = rageEnabledDef.defaultValue == 1.0
114119
) {
115120
self.input = input
116-
121+
117122
setupParameters()
118-
123+
119124
self.ratio = ratio
120125
self.threshold = threshold
121126
self.attackDuration = attackDuration

Sources/DevoloopAudioKit/RhinoGuitarProcessor.swift

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
// Copyright AudioKit. All Rights Reserved.
22

3-
import AVFoundation
43
import AudioKit
54
import AudioKitEX
5+
import AVFoundation
66
import CAudioKitEX
77

88
/// Guitar head and cab simulator.
99
///
1010
public class RhinoGuitarProcessor: Node {
11-
1211
let input: Node
13-
12+
1413
/// Connected nodes
1514
public var connections: [Node] { [input] }
1615

@@ -26,7 +25,8 @@ public class RhinoGuitarProcessor: Node {
2625
address: akGetParameterAddress("RhinoGuitarProcessorParameterPreGain"),
2726
defaultValue: 5.0,
2827
range: 0.0 ... 10.0,
29-
unit: .generic)
28+
unit: .generic
29+
)
3030

3131
/// Gain applied before processing.
3232
@Parameter(preGainDef) public var preGain: AUValue
@@ -38,7 +38,8 @@ public class RhinoGuitarProcessor: Node {
3838
address: akGetParameterAddress("RhinoGuitarProcessorParameterPostGain"),
3939
defaultValue: 0.7,
4040
range: 0.0 ... 1.0,
41-
unit: .linearGain)
41+
unit: .linearGain
42+
)
4243

4344
/// Gain applied after processing.
4445
@Parameter(postGainDef) public var postGain: AUValue
@@ -50,7 +51,8 @@ public class RhinoGuitarProcessor: Node {
5051
address: akGetParameterAddress("RhinoGuitarProcessorParameterLowGain"),
5152
defaultValue: 0.0,
5253
range: -1.0 ... 1.0,
53-
unit: .generic)
54+
unit: .generic
55+
)
5456

5557
/// Amount of Low frequencies.
5658
@Parameter(lowGainDef) public var lowGain: AUValue
@@ -62,7 +64,8 @@ public class RhinoGuitarProcessor: Node {
6264
address: akGetParameterAddress("RhinoGuitarProcessorParameterMidGain"),
6365
defaultValue: 0.0,
6466
range: -1.0 ... 1.0,
65-
unit: .generic)
67+
unit: .generic
68+
)
6669

6770
/// Amount of Middle frequencies.
6871
@Parameter(midGainDef) public var midGain: AUValue
@@ -74,7 +77,8 @@ public class RhinoGuitarProcessor: Node {
7477
address: akGetParameterAddress("RhinoGuitarProcessorParameterHighGain"),
7578
defaultValue: 0.0,
7679
range: -1.0 ... 1.0,
77-
unit: .generic)
80+
unit: .generic
81+
)
7882

7983
/// Amount of High frequencies.
8084
@Parameter(highGainDef) public var highGain: AUValue
@@ -86,11 +90,12 @@ public class RhinoGuitarProcessor: Node {
8690
address: akGetParameterAddress("RhinoGuitarProcessorParameterDistortion"),
8791
defaultValue: 1.0,
8892
range: 1.0 ... 20.0,
89-
unit: .generic)
93+
unit: .generic
94+
)
9095

9196
/// Distortion Amount
9297
@Parameter(distortionDef) public var distortion: AUValue
93-
98+
9499
// MARK: - Initialization
95100

96101
/// Initialize this Rhino head and cab simulator node
@@ -114,7 +119,7 @@ public class RhinoGuitarProcessor: Node {
114119
distortion: AUValue = distortionDef.defaultValue
115120
) {
116121
self.input = input
117-
122+
118123
setupParameters()
119124

120125
self.preGain = preGain

Tests/DevoloopAudioKitTests/GenericNodeTests.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
// Copyright AudioKit. All Rights Reserved.
22

33
import AudioKit
4-
import DevoloopAudioKit
54
import AVFoundation
5+
import DevoloopAudioKit
66
import XCTest
77

88
class GenericNodeTests: XCTestCase {
9-
10-
func nodeParameterTest(md5: String, factory: (Node)->Node, m1MD5: String = "", audition: Bool = false) {
11-
9+
func nodeParameterTest(md5: String, factory: (Node) -> Node, m1MD5: String = "", audition: Bool = false) {
1210
let url = Bundle.module.url(forResource: "12345", withExtension: "wav", subdirectory: "TestResources")!
1311
let player = AudioPlayer(url: url)!
1412
let node = factory(player)
1513

1614
let duration = node.parameters.count + 1
1715

1816
let engine = AudioEngine()
19-
var bigBuffer: AVAudioPCMBuffer? = nil
17+
var bigBuffer: AVAudioPCMBuffer?
2018

2119
engine.output = node
2220

@@ -32,7 +30,6 @@ class GenericNodeTests: XCTestCase {
3230
}
3331

3432
for i in 0 ..< node.parameters.count {
35-
3633
let node = factory(player)
3734
engine.output = node
3835

@@ -47,13 +44,12 @@ class GenericNodeTests: XCTestCase {
4744
audio.append(engine.render(duration: 1.0))
4845

4946
bigBuffer?.append(audio)
50-
5147
}
5248

5349
XCTAssertFalse(bigBuffer!.isSilent)
5450

5551
if audition { bigBuffer!.audition() }
56-
52+
5753
XCTAssertTrue([md5, m1MD5].contains(bigBuffer!.md5), "\(node)\nFAILEDMD5 \(bigBuffer!.md5)")
5854
}
5955

0 commit comments

Comments
 (0)