X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=MarkSlee.pde;fp=MarkSlee.pde;h=fde5fc7eda9a7b828652ba2b25c0335ca20d6a44;hb=66067e53a4adab2860ba09f88e2c3f8984ff65ba;hp=7a556d5d0f7850d5a463f7ba7f890365e664b828;hpb=1f974cbc418e3c35bb6010e1d7e566a9af63ff48;p=SugarCubes.git diff --git a/MarkSlee.pde b/MarkSlee.pde index 7a556d5..fde5fc7 100644 --- a/MarkSlee.pde +++ b/MarkSlee.pde @@ -173,11 +173,13 @@ class Pulley extends SCPattern { } // A little silliness to test the grid API - for (int i = 0; i < 7; ++i) { - for (int j = 0; j < 8; ++j) { - int gi = (int) constrain(j * NUM_DIVISIONS / 8, 0, NUM_DIVISIONS-1); - float b = 1 - 4.*abs((6-i)/7. - gravity[gi].getValuef() / model.yMax); - midiEngine.grid.setState(i, j, (b < 0) ? 0 : 1); + if (midiEngine != null && midiEngine.getFocusedPattern() == this) { + for (int i = 0; i < 5; ++i) { + for (int j = 0; j < 8; ++j) { + int gi = (int) constrain(j * NUM_DIVISIONS / 8, 0, NUM_DIVISIONS-1); + float b = 1 - 4.*abs((6-i)/6. - gravity[gi].getValuef() / model.yMax); + midiEngine.grid.setState(i, j, (b < 0) ? 0 : 3); + } } }