Skip to content

Sampler envelope fix#8

Merged
aure merged 4 commits intoAudioKit:developfrom
eljeff:sampler-envelope-fix
Apr 20, 2022
Merged

Sampler envelope fix#8
aure merged 4 commits intoAudioKit:developfrom
eljeff:sampler-envelope-fix

Conversation

@eljeff
Copy link
Copy Markdown
Member

@eljeff eljeff commented Apr 20, 2022

Brute force method to copy parameters from old sampler to newSampler on update.
Also includes test which passes

sampler.stop(noteNumber: 65)
testMD5(audio)
}

Copy link
Copy Markdown

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)

audio.append(engine.render(duration: 1.0)) //run test for a second before setting parameters
sampler.attackDuration = 1.0
sampler.load(avAudioFile: file)
audio.append(engine.render(duration: 1.0))//run test to give time to load
Copy link
Copy Markdown

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)

sampler.masterVolume = 1
engine.output = sampler
let audio = engine.startTest(totalDuration: 8.0)
audio.append(engine.render(duration: 1.0)) //run test for a second before setting parameters
Copy link
Copy Markdown

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)

func testSamplerAttackVolumeEnvelope() {
let engine = AudioEngine()
let sampleURL = Bundle.module.url(forResource: "TestResources/12345", withExtension: "wav")!
let file = try! AVAudioFile(forReading: sampleURL)
Copy link
Copy Markdown

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)

testMD5(audio)
}


Copy link
Copy Markdown

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)

@aure aure merged commit 866d5c1 into AudioKit:develop Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants