import net.beadsproject.beads.core.AudioContext;
import processing.core.PApplet;
import processing.core.PGraphics;

/* provides an octave of notes */
public class GridControlNote extends GridControl {

	int octave;
	public GridControlNote(int octave, AudioContext ac, PApplet papplet,int x, int y,
			SoundEffect se) {		
		super(ac, papplet,  13, x, y, se);	
		this.octave = octave;
	}
	
	public SoundEffect setupSoundEffect(int j, SoundEffect se)
	{
		double freq[] = {
				220.00,233.08,246.94,261.63,
				277.18,293.66,311.13,329.63,
				349.23,369.99,392.00,415.30,
				440.00};
		double freq2[] = {
880.00,932.33,987.77,1046.50,1108.73,1174.66,1244.51,1318.51,1396.91,1479.98,1567.98,1661.22,1760.00
		};
		
		SoundEffect se2 = new SoundEffect(se);
		se2.Frequency = (float) ((octave==0)?freq[j]:freq2[j]);
		//se2.MinFrequency*=(1 + dj);	
		return se2;
	}

}
