public void setFrequency(int gbFrequency) {
		try {
			float frequency = 131072 / 2048;

			if (gbFrequency != 2048) {
				frequency = ((float) 131072 / (float) (2048 - gbFrequency));
			}
			//  System.out.println("gbFrequency: " + gbFrequency + "");
			this.gbFrequency = gbFrequency;
			if (frequency != 0) {
				cycleLength = (256 * sampleRate) / (int) frequency;
			} else {
				cycleLength = 65535;
			}
			if (cycleLength == 0) cycleLength = 1;
			//  System.out.println("Cycle length : " + cycleLength + " samples");
		} catch (ArithmeticException e) {
			// Skip ip
		}
	}