LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 10-29-2007, 03:43 PM   #1
benslice
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
No sound from midi in java


Hey guys,
I have a sample java program that does a beat box using midi:
(url not allowed google "beatbox.java head first")
(sorry I have a new user name and no url privileges yet.)

And I can't get it to produce any sound on my linux box.

Here's what I've done:

alsa is installed and works
timidity can play a midi file (though i suspect this is unrelated)
I installed a soundbank from sun
(url not allowed google java midi soundbank)

(did i put this in the right place?)
/usr/java/jdk1.5.0_12/jre/lib/audio/soundbank.gm
/usr/java/jdk1.5.0_12/lib/audio/README-soundbank.txt
/usr/java/jdk1.5.0_12/lib/audio/soundbank-deluxe.gm
/usr/java/jdk1.5.0_12/lib/audio/soundbank-deluxe.gm.zip


The program exhibits the same behavior as windows/mac,
ie, throws no exceptions, doesn't crash etc, but no sound
is generated.

Here's my setup:
lenovo X61s
opensuse 10.2
java 5
alsa is from cvs (newish chip)

Am I missing another piece for midi generation?
Is there a device I need to set up?
Can test the midi subsystem from something other than the
java API to help locate the problem?


thanks

Benjamin
 
Old 10-29-2007, 06:35 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by benslice View Post
timidity can play a midi file (though i suspect this is unrelated)
Yes, this is (probably) unrelated. Timidity++ will convert a MIDI file to sound information and output it to the soundcard as a “wave” file (the PCM channel). The program you are writing most likely attempts to use the soundcard’s MIDI hardware to do this work. To check if your alsa setup correctly uses your soundcard as a sequencer, you might try to tell timidity to use the hardware or try a sequencer-based (i.e., non-software-based rendering) MIDI file player (e.g., playmidi).

As an alternative, if you don’t like the sound of your hardware sequencer compared to timidity (or like the prospect of sound fonts and such), you can use timidity as a server which provides alsa a virtual MIDI sequencer. This device can be made the default and would be used by playmidi and other players which access the sequencer.
 
Old 11-02-2007, 05:09 PM   #3
benslice
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Original Poster
Rep: Reputation: 0
I accidentally posted this twice,

please see my other thread:
http://www.linuxquestions.org/questi...4/#post2946222
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
java/midi no errors no sound benslice Programming 3 11-02-2007 06:59 PM
midi keyboard, how to make sound?midi keyboard, how to produce sounds? Blyiss Linux - Software 10 03-24-2007 08:53 PM
java midi packages angelo_maci Programming 1 05-07-2006 07:04 PM
Java, MIDI royals1216 Linux - Software 3 01-03-2004 11:19 AM
Java, Midi royals1216 Linux - Newbie 1 12-28-2003 04:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration