• 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

MidiEvent Issues.  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone,

I'm currently working through a tutorial on how to draw graphics in time with music and the first step in this tutorial
is to simply learn how to build a static utility method that makes a message and returns a midi event. The problem I'm having is that
my makeEvent method doesn't return a midiEvent but from what I can tell I've done it the right way. I'm still learning a lot about Java and really can't tell where I have gone wrong.
Below is my code.

Thanks in advance if anyone can offer any help

Dan


 
Marshal
Posts: 60157
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

You are making problems for yourself by having an empty catch block. Put something in there, eg ex.printStackTrace(); if you suffer an Exception you will never know about it and not know what the problem was.
 
Campbell Ritchie
Marshal
Posts: 60157
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried your code and it ran. I got sounds out of it.

By the way, your for loop doesn’t run from 5 to 61, b ut from 5 to 57.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!