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
1
vote
1 answer

EventListener at paintComponent

I am working on music application which creates a square and repaint the screen at every single event. The events are the sounds, I created them with sound.midi API. However, when I run the app the squares do not appear on the window! Could someone…
PJoe
  • 85
  • 2
  • 12
1
vote
1 answer

Pausing Java Sequencer Resets Tempo

I'm writing some code that will when run, auto-starts playback of a midi sequence, and that the user can pause at any time by pressing a key. They key event handling works just fine, however, I'm getting a very bizarre error, where pausing the…
1
vote
1 answer

Java Sound Midi Output to Hardware Keyboard

I am trying to create a program that can play notes to an MIDI Keyboard. I couldn't get the whole program to work, but am now trying to create a smaller proof of concept program to try and work it out. For this I am trying to play a .mid file to the…
Harris Mirza
  • 76
  • 1
  • 14
1
vote
0 answers

Android: How to retrieve MIDI events at the right time?

I am trying to retrieve all MIDI events at the right time from a MIDI file, within an Android app. The following code works on a standard JVM (on my computer), using the javax.sound.midi API. Sequencer sequencer =…
Victor
  • 51
  • 5
1
vote
2 answers

Send sysex message with Java

I'd like to send a Sysex message to a MIDI Port. Unfortunately there is no response at all when I send it. Sending regular MIDI messages (ShortMessage) works just fine, but as soon as I replace the ShortMessage with the SysexMessage things stop…
TomTom
  • 2,820
  • 4
  • 28
  • 46
1
vote
2 answers

How to get integer value from byte array returned by MetaMessage.getData()?

I need to get the tempo value from midi file. I found out, that the set_tempo command has value 0x51, so i have this piece of code: for (int i = 0; i < tracks[0].size(); i++) { MidiEvent event = tracks[0].get(i); MidiMessage…
Leprechaun
  • 852
  • 6
  • 25
1
vote
1 answer

Java :Painting Random Shapes on JFrame against Music Played

I am trying to paint JFrame when music is played , these shapes are created on random no calculation and when a there is some music played there pops up a JFrame and these shapes are painted there, problem is that when i run this code there…
user2088260
1
vote
0 answers

MIDI playback via javax.sound.midi.Sequencer pauses intermittently

I have a short snippet of Clojure code using the javax.sound.midi library to play a MIDI file. The problem is that, upon playback, the Sequence frequently pauses playback for about 20-30 seconds, then resumes. Here is the snippet of code: ;; given a…
dtg
  • 1,803
  • 4
  • 30
  • 44
1
vote
1 answer

Hardware MIDI Out for Playback in Java?

I am making a simple application to playback MIDI files in Java. I am using the javax.sound.midi library. I can retrieve my MIDI Out Device correctly (USB to MIDI Cable). But when I playback the sequence it always plays in the default sound…
Nathan McCoy
  • 3,092
  • 1
  • 24
  • 46
1
vote
1 answer

Why won't midi note timings work?

I'm creating a midi piano roll editor. The Note class creates and contains a NOTE_ON object and an associated NOTE_OFF object as well as a rectangle which the user manipulates on the screen to manipulate the pitch, timing and duration of the notes. …
Kyle Walker
  • 559
  • 3
  • 12
  • 25
0
votes
0 answers

Converting a MIDI file to MP3 in Java

I have midi files I want to convert to an mp3 file programmatically with a custom soundbank. As far as I can see the whole javax.sound package is only concerned with playback and the Soundbank loading classes are no longer part of the public…
xgb84j
  • 519
  • 2
  • 8
  • 19
0
votes
0 answers

Trying to import javax.sound into JavaFX project

IDE: Intellij Goal: Use javax.sound.midi.* in my project Problem: The import statement "import javax.sound.midi.*" gives the error: "package javax.sound.midi does not exist. When I import the javax.sound.midi in my swing project, everything works…
0
votes
1 answer

How to look ahead to next event in Midi Sequence

We are trying to code a simple guitar hero clone for university using javax.sound.midi. Currently we can play back a midi file with a sequencer and log the midi event that is currently played. However, we want to display the upcoming event (more…
0
votes
1 answer

Each time sequencer plays event, do something

We are trying to write a low-level guitar Hero clone for a semester project. I have created the track, sequence and sequencer for a song. Now I want the sequencer to notify another class every time its processes/plays an event of type NOTE_ON in its…
0
votes
0 answers

Java: get MIDI device's port number in a portable way

Some MIDI devices have several ports. For example, under Linux, $ amidi -l Dir Device Name IO hw:1,0,0 Launchpad X MIDI 1 IO hw:1,0,1 Launchpad X MIDI 2 shows that Launchpad X makes two MIDI ports available: 1 and 2. The user guide names…
scriptfoo
  • 476
  • 5
  • 17