Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two topics: images and midi

Status
Not open for further replies.

Chrissirhc

Programmer
May 20, 2000
926
GB
Hello
I was wondering if anyone could help me. I have looked around this site and there is so much information that its hard to find out very small things. My two queries are what are the best image formats that JDK1.2.2 and 1.3 for 8 bit images. I understand that I can use GZIP to compress them so they do not need to be compressed. My second and more important query is to do with MIDI. I want to have a class with arrays/vectors which hold information about a music peice. E.g have 3D array with note duration and pitch (a,b,c etc) etc. I then want to convert this into MIDI and play it back. Does anyone know how to do this can this be done in JAVA. I understand that JDK1.3 allows some MIDI functions but I cannot see how to write a midi file from typing (if that makes sense). :)
I would be grateful if someone could help me with this.

Thanks
Chris

 
I have never actually taken apart a sound file in java. I have played them using the audioclip class.
AudioClip
AudioFileFormat
AudioFileFormat.Type
AudioFileReader
AudioFileWriter
AudioFormat
AudioFormat.Encoding
AudioInputStream
AudioPermission
AudioSystem
These are other classes in the jdk1.2 that you may be interested in.......
link to there documentation...

good luck
 
Thanks for your response
I have looked briefly at these classes. They tend to be for playing and saving wav/au files raw audio kind of thing. My problem is midi. I know how to play a midi file. I need to convert score sheet into midi. So I assumed that as midi is just a file that just contains what instument what pitch and duration of notes, it would be feasible to do this quite easily. My problem is I do not know the format of these files. So I don't know how to make a midi file. I am probably explaining myself very badly. What I basically want to do is to be able to tell the computer to play c then d then b note in piano for one second each.

Chris
 
You might have to actually look at the binary values for the midi sound file. You will need to use a hex editor, many good shareware out there. View the midi in hexadecimal and find out what the differing values may be depending on file type. here is a link that contains info on the midi file format.

good luck
 
Thanks alot for your last post. This seems to be what I may have been looking for. I have skim read it and don't understand most of it. But will try to read it properly soon. I have a feeling I will be posting again due to my lack in understanding though.

Thanks again.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top