public void genNotes(double c) {
		double totalProb = 0;

		// randomly generate Note length
		for (int i = 0; i < prob.length; i++) {
			if (possibleCount[i] <= c) {
				totalProb += prob[i];
			}
		}
		double randGen = Math.random() * totalProb;
		int counter = -1;
		while (randGen > 0) {
			counter++;
			if (possibleCount[counter] <= c) {
				randGen -= prob[counter];
			}
		}

		// randomly generate Note subtype
		randGen = Math.random();
		if (randGen >= restChance) {
			list.add(new PlayNote(possibleCount[counter],minNote, maxNote, key));
		} else {
			list.add(new RestNote(possibleCount[counter]));
		}
		try {
		} catch (Exception e) {
		}
		if(c-possibleCount[counter]>0)
		{
			genNotes(c - possibleCount[counter]);
		}
		return;
	}