jFugue - How to use Left Hand and Right Hand on the Piano at the same time? [closed]

StackOverflow https://stackoverflow.com//questions/9585606

  •  08-12-2019
  •  | 
  •  

Pregunta

I am using jFugue to create generative music. So far I was successful with creating music based on probability from an analysis of the song. However, so far I only have the right hand side of the piano being played. I now want to include the left hand side of the piano as well, however I was unable to do is through jFugue.

The jFugue website is currently down when I tried to look for information there and didn't yet find a solution, maybe there is someone here who has more experience with this.

This is an example of the code which plays one side of the piano (this is not generative, but if I get how I can play two hands at the same time, I can adjust my algorithm to make it play both hands with generated music):

Pattern pattern = new Pattern("T126 I[PIANO] "  + "G#i A#i A#q F#q Fq F#i F#w Rs " + "G#i A#i A#q F#q Bh A#h F#q Ri " + "G#i A#i A#q F#q Fq F#i F#w Rs " + "G#i A#i A#q G#q Bh A#h F#w Rs");
player.play(pattern);
¿Fue útil?

Solución

I think what you're asking for is the ability to play two or more sequences of music at the same time. What you need is the Voice command.

Voices in JFugue correspond to MIDI channels. There are 16 voices/channels numbered 0-15, with voice 9 reserved for percussion instruments.

You want to say something like, "T126 I[Piano] V0 A B C V1 D E F" - this will play two sequences in harmony.

This is covered in the "Using the JFugue Music String" document available from the jfugue.org website.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top