Skip to content

Instantly share code, notes, and snippets.

Last active Mar 19, 2018
What would you like to do?
# SPDX-License-Identifier: WTFPL
# Copyright © 2018 Neil "Superna" Armstrong
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See the COPYING file or
# for more details.
PREV="$(date +%s%N | cut -b1-13)"
while read -p "tapTempo : press any key (CTRL+D for quit)" tap ; do
CUR="$(date +%s%N | cut -b1-13)"
TAPS="$TAPS + $(($CUR-$PREV))"
COUNT="$(($COUNT + 1))"
echo ""
echo BPM : $((60000 / $(($(($TAPS + 0)) / $COUNT))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment