My patch sends triggers bangs received from an iPhone compass (using C74 app as input). As the compass turns around and around, it sends out integers and resets to 0 after going around one revolution. I can't quite figure out how to have the direction reverse as it completes a full revolution, so that way instead of jumping to the first bang it simply changes direction as the iPhone continues spinning in the same direction (and also change direction if the spin changes direction).
Any ideas? Thanks!