I'm using Jfugue in Eclipse, and I have a list of music strings in the code. When I run the code, it plays back all of them, but I want to play back one at a time in random order.
So far I'm using:
Pattern pattern = new Pattern ("A");
Player.play(A);
Pattern pattern = new Pattern ("B");
Player.play(B);
I've tried using "Random random = new Random();" But this has not been working, and I don't know how to implement it.
I've also tried re-suing a random word generator:
for(int i = 0; i < numberOfTest; i++) {
int index = (int)(Math.random() * 10);
System.out.println(strings[index]);
But I don't know how to replace the word strings with music strings:
In general most of my problems stem from a lack of familiarity with the correct syntax, especially Jfugue.
Put them into a list, and then shuffle that:
And please note: the above is plain and simple java, it works independently of any specific framework such as jfugue.
For playing, you simply have to tell the player to play the patterns using the order of your shuffled list: