midi

Converting MIDI ticks to actual playback seconds

做~自己de王妃 提交于 2019-11-27 01:09:49
问题 I want to know how to convert MIDI ticks to actual playback seconds. For example, if the MIDI PPQ (Pulses per quarter note) is 1120, how would I convert it into real world playback seconds? 回答1: The formula is 60000 / (BPM * PPQ) (milliseconds). Where BPM is the tempo of the track (Beats Per Minute). (i.e. a 120 BPM track would have a MIDI time of (60000 / (120 * 192)) or 2.604 ms for 1 tick. If you don't know the BPM then you'll have to determine that first. MIDI times are entirely dependent

Java getting input from MIDI keyboard

半世苍凉 提交于 2019-11-26 22:44:34
问题 I have designed my own synthesizer in java and I now want to connect it with a midi keyboard. My class below searches through all the midi devices that have transmitters. It successfully finds my midi keyboard. I add my own receivers to each transmitter for each device so that it should pick up everything possible. From reading all the help documents and java doc I know that a Transmitter sends MidiEvents to a Receiver which then handles them with the send method. So I wrote my own inner

How to play a .MIDI file in a new thread in Java?

混江龙づ霸主 提交于 2019-11-26 22:12:04
问题 I am remaking part of a game in Java, and I need to know how to play the MIDI sound files. Preferably it would not involve importing any external libraries. It must also be runnable in a new thread, so that I can stack the individual sounds over the background song. Thanks for your thoughts and time. 回答1: This code plays two MIDI tracks at the same time (the 2nd sequence starts as soon as the 1st dialog is dismissed). No threads are explicitly created, but I imagine it would work much the

What is the structure of a MIDI file?

非 Y 不嫁゛ 提交于 2019-11-26 19:29:43
问题 I want to manually have a function that creates a MIDI file according to users demands, for example. User write 2 patches that contain 8 bars of 4 quarters of A4 (Concert A - 440hz) and C4 (each as a seperated channel) on 120 speed, at velocity 100, instrument piano (01) and patch 49 or whatever. How should the MIDI file look like according to the above. My goal is to learn how to create a function that generates MIDI data, then write everything to a MIDI file. So first I have to understand

Reading MIDI files in Java

こ雲淡風輕ζ 提交于 2019-11-26 19:09:11
问题 I'm trying to read in .MID files to a Java program, and would like to separate each note/chord so as to display them on a UI of some sort. I didn't have much luck using the Sequencer API in Java, and trying to use MidiFileReader directly didn't work for me either. I'll attach the code I used here, if anyone wants to see it: package miditest; import java.io.File; import java.io.IOException; import javax.sound.midi.InvalidMidiDataException; import javax.sound.midi.MidiSystem; import javax.sound

Android 6.0 (Marshmallow): How to play midi notes?

旧时模样 提交于 2019-11-26 18:18:58
问题 I'm creating an app that generates live instrument sounds and I'm planning on using the new Midi API featured in Android Marshmallow (version 6.0). I've read the package overview document here http://developer.android.com/reference/android/media/midi/package-summary.html and I know how to generate Midi notes but i'm still unsure: how do I actually play these notes after I've generated their Midi data? Do I need a synthesizer program to play Midi notes? If so, do I have to make my own or is