0

I have a Sequence player in which I simply open(), set the tempo, and start a Midi file where the Midi file is actually the bulk of my project (parsing a string file into a music piece)

Now in all the complexity of my code, I can't figure out how to change the instrument per voice:

The midi files can have multiple voices which my sequencer takes as being multiple notes to play at once. So if I have:

Voice: 1
notes
Voice: 2
more notes

Then my sequencer will play those two parts simultaneously. Maybe splitting the two to play different instruments isn't doable but at least how do I change the Instrument for the entire sequence?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
ZekeDroid
  • 7,089
  • 5
  • 33
  • 59

1 Answers1

0

"Voices" refer to how much polyphony the synth can handle.

If you wish to play a different synth, the easiest thing is probably to change the "channel" number, assuming you have different channels assigned to the different instruments that you wish to hear.

http://docs.oracle.com/javase/tutorial/sound/MIDI-synth.html

Phil Freihofner
  • 7,645
  • 1
  • 20
  • 41
  • ah so what you're saying is that I should be making synthesizers along with the sequencer? I have a single sequencer which I feed a stream and it plays. There is a channel which I am setting but changing it does not do much. I assume I'm missing a big chunk of info here but I'm starting to get the full picture as to how this could be accomplished. So, how would I go about changing the channel on my sequencer to play different instruments? – ZekeDroid Oct 30 '13 at 03:15
  • There IS a big chunk of info here that has to be learned, unfortunately for those of us who get impatient. (I count myself among such.) A reasonable place as any is to read the Java tutorials. A 'channel' is part of a standard MIDI message, and any synth that you have can be set to respond to a channel. If different synths are set to different channels, you can change the channel data on the sequence to have a different synth respond. There's more here than I'm capable of explaining, I'm afraid. – Phil Freihofner Oct 30 '13 at 09:51
  • No no you're actually being more helpful than you think. The question was tough in the sense that there's a lot of info I'm not being able to provide. I'm starting to get a sense for things and you actually told me kind of exactly what I need. I'm going to try to integrate a synthesizer into my code. Thanks! – ZekeDroid Oct 31 '13 at 14:34
  • By the way, now that I'm starting to get a feel for what question I should be asking, I will work hard to figure that out exactly. Then I'll post a question again and link it directly to this one that way if other people are struggling with coming up with the right question they can go straight there! So again, thanks a ton! – ZekeDroid Oct 31 '13 at 14:42