NoSloppy

Untitled

Dec 23rd, 2021 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 116.24 KB | None | 0 0
  1. z#!/bin/sh
  2. shopt -s extglob
  3. IFS=$'\n'
  4. echo BACKUP_FIRST_FILE_FIX1
  5.  
  6. echo " "
  7. echo "***********************************************************************"
  8. echo " Hello Saberfans! Welcome to the Soundfont Naming Converter."
  9. echo " - by @Mormegil and @NoSloppy - 2021"
  10. echo "***********************************************************************"
  11. echo " "
  12. echo " ** Please keep in mind, there's no reason to convert TO Proffie naming,"
  13. echo " ** because ProffieOS already supports other boards' fonts as they are."
  14. echo " "
  15. echo "To rename a Proffie soundfont for ideal performance, enter 'PtoP'"
  16. echo " "
  17. echo "To convert a soundfont from CFX to Proffie, enter 'CtoP'"
  18. echo "To convert a soundfont from CFX to GoldenHarvest, enter 'CtoG'"
  19. echo "To convert a soundfont from CFX to Xenopixel, enter 'CtoX'"
  20. # echo "To convert a soundfont from CFX to Asteria, enter 'CtoA'"
  21. echo " "
  22. echo "To convert a soundfont from Proffie to CFX, enter 'PtoC'"
  23. echo "To convert a soundfont from Proffie to GoldenHarvest, enter 'PtoG'"
  24. echo "To convert a soundfont from Proffie to Xenopixel, enter 'PtoX'"
  25. # echo "To convert a soundfont from Proffie to Asteria, enter 'PtoA'"
  26. echo " "
  27. echo "To convert a soundfont from Xenopixel to CFX, enter 'XtoC'"
  28. echo "To convert a soundfont from Xenopixel to GoldenHarvest,enter 'XtoG'"
  29. echo "To convert a soundfont from Xenopixel to Proffie, enter 'XtoP'"
  30. # echo "To convert a soundfont from Xenopixel to Asteria, enter 'XtoA'"
  31. # echo " "
  32. # echo "To convert a soundfont from GoldenHarvest to Proffie, enter 'GtoP'"
  33. # echo "To convert a soundfont from GoldenHarvest to CFX, enter 'GtoC'"
  34. # echo "To convert a soundfont from GoldenHarvest to Xenopixel,enter 'GtoX'"
  35. # echo "To convert a soundfont from GoldenHarvest to Asteria, enter 'GtoA'"
  36. # echo " "
  37. # echo "To convert a soundfont from Asteria to Proffie, enter 'AtoP'"
  38. # echo "To convert a soundfont from Asteria to CFX, enter 'AtoC'"
  39. # echo "To convert a soundfont from Asteria to GoldenHarvest, enter 'AtoG'"
  40. # echo "To convert a soundfont from Asteria to Xenopixel, enter 'AtoX'"
  41. echo " "
  42.  
  43. read boardchoice
  44. #-------------------------------------------------------------------------------------------------------------------------------------
  45.  
  46. if [ "$boardchoice" = "PtoP" ]; then
  47. echo " "
  48. echo "You chose Proffie to Proper Proffie Soundfont renaming/organization."
  49. echo " "
  50. echo "Do you wish to rename a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  51. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  52.  
  53. read selection
  54.  
  55. if [ "$selection" = "1" ]; then
  56. echo "You chose to rename a single soundfont. Please enter the name of the font folder containting the soundfont files."
  57. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  58.  
  59. read input
  60. dirs=$(find "$input" -maxdepth 0 -type d)
  61.  
  62. echo "Found the following soundfont folder:"
  63. echo $dirs
  64. echo "Does this folder only contain one soundfont? (y/n)"
  65.  
  66. read input2
  67.  
  68. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  69. echo "Continuing renaming"
  70. else
  71. echo "Aborting program"
  72. exit
  73. fi
  74.  
  75. elif [ "$selection" = "2" ]; then
  76. echo "You chose to rename several soundfonts. Each soundfont must be in a single subfolder."
  77. echo "Please enter the name of the folder containing the soundfont folders."
  78.  
  79. read input
  80. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  81.  
  82. echo "Found the following directories for soundfonts:"
  83. echo $dirs
  84. echo "Does each of these folders only contain one soundfont? (y/n)"
  85.  
  86. read input2
  87.  
  88. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  89. echo "Continuing renaming"
  90. else
  91. echo "Aborting program"
  92. exit
  93. fi
  94.  
  95. else
  96. echo "Your selection is invalid. Aborting program"
  97. exit
  98. fi
  99.  
  100. echo "Do you wish a detailed renaming progess report ('1') or only the imporant steps ('2')?"
  101. echo "Warning, the detailed report may produce a lot of console output!"
  102.  
  103. read verbosity
  104.  
  105. if [ "$verbosity" = "1" ]; then
  106. echo "Logging progress to console"
  107. else
  108. echo "Logging only important steps"
  109. fi
  110.  
  111. for font in ${dirs[@]}; do
  112.  
  113. sounds=$(find "$font" -type f -name '*.wav')
  114. echo "Sounds to rename/organize:"
  115. echo "${sounds[*]}"
  116. otherfiles=$(find -s "$font" -type f ! -name '*.wav' -and ! -name '.*')
  117. echo " "
  118. echo "Other files to move:"
  119. echo "${otherfiles[*]}"
  120. echo " "
  121. echo "Converting soundfont in ${font}".
  122.  
  123. targetpath="Converted_to_Proper_Proffie"
  124. mkdir -p "${targetpath}/${font}"
  125.  
  126. if [[ ! " ${otherfiles[*]} " =~ ${font}'/config.ini' ]]; then
  127. echo "Adding missing config.ini"
  128. rsync -Ab --no-perms "./inis/config.ini" "${targetpath}/${font}"
  129. fi
  130. if [[ ! " ${otherfiles[*]} " =~ ${font}'/smoothsw.ini' ]]; then
  131. echo "Adding missing smoothsw.ini"
  132. rsync -Ab --no-perms "./inis/smoothsw.ini" "${targetpath}/${font}"
  133. fi
  134.  
  135. for o in ${otherfiles}; do
  136. if [[ "${o}" == *"xtras"* ]] ; then
  137. path=`dirname ${o}`
  138. echo "Moving "${o}" to -> "${targetpath}/${path}
  139. mkdir -p "${targetpath}/${path}"
  140. rsync -rab "${o}" "${targetpath}/${path}"
  141. continue;
  142. fi
  143. echo "Moving "${o}" to -> "${targetpath}/${font}
  144. rsync -Ab --no-perms "${o}" "${targetpath}/${font}"
  145. done
  146.  
  147. if [[ "${sounds[*]}" == *"tracks"* ]]; then
  148. mkdir -p "${targetpath}/${font}/tracks"
  149. echo "Moving all tracks to -> tracks folder"
  150. rsync -rab "${font}/tracks/" "${targetpath}/${font}/tracks"
  151. fi
  152.  
  153. counter=1
  154. oldeffect="old"
  155.  
  156. for src in ${sounds[@]}; do
  157. # Move tracks folder as-is.
  158. if [[ "${src}" == *"tracks"* ]]; then
  159. echo "Already moved tracks."
  160. continue;
  161. fi
  162. # Strip digits, path, and extension from filename
  163. effectfile="${src//[0-9]/}"
  164. effect="${effectfile##*/}"
  165. effect="${effect%.*}"
  166. # Reset counter for new effect type
  167. if [[ "$effect" != "$oldeffect" ]]; then
  168. counter=1
  169. fi
  170. # Make subfolder for multiples, or leave single in root
  171. if [ $counter = 2 ]; then
  172. mkdir -p "${targetpath}/${font}/${effect}"
  173. mv "${target}" "./${targetpath}/${font}/${effect}/${targetfile}"
  174. echo "Moving ${targetfile} into ${font}/${effect} subfolder"
  175. fi
  176. # Check if leading zero is needed
  177. if [ "${#effect}" -gt 6 ] || [ "$counter" -gt 9 ]; then
  178. targetfile=$(printf %q "${effect}$counter.wav")
  179. else
  180. targetfile=$(printf %q "${effect}0$counter.wav")
  181. fi
  182. # Set path for single or multiple sounds
  183. if [ $counter -ge 2 ]; then
  184. target="./${targetpath}/${font}/${effect}/${targetfile}"
  185. else
  186. target="./${targetpath}/${font}/${targetfile}"
  187. fi
  188. if [ "$verbosity" = "1" ]; then
  189. echo "Converting ${src} to ${target}"
  190. fi
  191. rsync -Ab --no-perms "${src}" "${target}"
  192. # increment counter for next effect sound
  193. counter=$((counter+1))
  194. oldeffect="${effect}"
  195. done
  196.  
  197. echo " "
  198. echo "Coverted soundfont saved in ${targetpath}"
  199. done
  200.  
  201. echo " "
  202. echo " "
  203. echo "Soundfont conversion complete."
  204. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  205. echo " before the conversion and was renamed to avoid accidental overwriting."
  206. echo " "
  207. echo " --- MTFBWY ---"
  208.  
  209. #-------------------------------------------------------------------------------------------------------------------------------------
  210.  
  211. elif [ "$boardchoice" = "CtoP" ]; then
  212. echo "You chose CFX to Proffie Soundfont renaming converter."
  213. echo " ** Please Note ** This should only be used on Plecter fonts that are POLYPHONIC."
  214. echo " Naming a monophonic font to Proffie convention will cause the sounds to not mix correctly and it'll sound weird/abrubt"
  215. echo " with no crossfades."
  216. echo " "
  217. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  218. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  219.  
  220. read selection
  221.  
  222. if [ "$selection" = "1" ]; then
  223. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  224. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  225.  
  226. read input
  227. dirs=$(find "$input" -maxdepth 0 -type d)
  228.  
  229. echo "Found the following soundfont folder:"
  230. echo $dirs
  231. echo "Does this folder only contain one soundfont? (y/n)"
  232.  
  233. read input2
  234.  
  235. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  236. echo "Continuing conversion"
  237. else
  238. echo "Aborting program"
  239. exit
  240. fi
  241.  
  242. elif [ "$selection" = "2" ]; then
  243. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  244. echo "Please enter the name of the folder containing the soundfont folders."
  245.  
  246. read input
  247. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  248.  
  249. echo "Found the following directories for soundfonts:"
  250. echo $dirs
  251. echo "Does each of these folders only contain one soundfont? (y/n)"
  252.  
  253. read input2
  254.  
  255. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  256. echo "Continuing conversion"
  257. else
  258. echo "Aborting program"
  259. exit
  260. fi
  261.  
  262. else
  263. echo "Your selection is invalid. Aborting program"
  264. exit
  265. fi
  266.  
  267. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  268. echo "Warning, the detailed report will produce a lot of console output!"
  269.  
  270. read verbosity
  271.  
  272. if [ "$verbosity" = "1" ]; then
  273. echo "Logging progress to console"
  274. else
  275. echo "Logging only important steps"
  276. fi
  277.  
  278. for dir in ${dirs[@]}; do
  279.  
  280. sounds=$(find "$dir" -type f -name '*.wav')
  281. echo "Sounds to rename/organize:"
  282. echo "${sounds[*]}"
  283. otherfiles=$(find "$dir" -type f ! -name '*.wav' -and ! -name '.*')
  284. echo " "
  285. echo "Other files to move:"
  286. echo "${otherfiles[*]}"
  287. echo " "
  288. echo Converting soundfont in "${dir}".
  289.  
  290. targetpath="Converted_to_Proffie"
  291. mkdir -p "${targetpath}/${dir}"
  292.  
  293. echo "Adding missing config.ini"
  294. rsync -Ab --no-perms "./inis/config.ini" "${targetpath}/${dir}"
  295. echo "Adding missing smoothsw.ini"
  296. rsync -Ab --no-perms "./inis/smoothsw.ini" "${targetpath}/${dir}"
  297.  
  298. for o in ${otherfiles}; do
  299. echo "Moving "${o}" to converted folder"
  300. rsync -Ab --no-perms "${o}" "${targetpath}/${dir}"
  301. done
  302. if [ -d "${dir}/tracks" ]; then
  303. mkdir -p "${targetpath}/${dir}/tracks"
  304. echo "Moving tracks to converted folder"
  305. rsync -Ab --no-perms "${dir}/tracks/" "${targetpath}/${dir}/tracks"
  306. fi
  307. blastercounter=1
  308. bootcounter=1
  309. clashcounter=1
  310. colorcounter=1
  311. dragcounter=1
  312. enddragcounter=1
  313. endlockcounter=1
  314. fontcounter=1
  315. forcecounter=1
  316. hswingcounter=1
  317. humcounter=1
  318. lockupcounter=1
  319. lswingcounter=1
  320. poweroffcounter=1
  321. poweroncounter=1
  322. preoncounter=1
  323. pstoffcounter=1
  324. spincounter=1
  325. stabcounter=1
  326. startdragcounter=1
  327. startlockcounter=1
  328. swingcounter=1
  329.  
  330. for src in ${sounds[@]}/!(tracks); do
  331. case "${src##*/}" in
  332.  
  333. *laster*([0-9]).wav)
  334. mkdir -p "${targetpath}/${dir}"
  335. if [ $blastercounter = 2 ]; then
  336. mkdir -p "${targetpath}/${dir}/blst"
  337. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/blst/${targetfile}"
  338. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/blst/${targetfile}"
  339. echo "Moving ${targetfile} into ${dir}/blst subfolder"
  340. fi
  341. if [ "$blastercounter" -lt 10 ]; then
  342. targetfile=$(printf %q "blst0$blastercounter.wav")
  343. else
  344. targetfile=$(printf %q "blst$blastercounter.wav")
  345. fi
  346. if [ $blastercounter -ge 2 ]; then
  347. target="./${targetpath}/${dir}/blst/${targetfile}"
  348. else
  349. target="${targetpath}/${dir}/${targetfile}"
  350. fi
  351. if [ "$verbosity" = "1" ]; then
  352. echo "Converting ${src} to ${target}"
  353. fi
  354. rsync -Ab --no-perms "${src}" "${target}"
  355. blastercounter=$((blastercounter+1))
  356. ;;
  357.  
  358. *oot*([0-9]).wav)
  359. if [ $bootcounter = 2 ]; then
  360. mkdir -p "${targetpath}/${dir}/boot"
  361. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/boot/${targetfile}"
  362. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/boot/${targetfile}"
  363. echo "Moving ${targetfile} into ${dir}/boot subfolder"
  364. fi
  365. if [ "$bootcounter" -lt 10 ]; then
  366. targetfile=$(printf %q "boot0$bootcounter.wav")
  367. else
  368. targetfile=$(printf %q "boot$bootcounter.wav")
  369. fi
  370. if [ $bootcounter -ge 2 ]; then
  371. target="./${targetpath}/${dir}/boot/${targetfile}"
  372. else
  373. target="./${targetpath}/${dir}/${targetfile}"
  374. fi
  375. if [ "$verbosity" = "1" ]; then
  376. echo "Converting ${src} to ${target}"
  377. fi
  378. rsync -Ab --no-perms "${src}" "${target}"
  379. bootcounter=$((bootcounter+1))
  380. ;;
  381.  
  382. *lash*([0-9]).wav)
  383. if [ $clashcounter = 2 ]; then
  384. mkdir -p "${targetpath}/${dir}/clsh"
  385. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/clsh/${targetfile}"
  386. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/clsh/${targetfile}"
  387. echo "Moving ${targetfile} into ${dir}/clsh subfolder"
  388. fi
  389. if [ "$clashcounter" -lt 10 ]; then
  390. targetfile=$(printf %q "clsh0$clashcounter.wav")
  391. else
  392. targetfile=$(printf %q "clsh$clashcounter.wav")
  393. fi
  394. if [ $clashcounter -ge 2 ]; then
  395. target="./${targetpath}/${dir}/clsh/${targetfile}"
  396. else
  397. target="./${targetpath}/${dir}/${targetfile}"
  398. fi
  399. if [ "$verbosity" = "1" ]; then
  400. echo "Converting ${src} to ${target}"
  401. fi
  402. rsync -Ab --no-perms "${src}" "${target}"
  403. clashcounter=$((clashcounter+1))
  404. ;;
  405.  
  406. *olor*([0-9]).wav)
  407. if [ $colorcounter = 2 ]; then
  408. mkdir -p "${targetpath}/${dir}/ccchange"
  409. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/ccchange/0001.wav"
  410. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/ccchange/0001.wav"
  411. # ${target} is still file#1 at this point
  412. echo "Moving ${targetfile} into ${dir}/ccchange subfolder and renaming to 0001.wav"
  413. fi
  414. if [ "$colorcounter" = 1 ]; then
  415. targetfile=$(printf %q "ccchange.wav")
  416. elif [ "$colorcounter" -lt 10 ]; then
  417. targetfile=$(printf %q "000$colorcounter.wav")
  418. else
  419. targetfile=$(printf %q "00$colorcounter.wav")
  420. fi
  421. if [ $colorcounter -ge 2 ]; then
  422. target="./${targetpath}/${dir}/ccchange/${targetfile}"
  423. else
  424. target="./${targetpath}/${dir}/${targetfile}"
  425. fi
  426. if [ "$verbosity" = "1" ]; then
  427. echo "Converting ${src} to ${target}"
  428. fi
  429. rsync -Ab --no-perms "${src}" "${target}"
  430. colorcounter=$((colorcounter+1))
  431. ;;
  432.  
  433. *rag*([0-9]).wav)
  434. if [ $dragcounter = 2 ]; then
  435. mkdir -p "${targetpath}/${dir}/drag"
  436. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/drag/${targetfile}"
  437. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/drag/${targetfile}"
  438. echo "Moving ${targetfile} into ${dir}/drag subfolder"
  439. fi
  440. if [ "$dragcounter" -lt 10 ]; then
  441. targetfile=$(printf %q "drag0$dragcounter.wav")
  442. else
  443. targetfile=$(printf %q "drag$dragcounter.wav")
  444. fi
  445. if [ $dragcounter -ge 2 ]; then
  446. target="./${targetpath}/${dir}/drag/${targetfile}"
  447. else
  448. target="./${targetpath}/${dir}/${targetfile}"
  449. fi
  450. if [ "$verbosity" = "1" ]; then
  451. echo "Converting ${src} to ${target}"
  452. fi
  453. rsync -Ab --no-perms "${src}" "${target}"
  454. dragcounter=$((dragcounter+1))
  455. ;;
  456.  
  457. *nddrag*([0-9]).wav)
  458. if [ $enddragcounter = 2 ]; then
  459. mkdir -p "${targetpath}/${dir}/enddrag"
  460. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/enddrag/${targetfile}"
  461. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/enddrag/${targetfile}"
  462. echo "Moving ${targetfile} into ${dir}/enddrag subfolder"
  463. fi
  464. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  465. if [ $enddragcounter -ge 2 ]; then
  466. target="./${targetpath}/${dir}/enddrag/${targetfile}"
  467. else
  468. target="./${targetpath}/${dir}/${targetfile}"
  469. fi
  470. if [ "$verbosity" = "1" ]; then
  471. echo "Converting ${src} to ${target}"
  472. fi
  473. rsync -Ab --no-perms "${src}" "${target}"
  474. enddragcounter=$((enddragcounter+1))
  475. ;;
  476.  
  477. *ndlock*([0-9]).wav)
  478. if [ $endlockcounter = 2 ]; then
  479. mkdir -p "${targetpath}/${dir}/endlock"
  480. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/endlock/${targetfile}"
  481. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/endlock/${targetfile}"
  482. echo "Moving ${targetfile} into ${dir}/endlock subfolder"
  483. fi
  484. targetfile=$(printf %q "endlock$endlockcounter.wav")
  485. if [ $endlockcounter -ge 2 ]; then
  486. target="./${targetpath}/${dir}/endlock/${targetfile}"
  487. else
  488. target="./${targetpath}/${dir}/${targetfile}"
  489. fi
  490. if [ "$verbosity" = "1" ]; then
  491. echo "Converting ${src} to ${target}"
  492. fi
  493. rsync -Ab --no-perms "${src}" "${target}"
  494. endlockcounter=$((endlockcounter+1))
  495. ;;
  496.  
  497. *ont*([0-9]).wav)
  498. if [ $fontcounter = 2 ]; then
  499. mkdir -p "${targetpath}/${dir}/font"
  500. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/font/${targetfile}"
  501. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/font/${targetfile}"
  502. echo "Moving ${targetfile} into ${dir}/font subfolder"
  503. fi
  504. if [ "$fontcounter" -lt 10 ]; then
  505. targetfile=$(printf %q "font0$fontcounter.wav")
  506. else
  507. targetfile=$(printf %q "font$fontcounter.wav")
  508. fi
  509. if [ $fontcounter -ge 2 ]; then
  510. target="./${targetpath}/${dir}/font/${targetfile}"
  511. else
  512. target="./${targetpath}/${dir}/${targetfile}"
  513. fi
  514. if [ "$verbosity" = "1" ]; then
  515. echo "Converting ${src} to ${target}"
  516. fi
  517. rsync -Ab --no-perms "${src}" "${target}"
  518. fontcounter=$((fontcounter+1))
  519. ;;
  520.  
  521. *orce*|combo*([0-9]).wav)
  522. if [ $forcecounter = 2 ]; then
  523. mkdir -p "${targetpath}/${dir}/force"
  524. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/force/${targetfile}"
  525. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/force/${targetfile}"
  526. echo "Moving ${targetfile} into ${dir}/force subfolder"
  527. fi
  528. if [ "$forcecounter" -lt 10 ]; then
  529. targetfile=$(printf %q "force0$forcecounter.wav")
  530. else
  531. targetfile=$(printf %q "force$forcecounter.wav")
  532. fi
  533. if [ $forcecounter -ge 2 ]; then
  534. target="./${targetpath}/${dir}/force/${targetfile}"
  535. else
  536. target="./${targetpath}/${dir}/${targetfile}"
  537. fi
  538. if [ "$verbosity" = "1" ]; then
  539. echo "Converting ${src} to ${target}"
  540. fi
  541. rsync -Ab --no-perms "${src}" "${target}"
  542. forcecounter=$((forcecounter+1))
  543. ;;
  544.  
  545. hswing*([0-9]).wav)
  546. if [ $hswingcounter = 2 ]; then
  547. mkdir -p "${targetpath}/${dir}/swingh"
  548. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/swingh/${targetfile}"
  549. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/swingh/${targetfile}"
  550. echo "Moving ${targetfile} into ${dir}/swingh subfolder"
  551. fi
  552. if [ "$hswingcounter" -lt 10 ]; then
  553. targetfile=$(printf %q "swingh0$hswingcounter.wav")
  554. else
  555. targetfile=$(printf %q "swingh$hswingcounter.wav")
  556. fi
  557. if [ $hswingcounter -ge 2 ]; then
  558. target="./${targetpath}/${dir}/swingh/${targetfile}"
  559. else
  560. target="./${targetpath}/${dir}/${targetfile}"
  561. fi
  562. if [ "$verbosity" = "1" ]; then
  563. echo "Converting ${src} to ${target}"
  564. fi
  565. rsync -Ab --no-perms "${src}" "${target}"
  566. hswingcounter=$((hswingcounter+1))
  567. ;;
  568.  
  569. *um**([0-9]).wav)
  570. if [ $humcounter = 2 ]; then
  571. mkdir -p "${targetpath}/${dir}/hum"
  572. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/hum/${targetfile}"
  573. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/hum/${targetfile}"
  574. echo "Moving ${targetfile} into ${dir}/hum subfolder"
  575. fi
  576. if [ "$humcounter" -lt 10 ]; then
  577. targetfile=$(printf %q "hum0$humcounter.wav")
  578. else
  579. targetfile=$(printf %q "hum$humcounter.wav")
  580. fi
  581. if [ $humcounter -ge 2 ]; then
  582. target="./${targetpath}/${dir}/hum/${targetfile}"
  583. else
  584. target="./${targetpath}/${dir}/${targetfile}"
  585. fi
  586. if [ "$verbosity" = "1" ]; then
  587. echo "Converting ${src} to ${target}"
  588. fi
  589. rsync -Ab --no-perms "${src}" "${target}"
  590. humcounter=$((humcounter+1))
  591. ;;
  592.  
  593. lswing*([0-9]).wav)
  594. if [ $lswingcounter = 2 ]; then
  595. mkdir -p "${targetpath}/${dir}/swingl"
  596. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/swingl/${targetfile}"
  597. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/swingl/${targetfile}"
  598. echo "Moving ${targetfile} into ${dir}/swingl subfolder"
  599. fi
  600. if [ "$lswingcounter" -lt 10 ]; then
  601. targetfile=$(printf %q "swingl0$lswingcounter.wav")
  602. else
  603. targetfile=$(printf %q "swingl$lswingcounter.wav")
  604. fi
  605. if [ $lswingcounter -ge 2 ]; then
  606. target="./${targetpath}/${dir}/swingl/${targetfile}"
  607. else
  608. target="./${targetpath}/${dir}/${targetfile}"
  609. fi
  610. if [ "$verbosity" = "1" ]; then
  611. echo "Converting ${src} to ${target}"
  612. fi
  613. rsync -Ab --no-perms "${src}" "${target}"
  614. lswingcounter=$((lswingcounter+1))
  615. ;;
  616.  
  617. *ock**([0-9]).wav)
  618. if [ $lockupcounter = 2 ]; then
  619. mkdir -p "${targetpath}/${dir}/lock"
  620. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/lock/${targetfile}"
  621. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/lock/${targetfile}"
  622. echo "Moving ${targetfile} into ${dir}/lock subfolder"
  623. fi
  624. if [ "$lockupcounter" -lt 10 ]; then
  625. targetfile=$(printf %q "lock0$lockupcounter.wav")
  626. else
  627. targetfile=$(printf %q "lock$lockupcounter.wav")
  628. fi
  629. if [ $lockupcounter -ge 2 ]; then
  630. target="./${targetpath}/${dir}/lock/${targetfile}"
  631. else
  632. target="./${targetpath}/${dir}/${targetfile}"
  633. fi
  634. if [ "$verbosity" = "1" ]; then
  635. echo "Converting ${src} to ${target}"
  636. fi
  637. rsync -Ab --no-perms "${src}" "${target}"
  638. lockupcounter=$((lockupcounter+1))
  639. ;;
  640.  
  641. *oweroff*|*wroff*([0-9]).wav)
  642. if [ $poweroffcounter = 2 ]; then
  643. mkdir -p "${targetpath}/${dir}/in"
  644. echo "making ${dir}/in subfolder"
  645. if [[ ${target} != *"in"* ]]; then
  646. rsync -Ab --no-perms "./${targetpath}/${dir}/in01.wav" "./${targetpath}/${dir}/in/in01.wav"
  647. rsync -Ab --no-perms --remove-source-files "./${targetpath}/${dir}/in01.wav" "./${targetpath}/${dir}/in/in01.wav"
  648. echo "Moving in01.wav into ${dir}/in subfolder"
  649. fi
  650. fi
  651. if [ "$poweroffcounter" -lt 10 ]; then
  652. targetfile=$(printf %q "in0$poweroffcounter.wav")
  653. else
  654. targetfile=$(printf %q "in$poweroffcounter.wav")
  655. fi
  656. if [ $poweroffcounter -ge 2 ]; then
  657. target="./${targetpath}/${dir}/in/${targetfile}"
  658. else
  659. target="./${targetpath}/${dir}/${targetfile}"
  660. fi
  661. if [ "$verbosity" = "1" ]; then
  662. echo "Converting ${src} to ${target}"
  663. fi
  664. rsync -Ab --no-perms "${src}" "${target}"
  665. poweroffcounter=$((poweroffcounter+1))
  666. ;;
  667.  
  668. *oweron**([0-9]).wav)
  669. if [ $poweroncounter = 2 ]; then
  670. mkdir -p "${targetpath}/${dir}/out"
  671. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/out/${targetfile}"
  672. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/out/${targetfile}"
  673. echo "Moving ${targetfile} into ${dir}/out subfolder"
  674. fi
  675. if [ "$poweroncounter" -lt 10 ]; then
  676. targetfile=$(printf %q "out0$poweroncounter.wav")
  677. else
  678. targetfile=$(printf %q "out$poweroncounter.wav")
  679. fi
  680. if [ $poweroncounter -ge 2 ]; then
  681. target="./${targetpath}/${dir}/out/${targetfile}"
  682. else
  683. target="./${targetpath}/${dir}/${targetfile}"
  684. fi
  685. if [ "$verbosity" = "1" ]; then
  686. echo "Converting ${src} to ${target}"
  687. fi
  688. rsync -Ab --no-perms "${src}" "${target}"
  689. poweroncounter=$((poweroncounter+1))
  690. ;;
  691.  
  692. *reon*([0-9]).wav)
  693. if [ $preoncounter = 2 ]; then
  694. mkdir -p "${targetpath}/${dir}/preon"
  695. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/preon/${targetfile}"
  696. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/preon/${targetfile}"
  697. echo "Moving ${targetfile} into ${dir}/preon subfolder"
  698. fi
  699. if [ "$preoncounter" -lt 10 ]; then
  700. targetfile=$(printf %q "preon0$preoncounter.wav")
  701. else
  702. targetfile=$(printf %q "preon$preoncounter.wav")
  703. fi
  704. if [ $preoncounter -ge 2 ]; then
  705. target="./${targetpath}/${dir}/preon/${targetfile}"
  706. else
  707. target="./${targetpath}/${dir}/${targetfile}"
  708. fi
  709. if [ "$verbosity" = "1" ]; then
  710. echo "Converting ${src} to ${target}"
  711. fi
  712. rsync -Ab --no-perms "${src}" "${target}"
  713. preoncounter=$((preoncounter+1))
  714. ;;
  715.  
  716. *stoff*([0-9]).wav)
  717. if [ $pstoffcounter = 2 ]; then
  718. mkdir -p "${targetpath}/${dir}/pstoff"
  719. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/pstoff/${targetfile}"
  720. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/pstoff/${targetfile}"
  721. echo "Moving ${targetfile} into ${dir}/pstoff subfolder"
  722. fi
  723. if [ "$pstoffcounter" -lt 10 ]; then
  724. targetfile=$(printf %q "pstoff0$pstoffcounter.wav")
  725. else
  726. targetfile=$(printf %q "pstoff$pstoffcounter.wav")
  727. fi
  728. if [ $pstoffcounter -ge 2 ]; then
  729. target="./${targetpath}/${dir}/pstoff/${targetfile}"
  730. else
  731. target="./${targetpath}/${dir}/${targetfile}"
  732. fi
  733. if [ "$verbosity" = "1" ]; then
  734. echo "Converting ${src} to ${target}"
  735. fi
  736. rsync -Ab --no-perms "${src}" "${target}"
  737. pstoffcounter=$((pstoffcounter+1))
  738. ;;
  739.  
  740. *pin*([0-9]).wav)
  741. if [ $spincounter = 2 ]; then
  742. mkdir -p "${targetpath}/${dir}/spin"
  743. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/spin/${targetfile}"
  744. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/spin/${targetfile}"
  745. echo "Moving ${targetfile} into ${dir}/spin subfolder"
  746. fi
  747. if [ "$spincounter" -lt 10 ]; then
  748. targetfile=$(printf %q "spin0$spincounter.wav")
  749. else
  750. targetfile=$(printf %q "spin$spincounter.wav")
  751. fi
  752. if [ $spincounter -ge 2 ]; then
  753. target="./${targetpath}/${dir}/spin/${targetfile}"
  754. else
  755. target="./${targetpath}/${dir}/${targetfile}"
  756. fi
  757. if [ "$verbosity" = "1" ]; then
  758. echo "Converting ${src} to ${target}"
  759. fi
  760. rsync -Ab --no-perms "${src}" "${target}"
  761. spincounter=$((spincounter+1))
  762. ;;
  763.  
  764. *tab*([0-9]).wav)
  765. if [ $stabcounter = 2 ]; then
  766. mkdir -p "${targetpath}/${dir}/stab"
  767. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/stab/${targetfile}"
  768. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/stab/${targetfile}"
  769. echo "Moving ${targetfile} into ${dir}/stab subfolder"
  770. fi
  771. if [ "$stabcounter" -lt 10 ]; then
  772. targetfile=$(printf %q "stab0$stabcounter.wav")
  773. else
  774. targetfile=$(printf %q "stab$stabcounter.wav")
  775. fi
  776. if [ $stabcounter -ge 2 ]; then
  777. target="./${targetpath}/${dir}/stab/${targetfile}"
  778. else
  779. target="./${targetpath}/${dir}/${targetfile}"
  780. fi
  781. if [ "$verbosity" = "1" ]; then
  782. echo "Converting ${src} to ${target}"
  783. fi
  784. rsync -Ab --no-perms "${src}" "${target}"
  785. stabcounter=$((stabcounter+1))
  786. ;;
  787.  
  788. *tartdrag*([0-9]).wav)
  789. if [ $startdragcounter = 2 ]; then
  790. mkdir -p "${targetpath}/${dir}/bgndrag"
  791. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/bgndrag/${targetfile}"
  792. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/bgndrag/${targetfile}"
  793. echo "Moving ${targetfile} into ${dir}/bgndrag subfolder"
  794. fi
  795. targetfile=$(printf %q "bgndrag$startdragcounter.wav")
  796.  
  797. if [ $startdragcounter -ge 2 ]; then
  798. target="./${targetpath}/${dir}/bgndrag/${targetfile}"
  799. else
  800. target="./${targetpath}/${dir}/${targetfile}"
  801. fi
  802. if [ "$verbosity" = "1" ]; then
  803. echo "Converting ${src} to ${target}"
  804. fi
  805. rsync -Ab --no-perms "${src}" "${target}"
  806. startdragcounter=$((startdragcounter+1))
  807. ;;
  808.  
  809. *tartlock*([0-9]).wav)
  810. if [ $startlockcounter = 2 ]; then
  811. mkdir -p "${targetpath}/${dir}/bgnlock"
  812. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/bgnlock/${targetfile}"
  813. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/bgnlock/${targetfile}"
  814. echo "Moving ${targetfile} into ${dir}/bgnlock subfolder"
  815. fi
  816. targetfile=$(printf %q "bgnlock$startlockcounter.wav")
  817.  
  818. if [ $startlockcounter -ge 2 ]; then
  819. target="./${targetpath}/${dir}/bgnlock/${targetfile}"
  820. else
  821. target="./${targetpath}/${dir}/${targetfile}"
  822. fi
  823. if [ "$verbosity" = "1" ]; then
  824. echo "Converting ${src} to ${target}"
  825. fi
  826. rsync -Ab --no-perms "${src}" "${target}"
  827. startlockcounter=$((startlockcounter+1))
  828. ;;
  829.  
  830. *wing*([0-9]).wav)
  831. if [ $swingcounter = 2 ]; then
  832. mkdir -p "${targetpath}/${dir}/swng"
  833. rsync -Ab --no-perms "${target}" "./${targetpath}/${dir}/swng/${targetfile}"
  834. rsync -Ab --no-perms --remove-source-files "${target}" "./${targetpath}/${dir}/swng/${targetfile}"
  835. echo "Moving ${targetfile} into ${dir}/swng subfolder"
  836. fi
  837. if [ "$swingcounter" -lt 10 ]; then
  838. targetfile=$(printf %q "swng0$swingcounter.wav")
  839. else
  840. targetfile=$(printf %q "swng$swingcounter.wav")
  841. fi
  842. if [ $swingcounter -ge 2 ]; then
  843. target="./${targetpath}/${dir}/swng/${targetfile}"
  844. else
  845. target="./${targetpath}/${dir}/${targetfile}"
  846. fi
  847. if [ "$verbosity" = "1" ]; then
  848. echo "Converting ${src} to ${target}"
  849. fi
  850. rsync -Ab --no-perms "${src}" "${target}"
  851. swingcounter=$((swingcounter+1))
  852. ;;
  853.  
  854.  
  855. *)
  856. echo "No match found, ignoring file $src"
  857.  
  858. esac
  859. done
  860.  
  861. echo Coverted soundfont saved in "${targetpath}"
  862. done
  863.  
  864. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  865. echo "before the conversion and was renamed to avoid accidental overwriting."
  866. echo " "
  867. #-------------------------------------------------------------------------------------------------------------------------------------
  868.  
  869. elif [ "$boardchoice" = "CtoG" ]; then
  870. echo " "
  871. echo "You chose CFX to GoldenHarvest Soundfont converter."
  872. echo "*NOTE* Single font file supported."
  873. echo "- If you have multiple font.wavs in the source font, the last one will be used"
  874. echo "- save.wav not generated."
  875. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  876. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  877.  
  878. read selection
  879.  
  880. if [ "$selection" = "1" ]; then
  881. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  882. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  883.  
  884. read input
  885. dirs=$(find "$input" -maxdepth 0 -type d)
  886.  
  887. echo "Found the following soundfont folder:"
  888. echo $dirs
  889. echo "Does this folder only contain one soundfont? (y/n)"
  890.  
  891. read input2
  892.  
  893. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  894. echo "Continuing conversion"
  895. else
  896. echo "Aborting program"
  897. exit
  898. fi
  899.  
  900. elif [ "$selection" = "2" ]; then
  901. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  902. echo "Please enter the name of the folder containing the soundfont folders."
  903.  
  904. read input
  905. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  906.  
  907. echo "Found the following directories for soundfonts:"
  908. echo $dirs
  909. echo "Does each of these folders only contain one soundfont? (y/n)"
  910.  
  911. read input2
  912.  
  913. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  914. echo "Continuing conversion"
  915. else
  916. echo "Aborting program"
  917. exit
  918. fi
  919.  
  920. else
  921. echo "Your selection is invalid. Aborting program"
  922. exit
  923. fi
  924.  
  925. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  926. echo "Warning, the detailed report will produce a lot of console output!"
  927.  
  928. read verbosity
  929.  
  930. if [ "$verbosity" = "1" ]; then
  931. echo "Logging progress to console"
  932. else
  933. echo "Logging only important steps"
  934. fi
  935.  
  936.  
  937. for dir in ${dirs[@]}; do
  938.  
  939. sounds=$(find "$dir" -type f -name '*.wav')
  940.  
  941. echo Converting soundfont in "${dir}".
  942.  
  943. targetpath="Converted_to_GoldenHarvest/${dir}"
  944. mkdir -p "${targetpath}"
  945.  
  946. startdragounter=1
  947. startlockcounter=1
  948. blastercounter=1
  949. bootcounter=1
  950. colorcounter=1
  951. clashcounter=1
  952. dragcounter=1
  953. enddragcounter=1
  954. endlockcounter=1
  955. fontcounter=1
  956. forcecounter=1
  957. hswingcounter=1
  958. humMcounter=1
  959. lockupcounter=1
  960. lswingcounter=1
  961. preoncounter=1
  962. # pstoffcounter=1
  963. poweroffcounter=1
  964. poweroncounter=1
  965. # savecounter=1
  966. spincounter=1
  967. stabcounter=1
  968. swingcounter=1
  969. trackcounter=1
  970.  
  971. for src in ${sounds[@]}; do
  972. case "${src##*/}" in
  973.  
  974. *tartdrag*([0-9]).wav)
  975. targetfile=$(printf %q "bgndrag$startdragcounter.wav")
  976. startdragcounter=$((startdragcounter+1))
  977. target="./${targetpath}/${targetfile}"
  978. if [ "$verbosity" = "1" ]; then
  979. echo "Converting ${src} to ${target}"
  980. fi
  981. rsync -Ab --no-perms "${src}" "${target}"
  982. ;;
  983.  
  984. *tartlock*([0-9]).wav)
  985. targetfile=$(printf %q "bgnlock$startlockcounter.wav")
  986. startlockcounter=$((startlockcounter+1))
  987. target="./${targetpath}/${targetfile}"
  988. if [ "$verbosity" = "1" ]; then
  989. echo "Converting ${src} to ${target}"
  990. fi
  991. rsync -Ab --no-perms "${src}" "${target}"
  992. ;;
  993.  
  994. *laster*([0-9]).wav)
  995. targetfile=$(printf %q "blast$blastercounter.wav")
  996. blastercounter=$((blastercounter+1))
  997. target="./${targetpath}/${targetfile}"
  998. if [ "$verbosity" = "1" ]; then
  999. echo "Converting ${src} to ${target}"
  1000. fi
  1001. rsync -Ab --no-perms "${src}" "${target}"
  1002. ;;
  1003.  
  1004. *oot*([0-9]).wav)
  1005. targetfile=$(printf %q "boot$bootcounter.wav")
  1006. bootcounter=$((bootcounter+1))
  1007. target="./$targetpath/$targetfile"
  1008. if [ "$verbosity" = "1" ]; then
  1009. echo "Converting ${src} to ${target}"
  1010. fi
  1011. rsync -Ab --no-perms "${src}" "${target}"
  1012. ;;
  1013.  
  1014. *olor*([0-9]).wav)
  1015. targetfile=$(printf %q "change$colorcounter.wav")
  1016. colorcounter=$((colorcounter+1))
  1017. target="./$targetpath/$targetfile"
  1018. if [ "$verbosity" = "1" ]; then
  1019. echo "Converting ${src} to ${target}"
  1020. fi
  1021. rsync -Ab --no-perms "${src}" "${target}"
  1022. ;;
  1023.  
  1024. *lash*([0-9]).wav)
  1025. targetfile=$(printf %q "clash$clashcounter.wav")
  1026. clashcounter=$((clashcounter+1))
  1027. target="./$targetpath/$targetfile"
  1028. if [ "$verbosity" = "1" ]; then
  1029. echo "Converting ${src} to ${target}"
  1030. fi
  1031. rsync -Ab --no-perms "${src}" "${target}"
  1032. ;;
  1033.  
  1034. *rag*([0-9]).wav)
  1035. targetfile=$(printf %q "drag$dragcounter.wav")
  1036. dragcounter=$((dragcounter+1))
  1037. target="./$targetpath/$targetfile"
  1038. if [ "$verbosity" = "1" ]; then
  1039. echo "Converting ${src} to ${target}"
  1040. fi
  1041. rsync -Ab --no-perms "${src}" "${target}"
  1042. ;;
  1043.  
  1044. *nddrag*([0-9]).wav)
  1045. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  1046. enddragcounter=$((enddragcounter+1))
  1047. target="./$targetpath/$targetfile"
  1048. if [ "$verbosity" = "1" ]; then
  1049. echo "Converting ${src} to ${target}"
  1050. fi
  1051. rsync -Ab --no-perms "${src}" "${target}"
  1052. ;;
  1053.  
  1054. *ndlock*([0-9]).wav)
  1055. targetfile=$(printf %q "endlock$endlockcounter.wav")
  1056. endlockcounter=$((endlockcounter+1))
  1057. target="./$targetpath/$targetfile"
  1058. if [ "$verbosity" = "1" ]; then
  1059. echo "Converting ${src} to ${target}"
  1060. fi
  1061. rsync -Ab --no-perms "${src}" "${target}"
  1062. ;;
  1063.  
  1064. *ont*([0-9]).wav)
  1065. targetfile=$(printf %q "font.wav")
  1066. #fontcounter=$((fontcounter+1))
  1067. target="./$targetpath/$targetfile"
  1068. if [ "$verbosity" = "1" ]; then
  1069. echo "Converting ${src} to ${target}"
  1070. fi
  1071. rsync -Ab --no-perms "${src}" "${target}"
  1072. ;;
  1073.  
  1074. *orce*|quote*([0-9]).wav)
  1075. targetfile=$(printf %q "force$forcecounter.wav")
  1076. forcecounter=$((forcecounter+1))
  1077. target="./$targetpath/$targetfile"
  1078. if [ "$verbosity" = "1" ]; then
  1079. echo "Converting ${src} to ${target}"
  1080. fi
  1081. rsync -Ab --no-perms "${src}" "${target}"
  1082. ;;
  1083.  
  1084. hswing*([0-9]).wav)
  1085. targetfile=$(printf %q "hswing$hswingcounter.wav")
  1086. hswingcounter=$((hswingcounter+1))
  1087. target="./$targetpath/$targetfile"
  1088. if [ "$verbosity" = "1" ]; then
  1089. echo "Converting ${src} to ${target}"
  1090. fi
  1091. rsync -Ab --no-perms "${src}" "${target}"
  1092. ;;
  1093.  
  1094. *umM*([0-9]).wav)
  1095. targetfile=$(printf %q "hum$humMcounter.wav")
  1096. humMcounter=$((humMcounter+1))
  1097. target="./$targetpath/$targetfile"
  1098. if [ "$verbosity" = "1" ]; then
  1099. echo "Converting ${src} to ${target}"
  1100. fi
  1101. rsync -Ab --no-perms "${src}" "${target}"
  1102. ;;
  1103.  
  1104. *ockup*([0-9]).wav)
  1105. targetfile=$(printf %q "lock$lockupcounter.wav")
  1106. lockupcounter=$((lockupcounter+1))
  1107. target="./$targetpath/$targetfile"
  1108. if [ "$verbosity" = "1" ]; then
  1109. echo "Converting ${src} to ${target}"
  1110. fi
  1111. rsync -Ab --no-perms "${src}" "${target}"
  1112. ;;
  1113.  
  1114. lswing*([0-9]).wav)
  1115. targetfile=$(printf %q "lswing$lswingcounter.wav")
  1116. lswingcounter=$((lswingcounter+1))
  1117. target="./$targetpath/$targetfile"
  1118. if [ "$verbosity" = "1" ]; then
  1119. echo "Converting ${src} to ${target}"
  1120. fi
  1121. rsync -Ab --no-perms "${src}" "${target}"
  1122. ;;
  1123.  
  1124. *reon*([0-9]).wav)
  1125. targetfile=$(printf %q "preon$preoncounter.wav")
  1126. preoncounter=$((preoncounter+1))
  1127. target="./$targetpath/$targetfile"
  1128. if [ "$verbosity" = "1" ]; then
  1129. echo "Converting ${src} to ${target}"
  1130. fi
  1131. rsync -Ab --no-perms "${src}" "${target}"
  1132. ;;
  1133.  
  1134. # pstoff sounds are currently not supported by GoldenHarvest and therefore ignored.
  1135. # Uncomment counter above and code here and adapt targetfile if needed later.
  1136. # *stoff**([0-9]).wav)
  1137. # targetfile=$(printf %q "pstoff$pstoffcounter.wav")
  1138. # pstoffcounter=$((pstoffcounter+1))
  1139. # target="./${targetpath}/${dir}/pstoff/${targetfile}"
  1140. # if [ "$verbosity" = "1" ]; then
  1141. # echo "Converting ${src} to ${target}"
  1142. # fi
  1143. # rsync -Ab --no-perms "${src}" "${target}"
  1144. # ;;
  1145.  
  1146. *oweroff|*wroff*([0-9]).wav)
  1147. targetfile=$(printf %q "pwroff$poweroffcounter.wav")
  1148. poweroffcounter=$((poweroffcounter+1))
  1149. target="./$targetpath/$targetfile"
  1150. if [ "$verbosity" = "1" ]; then
  1151. echo "Converting ${src} to ${target}"
  1152. fi
  1153. rsync -Ab --no-perms "${src}" "${target}"
  1154. ;;
  1155.  
  1156. *oweron*([0-9]).wav)
  1157. targetfile=$(printf %q "pwron$poweroncounter.wav")
  1158. poweroncounter=$((poweroncounter+1))
  1159. target="./$targetpath/$targetfile"
  1160. if [ "$verbosity" = "1" ]; then
  1161. echo "Converting ${src} to ${target}"
  1162. fi
  1163. rsync -Ab --no-perms "${src}" "${target}"
  1164. ;;
  1165.  
  1166. # save sounds are currently only supported by GoldenHarvest and therefore ignored
  1167. # since the source has nothing to provide.
  1168. # Uncomment counter above and code here and adapt targetfile if needed later.
  1169. # save*([0-9]).wav)
  1170. # targetfile=$(printf %q "save$savecounter.wav")
  1171. # savecounter=$((savecounter+1))
  1172. # target="./${targetpath}/${dir}/${targetfile}"
  1173. # if [ "$verbosity" = "1" ]; then
  1174. # echo "Converting ${src} to ${target}"
  1175. # fi
  1176. # rsync -Ab --no-perms "${src}" "${target}"
  1177. # ;;
  1178.  
  1179. *pin*([0-9]).wav)
  1180. targetfile=$(printf %q "spin$spincounter.wav")
  1181. spincounter=$((spincounter+1))
  1182. target="./$targetpath/$targetfile"
  1183. if [ "$verbosity" = "1" ]; then
  1184. echo "Converting ${src} to ${target}"
  1185. fi
  1186. rsync -Ab --no-perms "${src}" "${target}"
  1187. ;;
  1188.  
  1189. *tab*([0-9]).wav)
  1190. targetfile=$(printf %q "stab$stabcounter.wav")
  1191. stabcounter=$((stabcounter+1))
  1192. target="./$targetpath/$targetfile"
  1193. if [ "$verbosity" = "1" ]; then
  1194. echo "Converting ${src} to ${target}"
  1195. fi
  1196. rsync -Ab --no-perms "${src}" "${target}"
  1197. ;;
  1198.  
  1199. *wing*([0-9]).wav)
  1200. targetfile=$(printf %q "swing$swingcounter.wav")
  1201. swingcounter=$((swingcounter+1))
  1202. target="./$targetpath/$targetfile"
  1203. if [ "$verbosity" = "1" ]; then
  1204. echo "Converting ${src} to ${target}"
  1205. fi
  1206. rsync -Ab --no-perms "${src}" "${target}"
  1207. ;;
  1208.  
  1209. *rack*([0-9]).wav)
  1210. targetfile=$(printf %q "track$trackcounter.wav")
  1211. trackcounter=$((trackcounter+1))
  1212. if [ "$verbosity" = "1" ]; then
  1213. echo "Converting ${src} to ${target}"
  1214. fi
  1215. rsync -Ab --no-perms "${src}" "${target}"
  1216. ;;
  1217.  
  1218. *)
  1219. echo "No match found, ignoring file $src"
  1220.  
  1221. esac
  1222. done
  1223.  
  1224. echo " "
  1225. echo Coverted soundfont saved in "${targetpath}"
  1226. done
  1227.  
  1228. echo " "
  1229. echo " "
  1230. echo "Soundfont conversion complete."
  1231. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  1232. echo " before the conversion and was renamed to avoid accidental overwriting."
  1233. echo " "
  1234. echo " --- MTFBWY ---"
  1235.  
  1236. #-------------------------------------------------------------------------------------------------------------------------------------
  1237.  
  1238. elif [ "$boardchoice" = "CtoX" ]; then
  1239. echo " "
  1240. echo "You chose CFX to Xenopixel Soundfont converter."
  1241. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1242. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1243.  
  1244. read selection
  1245.  
  1246. if [ "$selection" = "1" ]; then
  1247. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1248. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1249.  
  1250. read input
  1251. dirs=$(find "$input" -maxdepth 0 -type d)
  1252.  
  1253. echo "Found the following soundfont folder:"
  1254. echo $dirs
  1255. echo "Does this folder only contain one soundfont? (y/n)"
  1256.  
  1257. read input2
  1258.  
  1259. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1260. echo "Continuing conversion"
  1261. else
  1262. echo "Aborting program"
  1263. exit
  1264. fi
  1265.  
  1266. elif [ "$selection" = "2" ]; then
  1267. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1268. echo "Please enter the name of the folder containing the soundfont folders."
  1269.  
  1270. read input
  1271. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1272.  
  1273. echo "Found the following directories for soundfonts:"
  1274. echo $dirs
  1275. echo "Does each of these folders only contain one soundfont? (y/n)"
  1276.  
  1277. read input2
  1278.  
  1279. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1280. echo "Continuing conversion"
  1281. else
  1282. echo "Aborting program"
  1283. exit
  1284. fi
  1285.  
  1286. else
  1287. echo "Your selection is invalid. Aborting program"
  1288. exit
  1289. fi
  1290.  
  1291. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1292. echo "Warning, the detailed report will produce a lot of console output!"
  1293.  
  1294. read verbosity
  1295.  
  1296. if [ "$verbosity" = "1" ]; then
  1297. echo "Logging progress to console"
  1298. else
  1299. echo "Logging only important steps"
  1300. fi
  1301.  
  1302. for dir in ${dirs[@]}; do
  1303.  
  1304. sounds=$(find "$dir" -type f -name '*.wav')
  1305.  
  1306. echo Converting soundfont in "${dir}".
  1307.  
  1308. targetpath="Converted_to_Xenopixel"
  1309. mkdir -p "${targetpath}"
  1310. mkdir -p "${targetpath}/${dir}/set"
  1311. mkdir -p "${targetpath}/${dir}/tracks"
  1312. blastercounter=1
  1313. bootcounter=1
  1314. clashcounter=1
  1315. # colorcounter=1
  1316. dragcounter=1
  1317. # endlockcounter=1
  1318. fontcounter=1
  1319. forcecounter=1
  1320. hswingcounter=1
  1321. humcounter=1
  1322. lswingcounter=1
  1323. poweroffcounter=1
  1324. poweroncounter=1
  1325. lockcounter=1
  1326. lockupcounter=1
  1327. preoncounter=1
  1328. # spincounter=1
  1329. # stabcounter=1
  1330. # swingcounter=1
  1331. trackcounter=1
  1332.  
  1333. for src in ${sounds[@]}; do
  1334. case "${src##*/}" in
  1335.  
  1336. *laster*([0-9]).wav)
  1337. targetfile="blaster ($blastercounter).wav"
  1338. blastercounter=$((blastercounter+1))
  1339. target="./${targetpath}/${dir}/${targetfile}"
  1340. if [ "$verbosity" = "1" ]; then
  1341. echo "Converting ${src} to ${target}"
  1342. fi
  1343. rsync -Ab --no-perms "${src}" "${target}"
  1344. ;;
  1345.  
  1346. # boot sounds are converted to 'power on.wav and live in the 'set' folder.
  1347. # If there are more than one converted, the last one will be the resulting file.
  1348. *oot*([0-9]).wav)
  1349. targetfile="power on.wav"
  1350. bootcounter=$((bootcounter+1))
  1351. target="./$targetpath/${dir}/set/$targetfile"
  1352. if [ "$verbosity" = "1" ]; then
  1353. echo "Converting ${src} to ${target}"
  1354. fi
  1355. rsync -Ab --no-perms "${src}" "${target}"
  1356. ;;
  1357.  
  1358. *lash*([0-9]).wav)
  1359. targetfile="clash ($clashcounter).wav"
  1360. clashcounter=$((clashcounter+1))
  1361. target="./$targetpath//${dir}/$targetfile"
  1362. if [ "$verbosity" = "1" ]; then
  1363. echo "Converting ${src} to ${target}"
  1364. fi
  1365. rsync -Ab --no-perms "${src}" "${target}"
  1366. ;;
  1367.  
  1368. # color sounds are currently not supported by Xenopixel and therefore ignored.
  1369. # Uncomment counter above and code here and adapt targetfile if needed later.
  1370. # *olor*([0-9]).wav)
  1371. # targetfile="color ($colorcounter).wav"
  1372. # colorcounter=$((colorcounter+1))
  1373. # target="./${targetpath}/${dir}/${targetfile}"
  1374. # if [ "$verbosity" = "1" ]; then
  1375. # echo "Converting ${src} to ${target}"
  1376. # fi
  1377. # rsync -Ab --no-perms "${src}" "${target}"
  1378. # ;;
  1379.  
  1380. *rag*([0-9]).wav)
  1381. targetfile="drag ($dragcounter).wav"
  1382. dragcounter=$((dragcounter+1))
  1383. target="./$targetpath//${dir}/$targetfile"
  1384. if [ "$verbosity" = "1" ]; then
  1385. echo "Converting ${src} to ${target}"
  1386. fi
  1387. rsync -Ab --no-perms "${src}" "${target}"
  1388. ;;
  1389.  
  1390. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  1391. # Uncomment counter above and code here and adapt targetfile if needed later.
  1392. # *ndlock*([0-9]).wav)
  1393. # targetfile="endlock ($endlockcounter).wav"
  1394. # endlockcounter=$((endlockcounter+1))
  1395. # target="./${targetpath}/${dir}/${targetfile}"
  1396. # if [ "$verbosity" = "1" ]; then
  1397. # echo "Converting ${src} to ${target}"
  1398. # fi
  1399. # rsync -Ab --no-perms "${src}" "${target}"
  1400. # ;;
  1401.  
  1402. *ont*([0-9]).wav)
  1403. targetfile="font ($fontcounter).wav"
  1404. fontcounter=$((fontcounter+1))
  1405. target="./$targetpath//${dir}/$targetfile"
  1406. if [ "$verbosity" = "1" ]; then
  1407. echo "Converting ${src} to ${target}"
  1408. fi
  1409. rsync -Ab --no-perms "${src}" "${target}"
  1410. ;;
  1411.  
  1412. *orce*|combo*([0-9]).wav)
  1413. targetfile="force ($forcecounter).wav"
  1414. forcecounter=$((forcecounter+1))
  1415. target="./$targetpath//${dir}/$targetfile"
  1416. if [ "$verbosity" = "1" ]; then
  1417. echo "Converting ${src} to ${target}"
  1418. fi
  1419. rsync -Ab --no-perms "${src}" "${target}"
  1420. ;;
  1421.  
  1422. *um*|humM*([0-9]).wav)
  1423. targetfile="hum ($humcounter).wav"
  1424. humcounter=$((humcounter+1))
  1425. target="./$targetpath//${dir}/$targetfile"
  1426. if [ "$verbosity" = "1" ]; then
  1427. echo "Converting ${src} to ${target}"
  1428. fi
  1429. rsync -Ab --no-perms "${src}" "${target}"
  1430. ;;
  1431.  
  1432. *oweroff*|*wroff*([0-9]).wav)
  1433. targetfile="in ($poweroffcounter).wav"
  1434. poweroffcounter=$((poweroffcounter+1))
  1435. target="./$targetpath//${dir}/$targetfile"
  1436. if [ "$verbosity" = "1" ]; then
  1437. echo "Converting ${src} to ${target}"
  1438. fi
  1439. rsync -Ab --no-perms "${src}" "${target}"
  1440. ;;
  1441.  
  1442. *ock**([0-9]).wav)
  1443. targetfile="lock ($lockcounter).wav"
  1444. lockcounter=$((lockcounter+1))
  1445. target="./$targetpath//${dir}/$targetfile"
  1446. if [ "$verbosity" = "1" ]; then
  1447. echo "Converting ${src} to ${target}"
  1448. fi
  1449. rsync -Ab --no-perms "${src}" "${target}"
  1450. ;;
  1451.  
  1452. *oweron**([0-9]).wav)
  1453. targetfile="out ($poweroncounter).wav"
  1454. poweroncounter=$((poweroncounter+1))
  1455. target="./$targetpath//${dir}/$targetfile"
  1456. if [ "$verbosity" = "1" ]; then
  1457. echo "Converting ${src} to ${target}"
  1458. fi
  1459. rsync -Ab --no-perms "${src}" "${target}"
  1460. ;;
  1461.  
  1462. hswing*([0-9]).wav)
  1463. targetfile="hswing ($hswingcounter).wav"
  1464. hswingcounter=$((hswingcounter+1))
  1465. target="./$targetpath//${dir}/$targetfile"
  1466. if [ "$verbosity" = "1" ]; then
  1467. echo "Converting ${src} to ${target}"
  1468. fi
  1469. rsync -Ab --no-perms "${src}" "${target}"
  1470. ;;
  1471.  
  1472. lswing*([0-9]).wav)
  1473. targetfile="lswing ($lswingcounter).wav"
  1474. lswingcounter=$((lswingcounter+1))
  1475. target="./$targetpath//${dir}/$targetfile"
  1476. if [ "$verbosity" = "1" ]; then
  1477. echo "Converting ${src} to ${target}"
  1478. fi
  1479. rsync -Ab --no-perms "${src}" "${target}"
  1480. ;;
  1481.  
  1482. *reon*([0-9]).wav)
  1483. targetfile="preon ($preoncounter).wav"
  1484. if [ "$preoncounter" -ge 5 ]; then
  1485. preoncounter=1
  1486. else
  1487. preoncounter=$((preoncounter+1))
  1488. fi
  1489. target="./$targetpath/$targetfile"
  1490. target="./$targetpath/${dir}/set/$targetfile"
  1491. if [ "$verbosity" = "1" ]; then
  1492. echo "Converting ${src} to ${target}"
  1493. fi
  1494. rsync -Ab --no-perms "${src}" "${target}"
  1495. ;;
  1496.  
  1497. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  1498. # Uncomment counter above and code here and adapt targetfile if needed later.
  1499. # *pin*([0-9]).wav)
  1500. # targetfile="spin ($spincounter).wav"
  1501. # spincounter=$((spincounter+1))
  1502. # target="./${targetpath}/${dir}/${targetfile}"
  1503. # if [ "$verbosity" = "1" ]; then
  1504. # echo "Converting ${src} to ${target}"
  1505. # fi
  1506. # rsync -Ab --no-perms "${src}" "${target}"
  1507. # ;;
  1508.  
  1509. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  1510. # Uncomment counter above and code here and adapt targetfile if needed later.
  1511. # *tab*([0-9]).wav)
  1512. # targetfile="stab ($stabcounter).wav"
  1513. # stabcounter=$((stabcounter+1))
  1514. # target="./${targetpath}/${dir}/${targetfile}"
  1515. # if [ "$verbosity" = "1" ]; then
  1516. # echo "Converting ${src} to ${target}"
  1517. # fi
  1518. # rsync -Ab --no-perms "${src}" "${target}"
  1519. # ;;
  1520.  
  1521. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  1522. # Uncomment and adapt targetfile if needed later.
  1523. # *wng*([0-9]).wav)
  1524. # targetfile="swing ($swingcounter).wav"
  1525. # swingcounter=$((swingcounter+1))
  1526. # target="./${targetpath}/${dir}/${targetfile}"
  1527. # if [ "$verbosity" = "1" ]; then
  1528. # echo "Converting ${src} to ${target}"
  1529. # fi
  1530. # rsync -Ab --no-perms "${src}" "${target}"
  1531. # ;;
  1532.  
  1533. *rack*([0-9]).wav)
  1534. targetfile="track ($trackcounter).wav"
  1535. trackcounter=$((trackcounter+1))
  1536. target="./$targetpath/${dir}/tracks/$targetfile"
  1537. if [ "$verbosity" = "1" ]; then
  1538. echo "Converting ${src} to ${target}"
  1539. fi
  1540. rsync -Ab --no-perms "${src}" "${target}"
  1541. ;;
  1542.  
  1543. *)
  1544. echo "No match found, ignoring file $src"
  1545.  
  1546. esac
  1547. done
  1548.  
  1549. echo " "
  1550. echo Coverted soundfont saved in "${targetpath}"
  1551. done
  1552.  
  1553. echo " "
  1554. echo " "
  1555. echo "Soundfont conversion complete."
  1556. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  1557. echo " before the conversion and was renamed to avoid accidental overwriting."
  1558. echo " "
  1559. echo " --- MTFBWY ---"
  1560.  
  1561. #-------------------------------------------------------------------------------------------------------------------------------------
  1562.  
  1563. elif [ "$boardchoice" = "PtoC" ]; then
  1564. echo " "
  1565. echo "You chose Proffie to CFX Soundfont converter."
  1566. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1567. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1568.  
  1569. read selection
  1570.  
  1571. if [ "$selection" = "1" ]; then
  1572. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1573. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1574.  
  1575. read input
  1576. dirs=$(find "$input" -maxdepth 0 -type d)
  1577.  
  1578. echo "Found the following soundfont folder:"
  1579. echo $dirs
  1580. echo "Does this folder only contain one soundfont? (y/n)"
  1581.  
  1582. read input2
  1583.  
  1584. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1585. echo "Continuing conversion"
  1586. else
  1587. echo "Aborting program"
  1588. exit
  1589. fi
  1590.  
  1591. elif [ "$selection" = "2" ]; then
  1592. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1593. echo "Please enter the name of the folder containing the soundfont folders."
  1594.  
  1595. read input
  1596. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1597.  
  1598. echo "Found the following directories for soundfonts:"
  1599. echo $dirs
  1600. echo "Does each of these folders only contain one soundfont? (y/n)"
  1601.  
  1602. read input2
  1603.  
  1604. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1605. echo "Continuing conversion"
  1606. else
  1607. echo "Aborting program"
  1608. exit
  1609. fi
  1610.  
  1611. else
  1612. echo "Your selection is invalid. Aborting program"
  1613. exit
  1614. fi
  1615.  
  1616. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1617. echo "Warning, the detailed report will produce a lot of console output!"
  1618.  
  1619. read verbosity
  1620.  
  1621. if [ "$verbosity" = "1" ]; then
  1622. echo "Logging progress to console"
  1623. else
  1624. echo "Logging only important steps"
  1625. fi
  1626.  
  1627.  
  1628. for dir in ${dirs[@]}; do
  1629.  
  1630. sounds=$(find "$dir" -type f -name '*.wav')
  1631.  
  1632. echo Converting soundfont in "${dir}".
  1633.  
  1634. targetpath="Converted_to_CFX/${dir}"
  1635. mkdir -p "${targetpath}"
  1636.  
  1637. bgndragcounter=1
  1638. bgnlockcounter=1
  1639. blstcounter=1
  1640. bootcounter=1
  1641. clshcounter=1
  1642. ccchangecounter=1
  1643. dragcounter=1
  1644. enddragcounter=1
  1645. endlockcounter=1
  1646. fontcounter=1
  1647. forcecounter=1
  1648. humcounter=1
  1649. incounter=1
  1650. lockcounter=1
  1651. outcounter=1
  1652. preoncounter=1
  1653. spincounter=1
  1654. stabcounter=1
  1655. swinghcounter=1
  1656. swinglcounter=1
  1657. swngcounter=1
  1658. trackcounter=1
  1659.  
  1660. for src in ${sounds[@]}; do
  1661. case "${src##*/}" in
  1662.  
  1663. bgndrag*([0-9]).wav)
  1664. targetfile=$(printf %q "startdrag$bgndragcounter.wav")
  1665. bgndragcounter=$((bgndragcounter+1))
  1666. target="./${targetpath}/${targetfile}"
  1667. if [ "$verbosity" = "1" ]; then
  1668. echo "Converting ${src} to ${target}"
  1669. fi
  1670. rsync -Ab --no-perms "${src}" "${target}"
  1671. ;;
  1672.  
  1673. bgnlock*([0-9]).wav)
  1674. targetfile=$(printf %q "startlock$bgnlockcounter.wav")
  1675. bgnlockcounter=$((bgnlockcounter+1))
  1676. target="./${targetpath}/${targetfile}"
  1677. if [ "$verbosity" = "1" ]; then
  1678. echo "Converting ${src} to ${target}"
  1679. fi
  1680. rsync -Ab --no-perms "${src}" "${target}"
  1681. ;;
  1682.  
  1683. blst*([0-9]).wav)
  1684. if [ "$blstcounter" -eq 1 ]; then
  1685. targetfile=$(printf %q "blaster.wav")
  1686. else
  1687. targetfile=$(printf %q "blaster$blstcounter.wav")
  1688. fi
  1689. blstcounter=$((blstcounter+1))
  1690. target="./${targetpath}/${targetfile}"
  1691. if [ "$verbosity" = "1" ]; then
  1692. echo "Converting ${src} to ${target}"
  1693. fi
  1694. rsync -Ab --no-perms "${src}" "${target}"
  1695. ;;
  1696.  
  1697. boot*([0-9]).wav)
  1698. if [ "$bootcounter" -eq 1 ]; then
  1699. targetfile=$(printf %q "boot.wav")
  1700. else
  1701. targetfile=$(printf %q "boot$bootcounter.wav")
  1702. fi
  1703. bootcounter=$((bootcounter+1))
  1704. target="./$targetpath/$targetfile"
  1705. if [ "$verbosity" = "1" ]; then
  1706. echo "Converting ${src} to ${target}"
  1707. fi
  1708. rsync -Ab --no-perms "${src}" "${target}"
  1709. ;;
  1710.  
  1711. clsh*([0-9]).wav)
  1712. targetfile=$(printf %q "clash$clshcounter.wav")
  1713. clshcounter=$((clshcounter+1))
  1714. target="./$targetpath/$targetfile"
  1715. if [ "$verbosity" = "1" ]; then
  1716. echo "Converting ${src} to ${target}"
  1717. fi
  1718. rsync -Ab --no-perms "${src}" "${target}"
  1719. ;;
  1720.  
  1721. ccchange*([0-9]).wav)
  1722. if [ "$ccchangecounter" -eq 1 ]; then
  1723. targetfile=$(printf %q "color.wav")
  1724. else
  1725. targetfile=$(printf %q "color$ccchangecounter.wav")
  1726. fi
  1727. ccchangecounter=$((ccchangecounter+1))
  1728. target="./$targetpath/$targetfile"
  1729. if [ "$verbosity" = "1" ]; then
  1730. echo "Converting ${src} to ${target}"
  1731. fi
  1732. rsync -Ab --no-perms "${src}" "${target}"
  1733. ;;
  1734.  
  1735. drag*([0-9]).wav)
  1736. if [ "$dragcounter" -eq 1 ]; then
  1737. targetfile=$(printf %q "drag.wav")
  1738. else
  1739. targetfile=$(printf %q "drag$dragcounter.wav")
  1740. fi
  1741. dragcounter=$((dragcounter+1))
  1742. target="./$targetpath/$targetfile"
  1743. if [ "$verbosity" = "1" ]; then
  1744. echo "Converting ${src} to ${target}"
  1745. fi
  1746. rsync -Ab --no-perms "${src}" "${target}"
  1747. ;;
  1748.  
  1749. enddrag*([0-9]).wav)
  1750. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  1751. enddragcounter=$((enddragcounter+1))
  1752. target="./$targetpath/$targetfile"
  1753. if [ "$verbosity" = "1" ]; then
  1754. echo "Converting ${src} to ${target}"
  1755. fi
  1756. rsync -Ab --no-perms "${src}" "${target}"
  1757. ;;
  1758.  
  1759. endlock*([0-9]).wav)
  1760. targetfile=$(printf %q "endlock$endlockcounter.wav")
  1761. endlockcounter=$((endlockcounter+1))
  1762. target="./$targetpath/$targetfile"
  1763. if [ "$verbosity" = "1" ]; then
  1764. echo "Converting ${src} to ${target}"
  1765. fi
  1766. rsync -Ab --no-perms "${src}" "${target}"
  1767. ;;
  1768.  
  1769. font*([0-9]).wav)
  1770. if [ "$fontcounter" -eq 1 ]; then
  1771. targetfile=$(printf %q "font.wav")
  1772. else
  1773. targetfile=$(printf %q "font$fontcounter.wav")
  1774. fi
  1775. fontcounter=$((fontcounter+1))
  1776. target="./$targetpath/$targetfile"
  1777. if [ "$verbosity" = "1" ]; then
  1778. echo "Converting ${src} to ${target}"
  1779. fi
  1780. rsync -Ab --no-perms "${src}" "${target}"
  1781. ;;
  1782.  
  1783. force*|quote*([0-9]).wav)
  1784. if [ "$forcecounter" -eq 1 ]; then
  1785. targetfile=$(printf %q "force.wav")
  1786. else
  1787. targetfile=$(printf %q "force$forcecounter.wav")
  1788. fi
  1789. forcecounter=$((forcecounter+1))
  1790. target="./$targetpath/$targetfile"
  1791. if [ "$verbosity" = "1" ]; then
  1792. echo "Converting ${src} to ${target}"
  1793. fi
  1794. rsync -Ab --no-perms "${src}" "${target}"
  1795. ;;
  1796.  
  1797. hum*([0-9]).wav)
  1798. targetfile=$(printf %q "humM$humcounter.wav")
  1799. humcounter=$((humcounter+1))
  1800. target="./$targetpath/$targetfile"
  1801. if [ "$verbosity" = "1" ]; then
  1802. echo "Converting ${src} to ${target}"
  1803. fi
  1804. rsync -Ab --no-perms "${src}" "${target}"
  1805. ;;
  1806.  
  1807. in*([0-9]).wav)
  1808. if [ "$incounter" -eq 1 ]; then
  1809. targetfile=$(printf %q "poweroff.wav")
  1810. elif [ "$incounter" -eq 2 ]; then
  1811. targetfile=$(printf %q "pwroff$incounter.wav")
  1812. elif [ "$incounter" -ge 3 ]; then
  1813. targetfile=$(printf %q "poweroff$((incounter-1)).wav")
  1814. fi
  1815. incounter=$((incounter+1))
  1816. target="./$targetpath/$targetfile"
  1817. if [ "$verbosity" = "1" ]; then
  1818. echo "Converting ${src} to ${target}"
  1819. fi
  1820. rsync -Ab --no-perms "${src}" "${target}"
  1821. ;;
  1822.  
  1823. lock*([0-9]).wav)
  1824. if [ "$lockcounter" -eq 1 ]; then
  1825. targetfile=$(printf %q "lockup.wav")
  1826. else
  1827. targetfile=$(printf %q "lockup$lockcounter.wav")
  1828. fi
  1829. lockcounter=$((lockcounter+1))
  1830. target="./$targetpath/$targetfile"
  1831. if [ "$verbosity" = "1" ]; then
  1832. echo "Converting ${src} to ${target}"
  1833. fi
  1834. rsync -Ab --no-perms "${src}" "${target}"
  1835. ;;
  1836.  
  1837. out*([0-9]).wav)
  1838. if [ "$outcounter" -eq 1 ]; then
  1839. targetfile=$(printf %q "poweron.wav")
  1840. else
  1841. targetfile=$(printf %q "poweron$outcounter.wav")
  1842. fi
  1843. outcounter=$((outcounter+1))
  1844. target="./$targetpath/$targetfile"
  1845. if [ "$verbosity" = "1" ]; then
  1846. echo "Converting ${src} to ${target}"
  1847. fi
  1848. rsync -Ab --no-perms "${src}" "${target}"
  1849. ;;
  1850.  
  1851. preon*([0-9]).wav)
  1852. targetfile=$(printf %q "preon$preoncounter.wav")
  1853. preoncounter=$((preoncounter+1))
  1854. target="./$targetpath/$targetfile"
  1855. if [ "$verbosity" = "1" ]; then
  1856. echo "Converting ${src} to ${target}"
  1857. fi
  1858. rsync -Ab --no-perms "${src}" "${target}"
  1859. ;;
  1860.  
  1861. spin*([0-9]).wav)
  1862. targetfile=$(printf %q "spin$spincounter.wav")
  1863. spincounter=$((spincounter+1))
  1864. target="./$targetpath/$targetfile"
  1865. if [ "$verbosity" = "1" ]; then
  1866. echo "Converting ${src} to ${target}"
  1867. fi
  1868. rsync -Ab --no-perms "${src}" "${target}"
  1869. ;;
  1870.  
  1871. stab*([0-9]).wav)
  1872. targetfile=$(printf %q "stab$stabcounter.wav")
  1873. stabcounter=$((stabcounter+1))
  1874. target="./$targetpath/$targetfile"
  1875. if [ "$verbosity" = "1" ]; then
  1876. echo "Converting ${src} to ${target}"
  1877. fi
  1878. rsync -Ab --no-perms "${src}" "${target}"
  1879. ;;
  1880.  
  1881. swingh*([0-9]).wav)
  1882. targetfile=$(printf %q "hswing$swinghcounter.wav")
  1883. swinghcounter=$((swinghcounter+1))
  1884. target="./$targetpath/$targetfile"
  1885. if [ "$verbosity" = "1" ]; then
  1886. echo "Converting ${src} to ${target}"
  1887. fi
  1888. rsync -Ab --no-perms "${src}" "${target}"
  1889. ;;
  1890.  
  1891. swingl*([0-9]).wav)
  1892. targetfile=$(printf %q "lswing$swinglcounter.wav")
  1893. swinglcounter=$((swinglcounter+1))
  1894. target="./$targetpath/$targetfile"
  1895. if [ "$verbosity" = "1" ]; then
  1896. echo "Converting ${src} to ${target}"
  1897. fi
  1898. rsync -Ab --no-perms "${src}" "${target}"
  1899. ;;
  1900.  
  1901. swng*([0-9]).wav)
  1902. targetfile=$(printf %q "swing$swngcounter.wav")
  1903. swngcounter=$((swngcounter+1))
  1904. target="./$targetpath/$targetfile"
  1905. if [ "$verbosity" = "1" ]; then
  1906. echo "Converting ${src} to ${target}"
  1907. fi
  1908. rsync -Ab --no-perms "${src}" "${target}"
  1909. ;;
  1910.  
  1911. track*([0-9]).wav)
  1912. targetfile=$(printf %q "track$trackcounter.wav")
  1913. trackcounter=$((trackcounter+1))
  1914. if [ "$verbosity" = "1" ]; then
  1915. echo "Converting ${src} to ${target}"
  1916. fi
  1917. rsync -Ab --no-perms "${src}" "${target}"
  1918. ;;
  1919.  
  1920. *)
  1921. echo "No match found, ignoring file $src"
  1922.  
  1923. esac
  1924. done
  1925.  
  1926. echo " "
  1927. echo Coverted soundfont saved in "${targetpath}"
  1928. done
  1929.  
  1930. echo " "
  1931. echo " "
  1932. echo "Soundfont conversion complete."
  1933. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  1934. echo " before the conversion and was renamed to avoid accidental overwriting."
  1935. echo " "
  1936. echo " --- MTFBWY ---"
  1937.  
  1938. #-------------------------------------------------------------------------------------------------------------------------------------
  1939.  
  1940. elif [ "$boardchoice" = "PtoG" ]; then
  1941. echo " "
  1942. echo "You chose Proffie to GoldenHarvest Soundfont converter."
  1943. echo "*NOTE* Single font file supported."
  1944. echo "- If you have multiple font.wavs in the source font, the last one will be used"
  1945. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1946. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1947.  
  1948. read selection
  1949.  
  1950. if [ "$selection" = "1" ]; then
  1951. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1952. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1953.  
  1954. read input
  1955. dirs=$(find "$input" -maxdepth 0 -type d)
  1956.  
  1957. echo "Found the following soundfont folder:"
  1958. echo $dirs
  1959. echo "Does this folder only contain one soundfont? (y/n)"
  1960.  
  1961. read input2
  1962.  
  1963. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1964. echo "Continuing conversion"
  1965. else
  1966. echo "Aborting program"
  1967. exit
  1968. fi
  1969.  
  1970. elif [ "$selection" = "2" ]; then
  1971. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1972. echo "Please enter the name of the folder containing the soundfont folders."
  1973.  
  1974. read input
  1975. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1976.  
  1977. echo "Found the following directories for soundfonts:"
  1978. echo $dirs
  1979. echo "Does each of these folders only contain one soundfont? (y/n)"
  1980.  
  1981. read input2
  1982.  
  1983. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  1984. echo "Continuing conversion"
  1985. else
  1986. echo "Aborting program"
  1987. exit
  1988. fi
  1989.  
  1990. else
  1991. echo "Your selection is invalid. Aborting program"
  1992. exit
  1993. fi
  1994.  
  1995. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1996. echo "Warning, the detailed report will produce a lot of console output!"
  1997.  
  1998. read verbosity
  1999.  
  2000. if [ "$verbosity" = "1" ]; then
  2001. echo "Logging progress to console"
  2002. else
  2003. echo "Logging only important steps"
  2004. fi
  2005.  
  2006.  
  2007. for dir in ${dirs[@]}; do
  2008.  
  2009. sounds=$(find "$dir" -type f -name '*.wav')
  2010.  
  2011. echo Converting soundfont in "${dir}".
  2012.  
  2013. targetpath="Converted_to_GoldenHarvest/${dir}"
  2014. mkdir -p "${targetpath}"
  2015.  
  2016. bgndragcounter=1
  2017. bgnlockcounter=1
  2018. blstcounter=1
  2019. bootcounter=1
  2020. clshcounter=1
  2021. ccchangecounter=1
  2022. dragcounter=1
  2023. enddragcounter=1
  2024. endlockcounter=1
  2025. fontcounter=1
  2026. forcecounter=1
  2027. humcounter=1
  2028. incounter=1
  2029. lockcounter=1
  2030. outcounter=1
  2031. preoncounter=1
  2032. spincounter=1
  2033. stabcounter=1
  2034. swinghcounter=1
  2035. swinglcounter=1
  2036. swngcounter=1
  2037. trackcounter=1
  2038.  
  2039. for src in ${sounds[@]}; do
  2040. case "${src##*/}" in
  2041.  
  2042. bgndrag*([0-9]).wav)
  2043. targetfile=$(printf %q "bgndrag$bgndragcounter.wav")
  2044. bgndragcounter=$((bgndragcounter+1))
  2045. target="./${targetpath}/${targetfile}"
  2046. if [ "$verbosity" = "1" ]; then
  2047. echo "Converting ${src} to ${target}"
  2048. fi
  2049. rsync -Ab --no-perms "${src}" "${target}"
  2050. ;;
  2051.  
  2052. bgnlock*([0-9]).wav)
  2053. targetfile=$(printf %q "bgnlock$bgnlockcounter.wav")
  2054. bgnlockcounter=$((bgnlockcounter+1))
  2055. target="./${targetpath}/${targetfile}"
  2056. if [ "$verbosity" = "1" ]; then
  2057. echo "Converting ${src} to ${target}"
  2058. fi
  2059. rsync -Ab --no-perms "${src}" "${target}"
  2060. ;;
  2061.  
  2062. blst*([0-9]).wav)
  2063. targetfile=$(printf %q "blast$blstcounter.wav")
  2064. blstcounter=$((blstcounter+1))
  2065. target="./${targetpath}/${targetfile}"
  2066. if [ "$verbosity" = "1" ]; then
  2067. echo "Converting ${src} to ${target}"
  2068. fi
  2069. rsync -Ab --no-perms "${src}" "${target}"
  2070. ;;
  2071.  
  2072. boot*([0-9]).wav)
  2073. targetfile=$(printf %q "boot$bootcounter.wav")
  2074. bootcounter=$((bootcounter+1))
  2075. target="./$targetpath/$targetfile"
  2076. if [ "$verbosity" = "1" ]; then
  2077. echo "Converting ${src} to ${target}"
  2078. fi
  2079. rsync -Ab --no-perms "${src}" "${target}"
  2080. ;;
  2081.  
  2082. clsh*([0-9]).wav)
  2083. targetfile=$(printf %q "clash$clshcounter.wav")
  2084. clshcounter=$((clshcounter+1))
  2085. target="./$targetpath/$targetfile"
  2086. if [ "$verbosity" = "1" ]; then
  2087. echo "Converting ${src} to ${target}"
  2088. fi
  2089. rsync -Ab --no-perms "${src}" "${target}"
  2090. ;;
  2091.  
  2092. ccchange*([0-9]).wav)
  2093. targetfile=$(printf %q "change$ccchangecounter.wav")
  2094. ccchangecounter=$((ccchangecounter+1))
  2095. target="./$targetpath/$targetfile"
  2096. if [ "$verbosity" = "1" ]; then
  2097. echo "Converting ${src} to ${target}"
  2098. fi
  2099. rsync -Ab --no-perms "${src}" "${target}"
  2100. ;;
  2101.  
  2102. drag*([0-9]).wav)
  2103. targetfile=$(printf %q "drag$dragcounter.wav")
  2104. dragcounter=$((dragcounter+1))
  2105. target="./$targetpath/$targetfile"
  2106. if [ "$verbosity" = "1" ]; then
  2107. echo "Converting ${src} to ${target}"
  2108. fi
  2109. rsync -Ab --no-perms "${src}" "${target}"
  2110. ;;
  2111.  
  2112. enddrag*([0-9]).wav)
  2113. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  2114. enddragcounter=$((enddragcounter+1))
  2115. target="./$targetpath/$targetfile"
  2116. if [ "$verbosity" = "1" ]; then
  2117. echo "Converting ${src} to ${target}"
  2118. fi
  2119. rsync -Ab --no-perms "${src}" "${target}"
  2120. ;;
  2121.  
  2122. endlock*([0-9]).wav)
  2123. targetfile=$(printf %q "endlock$endlockcounter.wav")
  2124. endlockcounter=$((endlockcounter+1))
  2125. target="./$targetpath/$targetfile"
  2126. if [ "$verbosity" = "1" ]; then
  2127. echo "Converting ${src} to ${target}"
  2128. fi
  2129. rsync -Ab --no-perms "${src}" "${target}"
  2130. ;;
  2131.  
  2132. font*([0-9]).wav)
  2133. #fontcounter=$((fontcounter+1))
  2134. targetfile=$(printf %q "font.wav")
  2135. target="./$targetpath/$targetfile"
  2136. if [ "$verbosity" = "1" ]; then
  2137. echo "Converting ${src} to ${target}"
  2138. fi
  2139. rsync -Ab --no-perms "${src}" "${target}"
  2140. ;;
  2141.  
  2142. force*|quote*([0-9]).wav)
  2143. targetfile=$(printf %q "force$forcecounter.wav")
  2144. forcecounter=$((forcecounter+1))
  2145. target="./$targetpath/$targetfile"
  2146. if [ "$verbosity" = "1" ]; then
  2147. echo "Converting ${src} to ${target}"
  2148. fi
  2149. rsync -Ab --no-perms "${src}" "${target}"
  2150. ;;
  2151.  
  2152. hum*([0-9]).wav)
  2153. targetfile=$(printf %q "hum$humcounter.wav")
  2154. humcounter=$((humcounter+1))
  2155. target="./$targetpath/$targetfile"
  2156. if [ "$verbosity" = "1" ]; then
  2157. echo "Converting ${src} to ${target}"
  2158. fi
  2159. rsync -Ab --no-perms "${src}" "${target}"
  2160. ;;
  2161.  
  2162. in*([0-9]).wav)
  2163. targetfile=$(printf %q "pwroff$incounter.wav")
  2164. incounter=$((incounter+1))
  2165. target="./$targetpath/$targetfile"
  2166. if [ "$verbosity" = "1" ]; then
  2167. echo "Converting ${src} to ${target}"
  2168. fi
  2169. rsync -Ab --no-perms "${src}" "${target}"
  2170. ;;
  2171.  
  2172. lock*([0-9]).wav)
  2173. targetfile=$(printf %q "lockup$lockcounter.wav")
  2174. lockcounter=$((lockcounter+1))
  2175. target="./$targetpath/$targetfile"
  2176. if [ "$verbosity" = "1" ]; then
  2177. echo "Converting ${src} to ${target}"
  2178. fi
  2179. rsync -Ab --no-perms "${src}" "${target}"
  2180. ;;
  2181.  
  2182. out*([0-9]).wav)
  2183. targetfile=$(printf %q "pwron$outcounter.wav")
  2184. outcounter=$((outcounter+1))
  2185. target="./$targetpath/$targetfile"
  2186. if [ "$verbosity" = "1" ]; then
  2187. echo "Converting ${src} to ${target}"
  2188. fi
  2189. rsync -Ab --no-perms "${src}" "${target}"
  2190. ;;
  2191.  
  2192. preon*([0-9]).wav)
  2193. targetfile=$(printf %q "preon$preoncounter.wav")
  2194. preoncounter=$((preoncounter+1))
  2195. target="./$targetpath/$targetfile"
  2196. if [ "$verbosity" = "1" ]; then
  2197. echo "Converting ${src} to ${target}"
  2198. fi
  2199. rsync -Ab --no-perms "${src}" "${target}"
  2200. ;;
  2201.  
  2202.  
  2203. spin*([0-9]).wav)
  2204. targetfile=$(printf %q "spin$spincounter.wav")
  2205. spincounter=$((spincounter+1))
  2206. target="./$targetpath/$targetfile"
  2207. if [ "$verbosity" = "1" ]; then
  2208. echo "Converting ${src} to ${target}"
  2209. fi
  2210. rsync -Ab --no-perms "${src}" "${target}"
  2211. ;;
  2212.  
  2213. stab*([0-9]).wav)
  2214. targetfile=$(printf %q "stab$stabcounter.wav")
  2215. stabcounter=$((stabcounter+1))
  2216. target="./$targetpath/$targetfile"
  2217. if [ "$verbosity" = "1" ]; then
  2218. echo "Converting ${src} to ${target}"
  2219. fi
  2220. rsync -Ab --no-perms "${src}" "${target}"
  2221. ;;
  2222.  
  2223. swingh*([0-9]).wav)
  2224. targetfile=$(printf %q "hswing$swinghcounter.wav")
  2225. swinghcounter=$((swinghcounter+1))
  2226. target="./$targetpath/$targetfile"
  2227. if [ "$verbosity" = "1" ]; then
  2228. echo "Converting ${src} to ${target}"
  2229. fi
  2230. rsync -Ab --no-perms "${src}" "${target}"
  2231. ;;
  2232.  
  2233. swingl*([0-9]).wav)
  2234. targetfile=$(printf %q "lswing$swinglcounter.wav")
  2235. swinglcounter=$((swinglcounter+1))
  2236. target="./$targetpath/$targetfile"
  2237. if [ "$verbosity" = "1" ]; then
  2238. echo "Converting ${src} to ${target}"
  2239. fi
  2240. rsync -Ab --no-perms "${src}" "${target}"
  2241. ;;
  2242.  
  2243. swng*([0-9]).wav)
  2244. targetfile=$(printf %q "swing$swngcounter.wav")
  2245. swngcounter=$((swngcounter+1))
  2246. target="./$targetpath/$targetfile"
  2247. if [ "$verbosity" = "1" ]; then
  2248. echo "Converting ${src} to ${target}"
  2249. fi
  2250. rsync -Ab --no-perms "${src}" "${target}"
  2251. ;;
  2252.  
  2253. track*([0-9]).wav)
  2254. targetfile=$(printf %q "track$trackcounter.wav")
  2255. trackcounter=$((trackcounter+1))
  2256. if [ "$verbosity" = "1" ]; then
  2257. echo "Converting ${src} to ${target}"
  2258. fi
  2259. rsync -Ab --no-perms "${src}" "${target}"
  2260. ;;
  2261.  
  2262. *)
  2263. echo "No match found, ignoring file $src"
  2264.  
  2265. esac
  2266. done
  2267.  
  2268. echo " "
  2269. echo Coverted soundfont saved in "${targetpath}"
  2270. done
  2271.  
  2272. echo " "
  2273. echo " "
  2274. echo "Soundfont conversion complete."
  2275. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  2276. echo " before the conversion and was renamed to avoid accidental overwriting."
  2277. echo " "
  2278. echo " --- MTFBWY ---"
  2279.  
  2280. #-------------------------------------------------------------------------------------------------------------------------------------
  2281.  
  2282. elif [ "$boardchoice" = "PtoX" ]; then
  2283. echo " "
  2284. echo "You chose Proffie to Xenopixel Soundfont converter."
  2285. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  2286. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  2287.  
  2288. read selection
  2289.  
  2290. if [ "$selection" = "1" ]; then
  2291. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  2292. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  2293.  
  2294. read input
  2295. dirs=$(find "$input" -maxdepth 0 -type d)
  2296.  
  2297. echo "Found the following soundfont folder:"
  2298. echo $dirs
  2299. echo "Does this folder only contain one soundfont? (y/n)"
  2300.  
  2301. read input2
  2302.  
  2303. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2304. echo "Continuing conversion"
  2305. else
  2306. echo "Aborting program"
  2307. exit
  2308. fi
  2309.  
  2310. elif [ "$selection" = "2" ]; then
  2311. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  2312. echo "Please enter the name of the folder containing the soundfont folders."
  2313.  
  2314. read input
  2315. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  2316.  
  2317. echo "Found the following directories for soundfonts:"
  2318. echo $dirs
  2319. echo "Does each of these folders only contain one soundfont? (y/n)"
  2320.  
  2321. read input2
  2322.  
  2323. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2324. echo "Continuing conversion"
  2325. else
  2326. echo "Aborting program"
  2327. exit
  2328. fi
  2329.  
  2330. else
  2331. echo "Your selection is invalid. Aborting program"
  2332. exit
  2333. fi
  2334.  
  2335. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  2336. echo "Warning, the detailed report will produce a lot of console output!"
  2337.  
  2338. read verbosity
  2339.  
  2340. if [ "$verbosity" = "1" ]; then
  2341. echo "Logging progress to console"
  2342. else
  2343. echo "Logging only important steps"
  2344. fi
  2345.  
  2346.  
  2347. for dir in ${dirs[@]}; do
  2348.  
  2349. sounds=$(find "$dir" -type f -name '*.wav')
  2350.  
  2351. echo Converting soundfont in "${dir}".
  2352.  
  2353. targetpath="Converted_to_Xenopixel"
  2354. mkdir -p "${targetpath}"
  2355. mkdir -p "${targetpath}/${dir}/set"
  2356. mkdir -p "${targetpath}/${dir}/tracks"
  2357.  
  2358. blstcounter=1
  2359. bootcounter=1
  2360. clshcounter=1
  2361. # colorcounter=1
  2362. dragcounter=1
  2363. # endlockcounter=1
  2364. fontcounter=1
  2365. forcecounter=1
  2366. humcounter=1
  2367. incounter=1
  2368. lockcounter=1
  2369. outcounter=1
  2370. preoncounter=1
  2371. swinghcounter=1
  2372. swinglcounter=1
  2373. # spincounter=1
  2374. # stabcounter=1
  2375. # swngcounter=1
  2376. trackcounter=1
  2377.  
  2378. for src in ${sounds[@]}; do
  2379. case "${src##*/}" in
  2380. blst*([0-9]).wav)
  2381. targetfile="blaster ($blstcounter).wav"
  2382. blstcounter=$((blstcounter+1))
  2383. target="./${targetpath}/${dir}/${targetfile}"
  2384. if [ "$verbosity" = "1" ]; then
  2385. echo "Converting ${src} to ${target}"
  2386. fi
  2387. rsync -Ab --no-perms "${src}" "${target}"
  2388. ;;
  2389.  
  2390. # boot sounds are converted to 'power on.wav and live in the 'set' folder.
  2391. # If there are more than one converted, the last one will be the resulting file.
  2392. boot*([0-9]).wav)
  2393. targetfile="power on.wav"
  2394. bootcounter=$((bootcounter+1))
  2395. target="./$targetpath/${dir}/set/$targetfile"
  2396. if [ "$verbosity" = "1" ]; then
  2397. echo "Converting ${src} to ${target}"
  2398. fi
  2399. rsync -Ab --no-perms "${src}" "${target}"
  2400. ;;
  2401.  
  2402. clsh*([0-9]).wav)
  2403. targetfile="clash ($clshcounter).wav"
  2404. clshcounter=$((clshcounter+1))
  2405. target="./${targetpath}/${dir}/${targetfile}"
  2406. if [ "$verbosity" = "1" ]; then
  2407. echo "Converting ${src} to ${target}"
  2408. fi
  2409. rsync -Ab --no-perms "${src}" "${target}"
  2410. ;;
  2411.  
  2412. # color sounds are currently not supported by Xenopixel and therefore ignored.
  2413. # Uncomment counter above and code here and adapt targetfile if needed later.
  2414. # color*([0-9]).wav)
  2415. # targetfile="color ($colorcounter).wav"
  2416. # colorcounter=$((colorcounter+1))
  2417. # target="./${targetpath}/${dir}/${targetfile}"
  2418. # if [ "$verbosity" = "1" ]; then
  2419. # echo "Converting ${src} to ${target}"
  2420. # fi
  2421. # rsync -Ab --no-perms "${src}" "${target}"
  2422. # ;;
  2423.  
  2424. drag*([0-9]).wav)
  2425. targetfile="drag ($dragcounter).wav"
  2426. dragcounter=$((dragcounter+1))
  2427. target="./${targetpath}/${dir}/${targetfile}"
  2428. if [ "$verbosity" = "1" ]; then
  2429. echo "Converting ${src} to ${target}"
  2430. fi
  2431. rsync -Ab --no-perms "${src}" "${target}"
  2432. ;;
  2433.  
  2434. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  2435. # Uncomment counter above and code here and adapt targetfile if needed later.
  2436. # endlock*([0-9]).wav)
  2437. # targetfile="endlock ($endlockcounter).wav"
  2438. # endlockcounter=$((endlockcounter+1))
  2439. # target="./${targetpath}/${dir}/${targetfile}"
  2440. # if [ "$verbosity" = "1" ]; then
  2441. # echo "Converting ${src} to ${target}"
  2442. # fi
  2443. # rsync -Ab --no-perms "${src}" "${target}"
  2444. # ;;
  2445.  
  2446. font*([0-9]).wav)
  2447. targetfile="font ($fontcounter).wav"
  2448. fontcounter=$((fontcounter+1))
  2449. target="./${targetpath}/${dir}/${targetfile}"
  2450. if [ "$verbosity" = "1" ]; then
  2451. echo "Converting ${src} to ${target}"
  2452. fi
  2453. rsync -Ab --no-perms "${src}" "${target}"
  2454. ;;
  2455.  
  2456. force*|quote*([0-9]).wav)
  2457. targetfile="force ($forcecounter).wav"
  2458. forcecounter=$((forcecounter+1))
  2459. target="./${targetpath}/${dir}/${targetfile}"
  2460. if [ "$verbosity" = "1" ]; then
  2461. echo "Converting ${src} to ${target}"
  2462. fi
  2463. rsync -Ab --no-perms "${src}" "${target}"
  2464. ;;
  2465.  
  2466. hum*([0-9]).wav)
  2467. targetfile="hum ($humcounter).wav"
  2468. humcounter=$((humcounter+1))
  2469. target="./${targetpath}/${dir}/${targetfile}"
  2470. if [ "$verbosity" = "1" ]; then
  2471. echo "Converting ${src} to ${target}"
  2472. fi
  2473. rsync -Ab --no-perms "${src}" "${target}"
  2474. ;;
  2475.  
  2476. in*([0-9]).wav)
  2477. targetfile="in ($incounter).wav"
  2478. incounter=$((incounter+1))
  2479. target="./${targetpath}/${dir}/${targetfile}"
  2480. if [ "$verbosity" = "1" ]; then
  2481. echo "Converting ${src} to ${target}"
  2482. fi
  2483. rsync -Ab --no-perms "${src}" "${target}"
  2484. ;;
  2485.  
  2486. lock*([0-9]).wav)
  2487. targetfile="lock ($lockcounter).wav"
  2488. lockcounter=$((lockcounter+1))
  2489. target="./${targetpath}/${dir}/${targetfile}"
  2490. if [ "$verbosity" = "1" ]; then
  2491. echo "Converting ${src} to ${target}"
  2492. fi
  2493. rsync -Ab --no-perms "${src}" "${target}"
  2494. ;;
  2495.  
  2496. out*([0-9]).wav)
  2497. targetfile="out ($outcounter).wav"
  2498. outcounter=$((outcounter+1))
  2499. target="./${targetpath}/${dir}/${targetfile}"
  2500. if [ "$verbosity" = "1" ]; then
  2501. echo "Converting ${src} to ${target}"
  2502. fi
  2503. rsync -Ab --no-perms "${src}" "${target}"
  2504. ;;
  2505. swingh*([0-9]).wav)
  2506. targetfile="swingh ($swinghcounter).wav"
  2507. swinghcounter=$((swinghcounter+1))
  2508. target="./${targetpath}/${dir}/${targetfile}"
  2509. if [ "$verbosity" = "1" ]; then
  2510. echo "Converting ${src} to ${target}"
  2511. fi
  2512. rsync -Ab --no-perms "${src}" "${target}"
  2513. ;;
  2514.  
  2515. swingl*([0-9]).wav)
  2516. targetfile="swingl ($swinglcounter).wav"
  2517. swinglcounter=$((swinglcounter+1))
  2518. target="./${targetpath}/${dir}/${targetfile}"
  2519. if [ "$verbosity" = "1" ]; then
  2520. echo "Converting ${src} to ${target}"
  2521. fi
  2522. rsync -Ab --no-perms "${src}" "${target}"
  2523. ;;
  2524.  
  2525. preon*([0-9]).wav)
  2526. targetfile="preon ($preoncounter).wav"
  2527. if [ "$preoncounter" -ge 5 ]; then
  2528. preoncounter=1
  2529. else
  2530. preoncounter=$((preoncounter+1))
  2531. fi
  2532. target="./$targetpath/$targetfile"
  2533. target="./$targetpath/${dir}/set/$targetfile"
  2534. if [ "$verbosity" = "1" ]; then
  2535. echo "Converting ${src} to ${target}"
  2536. fi
  2537. rsync -Ab --no-perms "${src}" "${target}"
  2538. ;;
  2539.  
  2540. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  2541. # Uncomment counter above and code here and adapt targetfile if needed later.
  2542. # spin*([0-9]).wav)
  2543. # targetfile="spin ($spincounter).wav"
  2544. # spincounter=$((spincounter+1))
  2545. # target="./${targetpath}/${dir}/${targetfile}"
  2546. # if [ "$verbosity" = "1" ]; then
  2547. # echo "Converting ${src} to ${target}"
  2548. # fi
  2549. # rsync -Ab --no-perms "${src}" "${target}"
  2550. # ;;
  2551.  
  2552. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  2553. # Uncomment counter above and code here and adapt targetfile if needed later.
  2554. # stab*([0-9]).wav)
  2555. # targetfile="stab ($stabcounter).wav"
  2556. # stabcounter=$((stabcounter+1))
  2557. # target="./${targetpath}/${dir}/${targetfile}"
  2558. # if [ "$verbosity" = "1" ]; then
  2559. # echo "Converting ${src} to ${target}"
  2560. # fi
  2561. # rsync -Ab --no-perms "${src}" "${target}"
  2562. # ;;
  2563. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  2564. # Uncomment and adapt targetfile if needed later.
  2565. # swng*([0-9]).wav)
  2566. # targetfile="swing ($swingcounter).wav"
  2567. # swingcounter=$((swingcounter+1))
  2568. # target="./${targetpath}/${dir}/${targetfile}"
  2569. # if [ "$verbosity" = "1" ]; then
  2570. # echo "Converting ${src} to ${target}"
  2571. # fi
  2572. # rsync -Ab --no-perms "${src}" "${target}"
  2573. # ;;
  2574.  
  2575. track*([0-9]).wav)
  2576. targetfile="track ($trackcounter).wav"
  2577. trackcounter=$((trackcounter+1))
  2578. target="./$targetpath/${dir}/tracks/$targetfile"
  2579. if [ "$verbosity" = "1" ]; then
  2580. echo "Converting ${src} to ${target}"
  2581. fi
  2582. rsync -Ab --no-perms "${src}" "${target}"
  2583. ;;
  2584.  
  2585. *)
  2586. echo "No match found, ignoring file $src"
  2587.  
  2588. esac
  2589. done
  2590.  
  2591. echo " "
  2592. echo Coverted soundfont saved in "${targetpath}"
  2593. done
  2594.  
  2595. echo " "
  2596. echo " "
  2597. echo "Soundfont conversion complete."
  2598. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  2599. echo " before the conversion and was renamed to avoid accidental overwriting."
  2600. echo " "
  2601. echo " --- MTFBWY ---"
  2602.  
  2603. #-------------------------------------------------------------------------------------------------------------------------------------
  2604.  
  2605. elif [ "$boardchoice" = "XtoC" ]; then
  2606. echo " "
  2607. echo "You chose Xenopixel to CFX Soundfont converter."
  2608. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  2609. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  2610.  
  2611. read selection
  2612.  
  2613. if [ "$selection" = "1" ]; then
  2614. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  2615. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  2616.  
  2617. read input
  2618. dirs=$(find "$input" -maxdepth 0 -type d)
  2619.  
  2620. echo "Found the following soundfont folder:"
  2621. echo $dirs
  2622. echo "Does this folder only contain one soundfont? (y/n)"
  2623.  
  2624. read input2
  2625.  
  2626. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2627. echo "Continuing conversion"
  2628. else
  2629. echo "Aborting program"
  2630. exit
  2631. fi
  2632.  
  2633. elif [ "$selection" = "2" ]; then
  2634. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  2635. echo "Please enter the name of the folder containing the soundfont folders."
  2636.  
  2637. read input
  2638. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  2639.  
  2640. echo "Found the following directories for soundfonts:"
  2641. echo $dirs
  2642. echo "Does each of these folders only contain one soundfont? (y/n)"
  2643.  
  2644. read input2
  2645.  
  2646. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2647. echo "Continuing conversion"
  2648. else
  2649. echo "Aborting program"
  2650. exit
  2651. fi
  2652.  
  2653. else
  2654. echo "Your selection is invalid. Aborting program"
  2655. exit
  2656. fi
  2657.  
  2658. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  2659. echo "Warning, the detailed report will produce a lot of console output!"
  2660.  
  2661. read verbosity
  2662.  
  2663. if [ "$verbosity" = "1" ]; then
  2664. echo "Logging progress to console"
  2665. else
  2666. echo "Logging only important steps"
  2667. fi
  2668.  
  2669. for dir in ${dirs[@]}; do
  2670.  
  2671. sounds=$(find "$dir" -type f -name '*.wav')
  2672.  
  2673. echo Converting soundfont in "${dir}".
  2674.  
  2675. targetpath="Converted_to_CFX/${dir}"
  2676. mkdir -p "${targetpath}"
  2677.  
  2678. blastercounter=1
  2679. # bootcounter=1
  2680. clashcounter=1
  2681. # colorcounter=1
  2682. dragcounter=1
  2683. # endlockcounter=1
  2684. fontcounter=1
  2685. forcecounter=1
  2686. hswingcounter=1
  2687. humcounter=1
  2688. incounter=1
  2689. lockcounter=1
  2690. lswingcounter=1
  2691. outcounter=1
  2692. # preoncounter=1
  2693. # spincounter=1
  2694. # stabcounter=1
  2695. # swingcounter=1
  2696. trackcounter=1
  2697.  
  2698. for src in ${sounds[@]}; do
  2699. case "${src##*/}" in
  2700.  
  2701. blaster**([0-9]).wav)
  2702. if [ "$blastercounter" -eq 1 ]; then
  2703. targetfile=$(printf %q "blaster.wav")
  2704. else
  2705. targetfile=$(printf %q "blaster$blastercounter.wav")
  2706. fi
  2707. blastercounter=$((blastercounter+1))
  2708. target="./${targetpath}/${targetfile}"
  2709. if [ "$verbosity" = "1" ]; then
  2710. echo "Converting ${src} to ${target}"
  2711. fi
  2712. rsync -Ab --no-perms "${src}" "${target}"
  2713. ;;
  2714.  
  2715. # boot sounds are currently not supported by Xenopixel and therefore ignored.
  2716. # Uncomment counter above and code here and adapt targetfile if needed later.
  2717. # boot**([0-9]).wav)
  2718. # targetfile=$(printf %q "boot$bootcounter.wav")
  2719. # bootcounter=$((bootcounter+1))
  2720. # target="./$targetpath/$targetfile"
  2721. # if [ "$verbosity" = "1" ]; then
  2722. # echo "Converting ${src} to ${target}"
  2723. # fi
  2724. # rsync -Ab --no-perms "${src}" "${target}"
  2725. # ;;
  2726.  
  2727. clash**([0-9]).wav)
  2728. targetfile=$(printf %q "clash$clashcounter.wav")
  2729. clashcounter=$((clashcounter+1))
  2730. target="./$targetpath/$targetfile"
  2731. if [ "$verbosity" = "1" ]; then
  2732. echo "Converting ${src} to ${target}"
  2733. fi
  2734. rsync -Ab --no-perms "${src}" "${target}"
  2735. ;;
  2736.  
  2737. # color sounds are currently not supported by Xenopixel and therefore ignored.
  2738. # Uncomment counter above and code here and adapt targetfile if needed later.
  2739. # color**([0-9]).wav)
  2740. # targetfile=$(printf %q "color$colorcounter.wav")
  2741. # colorcounter=$((colorcounter+1))
  2742. # target="./$targetpath/$targetfile"
  2743. # if [ "$verbosity" = "1" ]; then
  2744. # echo "Converting ${src} to ${target}"
  2745. # fi
  2746. # rsync -Ab --no-perms "${src}" "${target}"
  2747. # ;;
  2748.  
  2749. drag**([0-9]).wav)
  2750. if [ "$dragcounter" -eq 1 ]; then
  2751. targetfile=$(printf %q "drag.wav")
  2752. else
  2753. targetfile=$(printf %q "drag$dragcounter.wav")
  2754. fi
  2755. dragcounter=$((dragcounter+1))
  2756. target="./$targetpath/$targetfile"
  2757. if [ "$verbosity" = "1" ]; then
  2758. echo "Converting ${src} to ${target}"
  2759. fi
  2760. rsync -Ab --no-perms "${src}" "${target}"
  2761. ;;
  2762.  
  2763. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  2764. # Uncomment counter above and code here and adapt targetfile if needed later.
  2765. # endlock*([0-9]).wav)
  2766. # targetfile=$(printf %q "endlock$endlockcounter.wav")
  2767. # endlockcounter=$((endlockcounter+1))
  2768. # target="./$targetpath/$targetfile"
  2769. # if [ "$verbosity" = "1" ]; then
  2770. # echo "Converting ${src} to ${target}"
  2771. # fi
  2772. # rsync -Ab --no-perms "${src}" "${target}"
  2773. # ;;
  2774.  
  2775. font**([0-9]).wav)
  2776. if [ "$fontcounter" -eq 1 ]; then
  2777. targetfile=$(printf %q "font.wav")
  2778. else
  2779. targetfile=$(printf %q "font$fontcounter.wav")
  2780. fi
  2781. fontcounter=$((fontcounter+1))
  2782. target="./$targetpath/$targetfile"
  2783. if [ "$verbosity" = "1" ]; then
  2784. echo "Converting ${src} to ${target}"
  2785. fi
  2786. rsync -Ab --no-perms "${src}" "${target}"
  2787. ;;
  2788.  
  2789. force**([0-9]).wav)
  2790. if [ "$forcecounter" -eq 1 ]; then
  2791. targetfile=$(printf %q "force.wav")
  2792. else
  2793. targetfile=$(printf %q "force$forcecounter.wav")
  2794. fi
  2795. forcecounter=$((forcecounter+1))
  2796. target="./$targetpath/$targetfile"
  2797. if [ "$verbosity" = "1" ]; then
  2798. echo "Converting ${src} to ${target}"
  2799. fi
  2800. rsync -Ab --no-perms "${src}" "${target}"
  2801. ;;
  2802.  
  2803. hum**([0-9]).wav)
  2804. targetfile=$(printf %q "humM$humcounter.wav")
  2805. humcounter=$((humcounter+1))
  2806. target="./$targetpath/$targetfile"
  2807. if [ "$verbosity" = "1" ]; then
  2808. echo "Converting ${src} to ${target}"
  2809. fi
  2810. rsync -Ab --no-perms "${src}" "${target}"
  2811. ;;
  2812.  
  2813. in**([0-9]).wav)
  2814. if [ "$incounter" -eq 1 ]; then
  2815. targetfile=$(printf %q "poweroff.wav")
  2816. elif [ "$incounter" -eq 2 ]; then
  2817. targetfile=$(printf %q "pwroff$incounter.wav")
  2818. elif [ "$incounter" -ge 3 ]; then
  2819. targetfile=$(printf %q "poweroff$((incounter-1)).wav")
  2820. fi
  2821. incounter=$((incounter+1))
  2822. target="./$targetpath/$targetfile"
  2823. if [ "$verbosity" = "1" ]; then
  2824. echo "Converting ${src} to ${target}"
  2825. fi
  2826. rsync -Ab --no-perms "${src}" "${target}"
  2827. ;;
  2828.  
  2829. lock**([0-9]).wav)
  2830. if [ "$lockcounter" -eq 1 ]; then
  2831. targetfile=$(printf %q "lockup.wav")
  2832. else
  2833. targetfile=$(printf %q "lockup$lockcounter.wav")
  2834. fi
  2835. lockcounter=$((lockcounter+1))
  2836. target="./$targetpath/$targetfile"
  2837. if [ "$verbosity" = "1" ]; then
  2838. echo "Converting ${src} to ${target}"
  2839. fi
  2840. rsync -Ab --no-perms "${src}" "${target}"
  2841. ;;
  2842.  
  2843. out**([0-9]).wav)
  2844. if [ "$outcounter" -eq 1 ]; then
  2845. targetfile=$(printf %q "poweron.wav")
  2846. else
  2847. targetfile=$(printf %q "poweron$outcounter.wav")
  2848. fi
  2849. outcounter=$((outcounter+1))
  2850. target="./$targetpath/$targetfile"
  2851. if [ "$verbosity" = "1" ]; then
  2852. echo "Converting ${src} to ${target}"
  2853. fi
  2854. rsync -Ab --no-perms "${src}" "${target}"
  2855. ;;
  2856.  
  2857. hswing**([0-9]).wav)
  2858. targetfile=$(printf %q "hswing$hswingcounter.wav")
  2859. hswingcounter=$((hswingcounter+1))
  2860. target="./$targetpath/$targetfile"
  2861. if [ "$verbosity" = "1" ]; then
  2862. echo "Converting ${src} to ${target}"
  2863. fi
  2864. rsync -Ab --no-perms "${src}" "${target}"
  2865. ;;
  2866.  
  2867. lswing**([0-9]).wav)
  2868. targetfile=$(printf %q "lswing$lswingcounter.wav")
  2869. lswingcounter=$((lswingcounter+1))
  2870. target="./$targetpath/$targetfile"
  2871. if [ "$verbosity" = "1" ]; then
  2872. echo "Converting ${src} to ${target}"
  2873. fi
  2874. rsync -Ab --no-perms "${src}" "${target}"
  2875. ;;
  2876.  
  2877. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  2878. # Uncomment and adapt targetfile if needed later.
  2879. # swng**([0-9]).wav)
  2880. # targetfile=$(printf %q "swing$swingcounter.wav")
  2881. # swingcounter=$((swingcounter+1))
  2882. # target="./$targetpath/$targetfile"
  2883. # if [ "$verbosity" = "1" ]; then
  2884. # echo "Converting ${src} to ${target}"
  2885. # fi
  2886. # rsync -Ab --no-perms "${src}" "${target}"
  2887. # ;;
  2888.  
  2889. track**([0-9]).wav)
  2890. targetfile=$(printf %q "track$trackcounter.wav")
  2891. trackcounter=$((trackcounter+1))
  2892. if [ "$verbosity" = "1" ]; then
  2893. echo "Converting ${src} to ${target}"
  2894. fi
  2895. rsync -Ab --no-perms "${src}" "${target}"
  2896. ;;
  2897.  
  2898. *)
  2899. echo "No match found, ignoring file $src"
  2900.  
  2901. esac
  2902. done
  2903.  
  2904. echo " "
  2905. echo Coverted soundfont saved in "${targetpath}"
  2906. done
  2907.  
  2908. echo " "
  2909. echo " "
  2910. echo "Soundfont conversion complete."
  2911. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  2912. echo " before the conversion and was renamed to avoid accidental overwriting."
  2913. echo " "
  2914. echo " --- MTFBWY ---"
  2915.  
  2916. #-------------------------------------------------------------------------------------------------------------------------------------
  2917.  
  2918. elif [ "$boardchoice" = "XtoG" ]; then
  2919. echo " "
  2920. echo "You chose Xenopixel to GoldenHarvest Soundfont converter."
  2921. echo "*NOTE* Single font file supported."
  2922. echo "- If you have multiple font.wavs in the source font, the last one will be used"
  2923. echo "- save.wav not generated."
  2924. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  2925. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  2926.  
  2927. read selection
  2928.  
  2929. if [ "$selection" = "1" ]; then
  2930. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  2931. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  2932.  
  2933. read input
  2934. dirs=$(find "$input" -maxdepth 0 -type d)
  2935.  
  2936. echo "Found the following soundfont folder:"
  2937. echo $dirs
  2938. echo "Does this folder only contain one soundfont? (y/n)"
  2939.  
  2940. read input2
  2941.  
  2942. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2943. echo "Continuing conversion"
  2944. else
  2945. echo "Aborting program"
  2946. exit
  2947. fi
  2948.  
  2949. elif [ "$selection" = "2" ]; then
  2950. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  2951. echo "Please enter the name of the folder containing the soundfont folders."
  2952.  
  2953. read input
  2954. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  2955.  
  2956. echo "Found the following directories for soundfonts:"
  2957. echo $dirs
  2958. echo "Does each of these folders only contain one soundfont? (y/n)"
  2959.  
  2960. read input2
  2961.  
  2962. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  2963. echo "Continuing conversion"
  2964. else
  2965. echo "Aborting program"
  2966. exit
  2967. fi
  2968.  
  2969. else
  2970. echo "Your selection is invalid. Aborting program"
  2971. exit
  2972. fi
  2973.  
  2974. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  2975. echo "Warning, the detailed report will produce a lot of console output!"
  2976.  
  2977. read verbosity
  2978.  
  2979. if [ "$verbosity" = "1" ]; then
  2980. echo "Logging progress to console"
  2981. else
  2982. echo "Logging only important steps"
  2983. fi
  2984.  
  2985. for dir in ${dirs[@]}; do
  2986.  
  2987. sounds=$(find "$dir" -type f -name '*.wav')
  2988.  
  2989. echo Converting soundfont in "${dir}".
  2990.  
  2991. targetpath="Converted_to_GoldenHarvest/${dir}"
  2992. mkdir -p "${targetpath}"
  2993.  
  2994. blastercounter=1
  2995. # bootcounter=1
  2996. clashcounter=1
  2997. # colorcounter=1
  2998. dragcounter=1
  2999. # endlockcounter=1
  3000. fontcounter=1
  3001. forcecounter=1
  3002. hswingcounter=1
  3003. humcounter=1
  3004. incounter=1
  3005. lockcounter=1
  3006. lswingcounter=1
  3007. outcounter=1
  3008. # preoncounter=1
  3009. # spincounter=1
  3010. # stabcounter=1
  3011. # swingcounter=1
  3012. trackcounter=1
  3013.  
  3014. for src in ${sounds[@]}; do
  3015. case "${src##*/}" in
  3016.  
  3017. blaster**([0-9]).wav)
  3018. targetfile=$(printf %q "blast$blastercounter.wav")
  3019. blastercounter=$((blastercounter+1))
  3020. target="./${targetpath}/${targetfile}"
  3021. if [ "$verbosity" = "1" ]; then
  3022. echo "Converting ${src} to ${target}"
  3023. fi
  3024. rsync -Ab --no-perms "${src}" "${target}"
  3025. ;;
  3026.  
  3027. # boot sounds are currently not supported by Xenopixel and therefore ignored.
  3028. # Uncomment counter above and code here and adapt targetfile if needed later.
  3029. # boot**([0-9]).wav)
  3030. # targetfile=$(printf %q "boot$bootcounter.wav")
  3031. # bootcounter=$((bootcounter+1))
  3032. # target="./$targetpath/$targetfile"
  3033. # if [ "$verbosity" = "1" ]; then
  3034. # echo "Converting ${src} to ${target}"
  3035. # fi
  3036. # rsync -Ab --no-perms "${src}" "${target}"
  3037. # ;;
  3038.  
  3039. clash**([0-9]).wav)
  3040. targetfile=$(printf %q "clash$clashcounter.wav")
  3041. clashcounter=$((clashcounter+1))
  3042. target="./$targetpath/$targetfile"
  3043. if [ "$verbosity" = "1" ]; then
  3044. echo "Converting ${src} to ${target}"
  3045. fi
  3046. rsync -Ab --no-perms "${src}" "${target}"
  3047. ;;
  3048.  
  3049. # color sounds are currently not supported by Xenopixel and therefore ignored.
  3050. # Uncomment counter above and code here and adapt targetfile if needed later.
  3051. # color**([0-9]).wav)
  3052. # targetfile=$(printf %q "color$colorcounter.wav")
  3053. # colorcounter=$((colorcounter+1))
  3054. # target="./$targetpath/$targetfile"
  3055. # if [ "$verbosity" = "1" ]; then
  3056. # echo "Converting ${src} to ${target}"
  3057. # fi
  3058. # rsync -Ab --no-perms "${src}" "${target}"
  3059. # ;;
  3060.  
  3061. drag**([0-9]).wav)
  3062. targetfile=$(printf %q "drag$dragcounter.wav")
  3063. dragcounter=$((dragcounter+1))
  3064. target="./$targetpath/$targetfile"
  3065. if [ "$verbosity" = "1" ]; then
  3066. echo "Converting ${src} to ${target}"
  3067. fi
  3068. rsync -Ab --no-perms "${src}" "${target}"
  3069. ;;
  3070.  
  3071. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  3072. # Uncomment counter above and code here and adapt targetfile if needed later.
  3073. # endlock*([0-9]).wav)
  3074. # targetfile=$(printf %q "endlock$endlockcounter.wav")
  3075. # endlockcounter=$((endlockcounter+1))
  3076. # target="./$targetpath/$targetfile"
  3077. # if [ "$verbosity" = "1" ]; then
  3078. # echo "Converting ${src} to ${target}"
  3079. # fi
  3080. # rsync -Ab --no-perms "${src}" "${target}"
  3081. # ;;
  3082.  
  3083. font**([0-9]).wav)
  3084. targetfile=$(printf %q "font.wav")
  3085. # fontcounter=$((fontcounter+1))
  3086. target="./$targetpath/$targetfile"
  3087. if [ "$verbosity" = "1" ]; then
  3088. echo "Converting ${src} to ${target}"
  3089. fi
  3090. rsync -Ab --no-perms "${src}" "${target}"
  3091. ;;
  3092.  
  3093. force**([0-9]).wav)
  3094. targetfile=$(printf %q "force$forcecounter.wav")
  3095. forcecounter=$((forcecounter+1))
  3096. target="./$targetpath/$targetfile"
  3097. if [ "$verbosity" = "1" ]; then
  3098. echo "Converting ${src} to ${target}"
  3099. fi
  3100. rsync -Ab --no-perms "${src}" "${target}"
  3101. ;;
  3102.  
  3103. hum**([0-9]).wav)
  3104. targetfile=$(printf %q "hum$humcounter.wav")
  3105. humcounter=$((humcounter+1))
  3106. target="./$targetpath/$targetfile"
  3107. if [ "$verbosity" = "1" ]; then
  3108. echo "Converting ${src} to ${target}"
  3109. fi
  3110. rsync -Ab --no-perms "${src}" "${target}"
  3111. ;;
  3112.  
  3113. in**([0-9]).wav)
  3114. targetfile=$(printf %q "pwroff$incounter.wav")
  3115. incounter=$((incounter+1))
  3116. target="./$targetpath/$targetfile"
  3117. if [ "$verbosity" = "1" ]; then
  3118. echo "Converting ${src} to ${target}"
  3119. fi
  3120. rsync -Ab --no-perms "${src}" "${target}"
  3121. ;;
  3122.  
  3123. lock**([0-9]).wav)
  3124. targetfile=$(printf %q "lockup$lockcounter.wav")
  3125. lockcounter=$((lockcounter+1))
  3126. target="./$targetpath/$targetfile"
  3127. if [ "$verbosity" = "1" ]; then
  3128. echo "Converting ${src} to ${target}"
  3129. fi
  3130. rsync -Ab --no-perms "${src}" "${target}"
  3131. ;;
  3132.  
  3133. out*([0-9]).wav)
  3134. targetfile=$(printf %q "pwron$outcounter.wav")
  3135. outcounter=$((outcounter+1))
  3136. target="./$targetpath/$targetfile"
  3137. if [ "$verbosity" = "1" ]; then
  3138. echo "Converting ${src} to ${target}"
  3139. fi
  3140. rsync -Ab --no-perms "${src}" "${target}"
  3141. ;;
  3142.  
  3143. hswing**([0-9]).wav)
  3144. targetfile=$(printf %q "hswing$hswingcounter.wav")
  3145. hswingcounter=$((hswingcounter+1))
  3146. target="./$targetpath/$targetfile"
  3147. if [ "$verbosity" = "1" ]; then
  3148. echo "Converting ${src} to ${target}"
  3149. fi
  3150. rsync -Ab --no-perms "${src}" "${target}"
  3151. ;;
  3152.  
  3153. lswing**([0-9]).wav)
  3154. targetfile=$(printf %q "lswing$lswingcounter.wav")
  3155. lswingcounter=$((lswingcounter+1))
  3156. target="./$targetpath/$targetfile"
  3157. if [ "$verbosity" = "1" ]; then
  3158. echo "Converting ${src} to ${target}"
  3159. fi
  3160. rsync -Ab --no-perms "${src}" "${target}"
  3161. ;;
  3162.  
  3163. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  3164. # Uncomment and adapt targetfile if needed later.
  3165. # swng**([0-9]).wav)
  3166. # targetfile=$(printf %q "swing$swingcounter.wav")
  3167. # swingcounter=$((swingcounter+1))
  3168. # target="./$targetpath/$targetfile"
  3169. # if [ "$verbosity" = "1" ]; then
  3170. # echo "Converting ${src} to ${target}"
  3171. # fi
  3172. # rsync -Ab --no-perms "${src}" "${target}"
  3173. # ;;
  3174.  
  3175. track**([0-9]).wav)
  3176. targetfile=$(printf %q "track$trackcounter.wav")
  3177. trackcounter=$((trackcounter+1))
  3178. if [ "$verbosity" = "1" ]; then
  3179. echo "Converting ${src} to ${target}"
  3180. fi
  3181. rsync -Ab --no-perms "${src}" "${target}"
  3182. ;;
  3183.  
  3184. *)
  3185. echo "No match found, ignoring file $src"
  3186.  
  3187. esac
  3188. done
  3189.  
  3190. echo " "
  3191. echo Coverted soundfont saved in "${targetpath}"
  3192. echo " "
  3193. done
  3194.  
  3195. echo " "
  3196. echo " "
  3197. echo "Soundfont conversion complete."
  3198. echo " If you see files with a '~' at the end, this file already existed in the output folder"
  3199. echo " before the conversion and was renamed to avoid accidental overwriting."
  3200. echo " "
  3201. echo " --- MTFBWY ---"
  3202.  
  3203. #-------------------------------------------------------------------------------------------------------------------------------------
  3204.  
  3205. elif [ "$boardchoice" = "XtoP" ]; then
  3206. echo "You chose Xenopixel to Proffie Soundfont converter."
  3207. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  3208. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  3209.  
  3210. read selection
  3211.  
  3212. if [ "$selection" = "1" ]; then
  3213. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  3214. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  3215.  
  3216. read input
  3217. dirs=$(find "$input" -maxdepth 0 -type d)
  3218.  
  3219. echo "Found the following soundfont folder:"
  3220. echo $dirs
  3221. echo "Does this folder only contain one soundfont? (y/n)"
  3222.  
  3223. read input2
  3224.  
  3225. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  3226. echo "Continuing conversion"
  3227. else
  3228. echo "Aborting program"
  3229. exit
  3230. fi
  3231.  
  3232. elif [ "$selection" = "2" ]; then
  3233. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  3234. echo "Please enter the name of the folder containing the soundfont folders."
  3235.  
  3236. read input
  3237. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  3238.  
  3239. echo "Found the following directories for soundfonts:"
  3240. echo $dirs
  3241. echo "Does each of these folders only contain one soundfont? (y/n)"
  3242.  
  3243. read input2
  3244.  
  3245. if [[ "$input2" = "y" || "$input2" = "Y" ]]; then
  3246. echo "Continuing conversion"
  3247. else
  3248. echo "Aborting program"
  3249. exit
  3250. fi
  3251.  
  3252. else
  3253. echo "Your selection is invalid. Aborting program"
  3254. exit
  3255. fi
  3256.  
  3257. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  3258. echo "Warning, the detailed report will produce a lot of console output!"
  3259.  
  3260. read verbosity
  3261.  
  3262. if [ "$verbosity" = "1" ]; then
  3263. echo "Logging progress to console"
  3264. else
  3265. echo "Logging only important steps"
  3266. fi
  3267.  
  3268.  
  3269. for dir in ${dirs[@]}; do
  3270.  
  3271. sounds=$(find "$dir" -type f -name '*.wav')
  3272.  
  3273. echo Converting soundfont in "${dir}".
  3274.  
  3275. targetpath="Converted_to_Proffie"
  3276. mkdir -p "${targetpath}"
  3277.  
  3278. if [ -d "${dir}/tracks" ]; then
  3279. mkdir -p "${targetpath}/${dir}/tracks"
  3280. rsync -Ab --no-perms "${dir}/tracks/" "${targetpath}/${dir}/tracks"
  3281. fi
  3282.  
  3283. blastercounter=1
  3284. # bootcounter=1
  3285. clashcounter=1
  3286. # colorcounter=1
  3287. dragcounter=1
  3288. # endlockcounter=1
  3289. fontcounter=1
  3290. forcecounter=1
  3291. hswingcounter=1
  3292. humcounter=1
  3293. incounter=1
  3294. lockcounter=1
  3295. lswingcounter=1
  3296. outcounter=1
  3297. # preoncounter=1
  3298. # spincounter=1
  3299. # stabcounter=1
  3300. # swingcounter=1
  3301.  
  3302. for src in ${sounds[@]}/!(tracks); do
  3303. case "${src##*/}" in
  3304.  
  3305. blaster*([0-9]).wav)
  3306. if [ $blastercounter = 2 ]; then
  3307. mkdir -p "${targetpath}/${dir}/blst"
  3308. mv "${target}" "./${targetpath}/${dir}/blst/${targetfile}"
  3309. echo "Moving ${targetfile} into ${dir}/blst subfolder"
  3310. fi
  3311. if [ "$blastercounter" -lt 10 ]; then
  3312. targetfile=$(printf %q "blst0$blastercounter.wav")
  3313. else
  3314. targetfile=$(printf %q "blst$blastercounter.wav")
  3315. fi
  3316. if [ $blastercounter -ge 2 ]; then
  3317. target="./${targetpath}/${dir}/blst/${targetfile}"
  3318. else
  3319. target="./${targetpath}/${dir}/${targetfile}"
  3320. fi
  3321. if [ "$verbosity" = "1" ]; then
  3322. echo "Converting ${src} to ${target}"
  3323. fi
  3324. rsync -Ab --no-perms "${src}" "${target}"
  3325. blastercounter=$((blastercounter+1))
  3326. ;;
  3327.  
  3328. # boot sounds are currently not supported by Xenopixel and therefore ignored.
  3329. # Uncomment counter above and code here and adapt targetfile if needed later.
  3330. # boot**([0-9]).wav)
  3331. # if [ "$bootcounter" -lt 10 ]; then
  3332. # targetfile=$(printf %q "boot0$bootcounter.wav")
  3333. # else
  3334. # targetfile=$(printf %q "boot$bootcounter.wav")
  3335. # fi
  3336. # bootcounter=$((bootcounter+1))
  3337. # target="./$targetpath/${dir}/boot/$targetfile"
  3338. # if [ "$verbosity" = "1" ]; then
  3339. # echo "Converting ${src} to ${target}"
  3340. # fi
  3341. # rsync -Ab --no-perms "${src}" "${target}"
  3342. # ;;
  3343.  
  3344. clash*([0-9]).wav)
  3345. if [ $clashcounter = 2 ]; then
  3346. mkdir -p "${targetpath}/${dir}/clsh"
  3347. mv "${target}" "./${targetpath}/${dir}/clsh/${targetfile}"
  3348. echo "Moving ${targetfile} into ${dir}/clsh subfolder"
  3349. fi
  3350. if [ "$clashcounter" -lt 10 ]; then
  3351. targetfile=$(printf %q "clsh0$clashcounter.wav")
  3352. else
  3353. targetfile=$(printf %q "clsh$clashcounter.wav")
  3354. fi
  3355. if [ $clashcounter -ge 2 ]; then
  3356. target="./${targetpath}/${dir}/clsh/${targetfile}"
  3357. else
  3358. target="./${targetpath}/${dir}/${targetfile}"
  3359. fi
  3360. if [ "$verbosity" = "1" ]; then
  3361. echo "Converting ${src} to ${target}"
  3362. fi
  3363. rsync -Ab --no-perms "${src}" "${target}"
  3364. clashcounter=$((clashcounter+1))
  3365. ;;
  3366.  
  3367. # color sounds are currently not supported by Xenopixel and therefore ignored.
  3368. # Uncomment counter above and code here and adapt targetfile if needed later.
  3369. # color**([0-9]).wav)
  3370. # targetfile=$(printf %q "ccchage$colorcounter.wav")
  3371. # colorcounter=$((colorcounter+1))
  3372. # target="./$targetpath/${dir}/ccchange/$targetfile"
  3373. # if [ "$verbosity" = "1" ]; then
  3374. # echo "Converting ${src} to ${target}"
  3375. # fi
  3376. # rsync -Ab --no-perms "${src}" "${target}"
  3377. # ;;
  3378.  
  3379. drag*([0-9]).wav)
  3380. if [ $dragcounter = 2 ]; then
  3381. mkdir -p "${targetpath}/${dir}/drag"
  3382. mv "${target}" "./${targetpath}/${dir}/drag/${targetfile}"
  3383. echo "Moving ${targetfile} into ${dir}/drag subfolder"
  3384. fi
  3385. if [ "$dragcounter" -lt 10 ]; then
  3386. targetfile=$(printf %q "drag0$dragcounter.wav")
  3387. else
  3388. targetfile=$(printf %q "drag$dragcounter.wav")
  3389. fi
  3390. if [ $dragcounter -ge 2 ]; then
  3391. target="./${targetpath}/${dir}/drag/${targetfile}"
  3392. else
  3393. target="./${targetpath}/${dir}/${targetfile}"
  3394. fi
  3395. if [ "$verbosity" = "1" ]; then
  3396. echo "Converting ${src} to ${target}"
  3397. fi
  3398. rsync -Ab --no-perms "${src}" "${target}"
  3399. dragcounter=$((dragcounter+1))
  3400. ;;
  3401.  
  3402. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  3403. # Uncomment counter above and code here and adapt targetfile if needed later.
  3404. # endlock**([0-9]).wav)
  3405. # targetfile=$(printf %q "endlock$endlockcounter.wav")
  3406. # endlockcounter=$((endlockcounter+1))
  3407. # target="./$targetpath/${dir}/endlock/$targetfile"
  3408. # if [ "$verbosity" = "1" ]; then
  3409. # echo "Converting ${src} to ${target}"
  3410. # fi
  3411. # rsync -Ab --no-perms "${src}" "${target}"
  3412. # ;;
  3413.  
  3414. font*([0-9]).wav)
  3415. if [ $fontcounter = 2 ]; then
  3416. mkdir -p "${targetpath}/${dir}/font"
  3417. mv "${target}" "./${targetpath}/${dir}/font/${targetfile}"
  3418. echo "Moving ${targetfile} into ${dir}/font subfolder"
  3419. fi
  3420. if [ "$fontcounter" -lt 10 ]; then
  3421. targetfile=$(printf %q "font0$fontcounter.wav")
  3422. else
  3423. targetfile=$(printf %q "font$fontcounter.wav")
  3424. fi
  3425. if [ $fontcounter -ge 2 ]; then
  3426. target="./${targetpath}/${dir}/font/${targetfile}"
  3427. else
  3428. target="./${targetpath}/${dir}/${targetfile}"
  3429. fi
  3430. if [ "$verbosity" = "1" ]; then
  3431. echo "Converting ${src} to ${target}"
  3432. fi
  3433. rsync -Ab --no-perms "${src}" "${target}"
  3434. fontcounter=$((fontcounter+1))
  3435. ;;
  3436.  
  3437. force*([0-9]).wav)
  3438. if [ $forcecounter = 2 ]; then
  3439. mkdir -p "${targetpath}/${dir}/force"
  3440. mv "${target}" "./${targetpath}/${dir}/force/${targetfile}"
  3441. echo "Moving ${targetfile} into ${dir}/force subfolder"
  3442. fi
  3443. if [ "$forcecounter" -lt 10 ]; then
  3444. targetfile=$(printf %q "force0$forcecounter.wav")
  3445. else
  3446. targetfile=$(printf %q "force$forcecounter.wav")
  3447. fi
  3448. if [ $forcecounter -ge 2 ]; then
  3449. target="./${targetpath}/${dir}/force/${targetfile}"
  3450. else
  3451. target="./${targetpath}/${dir}/${targetfile}"
  3452. fi
  3453. if [ "$verbosity" = "1" ]; then
  3454. echo "Converting ${src} to ${target}"
  3455. fi
  3456. rsync -Ab --no-perms "${src}" "${target}"
  3457. forcecounter=$((forcecounter+1))
  3458. ;;
  3459.  
  3460. hswing*([0-9]).wav)
  3461. if [ $hswingcounter = 2 ]; then
  3462. mkdir -p "${targetpath}/${dir}/swingh"
  3463. mv "${target}" "./${targetpath}/${dir}/swingh/${targetfile}"
  3464. echo "Moving ${targetfile} into ${dir}/swingh subfolder"
  3465. fi
  3466. if [ "$hswingcounter" -lt 10 ]; then
  3467. targetfile=$(printf %q "swingh0$hswingcounter.wav")
  3468. else
  3469. targetfile=$(printf %q "swingh$hswingcounter.wav")
  3470. fi
  3471. if [ $hswingcounter -ge 2 ]; then
  3472. target="./${targetpath}/${dir}/swingh/${targetfile}"
  3473. else
  3474. target="./${targetpath}/${dir}/${targetfile}"
  3475. fi
  3476. if [ "$verbosity" = "1" ]; then
  3477. echo "Converting ${src} to ${target}"
  3478. fi
  3479. rsync -Ab --no-perms "${src}" "${target}"
  3480. hswingcounter=$((hswingcounter+1))
  3481. ;;
  3482.  
  3483. hum*([0-9]).wav)
  3484. if [ $humcounter = 2 ]; then
  3485. mkdir -p "${targetpath}/${dir}/hum"
  3486. mv "${target}" "./${targetpath}/${dir}/hum/${targetfile}"
  3487. echo "Moving ${targetfile} into ${dir}/hum subfolder"
  3488. fi
  3489. if [ "$humcounter" -lt 10 ]; then
  3490. targetfile=$(printf %q "hum0$humcounter.wav")
  3491. else
  3492. targetfile=$(printf %q "hum$humcounter.wav")
  3493. fi
  3494. if [ $humcounter -ge 2 ]; then
  3495. target="./${targetpath}/${dir}/hum/${targetfile}"
  3496. else
  3497. target="./${targetpath}/${dir}/${targetfile}"
  3498. fi
  3499. if [ "$verbosity" = "1" ]; then
  3500. echo "Converting ${src} to ${target}"
  3501. fi
  3502. rsync -Ab --no-perms "${src}" "${target}"
  3503. humcounter=$((humcounter+1))
  3504. ;;
  3505.  
  3506. lswing*([0-9]).wav)
  3507. if [ $lswingcounter = 2 ]; then
  3508. mkdir -p "${targetpath}/${dir}/swingl"
  3509. mv "${target}" "./${targetpath}/${dir}/swingl/${targetfile}"
  3510. echo "Moving ${targetfile} into ${dir}/swingl subfolder"
  3511. fi
  3512. if [ "$lswingcounter" -lt 10 ]; then
  3513. targetfile=$(printf %q "swingl0$lswingcounter.wav")
  3514. else
  3515. targetfile=$(printf %q "swingl$lswingcounter.wav")
  3516. fi
  3517. if [ $lswingcounter -ge 2 ]; then
  3518. target="./${targetpath}/${dir}/swingl/${targetfile}"
  3519. else
  3520. target="./${targetpath}/${dir}/${targetfile}"
  3521. fi
  3522. if [ "$verbosity" = "1" ]; then
  3523. echo "Converting ${src} to ${target}"
  3524. fi
  3525. rsync -Ab --no-perms "${src}" "${target}"
  3526. lswingcounter=$((lswingcounter+1))
  3527. ;;
  3528.  
  3529. in*([0-9]).wav)
  3530. if [ $incounter = 2 ]; then
  3531. mkdir -p "${targetpath}/${dir}/in"
  3532. mv "${target}" "./${targetpath}/${dir}/in/${targetfile}"
  3533. echo "Moving ${targetfile} into ${dir}/in subfolder"
  3534. fi
  3535. if [ "$incounter" -lt 10 ]; then
  3536. targetfile=$(printf %q "in0$incounter.wav")
  3537. else
  3538. targetfile=$(printf %q "in$incounter.wav")
  3539. fi
  3540. if [ $incounter -ge 2 ]; then
  3541. target="./${targetpath}/${dir}/in/${targetfile}"
  3542. else
  3543. target="./${targetpath}/${dir}/${targetfile}"
  3544. fi
  3545. if [ "$verbosity" = "1" ]; then
  3546. echo "Converting ${src} to ${target}"
  3547. fi
  3548. rsync -Ab --no-perms "${src}" "${target}"
  3549. incounter=$((incounter+1))
  3550. ;;
  3551.  
  3552. out*([0-9]).wav)
  3553. if [ $outcounter = 2 ]; then
  3554. mkdir -p "${targetpath}/${dir}/out"
  3555. mv "${target}" "./${targetpath}/${dir}/out/${targetfile}"
  3556. echo "Moving ${targetfile} into ${dir}/out subfolder"
  3557. fi
  3558. if [ "$outcounter" -lt 10 ]; then
  3559. targetfile=$(printf %q "out0$outcounter.wav")
  3560. else
  3561. targetfile=$(printf %q "out$outcounter.wav")
  3562. fi
  3563. if [ $outcounter -ge 2 ]; then
  3564. target="./${targetpath}/${dir}/out/${targetfile}"
  3565. else
  3566. target="./${targetpath}/${dir}/${targetfile}"
  3567. fi
  3568. if [ "$verbosity" = "1" ]; then
  3569. echo "Converting ${src} to ${target}"
  3570. fi
  3571. rsync -Ab --no-perms "${src}" "${target}"
  3572. outcounter=$((outcounter+1))
  3573. ;;
  3574.  
  3575. lock*([0-9]).wav)
  3576. if [ $lockcounter = 2 ]; then
  3577. mkdir -p "${targetpath}/${dir}/lock"
  3578. mv "${target}" "./${targetpath}/${dir}/lock/${targetfile}"
  3579. echo "Moving ${targetfile} into ${dir}/lock subfolder"
  3580. fi
  3581. if [ "$lockcounter" -lt 10 ]; then
  3582. targetfile=$(printf %q "lock0$lockcounter.wav")
  3583. else
  3584. targetfile=$(printf %q "lock$lockcounter.wav")
  3585. fi
  3586. if [ $lockcounter -ge 2 ]; then
  3587. target="./${targetpath}/${dir}/lock/${targetfile}"
  3588. else
  3589. target="./${targetpath}/${dir}/${targetfile}"
  3590. fi
  3591. if [ "$verbosity" = "1" ]; then
  3592. echo "Converting ${src} to ${target}"
  3593. fi
  3594. rsync -Ab --no-perms "${src}" "${target}"
  3595. lockcounter=$((lockcounter+1))
  3596. ;;
  3597.  
  3598. # preon sounds are currently not supported by Xenopixel and therefore ignored.
  3599. # Uncomment counter above and code here and adapt targetfile if needed later.
  3600. # preon*([0-9]).wav)
  3601. # if [ $preoncounter = 2 ]; then
  3602. # mkdir -p "${targetpath}/${dir}/preon"
  3603. # mv "${target}" "./${targetpath}/${dir}/preon/${targetfile}"
  3604. # echo "Moving ${targetfile} into ${dir}/preon subfolder"
  3605. # fi
  3606. # if [ "$preoncounter" -lt 10 ]; then
  3607. # targetfile=$(printf %q "preon0$preoncounter.wav")
  3608. # else
  3609. # targetfile=$(printf %q "preon$preoncounter.wav")
  3610. # fi
  3611. # if [ $preoncounter -ge 2 ]; then
  3612. # target="./${targetpath}/${dir}/preon/${targetfile}"
  3613. # else
  3614. # target="./${targetpath}/${dir}/${targetfile}"
  3615. # fi
  3616. # if [ "$verbosity" = "1" ]; then
  3617. # echo "Converting ${src} to ${target}"
  3618. # fi
  3619. # rsync -Ab --no-perms "${src}" "${target}"
  3620. # preoncounter=$((preoncounter+1))
  3621. # ;;
  3622.  
  3623. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  3624. # Uncomment counter above and code here and adapt targetfile if needed later.
  3625. # spin*([0-9]).wav)
  3626. # if [ $spincounter = 2 ]; then
  3627. # mkdir -p "${targetpath}/${dir}/spin"
  3628. # mv "${target}" "./${targetpath}/${dir}/spin/${targetfile}"
  3629. # echo "Moving ${targetfile} into ${dir}/spin subfolder"
  3630. # fi
  3631. # if [ "$spincounter" -lt 10 ]; then
  3632. # targetfile=$(printf %q "spin0$spincounter.wav")
  3633. # else
  3634. # targetfile=$(printf %q "spin$spincounter.wav")
  3635. # fi
  3636. # if [ $spincounter -ge 2 ]; then
  3637. # target="./${targetpath}/${dir}/spin/${targetfile}"
  3638. # else
  3639. # target="./${targetpath}/${dir}/${targetfile}"
  3640. # fi
  3641. # if [ "$verbosity" = "1" ]; then
  3642. # echo "Converting ${src} to ${target}"
  3643. # fi
  3644. # rsync -Ab --no-perms "${src}" "${target}"
  3645. # spincounter=$((spincounter+1))
  3646. # ;;
  3647.  
  3648. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  3649. # Uncomment counter above and code here and adapt targetfile if needed later.
  3650. # stab*([0-9]).wav)
  3651. # if [ $stabcounter = 2 ]; then
  3652. # mkdir -p "${targetpath}/${dir}/stab"
  3653. # mv "${target}" "./${targetpath}/${dir}/stab/${targetfile}"
  3654. # echo "Moving ${targetfile} into ${dir}/stab subfolder"
  3655. # fi
  3656. # if [ "$stabcounter" -lt 10 ]; then
  3657. # targetfile=$(printf %q "stab0$stabcounter.wav")
  3658. # else
  3659. # targetfile=$(printf %q "stab$stabcounter.wav")
  3660. # fi
  3661. # if [ $stabcounter -ge 2 ]; then
  3662. # target="./${targetpath}/${dir}/stab/${targetfile}"
  3663. # else
  3664. # target="./${targetpath}/${dir}/${targetfile}"
  3665. # fi
  3666. # if [ "$verbosity" = "1" ]; then
  3667. # echo "Converting ${src} to ${target}"
  3668. # fi
  3669. # rsync -Ab --no-perms "${src}" "${target}"
  3670. # stabcounter=$((stabcounter+1))
  3671. # ;;
  3672.  
  3673. # Accent Swing sounds are currently not supported by Xenopixel and therefore ignored.
  3674. # Uncomment counter above and code here and adapt targetfile if needed later.
  3675. # swing*([0-9]).wav)
  3676. # if [ $swingcounter = 2 ]; then
  3677. # mkdir -p "${targetpath}/${dir}/swng"
  3678. # mv "${target}" "./${targetpath}/${dir}/swng/${targetfile}"
  3679. # echo "Moving ${targetfile} into ${dir}/swng subfolder"
  3680. # fi
  3681. # if [ "$swingcounter" -lt 10 ]; then
  3682. # targetfile=$(printf %q "swng0$swingcounter.wav")
  3683. # else
  3684. # targetfile=$(printf %q "swng$swingcounter.wav")
  3685. # fi
  3686. # if [ $swingcounter -ge 2 ]; then
  3687. # target="./${targetpath}/${dir}/swng/${targetfile}"
  3688. # else
  3689. # target="./${targetpath}/${dir}/${targetfile}"
  3690. # fi
  3691. # if [ "$verbosity" = "1" ]; then
  3692. # echo "Converting ${src} to ${target}"
  3693. # fi
  3694. # rsync -Ab --no-perms "${src}" "${target}"
  3695. # swingcounter=$((swingcounter+1))
  3696. # ;;
  3697.  
  3698.  
  3699. *)
  3700. echo "No match found, ignoring file $src"
  3701.  
  3702. esac
  3703. done
  3704.  
  3705. echo Coverted soundfont saved in "${targetpath}"
  3706. done
  3707.  
  3708. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  3709. echo "before the conversion and was renamed to avoid accidental overwriting."
  3710. echo " "
  3711. echo " --- MTFBWY ---"
  3712. else
  3713. echo "Invalid conversion choice, please run the tool again."
  3714. echo " "
  3715. echo " "
  3716. fi
Add Comment
Please, Sign In to add comment