banovski

Vocals recording

Feb 23rd, 2021 (edited)
557
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. function exiting()
  4. {
  5.     espeak -v english "$1"
  6.     exit "$2"
  7. }
  8.  
  9. temporary_directory="$(mktemp -d)"
  10. vocal_directory="/home/skab/Data/audio/vocals"
  11. cd $vocal_directory
  12.  
  13. zenity --question --title="Vocals: recording" --text="Have you copied the URL of the track?" --ok-label="Start!" --cancel-label="Quit!"
  14. if test $? -ne 0; then
  15.     exiting "Quitting" 1
  16. fi
  17.  
  18. track_url=$(xclip -o -selection clipboard)
  19. sox "$track_url" "$temporary_directory/backing_track.wav" vol 0.5
  20.  
  21. file_names=(01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24)
  22.  
  23. i=1
  24. while test $i -lt 25; do
  25.     current_name=${file_names[$((i - 1))]}.wav
  26.     rec -r 44100 "$temporary_directory/vocal_track.wav" treble 12 &
  27.     play "$track_url" && killall rec
  28.     sox "$temporary_directory/vocal_track.wav" ./"$current_name" --norm=0
  29.     play -m "$temporary_directory/backing_track.wav" ./"$current_name" --norm=0
  30.     counter=$((counter+1))
  31.  
  32.     zenity --question --title="Vocals: recording" --text="Take $i done. What's next?" --ok-label="Next take" --cancel-label="Abort"
  33.     if test $? -ne 0; then
  34.         exiting "Aborted" 1
  35.     fi
  36.  
  37.     i=$((i+1))
  38. done
  39.  
RAW Paste Data