gpt4 book ai didi

ios - audiokit 的波表参数

转载 作者:可可西里 更新时间:2023-11-01 06:13:47 28 4
gpt4 key购买 nike

AudioKit 非常棒,它可以让您启动一些振荡器并即时改变它们的频率。现在我想更改波形的形状,以便为我的振荡器创建自定义音色。

有四种标准类型,实际上 AudioKit 支持五种:

- sine
- triangle (good sine approximate)
- square wave
- sawtooth
- reverse sawtooth wave

它们听起来都不一样,但如果我可以使用内置的 waveTable 支持来更改波形的类型,那就太好了。

http://audiokit.io/docs/Structs/AKTable.html#/s:vV8AudioKit7AKTable6valuesGSaSf_提到了 AKMorphingOscillator,它就像一个奇迹类,可以改变振荡器的波形。默认值都有效,但我对填充 AKTable 字段真的很陌生。

git 页面 https://github.com/audiokit/AudioKit/blob/master/AudioKit/Common/Internals/AKTable.swift表明:

/// A table of values accessible as a waveform or lookup mechanism
public struct AKTable {

// MARK: - Properties

/// Values stored in the table
public var values = [Float]()

/// Number of values stored in the table
var size = 4096

/// Type of table
var type: AKTableType

// MARK: - Initialization

/// Initialize and set up the default table
///
/// - parameter tableType: AKTableType of teh new table
/// - parameter size: Size of the table (multiple of 2)
///
public init(_ tableType: AKTableType = .Sine, size tableSize: Int = 4096) {
type = tableType
size = tableSize
....

所以我的问题是,我可以直接访问values 数组并简单地修改它来制作新的波形吗?有没有明智或惯用的方法来做到这一点?

蛋壳。

最佳答案

由于 AudioKit 支持正在从 Google Groups 转移到 StackOverflow,因此我在这里回应更老的问题。基本上表格可以是任何你想要的。它们是类,不再是表格,并且有一个展示如何使用它们以及如何使用 AKTableView 绘制它们的 Playground 。

在这里查看:http://audiokit.io/playgrounds/Basics/Tables/

关于ios - audiokit 的波表参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36756915/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com