Skip to content

Instantly share code, notes, and snippets.

@williamfields
Last active March 20, 2023 22:36
Show Gist options
  • Save williamfields/fd17b4710587a93501551cde481f79c2 to your computer and use it in GitHub Desktop.
Save williamfields/fd17b4710587a93501551cde481f79c2 to your computer and use it in GitHub Desktop.
TouchOSC: Snap to grid
function onValueChanged()
self.values.x = math.modf(self.values.x * self.properties.gridSteps, self.properties.gridSteps) / (self.properties.gridSteps-1)
end
@cornedriesprong
Copy link

cornedriesprong commented Mar 20, 2023

this was helpful 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment