Results 1 to 2 of 2
- 03-04-2009, 04:32 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 3
- Rep Power
- 0
Manually edit volume of MIDI file in Java
Hey all, I'm trying to find a way to manually change the volume (velocity) of a midi file before playback, i.e. directly in the code. This is the code I'm using to play my midi files:
import javax.sound.midi.*;
import java.io.*;
/** Plays a midi file provided on command line */
public class MidiPlayer {
public static void main(String args[]) {
try {
// From file
Sequence sequence = MidiSystem.getSequence(new File("C:\\Sounds\\twinkleaccomp.mid"));
// Create a sequencer for the sequence
Sequencer sequencer = MidiSystem.getSequencer();
sequencer.open();
sequencer.setSequence(sequence);
// Start playing
sequencer.start();
} catch (IOException e) {
} catch (MidiUnavailableException e) {
} catch (InvalidMidiDataException e) {
}
}
}
How can I edit my code so that I can easily change the midi file's volume before I run and compile the code?
Thank you, any help will be appreciated! :)
- 03-04-2009, 05:57 PM #2
Similar Threads
-
Manually adding a component
By djc in forum NetBeansReplies: 3Last Post: 04-01-2009, 11:51 AM -
How to edit/delete a line in *.dat file in java io and applets
By kalanidhi in forum New To JavaReplies: 1Last Post: 11-10-2008, 09:49 AM -
Handle exception manually
By John_28 in forum New To JavaReplies: 2Last Post: 06-05-2008, 11:26 AM -
I need help with my java servlet homework(add,edit and delete)
By jellyfish888 in forum Java ServletReplies: 3Last Post: 12-26-2007, 06:42 AM -
how to play MIDI in java application?
By oregon in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 02:26 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks