将 MIDI 事件添加到时钟 - Java
我正在使用 C# 创建一个简单的 MIDI 应用程序,其中包含一个开源库,该库允许用户指定通道、音高和速度并将它们添加到时钟。然后,该时钟可以按照添加的顺序播放所有音符。
一切都运行良好,现在我正在创建应用程序的 Java 版本,我似乎遇到的唯一麻烦是我找不到任何简单的教程或解释时钟系统如何在 MIDI Java 中工作。
Java 声音框架中是否存在时钟,或者这是我必须自己实现的东西?
谢谢!
I am creating a simple MIDI application in C# with an open source library that allows the user to specify a channel, pitch and velocity and add them to a Clock. This clock can then play all the notes in the sequence that they were added.
Everything works great and now I am in the process of creating a Java version of the application, the only trouble I seem to be having is that I can't find any simple tutorial or explanation of how the clock system works within MIDI Java.
Does the Clock exist in Java Sound Framework or is this something I will have to implement myself?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经很长时间没有接触 Java Midi 了,但一般来说,要以编程方式构建 MIDI,您需要执行以下步骤。
假设
import javax.sound.midi;
:您需要创建一个
Sequencer
对象:接下来,您需要创建一个
Track
对象(每个通道一个或所有通道一个) ,这取决于你):现在,您可以向其中添加事件:
Sequence
!查看此处的文档: http ://download.oracle.com/javase/7/docs/api/index.html?javax/sound/midi/MidiSystem.html
It's been a long time since I've touched the Java Midi stuff, but in general, to programmatically build a MIDI, you need to do the following steps.
Assuming
import javax.sound.midi;
:You need to create a
Sequencer
object:Next, you need to create a
Track
object (one per channel or one for everything, it's up to you):Now, you can add events to it:
When you're done that, you can then play the
Sequence
like normal!Check out the docs here: http://download.oracle.com/javase/7/docs/api/index.html?javax/sound/midi/MidiSystem.html