Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Creating a click track on Linux command line (Read 420 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Creating a click track on Linux command line

I'm looking to compare some wireless speakers and the obvious way to do that is by listening to the same song.

I tried with starting the same song on both speakers then muting one whilst unmuting the other, but it's a bit of a faff whilst also taking my attention away from the music. In the end I used sox to create two tracks with opposing segments of silence, and that's all worked fine, but what I would like to add to the beginning is a small click track to help align them (it doesn't have to be perfect as I have a small fade between silences anyway).

I know I can create one in Audacity, but was really hoping to be able to create it from the command line using a tool available from the standard repositories if anyone knows of a tool to do that?

Re: Creating a click track on Linux command line

Reply #1
Here is what I use:

Code: [Select]
# add this for example in ~/.bashrc
click() {
  local -r bpm=${1:?}
  play -q -n -c 1 synth 0.01 sine 880 delay "$(echo "scale=6; 60 / $bpm" | bc)" overdrive 20 100 norm -9 repeat -
}

# then to play a click track at 100bpm:
click 100

Re: Creating a click track on Linux command line

Reply #2
Code: [Select]
play -q -n -c 1 synth 0.01 sine 880 delay "$(echo "scale=6; 60 / $bpm" | bc)" overdrive 20 100 norm -9 repeat -
More "knock-knock" click, an impulse bandlimitted to 2k:
Code: [Select]
play -q -n -c 1 synth sq 1 trim 0 1s pad 30s 200s sinc -M -2k delay "$(echo "scale=6; 60 / $bpm" | bc)" norm -9 repeat -

Re: Creating a click track on Linux command line

Reply #3
Thanks for those suggestions they should do nicely, I hadn't considered using sox itself.

I also found klick yesterday. A little excessive for my use case, but seems very flexible.