Created
March 27, 2022 09:26
-
-
Save jobbautista9/23f18bce10dd4f5f2aa6532415e7b735 to your computer and use it in GitHub Desktop.
Akutagawa Ryuunosuke's "Kappa" ~ Candid Friend (bash/SoX arrange)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
: ' | |
Copyright (C) 2022 Job Bautista | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
of the Software, and to permit persons to whom the Software is furnished to do | |
so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all | |
copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
SOFTWARE. | |
' | |
echo ' __ __ __ _____ ___ __' | |
echo '/ ` /\ |\ || \|| \ |__|__)||__ |\ || \' | |
echo '\__,/~~\| \||__/||__/ | | \||___| \||__/' | |
echo "Akutagawa Ryuunosuke's Kappa ~ Candid Friend" | |
echo "Composed by ZUN for Touhou Fuujinroku: Mountain of Faith" | |
printf "Arranged by Job Bautista\n\n" | |
# unused notes and durations are commented | |
# notes | |
: ' | |
declare -r c0=16 | |
declare -r cs0=17 | |
declare -r d0=18 | |
declare -r ds0=19 | |
declare -r e0=20 | |
declare -r f0=21 | |
declare -r fs0=23 | |
declare -r g0=24 | |
declare -r gs0=25 | |
declare -r a0=27 | |
declare -r as0=29 | |
declare -r b0=30 | |
' | |
declare -r c1=32 | |
# declare -r cs1=34 | |
declare -r d1=36 | |
# declare -r ds1=38 | |
declare -r e1=41 | |
declare -r f1=43 | |
# declare -r fs1=48 | |
# declare -r gs1=51 | |
declare -r a1=55 | |
# declare -r as1=58 | |
declare -r b1=61 | |
declare -r c2=65 | |
: ' | |
declare -r cs2=69 | |
declare -r d2=73 | |
declare -r ds2=77 | |
declare -r e2=82 | |
' | |
declare -r f2=87 | |
: ' | |
declare -r fs2=92 | |
declare -r g2=97 | |
declare -r gs2=103 | |
declare -r a2=110 | |
declare -r as2=116 | |
' | |
declare -r b2=123 | |
declare -r c3=130 | |
# declare -r cs3=138 | |
# declare -r d3=146 | |
# declare -r ds3=155 | |
declare -r e3=164 | |
declare -r f3=174 | |
declare -r fs3=184 | |
declare -r g3=195 | |
declare -r gs3=207 | |
declare -r a3=220 | |
declare -r as3=233 | |
declare -r b3=246 | |
declare -r c4=261 | |
declare -r cs4=277 | |
declare -r d4=293 | |
declare -r ds4=311 | |
declare -r e4=329 | |
declare -r f4=349 | |
declare -r fs4=369 | |
declare -r g4=391 | |
declare -r gs4=415 | |
declare -r a4=440 | |
declare -r as4=466 | |
declare -r b4=493 | |
declare -r c5=523 | |
declare -r cs5=554 | |
declare -r d5=587 | |
declare -r ds5=622 | |
declare -r e5=659 | |
declare -r f5=698 | |
declare -r fs5=739 | |
declare -r g5=783 | |
declare -r gs5=830 | |
declare -r a5=880 | |
# declare -r as5=932 | |
# declare -r b5=987 | |
# durations | |
declare -r fu=0.75 | |
declare -r ha=0.5 | |
declare -r qu=0.25 | |
declare -r ei=0.125 | |
declare -r si=0.0625 | |
function note { # $1 = duration, $2 = note | |
echo $1 $2; play -q -V0 -n synth $1 sin $2; | |
} | |
function fu { note $fu $1; }; | |
function ha { note $ha $1; }; | |
function qu { note $qu $1; }; | |
function ei { note $ei $1; }; | |
function si { note $si $1; }; | |
function fastintro { | |
function fipart1 { | |
si $b2 | |
si $e3 | |
si $fs3 | |
si $a3 | |
} | |
for i in 1 2 3 4 | |
do | |
fipart1 | |
done | |
si $b3 | |
si $e4 | |
si $fs4 | |
si $a4 | |
si $fs4 | |
si $e4 | |
si $a3 | |
si $e3 | |
} | |
function trueintro { | |
qu $cs4 | |
qu $ds4 | |
qu $e4 | |
qu $fs4 | |
qu $b4 | |
qu $ds5 | |
ha $cs5 | |
qu $b4 | |
ha $cs5 | |
} | |
function part0-5 { # drum-like sounds | |
function main { | |
si $e1 | |
si $f1 | |
si $c1 | |
si $d1 | |
si $a1 | |
si $b1 | |
} | |
main; main; | |
} | |
function part1 { | |
qu $d4 | |
qu $e4 | |
qu $f4 | |
qu $a4 | |
qu $f4 | |
qu $e4 | |
ha $d4 | |
qu $c4 | |
ha $a3 | |
qu $a3 | |
qu $d4 | |
qu $e4 | |
qu $f4 | |
qu $g4 | |
qu $f4 | |
qu $e4 | |
ha $d4 | |
qu $c4 | |
fu $d4 | |
} | |
function part2 { | |
ha $as3 | |
qu $c4 | |
ha $a3 | |
qu $a3 | |
qu $as3 | |
qu $c4 | |
qu $d4 | |
qu $cs4 | |
qu $as3 | |
ei $a3 | |
ha $as3 | |
qu $c4 | |
qu $d4 | |
qu $e4 | |
qu $f4 | |
qu $g4 | |
ha $f4 | |
} | |
function part2-5 { | |
si $g4 | |
si $a4 | |
si $g4 | |
si $a4 | |
si $f4 | |
si $e4 | |
si $d4 | |
si $c4 | |
si $a3 | |
si $c4 | |
si $a3 | |
} | |
function part3 { | |
ha $f4 | |
qu $g4 | |
ha $e4 | |
qu $e4 | |
qu $f4 | |
qu $g4 | |
qu $a4 | |
qu $g4 | |
qu $f4 | |
ei $e4 | |
ha $f4 | |
qu $g4 | |
qu $a4 | |
qu $g4 | |
qu $c5 | |
qu $e5 | |
fu $d5 | |
fu $d5 | |
} | |
function part4 { | |
function dahdahdah { | |
ei $g4 | |
ei $a4 | |
qu $as4 | |
} | |
qu $d4 | |
dahdahdah | |
qu $d4 | |
dahdahdah | |
qu $c5 | |
qu $as4 | |
ei $a4 | |
ei $as4 | |
qu $a4 | |
qu $f4 | |
qu $c4 | |
qu $f4 | |
ei $as4 | |
ei $c5 | |
qu $cs5 | |
qu $c5 | |
qu $gs4 | |
qu $ds4 | |
ha $f4 | |
qu $as4 | |
qu $a4 | |
qu $ds5 | |
qu $c5 | |
qu $as4 | |
ei $g4 | |
ei $a4 | |
qu $as4 | |
qu $c5 | |
ei $a4 | |
ei $as4 | |
ei $c5 | |
ei $d5 | |
ei $as4 | |
ei $g4 | |
ei $d4 | |
ei $as4 | |
qu $a4 | |
ei $a4 | |
ei $f4 | |
ei $c4 | |
ei $f4 | |
qu $c4 | |
qu $as3 | |
ei $g3 | |
ei $a3 | |
qu $as3 | |
qu $a3 | |
qu $f3 | |
qu $a3 | |
note 0.625 $g3 # custom duration to not sound awkward | |
fu $g4 | |
} | |
function part5 { | |
qu $d5 | |
qu $e5 | |
qu $f5 | |
qu $a5 | |
qu $f5 | |
qu $e5 | |
ha $d5 | |
qu $c5 | |
ha $a4 | |
qu $a4 | |
qu $d5 | |
qu $e5 | |
qu $f5 | |
qu $g5 | |
qu $f5 | |
qu $e5 | |
ha $d5 | |
qu $c5 | |
fu $d5 | |
} | |
: ' | |
function part5-5 { # too fast :( | |
si $f3 | |
si $f3 | |
si $f3 | |
ei $c3 | |
ei $c3 | |
ei $f3 | |
ei $f3 | |
ei $c3 | |
ei $c3 | |
ei $c3 | |
ei $c3 | |
ei $f3 | |
ei $f2 | |
ei $c2 | |
ei $c2 | |
} | |
' | |
function part6 { | |
function dahdahdah { | |
ei $gs4 | |
ei $as4 | |
qu $b4 | |
} | |
qu $ds4 | |
dahdahdah | |
qu $ds4 | |
dahdahdah | |
qu $cs5 | |
qu $b4 | |
ei $as4 | |
ei $b4 | |
qu $as4 | |
qu $fs4 | |
qu $cs4 | |
qu $fs4 | |
ei $b4 | |
ei $cs5 | |
qu $d5 | |
qu $cs5 | |
qu $a4 | |
qu $e4 | |
ha $fs4 | |
qu $b4 | |
qu $as4 | |
qu $e5 | |
qu $cs5 | |
qu $b4 | |
ei $gs4 | |
ei $as4 | |
qu $b4 | |
qu $cs5 | |
ei $as4 | |
ei $b4 | |
ei $cs5 | |
ei $ds5 | |
ei $b4 | |
ei $gs4 | |
ei $ds4 | |
ei $b4 | |
qu $as4 | |
ei $as4 | |
ei $fs4 | |
ei $cs4 | |
ei $fs4 | |
qu $cs4 | |
qu $b3 | |
ei $gs3 | |
ei $as3 | |
qu $b3 | |
qu $as3 | |
qu $fs3 | |
qu $as3 | |
note 0.625 $gs3 | |
fu $gs4 | |
} | |
function part7 { | |
function dahdahdah { | |
ei $b4 | |
ei $cs5 | |
qu $ds5 | |
} | |
qu $gs4 | |
dahdahdah | |
qu $gs4 | |
dahdahdah | |
ei $ds5 | |
ei $gs5 | |
ei $cs5 | |
ei $fs5 | |
ei $b4 | |
ei $ds5 | |
ei $cs5 | |
ei $as4 | |
ei $b4 | |
ei $gs4 | |
ei $as4 | |
ei $fs4 | |
qu $b4 | |
ei $d5 | |
ei $e5 | |
qu $fs5 | |
qu $e5 | |
qu $cs5 | |
qu $a4 | |
ha $as4 | |
qu $b4 | |
qu $as4 | |
qu $e5 | |
qu $cs5 | |
qu $ds5 | |
ei $b4 | |
ei $cs5 | |
qu $ds5 | |
qu $fs5 | |
ei $cs5 | |
ei $ds5 | |
ei $fs5 | |
ei $gs5 | |
ei $ds5 | |
ei $b4 | |
ei $gs4 | |
ei $ds5 | |
qu $cs5 | |
ei $cs5 | |
ei $as4 | |
ei $fs4 | |
ei $cs5 | |
qu $gs4 | |
qu $ds4 | |
ei $b3 | |
ei $cs4 | |
qu $ds4 | |
qu $cs4 | |
qu $as3 | |
qu $cs4 | |
ha $b3 | |
qu $c4 | |
fu $c5 | |
} | |
trap 'exit 0' SIGUSR2 | |
fastintro | |
trueintro | |
part0-5 | |
while true | |
do | |
part0-5 | |
part1 | |
part1 | |
part2 | |
part2-5 | |
part3 | |
part4 | |
part4 | |
part1 | |
part1 | |
part5 | |
part5 | |
part0-5 | |
part6 | |
part7 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment