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
2 answers

try-catch not working properly

I'm reading Java from HeadFirst. I started reading the chapter about Exception Handling. There was code in the book that I executed on my computer. import javax.sound.midi.*; class PlayMusic { public void play() { try{ …
Arindam
  • 163
  • 1
  • 13
0
votes
1 answer

MIDI Sequencer stop without flushing

For a project I am working on I need to pause the midi sequencer and I want all the sounding notes to sustain and thus make those notes endless. The problem I am facing is that sequencer.stop() apparently not only stops the playback, but also sends…
Tomasito665
  • 1,188
  • 1
  • 12
  • 24
0
votes
2 answers

Java MIDI Sequencer SyncMode

Hi: I'm trying to get an instance of the MIDI Sequencer sync to an external clock. I did: S_p = MidiSystem.getSequencer(false); D2 =…
cladelpino
  • 337
  • 3
  • 14
0
votes
1 answer

Simple sound not playing in java midi test code

I am trying to establish the ability of javax.sound.midi code to generate a simple sound, so that I can be setup to start to work on more complicated MIDI code. But the code below is not producing a sound. The code sample is only about 50 lines…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
0
votes
1 answer

How to use "javax.sound.midi.MidiSystem.getSequence" in Octave

I have been using Matlab for some time, but have just started using Octave. I am trying to read a midi file using the following code on my Windows machine: javaaddpath('C:/Program Files/Java/jdk1.8.0_45/jre/lib/rt.jar'); midiFile =…
user1340654
  • 395
  • 2
  • 5
  • 16
0
votes
1 answer

JFugue 5 external midi device

Been trying for a long time to send a sequence to a midi device with jFugue 5: MusicReceiver device = getDeviceByName("name"); Player player = new Player(); Pattern pattern = new Pattern("A"); …
Yan
  • 582
  • 2
  • 6
  • 22
0
votes
2 answers

Synchronise to beats per minute / Send quantised messages

I'm getting periodic signals (beats per minute) from a Transmitter and now want to call methods in a fraction of the period, e.g. send 1/1, 1/2, 1/4, 1/8, 1/16,.. notes. My solution for this is to create a thread, do a busy wait and then execute the…
user
  • 211
  • 2
  • 12
0
votes
0 answers

Jython/Java communicate with usb midi device using javax.sound.midi.*. (lividinstruments)

I'm trying to communicate with an usb midi controller using the midi classes from javax.sound package. I successfully got input from device, but i can't work out how to communicate with device. The device is livid OhmRGB. According to wiki i…
0
votes
1 answer

Play a single, random note in Java

I want to play a single, random note in Java. I use the following: Random rand = new Random(); try { Synthesizer synth = MidiSystem.getSynthesizer(); synth.open(); int note = rand.nextInt(128); channels[0].noteOn(note, 80); } catch…
ricky3350
  • 1,710
  • 3
  • 20
  • 35
0
votes
1 answer

How to create MIDI Sysex Master Volume message from volume level?

If volume level is represented as a float value between 0 and 1, how to create data bytes of the Universal SysEx Master Volume message? This is Sysex message constructor, with given Sysex message status byte (0xF0) and data bytes: new…
krsi
  • 1,045
  • 2
  • 14
  • 24
0
votes
1 answer

Playing created midi sounds simultaneously in Java

I have a problem and I hope to get here an answer. I want to create many midi sounds without saving them on the client pc, because this should work in an Applet. The creating sound part isn't the problem, the problem is to play these sound…
Mangooxx
  • 1,313
  • 2
  • 12
  • 13
0
votes
1 answer

How to Receive the Response of a MIDI Bulk Tuning Dump Request?

I'am using the MIDI Tuning Standard to change the tuning from concert pitch A4 = 440 Hz to arbitrary tuing frequencies. It works well on my machine with Windows 7 and JDK 1.8.0. But I want check before, if the Tuning Standard is…
Vertex
  • 2,682
  • 3
  • 29
  • 43
0
votes
2 answers

How can I be notified when a certain tick is reached in a midi sequence?

I'm using javax.sound.midi.Sequencer to play a sequence and I need to jump to an other part of the sequence when a certain tick is reached. Imagine a loop that when we reach tick number "y" we jump back to tick number "x". But I'm not doing a loop…
0
votes
1 answer

NullPointerException while passing an InputStream to Soundbank of MidiSystem in Java

I am trying to create a soundbank by reading from a file and passing it onto the getSoundbank function of MidiSystem. For this purpose, I have to read the file as InputStream for which I tried the following techniques but failed. First technique --…
0
votes
1 answer

Send multiple MIDI messages

I want to be able to send multiple MIDI messages independently. But the problem is that I have to wait until the previous note has ended. Do I have to create a thread for all my voices? Let's say I want to be able to play 10 notes at the same time.…
TomTom
  • 2,820
  • 4
  • 28
  • 46