• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

java midi synthesizing

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I'm trying to make java play predefined notes, and it does so but the notes do not sound right at all and I'm not sure what is causing it.

This is how I initialize my program


I use threads to play multiple notes at once on the same channel which is created through playNote() function but in essence this is what I do to play a single note


So far I've assumed that note number 60 corresponds to middle C on a piano, 61 to C-sharp, 62 to D and so on, I am perfectly aware that this could be a wrong assumption.
Now I've tried changing the instrument number above and the channel, I get different sounds but the music always sounds like it's played in the wrong key, so I'm hoping that someone can give me some pointers here how to map notes from java default synthesizer to the keys on a real keyboard and if there is a better way to accomplish this.
Thank you
 
Unnar Björnsson
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found out what was causing the false music, I assumed that each notenumber is an increment of 2 i.e C=60 B=62 and so on but failed to take into account the missing half notes in each octave :P
 
reply
    Bookmark Topic Watch Topic
  • New Topic