Esempio n. 1
0
void MemoryBitmap::SetMatrix(const MonteCarlo::SpinMatrix& matrix, unsigned int spinsWidth, unsigned int spinsHeight, unsigned int spinSize)
{
	SetSize(spinSize*spinsWidth, spinSize*spinsHeight);

	const int widthZeroOrig = (spinsWidth - static_cast<int>(matrix.getCols())) / 2;
	const int heightZeroOrig = (spinsHeight - static_cast<int>(matrix.getRows())) / 2;

	for (unsigned int i = 0; i < spinsHeight; ++i)
		for (unsigned int j = 0; j < spinsWidth; ++j)
		{
			const int spin = matrix.GetSpinPeriodic(i - heightZeroOrig, j - widthZeroOrig);

			FillSquare(j * spinSize, i * spinSize, spinSize, spin > 0 ? theApp.options.spinUpColor : theApp.options.spinDownColor);
		}
}
Esempio n. 2
0
//CARRIER
// compare symbol with stored symbols to determine which wavetable should be made
void FMSet(fmsynth *x, t_symbol *s) {
	if (s == sineMess)
		FillSine(x);
	else if (s == squareMess)
		FillSquare(x);
    else if (s == triMess)
        FillTri(x);
    else if (s == sawMess)
        FillSaw(x);
    else if (s == phasorMess)
        FillPhasor(x);
    //MODULATOR
    else if (s == sineMessMod)
		FillSineMod(x);
	else if (s == squareMessMod)
		FillSquareMod(x);
    else if (s == triMessMod)
        FillTriMod(x);
    else if (s == sawMessMod)
        FillSawMod(x);
    else if (s == phasorMessMod)
        FillPhasorMod(x);
}