This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

No MIDI sound on Ubuntu - Java Head First  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I'm at chapter 11 of 'Java Head First' and there is this example MIDI program whose code I wrote down and compiled, it's supposed to give me a short sound when I run it, but there's no sound at all coming from my device (I can hear sounds of everything else outside my program just fine).

My OS: Ubuntu 16.04 LS
Java version: 1.5 (the one used with the book)

The code:



I'll be more than happy to provide you with other details.
 
Marshal
Posts: 60168
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch and sorry for the delay in replying. I had to find my copy of HFJ to verify that you had copied the code correctly, which you have. I am afraid I don't know why you are having problems; it made the right sound for me.
 
Sheriff
Posts: 5130
138
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can your system play a MIDI file, outside of Java?  For instance, can you play this?

https://drive.google.com/file/d/15jTEDSnaxMzckeC8HvPnqsAxTMCBsdh6/view?usp=sharing
 
Jan Kowalskii
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch and sorry for the delay in replying. I had to find my copy of HFJ to verify that you had copied the code correctly, which you have. I am afraid I don't know why you are having problems; it made the right sound for me.


Thank you! Good to know that the code is correct, so I guess it's the OS's fault. What OS have you run the code on though?

Knute Snortum wrote:Can your system play a MIDI file, outside of Java?  For instance, can you play this?

https://drive.google.com/file/d/15jTEDSnaxMzckeC8HvPnqsAxTMCBsdh6/view?usp=sharing


I couldn't play the file. I installed the program Timidity and associated MIDI files with it so the file is played by default by it, but that didn't aid in my problem with the command line app.
 
Campbell Ritchie
Marshal
Posts: 60168
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jan Kowalskii wrote:. . . What OS have you run the code on though? . . .

Fedora 27 and Ubuntu 17.10, both with JDK9.0.1.
 
Knute Snortum
Sheriff
Posts: 5130
138
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jan Kowalskii wrote:I couldn't play the file. I installed the program Timidity and associated MIDI files with it so the file is played by default by it, but that didn't aid in my problem with the command line app.


Okay, just to be clear, you could play the MIDI file from the command line after you installed Timidity but your HFJ program still didn't play a note?
 
Jan Kowalskii
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:

Jan Kowalskii wrote:I couldn't play the file. I installed the program Timidity and associated MIDI files with it so the file is played by default by it, but that didn't aid in my problem with the command line app.


Okay, just to be clear, you could play the MIDI file from the command line after you installed Timidity but your HFJ program still didn't play a note?



Exactly what happened. I can play your MIDI file via Terminal (or outside of it within app's GUI), but the HFJ code doesn't yield any results.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!