]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
nokia2tuba: improve legato.
authorRudolf Polzer <divVerent@gmail.com>
Sat, 20 Nov 2021 19:00:46 +0000 (14:00 -0500)
committerRudolf Polzer <divVerent@gmail.com>
Sat, 20 Nov 2021 19:00:46 +0000 (14:00 -0500)
Oops, had this commit laying around quite long.

misc/tools/nokia2tuba.sh

index ac9172edcebec8a648ffbce41e60c775f3bdc84d..f96ed065227fcd631ac43b7afd900d847a9d8cf4 100755 (executable)
@@ -6,6 +6,8 @@ defaultoctave=1
 defaultlength=4
 baseoctave=1
 gato=-0.1
+mingato=0.034
+maxgato=-0.034
 
 tuba_note_42="moveleft back crouch fire"
 tuba_note_43="back crouch fire"
@@ -123,6 +125,14 @@ playnote() {
                                noteoff=$(echo "$time + $gato" | bc -l)
                                ;;
                esac
+               noteoff=$(echo "
+                       minnoteoff = $time + $mingato;
+                       maxnoteoff = $time + $duration + $maxgato;
+                       noteoff = $noteoff;
+                       if (noteoff > maxnoteoff) { noteoff = maxnoteoff; }
+                       if (noteoff < minnoteoff) { noteoff = minnoteoff; }
+                       noteoff;
+               " | bc -l)
                echo "defer $time \"$(tuba +)\""
                echo "defer $noteoff \"$(tuba -)\""
        fi