动态更新 MIDI 序列

发布于 2024-10-06 07:56:23 字数 329 浏览 1 评论 0原文

我有一个程序,可以在用户输入后动态创建 MIDI 事件序列,并在循环当前播放的序列时执行此操作。它是用 scala 编写的,我正在使用 java 库 javax.sound.midi.*

如下:

  1. 现在该算法的工作原理
  2. 构建序列;
  3. 设置序列
  4. 启动序列器;
  5. 建立新序列;
  6. 当完成事件由定序器从 3 开始执行时触发时,

这种方法的问题是两个序列之间存在延迟,而我希望它能够不间断地播放,如果可能的话甚至可以重叠两个序列。

有什么办法可以做到吗?

I have a program which dynamically creates sequences of midi events after some user input, and does that while looping the currently played sequence. It's written in scala and I'm using the java library javax.sound.midi.*

Now the algorithm works as follows:

  1. create sequencer;
  2. build sequence;
  3. set sequence
  4. start the sequencer;
  5. build new sequence;
  6. when the finish event is triggered by the sequencer execute from 3

the problem with this approach is that there is a delay between two sequences, while I would like it to be playing without pauses, if possible even overlapping the two sequences.

Is there any way to do it?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文