`if y < prevValue or prevValue is None:`
should be
`if prevValue is None or y < prevValue:`
because the first one will make a comparison for `y < None`, while the second one won't. `y < None` will always return `False` while `prevValue is None` will then always return `True`, making the entire statement `True` if `prevValue` is `None`.
It is not a bug but it's something which I would correct. In the second one `y < prevValue` would not get evaluated if `prevValue` is `None` and it's not really clear what `y < None` means.
--
Great work which reminded me of the Ace of Spades-Robots. It also shows how insanely good humans can be at playing guitars.