程序军鼓

发布于 2024-08-23 01:20:06 字数 577 浏览 3 评论 0原文

所以我有类似的东西:

    void createSinewave( short * array, int duration, int startOffset,
float freq, float amp ) ;
    void createSquarewave( short * array, int duration, int startOffset,
float freq, float amp ) ;

其他函数将波形从某个低频“滑动”到某个高频,并接受两个频率参数。

仅使用这些功能,我就能够创建各种声音......底鼓、老式激光射击声音以及一堆听起来像脚步声的声音。我无法合成军鼓类型的声音。

关于如何生成一个有什么建议吗?混合什么频率以及混合的量是多少?除了正弦波、方波和三角波之外,还可以使用其他波形类型吗?

有点受 64 k 可执行文件< /a> 竞赛。

So I've got something like:

    void createSinewave( short * array, int duration, int startOffset,
float freq, float amp ) ;
    void createSquarewave( short * array, int duration, int startOffset,
float freq, float amp ) ;

Other functions "slide" a wave form from some low frequency to some high frequency, and accept two frequency parameters.

Using just these functions i've been able to create a variety of sounds.. kick drum, an old school laser fire sound, and a bunch of things that sound like footsteps. I've not been able to synthesize a snare drum type sound.

Any suggestions on how to generate one? What frequencies to mix and in what amounts to mix them in? Other wave form types to use than sine and square and triangle wave?

Kind of inspired by 64 k executable contests.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

绮筵 2024-08-30 01:20:06

鼓声通常由短促的噪音合成,例如 white粉色

其中,白噪声是最容易生成的:只需用随机样本填充数组,这些样本以统一的概率独立选择。布朗噪声也很容易。

Drums are often synthesized by short bursts of noise, for example white, pink or brown noise.

Of these, white noise is the easiest to generate: just fill your array with random samples, independently chosen with uniform probability. Brown noise is also pretty easy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文