Questions tagged [javax.sound.midi]

Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data.

The javax.sound.midi API provides interfaces and classes for I/O, sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data.

For further details, see:

85 questions
0
votes
1 answer

Receiving com.sun.media.sound.FastShortMessage from MIDI Controller in Java, how to decode?

I have a java program set up that takes MIDI input from a controller and ideally does different things (not necessarily related to playing synthesizer output) depending on which midi note is sent. My code is heavily based on the code in this SO…
user24601
  • 160
  • 1
  • 11
0
votes
1 answer

Preventing TempoCache from messing up tempo

I'm using a copy-paste of TempoCache from javax.sound.midi to handle the tick calculations for my MIDI player, but on some files the tempo is terribly miscalculated. It seems to average the tempo from the tempo events, but I can't figure out any way…
Octavia Togami
  • 4,186
  • 4
  • 31
  • 49
0
votes
1 answer

Is MIDI Sequence required to close?

I am parsing a MIDI file in Java. At first I create a sequence using: Sequence sequence = MidiSystem.getSequence(paFile); which throws checked IOException. Am I supposed to close this resource somehow? If so, why doesn't sequence or MidiSystem…
Leprechaun
  • 852
  • 6
  • 25
0
votes
0 answers

Can't hear sound in Java

I'm trying to play a bit with javax.sound.midi and I have encountered a problem - I cannot hear the sound. I have soundbank installed btw. The code looks like that: public class MainClass { public static void main(String[] args) { Synthesizer…
user3107531
  • 85
  • 1
  • 9
0
votes
1 answer

Changing instruments in javax sound midi Sequencer

I have a Sequence player in which I simply open(), set the tempo, and start a Midi file where the Midi file is actually the bulk of my project (parsing a string file into a music piece) Now in all the complexity of my code, I can't figure out how to…
ZekeDroid
  • 7,089
  • 5
  • 33
  • 59
0
votes
1 answer

Check if a HashMap contains a MidiMessage

The abstract class MidiMessage has 3 subclasses: MetaMessage, ShortMessage, SysexMessage. I'm listening to a MidiDevice, which sends either shortmessages or sysexmessages. Problem is that the hashcode of a MidiMessage is never the same. Therefore…
user
  • 211
  • 2
  • 12
0
votes
3 answers

How do you access data from MIDI IN stream in java?

I would like to make use of the data coming from a MIDI in device. I need to be notified when certain events occur so that I can do things like transpose certain notes on the fly or call a method or whatever you can think of. Although I'm quite new…
0
votes
1 answer

Installing a new MidiOut into Java?

I want to use one of the custom MIDI drivers on my system in Java, but when I try to set it via this code: MidiDevice midi_dev =…
Octavia Togami
  • 4,186
  • 4
  • 31
  • 49
-1
votes
1 answer

Stop a MIDI Sequencer so that I can play something else

EDIT: Here's a self-contained example: MidiLatte midiLatte = new MidiLatte(); for (int i = 60; i <= 72; i++) { midiLatte.addNote(i, 4); } midiLatte.playAndRemove(); try { Thread.sleep(3000); } catch (InterruptedException e) { …
ostrichofevil
  • 749
  • 7
  • 19
-1
votes
1 answer

Eclipse can't resolve MidiSystem.getSequencer()

Eclipse is throwing the error : "MidiSystem.getSequencer cannot be resolved to a type" I am running JavaSE- 1.7 with compliance level 1.7 Not sure what is going on here import javax.sound.midi.*; public class drumKit{ public void play(){ …
Keller Waldron
  • 25
  • 1
  • 1
  • 5
1 2 3 4 5
6