gpt4 book ai didi

ios - 使用 AKKeyboardView 的钢琴音符

转载 作者:行者123 更新时间:2023-11-28 07:38:05 25 4
gpt4 key购买 nike

我是 AudioKit 的新手 - 我可以使用 AKKeyboardView 使用 AKOscillatorBank 来弹奏音符,但我希望音频听起来更像三角钢琴。加载 .wav 文件似乎会使音符断断续续。我也改变了便条信封。如何将大钢琴音符映射到 AKKeyboardView 键上?

最佳答案

您不容易从振荡器中获得钢琴音色。您可能想改用 soundfont。您可以将 sf2(我相信不是 sf3)加载到 AKAppleSampler 中,并使用 AKKeyboardDelegate 触发它,就像您对 AKOscillatorBank 所做的那样。 MuseScore has list of soundfont file links ,其中许多使用开源许可证。

首先将 sf2 文件添加到您的项目中,然后设置 AKAppleSampler:

let sampler = AKAppleSampler()
// note that if you're using a GM soundfont, 'Grand Piano' will be preset 0
sampler.loadMelodicSoundFont("NameOfSoundFontWithoutExtension", preset: 0)

关于ios - 使用 AKKeyboardView 的钢琴音符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52907857/

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