Loopy Pro: Create music, your way.
What is Loopy Pro? — Loopy Pro is a powerful, flexible, and intuitive live looper, sampler, clip launcher and DAW for iPhone and iPad. At its core, it allows you to record and layer sounds in real-time to create complex musical arrangements. But it doesn’t stop there—Loopy Pro offers advanced tools to customize your workflow, build dynamic performance setups, and create a seamless connection between instruments, effects, and external gear.
Use it for live looping, sequencing, arranging, mixing, and much more. Whether you're a live performer, a producer, or just experimenting with sound, Loopy Pro helps you take control of your creative process.
Download on the App StoreLoopy Pro is your all-in-one musical toolkit. Try it for free today.
double tap, long tap detection?
here's another one:)
now that i got my fader working, i want to add double tap and long tap functionality to that fader.
how is that accomplished correctly?
i have 3 user events to listen to:
mouse_down
mouse_up
mouse_move
and i have a timer (milliseconds)
timer(n)
pseudocode:
mouse_down = 0
mouse_up = 1
mouse_move = 0
double_tap = 0
td = 0
tu = 0
start_timer(1) // from 0
on mouse_down // first event
td = get_timer(1) // say 5000
if td - tu < 250 // not correct! somehow got stuck here:)
double_tap = 1
mouse_move = 0
else
double_tap = 0
mouse_move = 1
on mouse_up
tu = get_timer(1) //say 6000
start timer()
Comments
No parentheses around (td-tu)?
I'm not sure if this applies, but you need to be very careful with subtraction if using "unsigned" variables, since any possible negative result will be treated as a very large value.
thanks for the hint @uncledave
but the above is just kind of "pseudocode"
What's the context and environment?
In general, this is kinda complex to handle. You may need to deal with cancelling single taps that have already been detected so that you don't add latency to the single tap. You'll probably want to add the ability to cancel the long press if the user drags out of the control or more than a certain distance during the hold part of the gesture. Since you are doing this in your fader, you may need to threshold the amount movement you allow before you start considering the long press as a tap-and-drag.
Accessibility is an important consideration too. For example, having a way to set the timing thresholds for double tap recognition can be really important. The builtin gestures on iOS tie directly into the system accessibility settings and are convenient for users. If you need to do the recognition yourself, there's an API for getting the system values to use.
What does stuck mean? Some things to consider…
Movement never is a result of up/down testing.
Double-click depends on the delta between mouse down events not an up/down pair. Press-hold-release-quickly-re-press is not a double-click.
The two mouse down events need to occur reasonably near each other in space as well as time.
Most systems have a function that returns the current time in milliseconds. Not sure why you wouldn’t use that rather than a timer.
Related… the timer code seems off. You’re restarting the timer on every mouse up and you’re subtracting the timers as if they were millisecond values. So you’re subtracting the time between two ups from the time between up/down.