Exemple #1
0
	void FourWayMic::init()
	{
		Matrix22 rot(owner->angle);
		allMicAbsPos[0] = owner->pos + rot*Vector( micDist, micDist);
		allMicAbsPos[1] = owner->pos + rot*Vector( micDist,-micDist);
		allMicAbsPos[2] = owner->pos + rot*Vector(-micDist, micDist);
		allMicAbsPos[3] = owner->pos + rot*Vector(-micDist,-micDist);
		resetSound();
	}
Exemple #2
0
int main (void)
{
	static byte rowNumber, columnNumber, synthesizing;
	static byte rowBit, columnBits, lastColumnBits[8], changedColumnBits;

     /* If we have a character, remove it from the buffer */
    if (kbhit ()) {
       	cgetc ();
    }

	resetSound();
    setUpScreen();
	synthesizing=TRUE;

    //main loop
    while(synthesizing)
    {
		//do keyboard scan
		for (rowNumber = 0; rowNumber <= KeyRows-1; rowNumber++)
		{
			rowBit = 1 << rowNumber;
			
			CIA1.pra = ~rowBit; 		//write the row we want to read
			columnBits = ~CIA1.prb;   	//read the keys pressed in the row
									
			if (lastColumnBits[rowNumber] != columnBits)
			{
				changedColumnBits=lastColumnBits[rowNumber]^columnBits;
				lastColumnBits[rowNumber]=columnBits;
				
				for(columnNumber = 0; 
					columnNumber<= KeyColumns-1 && changedColumnBits != 0; 
					columnNumber++)
				{
					if(changedColumnBits & 1)
					{
						changeFunctionStatus(functionMatrix[rowNumber][columnNumber], 
											columnBits & 1);
					}
					changedColumnBits >>= 1;
					columnBits >>= 1;
				}				
			}
		}

		if(kbhit()){
			if (cgetc()==13)
				synthesizing=FALSE;
		}
    }
Exemple #3
0
	void Microphone::init()
	{
		Matrix22 rot(owner->angle);
		micAbsPos = owner->pos + rot*micRelPos;
		resetSound();
	}