NoSloppy

Untitled

Oct 27th, 2021 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.46 KB | None | 0 0
  1. #!/bin/sh
  2. shopt -s extglob
  3. IFS=$'\n'
  4.  
  5. echo "Hello, welcome to the Soundfont converter for Windows."
  6. echo "To convert a soundfont from CFX to Proffie, enter 'CtoP'"
  7. echo "To convert a soundfont from CFX to Xenopixel, enter 'CtoX'"
  8. echo "To convert a soundfont from Proffie to CFX, enter 'PtoC'"
  9. echo "To convert a soundfont from Proffie to Xenopixel, enter 'PtoX'"
  10. echo "To convert a soundfont from Xenopixel to CFX, enter 'XtoC'"
  11. echo "To convert a soundfont from Xenopixel to Proffie, enter 'XtoP'"
  12. echo "To rename a Proffie soundfont for ideal performance, enter 'PtoP'"
  13.  
  14.  
  15. read boardchoice
  16.  
  17. if [ "$boardchoice" = "CtoP" ]; then
  18. echo "You chose CFX to Proffie Soundfont converter."
  19. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  20. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  21.  
  22. read selection
  23.  
  24. if [ "$selection" = "1" ]; then
  25. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  26. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  27.  
  28. read input
  29. dirs=$(find "$input" -maxdepth 0 -type d)
  30.  
  31. echo "Found the following soundfont folder:"
  32. echo $dirs
  33. echo "Does this folder only contain one soundfont? (y/n)"
  34.  
  35. read input2
  36.  
  37. if [ "$input2" = "y" ]; then
  38. echo "Continuing conversion"
  39. else
  40. echo "Aborting program"
  41. exit
  42. fi
  43.  
  44. elif [ "$selection" = "2" ]; then
  45. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  46. echo "Please enter the name of the folder containing the soundfont folders."
  47.  
  48. read input
  49. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  50.  
  51. echo "Found the following directories for soundfonts:"
  52. echo $dirs
  53. echo "Does each of these folders only contain one soundfont? (y/n)"
  54.  
  55. read input2
  56.  
  57. if [ "$input2" = "y" ]; then
  58. echo "Continuing conversion"
  59. else
  60. echo "Aborting program"
  61. exit
  62. fi
  63.  
  64. else
  65. echo "Your selection is invalid. Aborting program"
  66. exit
  67. fi
  68.  
  69. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  70. echo "Warning, the detailed report will produce a lot of console output!"
  71.  
  72. read verbosity
  73.  
  74. if [ "$verbosity" = "1" ]; then
  75. echo "Logging progress to console"
  76. else
  77. echo "Logging only important steps"
  78. fi
  79.  
  80. for dir in ${dirs[@]}; do
  81.  
  82. sounds=$(find "$dir" -type f -name '*.wav')
  83.  
  84. echo Converting soundfont in "${dir}".
  85.  
  86. targetpath="Converted_to_Proffie"
  87. mkdir -p "${targetpath}"
  88. cd "${targetpath}"
  89. mkdir -p "${dir}/bgndrag"
  90. mkdir -p "${dir}/bgnlock"
  91. mkdir -p "${dir}/blst"
  92. mkdir -p "${dir}/boot"
  93. mkdir -p "${dir}/clsh"
  94. mkdir -p "${dir}/ccchange"
  95. mkdir -p "${dir}/drag"
  96. mkdir -p "${dir}/enddrag"
  97. mkdir -p "${dir}/endlock"
  98. mkdir -p "${dir}/font"
  99. mkdir -p "${dir}/force"
  100. mkdir -p "${dir}/swingh"
  101. mkdir -p "${dir}/hum"
  102. mkdir -p "${dir}/swingl"
  103. mkdir -p "${dir}/in"
  104. mkdir -p "${dir}/out"
  105. mkdir -p "${dir}/lock"
  106. mkdir -p "${dir}/preon"
  107. mkdir -p "${dir}/spin"
  108. mkdir -p "${dir}/stab"
  109. mkdir -p "${dir}/swng"
  110. mkdir -p "${dir}/tracks"
  111. cd ".."
  112.  
  113. blastercounter=1
  114. bootcounter=1
  115. clashcounter=1
  116. colorcounter=1
  117. dragcounter=1
  118. enddragcounter=1
  119. endlockcounter=1
  120. fontcounter=1
  121. forcecounter=1
  122. hswingcounter=1
  123. humcounter=1
  124. lockupcounter=1
  125. lswingcounter=1
  126. poweroffcounter=1
  127. poweroncounter=1
  128. preoncounter=1
  129. spincounter=1
  130. stabcounter=1
  131. startdragcounter=1
  132. startlockcounter=1
  133. swingcounter=1
  134. trackcounter=1
  135.  
  136. for src in ${sounds[@]}; do
  137. case "${src##*/}" in
  138.  
  139. blaster*([0-9]).wav)
  140. if [ "$blastercounter" -lt 10 ]; then
  141. targetfile=$(printf %q "blst0$blastercounter.wav")
  142. else
  143. targetfile=$(printf %q "blst$blastercounter.wav")
  144. fi
  145. blastercounter=$((blastercounter+1))
  146. target="./${targetpath}/${dir}/blst/${targetfile}"
  147. if [ "$verbosity" = "1" ]; then
  148. echo "Converting ${src} to ${target}"
  149. fi
  150. cp -b "${src}" "${target}"
  151. ;;
  152.  
  153. boot*([0-9]).wav)
  154. if [ "$bootcounter" -lt 10 ]; then
  155. targetfile=$(printf %q "boot0$bootcounter.wav")
  156. else
  157. targetfile=$(printf %q "boot$bootcounter.wav")
  158. fi
  159. bootcounter=$((bootcounter+1))
  160. target="./$targetpath/${dir}/boot/$targetfile"
  161. if [ "$verbosity" = "1" ]; then
  162. echo "Converting ${src} to ${target}"
  163. fi
  164. cp -b "${src}" "${target}"
  165. ;;
  166.  
  167. clash*([0-9]).wav)
  168. if [ "$clashcounter" -lt 10 ]; then
  169. targetfile=$(printf %q "clsh0$clashcounter.wav")
  170. else
  171. targetfile=$(printf %q "clsh$clashcounter.wav")
  172. fi
  173. clashcounter=$((clashcounter+1))
  174. target="./$targetpath/${dir}/clsh/$targetfile"
  175. if [ "$verbosity" = "1" ]; then
  176. echo "Converting ${src} to ${target}"
  177. fi
  178. cp -b "${src}" "${target}"
  179. ;;
  180.  
  181. color*([0-9]).wav)
  182. targetfile=$(printf %q "ccchage$colorcounter.wav")
  183. colorcounter=$((colorcounter+1))
  184. target="./$targetpath/${dir}/ccchange/$targetfile"
  185. if [ "$verbosity" = "1" ]; then
  186. echo "Converting ${src} to ${target}"
  187. fi
  188. cp -b "${src}" "${target}"
  189. ;;
  190.  
  191. drag*([0-9]).wav)
  192. if [ "$dragcounter" -lt 10 ]; then
  193. targetfile=$(printf %q "drag0$dragcounter.wav")
  194. else
  195. targetfile=$(printf %q "drag$dragcounter.wav")
  196. fi
  197. dragcounter=$((dragcounter+1))
  198. target="./$targetpath/${dir}/drag/$targetfile"
  199. if [ "$verbosity" = "1" ]; then
  200. echo "Converting ${src} to ${target}"
  201. fi
  202. cp -b "${src}" "${target}"
  203. ;;
  204.  
  205. enddrag*([0-9]).wav)
  206. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  207. enddragcounter=$((enddragcounter+1))
  208. target="./$targetpath/${dir}/enddrag/$targetfile"
  209. if [ "$verbosity" = "1" ]; then
  210. echo "Converting ${src} to ${target}"
  211. fi
  212. cp -b "${src}" "${target}"
  213. ;;
  214.  
  215. endlock*([0-9]).wav)
  216. targetfile=$(printf %q "endlock$endlockcounter.wav")
  217. endlockcounter=$((endlockcounter+1))
  218. target="./$targetpath/${dir}/endlock/$targetfile"
  219. if [ "$verbosity" = "1" ]; then
  220. echo "Converting ${src} to ${target}"
  221. fi
  222. cp -b "${src}" "${target}"
  223. ;;
  224.  
  225. font*([0-9]).wav)
  226. if [ "$fontcounter" -lt 10 ]; then
  227. targetfile=$(printf %q "font0$fontcounter.wav")
  228. else
  229. targetfile=$(printf %q "font$fontcounter.wav")
  230. fi
  231. fontcounter=$((fontcounter+1))
  232. target="./$targetpath/${dir}/font/$targetfile"
  233. if [ "$verbosity" = "1" ]; then
  234. echo "Converting ${src} to ${target}"
  235. fi
  236. cp -b "${src}" "${target}"
  237. ;;
  238.  
  239. force*|combo*([0-9]).wav)
  240. if [ "$forcecounter" -lt 10 ]; then
  241. targetfile=$(printf %q "force0$forcecounter.wav")
  242. else
  243. targetfile=$(printf %q "force$forcecounter.wav")
  244. fi
  245. forcecounter=$((forcecounter+1))
  246. target="./$targetpath/${dir}/force/$targetfile"
  247. if [ "$verbosity" = "1" ]; then
  248. echo "Converting ${src} to ${target}"
  249. fi
  250. cp -b "${src}" "${target}"
  251. ;;
  252.  
  253. hswing*([0-9]).wav)
  254. if [ "$hswingcounter" -lt 10 ]; then
  255. targetfile=$(printf %q "swingh0$hswingcounter.wav")
  256. else
  257. targetfile=$(printf %q "swingh$hswingcounter.wav")
  258. fi
  259. hswingcounter=$((hswingcounter+1))
  260. target="./$targetpath/${dir}/swingh/$targetfile"
  261. if [ "$verbosity" = "1" ]; then
  262. echo "Converting ${src} to ${target}"
  263. fi
  264. cp -b "${src}" "${target}"
  265. ;;
  266.  
  267. hum**([0-9]).wav)
  268. if [ "$humcounter" -lt 10 ]; then
  269. targetfile=$(printf %q "hum0$humcounter.wav")
  270. else
  271. targetfile=$(printf %q "hum$humcounter.wav")
  272. fi
  273. humcounter=$((humcounter+1))
  274. target="./$targetpath/${dir}/hum/$targetfile"
  275. if [ "$verbosity" = "1" ]; then
  276. echo "Converting ${src} to ${target}"
  277. fi
  278. cp -b "${src}" "${target}"
  279. ;;
  280.  
  281. lswing*([0-9]).wav)
  282. if [ "$lswingcounter" -lt 10 ]; then
  283. targetfile=$(printf %q "swingl0$lswingcounter.wav")
  284. else
  285. targetfile=$(printf %q "swingl$lswingcounter.wav")
  286. fi
  287. lswingcounter=$((lswingcounter+1))
  288. target="./$targetpath/${dir}/swingl/$targetfile"
  289. if [ "$verbosity" = "1" ]; then
  290. echo "Converting ${src} to ${target}"
  291. fi
  292. cp -b "${src}" "${target}"
  293. ;;
  294.  
  295. lock**([0-9]).wav)
  296. if [ "$lockupcounter" -lt 10 ]; then
  297. targetfile=$(printf %q "lock0$lockupcounter.wav")
  298. else
  299. targetfile=$(printf %q "lock$lockupcounter.wav")
  300. fi
  301. lockupcounter=$((lockupcounter+1))
  302. target="./$targetpath/${dir}/lock/$targetfile"
  303. if [ "$verbosity" = "1" ]; then
  304. echo "Converting ${src} to ${target}"
  305. fi
  306. cp -b "${src}" "${target}"
  307. ;;
  308.  
  309. poweroff*|pwroff*([0-9]).wav)
  310. if [ "$poweroffcounter" -lt 10 ]; then
  311. targetfile=$(printf %q "in0$poweroffcounter.wav")
  312. else
  313. targetfile=$(printf %q "in$poweroffcounter.wav")
  314. fi
  315. poweroffcounter=$((poweroffcounter+1))
  316. target="./$targetpath/${dir}/in/$targetfile"
  317. if [ "$verbosity" = "1" ]; then
  318. echo "Converting ${src} to ${target}"
  319. fi
  320. cp -b "${src}" "${target}"
  321. ;;
  322.  
  323. poweron**([0-9]).wav)
  324. if [ "$poweroncounter" -lt 10 ]; then
  325. targetfile=$(printf %q "out0$poweroncounter.wav")
  326. else
  327. targetfile=$(printf %q "out$poweroncounter.wav")
  328. fi
  329. poweroncounter=$((poweroncounter+1))
  330. target="./$targetpath/${dir}/out/$targetfile"
  331. if [ "$verbosity" = "1" ]; then
  332. echo "Converting ${src} to ${target}"
  333. fi
  334. cp -b "${src}" "${target}"
  335. ;;
  336.  
  337. preon*([0-9]).wav)
  338. if [ "$preoncounter" -lt 10 ]; then
  339. targetfile=$(printf %q "preon0$preoncounter.wav")
  340. else
  341. targetfile=$(printf %q "preon$preoncounter.wav")
  342. fi
  343. preoncounter=$((preoncounter+1))
  344. target="./${targetpath}/${dir}/preon/${targetfile}"
  345. if [ "$verbosity" = "1" ]; then
  346. echo "Converting ${src} to ${target}"
  347. fi
  348. cp -b "${src}" "${target}"
  349. ;;
  350.  
  351. spin*([0-9]).wav)
  352. if [ "$spincounter" -lt 10 ]; then
  353. targetfile=$(printf %q "spin0$spincounter.wav")
  354. else
  355. targetfile=$(printf %q "spin$spincounter.wav")
  356. fi
  357. spincounter=$((spincounter+1))
  358. target="./$targetpath/${dir}/spin/$targetfile"
  359. if [ "$verbosity" = "1" ]; then
  360. echo "Converting ${src} to ${target}"
  361. fi
  362. cp -b "${src}" "${target}"
  363. ;;
  364.  
  365. stab*([0-9]).wav)
  366. if [ "$stabcounter" -lt 10 ]; then
  367. targetfile=$(printf %q "stab0$stabcounter.wav")
  368. else
  369. targetfile=$(printf %q "stab$stabcounter.wav")
  370. fi
  371. stabcounter=$((stabcounter+1))
  372. target="./$targetpath/${dir}/stab/$targetfile"
  373. if [ "$verbosity" = "1" ]; then
  374. echo "Converting ${src} to ${target}"
  375. fi
  376. cp -b "${src}" "${target}"
  377. ;;
  378.  
  379. startdrag*([0-9]).wav)
  380. targetfile=$(printf %q "bgndrag$startdragcounter.wav")
  381. startdragcounter=$((startdragcounter+1))
  382. target="./$targetpath/${dir}/bgndrag/$targetfile"
  383. if [ "$verbosity" = "1" ]; then
  384. echo "Converting ${src} to ${target}"
  385. fi
  386. cp -b "${src}" "${target}"
  387. ;;
  388.  
  389. startlock*([0-9]).wav)
  390. targetfile=$(printf %q "bgnlock$startlockcounter.wav")
  391. startlockcounter=$((startlockcounter+1))
  392. target="./$targetpath/${dir}/bgnlock/$targetfile"
  393. if [ "$verbosity" = "1" ]; then
  394. echo "Converting ${src} to ${target}"
  395. fi
  396. cp -b "${src}" "${target}"
  397. ;;
  398.  
  399. swing*([0-9]).wav)
  400. if [ "$swingcounter" -lt 10 ]; then
  401. targetfile=$(printf %q "swng0$swingcounter.wav")
  402. else
  403. targetfile=$(printf %q "swng$swingcounter.wav")
  404. fi
  405. swingcounter=$((swingcounter+1))
  406. target="./$targetpath/${dir}/swng/$targetfile"
  407. if [ "$verbosity" = "1" ]; then
  408. echo "Converting ${src} to ${target}"
  409. fi
  410. cp -b "${src}" "${target}"
  411. ;;
  412.  
  413. track*([0-9]).wav)
  414. if [ "$trackcounter" -lt 10 ]; then
  415. targetfile=$(printf %q "track0$trackcounter.wav")
  416. else
  417. targetfile=$(printf %q "track$trackcounter.wav")
  418. fi
  419. trackcounter=$((trackcounter+1))
  420. target="./$targetpath/${dir}/tracks/$targetfile"
  421. if [ "$verbosity" = "1" ]; then
  422. echo "Converting ${src} to ${target}"
  423. fi
  424. cp -b "${src}" "${target}"
  425. ;;
  426.  
  427. *)
  428. echo "No match found, ignoring file $src"
  429.  
  430. esac
  431. done
  432.  
  433. echo Coverted soundfont saved in "${targetpath}"
  434. done
  435.  
  436. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  437. echo "before the conversion and was renamed to avoid accidental overwriting."
  438. echo " "
  439.  
  440. #-------------------------------------------------------------------------------------------------------------------------------------
  441.  
  442. elif [ "$boardchoice" = "CtoX" ]; then
  443. echo "You chose CFX to Xenopixel Soundfont converter."
  444. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  445. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  446.  
  447. read selection
  448.  
  449. if [ "$selection" = "1" ]; then
  450. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  451. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  452.  
  453. read input
  454. dirs=$(find "$input" -maxdepth 0 -type d)
  455.  
  456. echo "Found the following soundfont folder:"
  457. echo $dirs
  458. echo "Does this folder only contain one soundfont? (y/n)"
  459.  
  460. read input2
  461.  
  462. if [ "$input2" = "y" ]; then
  463. echo "Continuing conversion"
  464. else
  465. echo "Aborting program"
  466. exit
  467. fi
  468.  
  469. elif [ "$selection" = "2" ]; then
  470. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  471. echo "Please enter the name of the folder containing the soundfont folders."
  472.  
  473. read input
  474. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  475.  
  476. echo "Found the following directories for soundfonts:"
  477. echo $dirs
  478. echo "Does each of these folders only contain one soundfont? (y/n)"
  479.  
  480. read input2
  481.  
  482. if [ "$input2" = "y" ]; then
  483. echo "Continuing conversion"
  484. else
  485. echo "Aborting program"
  486. exit
  487. fi
  488.  
  489. else
  490. echo "Your selection is invalid. Aborting program"
  491. exit
  492. fi
  493.  
  494. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  495. echo "Warning, the detailed report will produce a lot of console output!"
  496.  
  497. read verbosity
  498.  
  499. if [ "$verbosity" = "1" ]; then
  500. echo "Logging progress to console"
  501. else
  502. echo "Logging only important steps"
  503. fi
  504.  
  505. for dir in ${dirs[@]}; do
  506.  
  507. sounds=$(find "$dir" -type f -name '*.wav')
  508.  
  509. echo Converting soundfont in "${dir}".
  510.  
  511. targetpath="Converted_to_Xenopixel"
  512. mkdir -p "${targetpath}"
  513. mkdir -p "${targetpath}/${dir}/set"
  514. mkdir -p "${targetpath}/${dir}/tracks"
  515. blastercounter=1
  516. bootcounter=1
  517. clashcounter=1
  518. # colorcounter=1
  519. dragcounter=1
  520. # endlockcounter=1
  521. fontcounter=1
  522. forcecounter=1
  523. hswingcounter=1
  524. humcounter=1
  525. lswingcounter=1
  526. poweroffcounter=1
  527. poweroncounter=1
  528. lockcounter=1
  529. lockupcounter=1
  530. preoncounter=1
  531. # spincounter=1
  532. # stabcounter=1
  533. # swingcounter=1
  534. trackcounter=1
  535.  
  536. for src in ${sounds[@]}; do
  537. case "${src##*/}" in
  538.  
  539. blaster*([0-9]).wav)
  540. targetfile="blaster ($blastercounter).wav"
  541. blastercounter=$((blastercounter+1))
  542. target="./${targetpath}/${dir}/${targetfile}"
  543. if [ "$verbosity" = "1" ]; then
  544. echo "Converting ${src} to ${target}"
  545. fi
  546. cp -b "${src}" "${target}"
  547. ;;
  548.  
  549. # boot sounds are converted to 'power on.wav and live in the 'set' folder.
  550. # If there are more than one converted, the last one will be the resulting file.
  551. boot*([0-9]).wav)
  552. targetfile="power on.wav"
  553. bootcounter=$((bootcounter+1))
  554. target="./$targetpath/${dir}/set/$targetfile"
  555. if [ "$verbosity" = "1" ]; then
  556. echo "Converting ${src} to ${target}"
  557. fi
  558. cp -b "${src}" "${target}"
  559. ;;
  560.  
  561. clash*([0-9]).wav)
  562. targetfile="clash ($clashcounter).wav"
  563. clashcounter=$((clashcounter+1))
  564. target="./$targetpath//${dir}/$targetfile"
  565. if [ "$verbosity" = "1" ]; then
  566. echo "Converting ${src} to ${target}"
  567. fi
  568. cp -b "${src}" "${target}"
  569. ;;
  570.  
  571. # color sounds are currently not supported by Xenopixel and therefore ignored.
  572. # Uncomment counter above and code here and adapt targetfile if needed later.
  573. # color*([0-9]).wav)
  574. # targetfile="color ($colorcounter).wav"
  575. # colorcounter=$((colorcounter+1))
  576. # target="./${targetpath}/${dir}/${targetfile}"
  577. # if [ "$verbosity" = "1" ]; then
  578. # echo "Converting ${src} to ${target}"
  579. # fi
  580. # cp -b "${src}" "${target}"
  581. # ;;
  582.  
  583. drag*([0-9]).wav)
  584. targetfile="drag ($dragcounter).wav"
  585. dragcounter=$((dragcounter+1))
  586. target="./$targetpath//${dir}/$targetfile"
  587. if [ "$verbosity" = "1" ]; then
  588. echo "Converting ${src} to ${target}"
  589. fi
  590. cp -b "${src}" "${target}"
  591. ;;
  592.  
  593. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  594. # Uncomment counter above and code here and adapt targetfile if needed later.
  595. # endlock*([0-9]).wav)
  596. # targetfile="endlock ($endlockcounter).wav"
  597. # endlockcounter=$((endlockcounter+1))
  598. # target="./${targetpath}/${dir}/${targetfile}"
  599. # if [ "$verbosity" = "1" ]; then
  600. # echo "Converting ${src} to ${target}"
  601. # fi
  602. # cp -b "${src}" "${target}"
  603. # ;;
  604.  
  605. font*([0-9]).wav)
  606. targetfile="font ($fontcounter).wav"
  607. fontcounter=$((fontcounter+1))
  608. target="./$targetpath//${dir}/$targetfile"
  609. if [ "$verbosity" = "1" ]; then
  610. echo "Converting ${src} to ${target}"
  611. fi
  612. cp -b "${src}" "${target}"
  613. ;;
  614.  
  615. force*|combo*([0-9]).wav)
  616. targetfile="force ($forcecounter).wav"
  617. forcecounter=$((forcecounter+1))
  618. target="./$targetpath//${dir}/$targetfile"
  619. if [ "$verbosity" = "1" ]; then
  620. echo "Converting ${src} to ${target}"
  621. fi
  622. cp -b "${src}" "${target}"
  623. ;;
  624.  
  625. hum*|humM*([0-9]).wav)
  626. targetfile="hum ($humcounter).wav"
  627. humcounter=$((humcounter+1))
  628. target="./$targetpath//${dir}/$targetfile"
  629. if [ "$verbosity" = "1" ]; then
  630. echo "Converting ${src} to ${target}"
  631. fi
  632. cp -b "${src}" "${target}"
  633. ;;
  634.  
  635. poweroff*|pwroff*([0-9]).wav)
  636. targetfile="in ($poweroffcounter).wav"
  637. poweroffcounter=$((poweroffcounter+1))
  638. target="./$targetpath//${dir}/$targetfile"
  639. if [ "$verbosity" = "1" ]; then
  640. echo "Converting ${src} to ${target}"
  641. fi
  642. cp -b "${src}" "${target}"
  643. ;;
  644.  
  645. lock**([0-9]).wav)
  646. targetfile="lock ($lockcounter).wav"
  647. lockcounter=$((lockcounter+1))
  648. target="./$targetpath//${dir}/$targetfile"
  649. if [ "$verbosity" = "1" ]; then
  650. echo "Converting ${src} to ${target}"
  651. fi
  652. cp -b "${src}" "${target}"
  653. ;;
  654.  
  655. poweron**([0-9]).wav)
  656. targetfile="out ($poweroncounter).wav"
  657. poweroncounter=$((poweroncounter+1))
  658. target="./$targetpath//${dir}/$targetfile"
  659. if [ "$verbosity" = "1" ]; then
  660. echo "Converting ${src} to ${target}"
  661. fi
  662. cp -b "${src}" "${target}"
  663. ;;
  664.  
  665. hswing*([0-9]).wav)
  666. targetfile="hswing ($hswingcounter).wav"
  667. hswingcounter=$((hswingcounter+1))
  668. target="./$targetpath//${dir}/$targetfile"
  669. if [ "$verbosity" = "1" ]; then
  670. echo "Converting ${src} to ${target}"
  671. fi
  672. cp -b "${src}" "${target}"
  673. ;;
  674.  
  675. lswing*([0-9]).wav)
  676. targetfile="lswing ($lswingcounter).wav"
  677. lswingcounter=$((lswingcounter+1))
  678. target="./$targetpath//${dir}/$targetfile"
  679. if [ "$verbosity" = "1" ]; then
  680. echo "Converting ${src} to ${target}"
  681. fi
  682. cp -b "${src}" "${target}"
  683. ;;
  684.  
  685. preon*([0-9]).wav)
  686. targetfile="preon ($preoncounter).wav"
  687. if [ "$preoncounter" -ge 5 ]; then
  688. preoncounter=1
  689. else
  690. preoncounter=$((preoncounter+1))
  691. fi
  692. target="./$targetpath/$targetfile"
  693. target="./$targetpath/${dir}/set/$targetfile"
  694. if [ "$verbosity" = "1" ]; then
  695. echo "Converting ${src} to ${target}"
  696. fi
  697. cp -b "${src}" "${target}"
  698. ;;
  699.  
  700. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  701. # Uncomment counter above and code here and adapt targetfile if needed later.
  702. # spin*([0-9]).wav)
  703. # targetfile="spin ($spincounter).wav"
  704. # spincounter=$((spincounter+1))
  705. # target="./${targetpath}/${dir}/${targetfile}"
  706. # if [ "$verbosity" = "1" ]; then
  707. # echo "Converting ${src} to ${target}"
  708. # fi
  709. # cp -b "${src}" "${target}"
  710. # ;;
  711.  
  712. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  713. # Uncomment counter above and code here and adapt targetfile if needed later.
  714. # stab*([0-9]).wav)
  715. # targetfile="stab ($stabcounter).wav"
  716. # stabcounter=$((stabcounter+1))
  717. # target="./${targetpath}/${dir}/${targetfile}"
  718. # if [ "$verbosity" = "1" ]; then
  719. # echo "Converting ${src} to ${target}"
  720. # fi
  721. # cp -b "${src}" "${target}"
  722. # ;;
  723.  
  724. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  725. # Uncomment and adapt targetfile if needed later.
  726. # swng*([0-9]).wav)
  727. # targetfile="swing ($swingcounter).wav"
  728. # swingcounter=$((swingcounter+1))
  729. # target="./${targetpath}/${dir}/${targetfile}"
  730. # if [ "$verbosity" = "1" ]; then
  731. # echo "Converting ${src} to ${target}"
  732. # fi
  733. # cp -b "${src}" "${target}"
  734. # ;;
  735.  
  736. track*([0-9]).wav)
  737. targetfile="track ($trackcounter).wav"
  738. trackcounter=$((trackcounter+1))
  739. target="./$targetpath/${dir}/tracks/$targetfile"
  740. if [ "$verbosity" = "1" ]; then
  741. echo "Converting ${src} to ${target}"
  742. fi
  743. cp -b "${src}" "${target}"
  744. ;;
  745.  
  746. *)
  747. echo "No match found, ignoring file $src"
  748.  
  749. esac
  750. done
  751.  
  752. echo Coverted soundfont saved in "${targetpath}"
  753. done
  754.  
  755. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  756. echo "before the conversion and was renamed to avoid accidental overwriting."
  757. echo " "
  758.  
  759. #-------------------------------------------------------------------------------------------------------------------------------------
  760.  
  761. elif [ "$boardchoice" = "PtoC" ]; then
  762. echo "You chose Proffie to CFX Soundfont converter."
  763. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  764. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  765.  
  766. read selection
  767.  
  768. if [ "$selection" = "1" ]; then
  769. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  770. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  771.  
  772. read input
  773. dirs=$(find "$input" -maxdepth 0 -type d)
  774.  
  775. echo "Found the following soundfont folder:"
  776. echo $dirs
  777. echo "Does this folder only contain one soundfont? (y/n)"
  778.  
  779. read input2
  780.  
  781. if [ "$input2" = "y" ]; then
  782. echo "Continuing conversion"
  783. else
  784. echo "Aborting program"
  785. exit
  786. fi
  787.  
  788. elif [ "$selection" = "2" ]; then
  789. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  790. echo "Please enter the name of the folder containing the soundfont folders."
  791.  
  792. read input
  793. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  794.  
  795. echo "Found the following directories for soundfonts:"
  796. echo $dirs
  797. echo "Does each of these folders only contain one soundfont? (y/n)"
  798.  
  799. read input2
  800.  
  801. if [ "$input2" = "y" ]; then
  802. echo "Continuing conversion"
  803. else
  804. echo "Aborting program"
  805. exit
  806. fi
  807.  
  808. else
  809. echo "Your selection is invalid. Aborting program"
  810. exit
  811. fi
  812.  
  813. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  814. echo "Warning, the detailed report will produce a lot of console output!"
  815.  
  816. read verbosity
  817.  
  818. if [ "$verbosity" = "1" ]; then
  819. echo "Logging progress to console"
  820. else
  821. echo "Logging only important steps"
  822. fi
  823.  
  824.  
  825. for dir in ${dirs[@]}; do
  826.  
  827. sounds=$(find "$dir" -type f -name '*.wav')
  828.  
  829. echo Converting soundfont in "${dir}".
  830.  
  831. targetpath="Converted_to_CFX/${dir}"
  832. mkdir -p "${targetpath}"
  833.  
  834. bgndragcounter=1
  835. bgnlockcounter=1
  836. blstcounter=1
  837. bootcounter=1
  838. clshcounter=1
  839. ccchangecounter=1
  840. dragcounter=1
  841. enddragcounter=1
  842. endlockcounter=1
  843. fontcounter=1
  844. forcecounter=1
  845. humcounter=1
  846. incounter=1
  847. lockcounter=1
  848. outcounter=1
  849. preoncounter=1
  850. spincounter=1
  851. stabcounter=1
  852. swinghcounter=1
  853. swinglcounter=1
  854. swngcounter=1
  855. trackcounter=1
  856.  
  857. for src in ${sounds[@]}; do
  858. case "${src##*/}" in
  859.  
  860. bgndrag*([0-9]).wav)
  861. targetfile=$(printf %q "startdrag$bgndragcounter.wav")
  862. bgndragcounter=$((bgndragcounter+1))
  863. target="./${targetpath}/${targetfile}"
  864. if [ "$verbosity" = "1" ]; then
  865. echo "Converting ${src} to ${target}"
  866. fi
  867. cp -b "${src}" "${target}"
  868. ;;
  869.  
  870. bgnlock*([0-9]).wav)
  871. targetfile=$(printf %q "startlock$bgnlockcounter.wav")
  872. bgnlockcounter=$((bgnlockcounter+1))
  873. target="./${targetpath}/${targetfile}"
  874. if [ "$verbosity" = "1" ]; then
  875. echo "Converting ${src} to ${target}"
  876. fi
  877. cp -b "${src}" "${target}"
  878. ;;
  879.  
  880. blst*([0-9]).wav)
  881. if [ "$blstcounter" -eq 1 ]; then
  882. targetfile=$(printf %q "blaster.wav")
  883. else
  884. targetfile=$(printf %q "blaster$blstcounter.wav")
  885. fi
  886. blstcounter=$((blstcounter+1))
  887. target="./${targetpath}/${targetfile}"
  888. if [ "$verbosity" = "1" ]; then
  889. echo "Converting ${src} to ${target}"
  890. fi
  891. cp -b "${src}" "${target}"
  892. ;;
  893.  
  894. boot*([0-9]).wav)
  895. if [ "$bootcounter" -eq 1 ]; then
  896. targetfile=$(printf %q "boot.wav")
  897. else
  898. targetfile=$(printf %q "boot$bootcounter.wav")
  899. fi
  900. bootcounter=$((bootcounter+1))
  901. target="./$targetpath/$targetfile"
  902. if [ "$verbosity" = "1" ]; then
  903. echo "Converting ${src} to ${target}"
  904. fi
  905. cp -b "${src}" "${target}"
  906. ;;
  907.  
  908. clsh*([0-9]).wav)
  909. targetfile=$(printf %q "clash$clshcounter.wav")
  910. clshcounter=$((clshcounter+1))
  911. target="./$targetpath/$targetfile"
  912. if [ "$verbosity" = "1" ]; then
  913. echo "Converting ${src} to ${target}"
  914. fi
  915. cp -b "${src}" "${target}"
  916. ;;
  917.  
  918. ccchange*([0-9]).wav)
  919. if [ "$ccchangecounter" -eq 1 ]; then
  920. targetfile=$(printf %q "color.wav")
  921. else
  922. targetfile=$(printf %q "color$ccchangecounter.wav")
  923. fi
  924. ccchangecounter=$((ccchangecounter+1))
  925. target="./$targetpath/$targetfile"
  926. if [ "$verbosity" = "1" ]; then
  927. echo "Converting ${src} to ${target}"
  928. fi
  929. cp -b "${src}" "${target}"
  930. ;;
  931.  
  932. drag*([0-9]).wav)
  933. if [ "$dragcounter" -eq 1 ]; then
  934. targetfile=$(printf %q "drag.wav")
  935. else
  936. targetfile=$(printf %q "drag$dragcounter.wav")
  937. fi
  938. dragcounter=$((dragcounter+1))
  939. target="./$targetpath/$targetfile"
  940. if [ "$verbosity" = "1" ]; then
  941. echo "Converting ${src} to ${target}"
  942. fi
  943. cp -b "${src}" "${target}"
  944. ;;
  945.  
  946. enddrag*([0-9]).wav)
  947. targetfile=$(printf %q "enddrag$enddragcounter.wav")
  948. enddragcounter=$((enddragcounter+1))
  949. target="./$targetpath/$targetfile"
  950. if [ "$verbosity" = "1" ]; then
  951. echo "Converting ${src} to ${target}"
  952. fi
  953. cp -b "${src}" "${target}"
  954. ;;
  955.  
  956. endlock*([0-9]).wav)
  957. targetfile=$(printf %q "endlock$endlockcounter.wav")
  958. endlockcounter=$((endlockcounter+1))
  959. target="./$targetpath/$targetfile"
  960. if [ "$verbosity" = "1" ]; then
  961. echo "Converting ${src} to ${target}"
  962. fi
  963. cp -b "${src}" "${target}"
  964. ;;
  965.  
  966. font*([0-9]).wav)
  967. if [ "$fontcounter" -eq 1 ]; then
  968. targetfile=$(printf %q "font.wav")
  969. else
  970. targetfile=$(printf %q "font$fontcounter.wav")
  971. fi
  972. fontcounter=$((fontcounter+1))
  973. target="./$targetpath/$targetfile"
  974. if [ "$verbosity" = "1" ]; then
  975. echo "Converting ${src} to ${target}"
  976. fi
  977. cp -b "${src}" "${target}"
  978. ;;
  979.  
  980. force*|quote*([0-9]).wav)
  981. if [ "$forcecounter" -eq 1 ]; then
  982. targetfile=$(printf %q "force.wav")
  983. else
  984. targetfile=$(printf %q "force$forcecounter.wav")
  985. fi
  986. forcecounter=$((forcecounter+1))
  987. target="./$targetpath/$targetfile"
  988. if [ "$verbosity" = "1" ]; then
  989. echo "Converting ${src} to ${target}"
  990. fi
  991. cp -b "${src}" "${target}"
  992. ;;
  993.  
  994. hum*([0-9]).wav)
  995. targetfile=$(printf %q "humM$humcounter.wav")
  996. humcounter=$((humcounter+1))
  997. target="./$targetpath/$targetfile"
  998. if [ "$verbosity" = "1" ]; then
  999. echo "Converting ${src} to ${target}"
  1000. fi
  1001. cp -b "${src}" "${target}"
  1002. ;;
  1003.  
  1004. in*([0-9]).wav)
  1005. if [ "$incounter" -eq 1 ]; then
  1006. targetfile=$(printf %q "poweroff.wav")
  1007. elif [ "$incounter" -eq 2 ]; then
  1008. targetfile=$(printf %q "pwroff$incounter.wav")
  1009. elif [ "$incounter" -ge 3 ]; then
  1010. targetfile=$(printf %q "poweroff$((incounter-1)).wav")
  1011. fi
  1012. incounter=$((incounter+1))
  1013. target="./$targetpath/$targetfile"
  1014. if [ "$verbosity" = "1" ]; then
  1015. echo "Converting ${src} to ${target}"
  1016. fi
  1017. cp -b "${src}" "${target}"
  1018. ;;
  1019.  
  1020. lock*([0-9]).wav)
  1021. if [ "$lockcounter" -eq 1 ]; then
  1022. targetfile=$(printf %q "lockup.wav")
  1023. else
  1024. targetfile=$(printf %q "lockup$lockcounter.wav")
  1025. fi
  1026. lockcounter=$((lockcounter+1))
  1027. target="./$targetpath/$targetfile"
  1028. if [ "$verbosity" = "1" ]; then
  1029. echo "Converting ${src} to ${target}"
  1030. fi
  1031. cp -b "${src}" "${target}"
  1032. ;;
  1033.  
  1034. out*([0-9]).wav)
  1035. if [ "$outcounter" -eq 1 ]; then
  1036. targetfile=$(printf %q "poweron.wav")
  1037. else
  1038. targetfile=$(printf %q "poweron$outcounter.wav")
  1039. fi
  1040. outcounter=$((outcounter+1))
  1041. target="./$targetpath/$targetfile"
  1042. if [ "$verbosity" = "1" ]; then
  1043. echo "Converting ${src} to ${target}"
  1044. fi
  1045. cp -b "${src}" "${target}"
  1046. ;;
  1047.  
  1048. preon*([0-9]).wav)
  1049. targetfile=$(printf %q "preon$preoncounter.wav")
  1050. preoncounter=$((preoncounter+1))
  1051. target="./$targetpath/$targetfile"
  1052. if [ "$verbosity" = "1" ]; then
  1053. echo "Converting ${src} to ${target}"
  1054. fi
  1055. cp -b "${src}" "${target}"
  1056. ;;
  1057.  
  1058. spin*([0-9]).wav)
  1059. targetfile=$(printf %q "spin$spincounter.wav")
  1060. spincounter=$((spincounter+1))
  1061. target="./$targetpath/$targetfile"
  1062. if [ "$verbosity" = "1" ]; then
  1063. echo "Converting ${src} to ${target}"
  1064. fi
  1065. cp -b "${src}" "${target}"
  1066. ;;
  1067.  
  1068. stab*([0-9]).wav)
  1069. targetfile=$(printf %q "stab$stabcounter.wav")
  1070. stabcounter=$((stabcounter+1))
  1071. target="./$targetpath/$targetfile"
  1072. if [ "$verbosity" = "1" ]; then
  1073. echo "Converting ${src} to ${target}"
  1074. fi
  1075. cp -b "${src}" "${target}"
  1076. ;;
  1077.  
  1078. swingh*([0-9]).wav)
  1079. targetfile=$(printf %q "hswing$swinghcounter.wav")
  1080. swinghcounter=$((swinghcounter+1))
  1081. target="./$targetpath/$targetfile"
  1082. if [ "$verbosity" = "1" ]; then
  1083. echo "Converting ${src} to ${target}"
  1084. fi
  1085. cp -b "${src}" "${target}"
  1086. ;;
  1087.  
  1088. swingl*([0-9]).wav)
  1089. targetfile=$(printf %q "lswing$swinglcounter.wav")
  1090. swinglcounter=$((swinglcounter+1))
  1091. target="./$targetpath/$targetfile"
  1092. if [ "$verbosity" = "1" ]; then
  1093. echo "Converting ${src} to ${target}"
  1094. fi
  1095. cp -b "${src}" "${target}"
  1096. ;;
  1097.  
  1098. swng*([0-9]).wav)
  1099. targetfile=$(printf %q "swing$swingcounter.wav")
  1100. swingcounter=$((swingcounter+1))
  1101. target="./$targetpath/$targetfile"
  1102. if [ "$verbosity" = "1" ]; then
  1103. echo "Converting ${src} to ${target}"
  1104. fi
  1105. cp -b "${src}" "${target}"
  1106. ;;
  1107.  
  1108. track*([0-9]).wav)
  1109. targetfile=$(printf %q "track$trackcounter.wav")
  1110. trackcounter=$((trackcounter+1))
  1111. if [ "$verbosity" = "1" ]; then
  1112. echo "Converting ${src} to ${target}"
  1113. fi
  1114. cp -b "${src}" "${target}"
  1115. ;;
  1116.  
  1117. *)
  1118. echo "No match found, ignoring file $src"
  1119.  
  1120. esac
  1121. done
  1122.  
  1123. echo Coverted soundfont saved in "${targetpath}"
  1124. done
  1125.  
  1126. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  1127. echo "before the conversion and was renamed to avoid accidental overwriting."
  1128. echo " "
  1129.  
  1130. #-------------------------------------------------------------------------------------------------------------------------------------
  1131.  
  1132. elif [ "$boardchoice" = "PtoX" ]; then
  1133. echo "You chose Proffie to Xenopixel Soundfont converter."
  1134. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1135. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1136.  
  1137. read selection
  1138.  
  1139. if [ "$selection" = "1" ]; then
  1140. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1141. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1142.  
  1143. read input
  1144. dirs=$(find "$input" -maxdepth 0 -type d)
  1145.  
  1146. echo "Found the following soundfont folder:"
  1147. echo $dirs
  1148. echo "Does this folder only contain one soundfont? (y/n)"
  1149.  
  1150. read input2
  1151.  
  1152. if [ "$input2" = "y" ]; then
  1153. echo "Continuing conversion"
  1154. else
  1155. echo "Aborting program"
  1156. exit
  1157. fi
  1158.  
  1159. elif [ "$selection" = "2" ]; then
  1160. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1161. echo "Please enter the name of the folder containing the soundfont folders."
  1162.  
  1163. read input
  1164. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1165.  
  1166. echo "Found the following directories for soundfonts:"
  1167. echo $dirs
  1168. echo "Does each of these folders only contain one soundfont? (y/n)"
  1169.  
  1170. read input2
  1171.  
  1172. if [ "$input2" = "y" ]; then
  1173. echo "Continuing conversion"
  1174. else
  1175. echo "Aborting program"
  1176. exit
  1177. fi
  1178.  
  1179. else
  1180. echo "Your selection is invalid. Aborting program"
  1181. exit
  1182. fi
  1183.  
  1184. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1185. echo "Warning, the detailed report will produce a lot of console output!"
  1186.  
  1187. read verbosity
  1188.  
  1189. if [ "$verbosity" = "1" ]; then
  1190. echo "Logging progress to console"
  1191. else
  1192. echo "Logging only important steps"
  1193. fi
  1194.  
  1195.  
  1196. for dir in ${dirs[@]}; do
  1197.  
  1198. sounds=$(find "$dir" -type f -name '*.wav')
  1199.  
  1200. echo Converting soundfont in "${dir}".
  1201.  
  1202. targetpath="Converted_to_Xenopixel"
  1203. mkdir -p "${targetpath}"
  1204. mkdir -p "${targetpath}/${dir}/set"
  1205. mkdir -p "${targetpath}/${dir}/tracks"
  1206.  
  1207. blstcounter=1
  1208. bootcounter=1
  1209. clshcounter=1
  1210. # colorcounter=1
  1211. dragcounter=1
  1212. # endlockcounter=1
  1213. fontcounter=1
  1214. forcecounter=1
  1215. humcounter=1
  1216. incounter=1
  1217. lockcounter=1
  1218. outcounter=1
  1219. preoncounter=1
  1220. swinghcounter=1
  1221. swinglcounter=1
  1222. # spincounter=1
  1223. # stabcounter=1
  1224. # swngcounter=1
  1225. trackcounter=1
  1226.  
  1227. for src in ${sounds[@]}; do
  1228. case "${src##*/}" in
  1229. blst*([0-9]).wav)
  1230. targetfile="blaster ($blstcounter).wav"
  1231. blstcounter=$((blstcounter+1))
  1232. target="./${targetpath}/${dir}/${targetfile}"
  1233. if [ "$verbosity" = "1" ]; then
  1234. echo "Converting ${src} to ${target}"
  1235. fi
  1236. cp -b "${src}" "${target}"
  1237. ;;
  1238.  
  1239. # boot sounds are converted to 'power on.wav and live in the 'set' folder.
  1240. # If there are more than one converted, the last one will be the resulting file.
  1241. boot*([0-9]).wav)
  1242. targetfile="power on.wav"
  1243. bootcounter=$((bootcounter+1))
  1244. target="./$targetpath/${dir}/set/$targetfile"
  1245. if [ "$verbosity" = "1" ]; then
  1246. echo "Converting ${src} to ${target}"
  1247. fi
  1248. cp -b "${src}" "${target}"
  1249. ;;
  1250.  
  1251. clsh*([0-9]).wav)
  1252. targetfile="clash ($clshcounter).wav"
  1253. clshcounter=$((clshcounter+1))
  1254. target="./${targetpath}/${dir}/${targetfile}"
  1255. if [ "$verbosity" = "1" ]; then
  1256. echo "Converting ${src} to ${target}"
  1257. fi
  1258. cp -b "${src}" "${target}"
  1259. ;;
  1260.  
  1261. # color sounds are currently not supported by Xenopixel and therefore ignored.
  1262. # Uncomment counter above and code here and adapt targetfile if needed later.
  1263. color*([0-9]).wav)
  1264. targetfile="color ($colorcounter).wav"
  1265. colorcounter=$((colorcounter+1))
  1266. target="./${targetpath}/${dir}/${targetfile}"
  1267. if [ "$verbosity" = "1" ]; then
  1268. echo "Converting ${src} to ${target}"
  1269. fi
  1270. cp -b "${src}" "${target}"
  1271. ;;
  1272.  
  1273. drag*([0-9]).wav)
  1274. targetfile="drag ($dragcounter).wav"
  1275. dragcounter=$((dragcounter+1))
  1276. target="./${targetpath}/${dir}/${targetfile}"
  1277. if [ "$verbosity" = "1" ]; then
  1278. echo "Converting ${src} to ${target}"
  1279. fi
  1280. cp -b "${src}" "${target}"
  1281. ;;
  1282.  
  1283. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  1284. # Uncomment counter above and code here and adapt targetfile if needed later.
  1285. # endlock*([0-9]).wav)
  1286. # targetfile="endlock ($endlockcounter).wav"
  1287. # endlockcounter=$((endlockcounter+1))
  1288. # target="./${targetpath}/${dir}/${targetfile}"
  1289. # if [ "$verbosity" = "1" ]; then
  1290. # echo "Converting ${src} to ${target}"
  1291. # fi
  1292. # cp -b "${src}" "${target}"
  1293. # ;;
  1294.  
  1295. font*([0-9]).wav)
  1296. targetfile="font ($fontcounter).wav"
  1297. fontcounter=$((fontcounter+1))
  1298. target="./${targetpath}/${dir}/${targetfile}"
  1299. if [ "$verbosity" = "1" ]; then
  1300. echo "Converting ${src} to ${target}"
  1301. fi
  1302. cp -b "${src}" "${target}"
  1303. ;;
  1304.  
  1305. force*|quote*([0-9]).wav)
  1306. targetfile="force ($forcecounter).wav"
  1307. forcecounter=$((forcecounter+1))
  1308. target="./${targetpath}/${dir}/${targetfile}"
  1309. if [ "$verbosity" = "1" ]; then
  1310. echo "Converting ${src} to ${target}"
  1311. fi
  1312. cp -b "${src}" "${target}"
  1313. ;;
  1314.  
  1315. hum*([0-9]).wav)
  1316. targetfile="hum ($humcounter).wav"
  1317. humcounter=$((humcounter+1))
  1318. target="./${targetpath}/${dir}/${targetfile}"
  1319. if [ "$verbosity" = "1" ]; then
  1320. echo "Converting ${src} to ${target}"
  1321. fi
  1322. cp -b "${src}" "${target}"
  1323. ;;
  1324.  
  1325. in*([0-9]).wav)
  1326. targetfile="in ($incounter).wav"
  1327. incounter=$((incounter+1))
  1328. target="./${targetpath}/${dir}/${targetfile}"
  1329. if [ "$verbosity" = "1" ]; then
  1330. echo "Converting ${src} to ${target}"
  1331. fi
  1332. cp -b "${src}" "${target}"
  1333. ;;
  1334.  
  1335. lock*([0-9]).wav)
  1336. targetfile="lock ($lockcounter).wav"
  1337. lockcounter=$((lockcounter+1))
  1338. target="./${targetpath}/${dir}/${targetfile}"
  1339. if [ "$verbosity" = "1" ]; then
  1340. echo "Converting ${src} to ${target}"
  1341. fi
  1342. cp -b "${src}" "${target}"
  1343. ;;
  1344.  
  1345. out*([0-9]).wav)
  1346. targetfile="out ($outcounter).wav"
  1347. outcounter=$((outcounter+1))
  1348. target="./${targetpath}/${dir}/${targetfile}"
  1349. if [ "$verbosity" = "1" ]; then
  1350. echo "Converting ${src} to ${target}"
  1351. fi
  1352. cp -b "${src}" "${target}"
  1353. ;;
  1354. swingh*([0-9]).wav)
  1355. targetfile="swingh ($swinghcounter).wav"
  1356. swinghcounter=$((swinghcounter+1))
  1357. target="./${targetpath}/${dir}/${targetfile}"
  1358. if [ "$verbosity" = "1" ]; then
  1359. echo "Converting ${src} to ${target}"
  1360. fi
  1361. cp -b "${src}" "${target}"
  1362. ;;
  1363.  
  1364. swingl*([0-9]).wav)
  1365. targetfile="swingl ($swinglcounter).wav"
  1366. swinglcounter=$((swinglcounter+1))
  1367. target="./${targetpath}/${dir}/${targetfile}"
  1368. if [ "$verbosity" = "1" ]; then
  1369. echo "Converting ${src} to ${target}"
  1370. fi
  1371. cp -b "${src}" "${target}"
  1372. ;;
  1373.  
  1374. preon*([0-9]).wav)
  1375. targetfile="preon ($preoncounter).wav"
  1376. if [ "$preoncounter" -ge 5 ]; then
  1377. preoncounter=1
  1378. else
  1379. preoncounter=$((preoncounter+1))
  1380. fi
  1381. target="./$targetpath/$targetfile"
  1382. target="./$targetpath/${dir}/set/$targetfile"
  1383. if [ "$verbosity" = "1" ]; then
  1384. echo "Converting ${src} to ${target}"
  1385. fi
  1386. cp -b "${src}" "${target}"
  1387. ;;
  1388.  
  1389. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  1390. # Uncomment counter above and code here and adapt targetfile if needed later.
  1391. # spin*([0-9]).wav)
  1392. # targetfile="spin ($spincounter).wav"
  1393. # spincounter=$((spincounter+1))
  1394. # target="./${targetpath}/${dir}/${targetfile}"
  1395. # if [ "$verbosity" = "1" ]; then
  1396. # echo "Converting ${src} to ${target}"
  1397. # fi
  1398. # cp -b "${src}" "${target}"
  1399. # ;;
  1400.  
  1401. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  1402. # Uncomment counter above and code here and adapt targetfile if needed later.
  1403. # stab*([0-9]).wav)
  1404. # targetfile="stab ($stabcounter).wav"
  1405. # stabcounter=$((stabcounter+1))
  1406. # target="./${targetpath}/${dir}/${targetfile}"
  1407. # if [ "$verbosity" = "1" ]; then
  1408. # echo "Converting ${src} to ${target}"
  1409. # fi
  1410. # cp -b "${src}" "${target}"
  1411. # ;;
  1412. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  1413. # Uncomment and adapt targetfile if needed later.
  1414. # swng*([0-9]).wav)
  1415. # targetfile="swing ($swingcounter).wav"
  1416. # swingcounter=$((swingcounter+1))
  1417. # target="./${targetpath}/${dir}/${targetfile}"
  1418. # if [ "$verbosity" = "1" ]; then
  1419. # echo "Converting ${src} to ${target}"
  1420. # fi
  1421. # cp -b "${src}" "${target}"
  1422. # ;;
  1423.  
  1424. track*([0-9]).wav)
  1425. targetfile="track ($trackcounter).wav"
  1426. trackcounter=$((trackcounter+1))
  1427. target="./$targetpath/${dir}/tracks/$targetfile"
  1428. if [ "$verbosity" = "1" ]; then
  1429. echo "Converting ${src} to ${target}"
  1430. fi
  1431. cp -b "${src}" "${target}"
  1432. ;;
  1433.  
  1434. *)
  1435. echo "No match found, ignoring file $src"
  1436.  
  1437. esac
  1438. done
  1439.  
  1440. echo Coverted soundfont saved in "${targetpath}"
  1441. done
  1442.  
  1443. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  1444. echo "before the conversion and was renamed to avoid accidental overwriting."
  1445. echo " "
  1446.  
  1447. #-------------------------------------------------------------------------------------------------------------------------------------
  1448.  
  1449. elif [ "$boardchoice" = "XtoC" ]; then
  1450. echo "You chose Xenopixel to CFX Soundfont converter."
  1451. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1452. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1453.  
  1454. read selection
  1455.  
  1456. if [ "$selection" = "1" ]; then
  1457. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1458. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1459.  
  1460. read input
  1461. dirs=$(find "$input" -maxdepth 0 -type d)
  1462.  
  1463. echo "Found the following soundfont folder:"
  1464. echo $dirs
  1465. echo "Does this folder only contain one soundfont? (y/n)"
  1466.  
  1467. read input2
  1468.  
  1469. if [ "$input2" = "y" ]; then
  1470. echo "Continuing conversion"
  1471. else
  1472. echo "Aborting program"
  1473. exit
  1474. fi
  1475.  
  1476. elif [ "$selection" = "2" ]; then
  1477. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1478. echo "Please enter the name of the folder containing the soundfont folders."
  1479.  
  1480. read input
  1481. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1482.  
  1483. echo "Found the following directories for soundfonts:"
  1484. echo $dirs
  1485. echo "Does each of these folders only contain one soundfont? (y/n)"
  1486.  
  1487. read input2
  1488.  
  1489. if [ "$input2" = "y" ]; then
  1490. echo "Continuing conversion"
  1491. else
  1492. echo "Aborting program"
  1493. exit
  1494. fi
  1495.  
  1496. else
  1497. echo "Your selection is invalid. Aborting program"
  1498. exit
  1499. fi
  1500.  
  1501. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1502. echo "Warning, the detailed report will produce a lot of console output!"
  1503.  
  1504. read verbosity
  1505.  
  1506. if [ "$verbosity" = "1" ]; then
  1507. echo "Logging progress to console"
  1508. else
  1509. echo "Logging only important steps"
  1510. fi
  1511.  
  1512. for dir in ${dirs[@]}; do
  1513.  
  1514. sounds=$(find "$dir" -type f -name '*.wav')
  1515.  
  1516. echo Converting soundfont in "${dir}".
  1517.  
  1518. targetpath="Converted_to_CFX/${dir}"
  1519. mkdir -p "${targetpath}"
  1520.  
  1521. blastercounter=1
  1522. # bootcounter=1
  1523. clashcounter=1
  1524. # colorcounter=1
  1525. dragcounter=1
  1526. # endlockcounter=1
  1527. fontcounter=1
  1528. forcecounter=1
  1529. hswingcounter=1
  1530. humcounter=1
  1531. incounter=1
  1532. lockcounter=1
  1533. lswingcounter=1
  1534. outcounter=1
  1535. # preoncounter=1
  1536. # spincounter=1
  1537. # stabcounter=1
  1538. # swingcounter=1
  1539. trackcounter=1
  1540.  
  1541. for src in ${sounds[@]}; do
  1542. case "${src##*/}" in
  1543.  
  1544. blaster**([0-9]).wav)
  1545. if [ "$blastercounter" -eq 1 ]; then
  1546. targetfile=$(printf %q "blaster.wav")
  1547. else
  1548. targetfile=$(printf %q "blaster$blastercounter.wav")
  1549. fi
  1550. blastercounter=$((blastercounter+1))
  1551. target="./${targetpath}/${targetfile}"
  1552. if [ "$verbosity" = "1" ]; then
  1553. echo "Converting ${src} to ${target}"
  1554. fi
  1555. cp -b "${src}" "${target}"
  1556. ;;
  1557.  
  1558. # boot sounds are currently not supported by Xenopixel and therefore ignored.
  1559. # Uncomment counter above and code here and adapt targetfile if needed later.
  1560. # boot**([0-9]).wav)
  1561. # targetfile=$(printf %q "boot$bootcounter.wav")
  1562. # bootcounter=$((bootcounter+1))
  1563. # target="./$targetpath/$targetfile"
  1564. # if [ "$verbosity" = "1" ]; then
  1565. # echo "Converting ${src} to ${target}"
  1566. # fi
  1567. # cp -b "${src}" "${target}"
  1568. # ;;
  1569.  
  1570. clash**([0-9]).wav)
  1571. targetfile=$(printf %q "clash$clashcounter.wav")
  1572. clashcounter=$((clashcounter+1))
  1573. target="./$targetpath/$targetfile"
  1574. if [ "$verbosity" = "1" ]; then
  1575. echo "Converting ${src} to ${target}"
  1576. fi
  1577. cp -b "${src}" "${target}"
  1578. ;;
  1579.  
  1580. # color sounds are currently not supported by Xenopixel and therefore ignored.
  1581. # Uncomment counter above and code here and adapt targetfile if needed later.
  1582. # color**([0-9]).wav)
  1583. # targetfile=$(printf %q "color$colorcounter.wav")
  1584. # colorcounter=$((colorcounter+1))
  1585. # target="./$targetpath/$targetfile"
  1586. # if [ "$verbosity" = "1" ]; then
  1587. # echo "Converting ${src} to ${target}"
  1588. # fi
  1589. # cp -b "${src}" "${target}"
  1590. # ;;
  1591.  
  1592. drag**([0-9]).wav)
  1593. if [ "$dragcounter" -eq 1 ]; then
  1594. targetfile=$(printf %q "drag.wav")
  1595. else
  1596. targetfile=$(printf %q "drag$dragcounter.wav")
  1597. fi
  1598. dragcounter=$((dragcounter+1))
  1599. target="./$targetpath/$targetfile"
  1600. if [ "$verbosity" = "1" ]; then
  1601. echo "Converting ${src} to ${target}"
  1602. fi
  1603. cp -b "${src}" "${target}"
  1604. ;;
  1605.  
  1606. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  1607. # Uncomment counter above and code here and adapt targetfile if needed later.
  1608. # endlock*([0-9]).wav)
  1609. # targetfile=$(printf %q "endlock$endlockcounter.wav")
  1610. # endlockcounter=$((endlockcounter+1))
  1611. # target="./$targetpath/$targetfile"
  1612. # if [ "$verbosity" = "1" ]; then
  1613. # echo "Converting ${src} to ${target}"
  1614. # fi
  1615. # cp -b "${src}" "${target}"
  1616. # ;;
  1617.  
  1618. font**([0-9]).wav)
  1619. if [ "$fontcounter" -eq 1 ]; then
  1620. targetfile=$(printf %q "font.wav")
  1621. else
  1622. targetfile=$(printf %q "font$fontcounter.wav")
  1623. fi
  1624. fontcounter=$((fontcounter+1))
  1625. target="./$targetpath/$targetfile"
  1626. if [ "$verbosity" = "1" ]; then
  1627. echo "Converting ${src} to ${target}"
  1628. fi
  1629. cp -b "${src}" "${target}"
  1630. ;;
  1631.  
  1632. force**([0-9]).wav)
  1633. if [ "$forcecounter" -eq 1 ]; then
  1634. targetfile=$(printf %q "force.wav")
  1635. else
  1636. targetfile=$(printf %q "force$forcecounter.wav")
  1637. fi
  1638. forcecounter=$((forcecounter+1))
  1639. target="./$targetpath/$targetfile"
  1640. if [ "$verbosity" = "1" ]; then
  1641. echo "Converting ${src} to ${target}"
  1642. fi
  1643. cp -b "${src}" "${target}"
  1644. ;;
  1645.  
  1646. hum**([0-9]).wav)
  1647. targetfile=$(printf %q "humM$humcounter.wav")
  1648. humcounter=$((humcounter+1))
  1649. target="./$targetpath/$targetfile"
  1650. if [ "$verbosity" = "1" ]; then
  1651. echo "Converting ${src} to ${target}"
  1652. fi
  1653. cp -b "${src}" "${target}"
  1654. ;;
  1655.  
  1656. in**([0-9]).wav)
  1657. if [ "$incounter" -eq 1 ]; then
  1658. targetfile=$(printf %q "poweroff.wav")
  1659. elif [ "$incounter" -eq 2 ]; then
  1660. targetfile=$(printf %q "pwroff$incounter.wav")
  1661. elif [ "$incounter" -ge 3 ]; then
  1662. targetfile=$(printf %q "poweroff$((incounter-1)).wav")
  1663. fi
  1664. incounter=$((incounter+1))
  1665. target="./$targetpath/$targetfile"
  1666. if [ "$verbosity" = "1" ]; then
  1667. echo "Converting ${src} to ${target}"
  1668. fi
  1669. cp -b "${src}" "${target}"
  1670. ;;
  1671.  
  1672. lock**([0-9]).wav)
  1673. if [ "$lockcounter" -eq 1 ]; then
  1674. targetfile=$(printf %q "lockup.wav")
  1675. else
  1676. targetfile=$(printf %q "lockup$lockcounter.wav")
  1677. fi
  1678. lockcounter=$((lockcounter+1))
  1679. target="./$targetpath/$targetfile"
  1680. if [ "$verbosity" = "1" ]; then
  1681. echo "Converting ${src} to ${target}"
  1682. fi
  1683. cp -b "${src}" "${target}"
  1684. ;;
  1685.  
  1686. out**([0-9]).wav)
  1687. if [ "$outcounter" -eq 1 ]; then
  1688. targetfile=$(printf %q "poweron.wav")
  1689. else
  1690. targetfile=$(printf %q "poweron$outcounter.wav")
  1691. fi
  1692. outcounter=$((outcounter+1))
  1693. target="./$targetpath/$targetfile"
  1694. if [ "$verbosity" = "1" ]; then
  1695. echo "Converting ${src} to ${target}"
  1696. fi
  1697. cp -b "${src}" "${target}"
  1698. ;;
  1699.  
  1700. hswing**([0-9]).wav)
  1701. targetfile=$(printf %q "hswing$hswingcounter.wav")
  1702. hswingcounter=$((hswingcounter+1))
  1703. target="./$targetpath/$targetfile"
  1704. if [ "$verbosity" = "1" ]; then
  1705. echo "Converting ${src} to ${target}"
  1706. fi
  1707. cp -b "${src}" "${target}"
  1708. ;;
  1709.  
  1710. lswing**([0-9]).wav)
  1711. targetfile=$(printf %q "lswing$lswingcounter.wav")
  1712. lswingcounter=$((lswingcounter+1))
  1713. target="./$targetpath/$targetfile"
  1714. if [ "$verbosity" = "1" ]; then
  1715. echo "Converting ${src} to ${target}"
  1716. fi
  1717. cp -b "${src}" "${target}"
  1718. ;;
  1719.  
  1720. # Accent Swings are currently not supported by Xenopixel and therefore ignored.
  1721. # Uncomment and adapt targetfile if needed later.
  1722. # swng**([0-9]).wav)
  1723. # targetfile=$(printf %q "swing$swingcounter.wav")
  1724. # swingcounter=$((swingcounter+1))
  1725. # target="./$targetpath/$targetfile"
  1726. # if [ "$verbosity" = "1" ]; then
  1727. # echo "Converting ${src} to ${target}"
  1728. # fi
  1729. # cp -b "${src}" "${target}"
  1730. # ;;
  1731.  
  1732. track**([0-9]).wav)
  1733. targetfile=$(printf %q "track$trackcounter.wav")
  1734. trackcounter=$((trackcounter+1))
  1735. if [ "$verbosity" = "1" ]; then
  1736. echo "Converting ${src} to ${target}"
  1737. fi
  1738. cp -b "${src}" "${target}"
  1739. ;;
  1740.  
  1741. *)
  1742. echo "No match found, ignoring file $src"
  1743.  
  1744. esac
  1745. done
  1746.  
  1747. echo Coverted soundfont saved in "${targetpath}"
  1748. done
  1749.  
  1750. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  1751. echo "before the conversion and was renamed to avoid accidental overwriting."
  1752. echo " "
  1753.  
  1754. #-------------------------------------------------------------------------------------------------------------------------------------
  1755.  
  1756. elif [ "$boardchoice" = "XtoP" ]; then
  1757. echo "You chose Xenopixel to Proffie Soundfont converter."
  1758. echo "Do you wish to convert a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  1759. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  1760.  
  1761. read selection
  1762.  
  1763. if [ "$selection" = "1" ]; then
  1764. echo "You chose to convert a single soundfont. Please enter the name of the font folder containting the soundfont files."
  1765. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  1766.  
  1767. read input
  1768. dirs=$(find "$input" -maxdepth 0 -type d)
  1769.  
  1770. echo "Found the following soundfont folder:"
  1771. echo $dirs
  1772. echo "Does this folder only contain one soundfont? (y/n)"
  1773.  
  1774. read input2
  1775.  
  1776. if [ "$input2" = "y" ]; then
  1777. echo "Continuing conversion"
  1778. else
  1779. echo "Aborting program"
  1780. exit
  1781. fi
  1782.  
  1783. elif [ "$selection" = "2" ]; then
  1784. echo "You chose to convert several soundfonts. Each soundfont must be in a single subfolder."
  1785. echo "Please enter the name of the folder containing the soundfont folders."
  1786.  
  1787. read input
  1788. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  1789.  
  1790. echo "Found the following directories for soundfonts:"
  1791. echo $dirs
  1792. echo "Does each of these folders only contain one soundfont? (y/n)"
  1793.  
  1794. read input2
  1795.  
  1796. if [ "$input2" = "y" ]; then
  1797. echo "Continuing conversion"
  1798. else
  1799. echo "Aborting program"
  1800. exit
  1801. fi
  1802.  
  1803. else
  1804. echo "Your selection is invalid. Aborting program"
  1805. exit
  1806. fi
  1807.  
  1808. echo "Do you wish a detailed conversion progess report ('1') or only the imporant steps ('2')?"
  1809. echo "Warning, the detailed report will produce a lot of console output!"
  1810.  
  1811. read verbosity
  1812.  
  1813. if [ "$verbosity" = "1" ]; then
  1814. echo "Logging progress to console"
  1815. else
  1816. echo "Logging only important steps"
  1817. fi
  1818.  
  1819.  
  1820. for dir in ${dirs[@]}; do
  1821.  
  1822. sounds=$(find "$dir" -type f -name '*.wav')
  1823.  
  1824. echo Converting soundfont in "${dir}".
  1825.  
  1826. targetpath="Converted_to_Proffie"
  1827. mkdir -p "${targetpath}"
  1828. cd "${targetpath}"
  1829. mkdir -p "${dir}/bgndrag"
  1830. mkdir -p "${dir}/bgnlock"
  1831. mkdir -p "${dir}/blst"
  1832. mkdir -p "${dir}/boot"
  1833. mkdir -p "${dir}/clsh"
  1834. mkdir -p "${dir}/ccchange"
  1835. mkdir -p "${dir}/drag"
  1836. mkdir -p "${dir}/enddrag"
  1837. mkdir -p "${dir}/endlock"
  1838. mkdir -p "${dir}/font"
  1839. mkdir -p "${dir}/force"
  1840. mkdir -p "${dir}/swingh"
  1841. mkdir -p "${dir}/hum"
  1842. mkdir -p "${dir}/swingl"
  1843. mkdir -p "${dir}/in"
  1844. mkdir -p "${dir}/out"
  1845. mkdir -p "${dir}/lock"
  1846. mkdir -p "${dir}/preon"
  1847. mkdir -p "${dir}/spin"
  1848. mkdir -p "${dir}/stab"
  1849. mkdir -p "${dir}/swng"
  1850. mkdir -p "${dir}/tracks"
  1851. cd ".."
  1852.  
  1853. blastercounter=1
  1854. # bootcounter=1
  1855. clashcounter=1
  1856. # colorcounter=1
  1857. dragcounter=1
  1858. # endlockcounter=1
  1859. fontcounter=1
  1860. forcecounter=1
  1861. hswingcounter=1
  1862. humcounter=1
  1863. incounter=1
  1864. lockcounter=1
  1865. lswingcounter=1
  1866. outcounter=1
  1867. # preoncounter=1
  1868. # spincounter=1
  1869. # stabcounter=1
  1870. # swingcounter=1
  1871. trackcounter=1
  1872.  
  1873. for src in ${sounds[@]}; do
  1874. case "${src##*/}" in
  1875.  
  1876. blaster**([0-9]).wav)
  1877. if [ "$blastercounter" -lt 10 ]; then
  1878. targetfile=$(printf %q "blst0$blastercounter.wav")
  1879. else
  1880. targetfile=$(printf %q "blst$blastercounter.wav")
  1881. fi
  1882. blastercounter=$((blastercounter+1))
  1883. target="./${targetpath}/${dir}/blst/${targetfile}"
  1884. if [ "$verbosity" = "1" ]; then
  1885. echo "Converting ${src} to ${target}"
  1886. fi
  1887. cp -b "${src}" "${target}"
  1888. ;;
  1889.  
  1890. # boot sounds are currently not supported by Xenopixel and therefore ignored.
  1891. # Uncomment counter above and code here and adapt targetfile if needed later.
  1892. # boot**([0-9]).wav)
  1893. # if [ "$bootcounter" -lt 10 ]; then
  1894. # targetfile=$(printf %q "boot0$bootcounter.wav")
  1895. # else
  1896. # targetfile=$(printf %q "boot$bootcounter.wav")
  1897. # fi
  1898. # bootcounter=$((bootcounter+1))
  1899. # target="./$targetpath/${dir}/boot/$targetfile"
  1900. # if [ "$verbosity" = "1" ]; then
  1901. # echo "Converting ${src} to ${target}"
  1902. # fi
  1903. # cp -b "${src}" "${target}"
  1904. # ;;
  1905.  
  1906. clash**([0-9]).wav)
  1907. if [ "$clashcounter" -lt 10 ]; then
  1908. targetfile=$(printf %q "clsh0$clashcounter.wav")
  1909. else
  1910. targetfile=$(printf %q "clsh$clashcounter.wav")
  1911. fi
  1912. clashcounter=$((clashcounter+1))
  1913. target="./$targetpath/${dir}/clsh/$targetfile"
  1914. if [ "$verbosity" = "1" ]; then
  1915. echo "Converting ${src} to ${target}"
  1916. fi
  1917. cp -b "${src}" "${target}"
  1918. ;;
  1919.  
  1920. # color sounds are currently not supported by Xenopixel and therefore ignored.
  1921. # Uncomment counter above and code here and adapt targetfile if needed later.
  1922. # color**([0-9]).wav)
  1923. # targetfile=$(printf %q "ccchage$colorcounter.wav")
  1924. # colorcounter=$((colorcounter+1))
  1925. # target="./$targetpath/${dir}/ccchange/$targetfile"
  1926. # if [ "$verbosity" = "1" ]; then
  1927. # echo "Converting ${src} to ${target}"
  1928. # fi
  1929. # cp -b "${src}" "${target}"
  1930. # ;;
  1931.  
  1932. drag**([0-9]).wav)
  1933. if [ "$dragcounter" -lt 10 ]; then
  1934. targetfile=$(printf %q "drag0$dragcounter.wav")
  1935. else
  1936. targetfile=$(printf %q "drag$dragcounter.wav")
  1937. fi
  1938. dragcounter=$((dragcounter+1))
  1939. target="./$targetpath/${dir}/drag/$targetfile"
  1940. if [ "$verbosity" = "1" ]; then
  1941. echo "Converting ${src} to ${target}"
  1942. fi
  1943. cp -b "${src}" "${target}"
  1944. ;;
  1945.  
  1946. # endlock sounds are currently not supported by Xenopixel and therefore ignored.
  1947. # Uncomment counter above and code here and adapt targetfile if needed later.
  1948. # endlock**([0-9]).wav)
  1949. # targetfile=$(printf %q "endlock$endlockcounter.wav")
  1950. # endlockcounter=$((endlockcounter+1))
  1951. # target="./$targetpath/${dir}/endlock/$targetfile"
  1952. # if [ "$verbosity" = "1" ]; then
  1953. # echo "Converting ${src} to ${target}"
  1954. # fi
  1955. # cp -b "${src}" "${target}"
  1956. # ;;
  1957.  
  1958. font**([0-9]).wav)
  1959. if [ "$fontcounter" -lt 10 ]; then
  1960. targetfile=$(printf %q "font0$fontcounter.wav")
  1961. else
  1962. targetfile=$(printf %q "font$fontcounter.wav")
  1963. fi
  1964. fontcounter=$((fontcounter+1))
  1965. target="./$targetpath/${dir}/font/$targetfile"
  1966. if [ "$verbosity" = "1" ]; then
  1967. echo "Converting ${src} to ${target}"
  1968. fi
  1969. cp -b "${src}" "${target}"
  1970. ;;
  1971.  
  1972. force**|combo*([0-9]).wav)
  1973. if [ "$forcecounter" -lt 10 ]; then
  1974. targetfile=$(printf %q "force0$forcecounter.wav")
  1975. else
  1976. targetfile=$(printf %q "force$forcecounter.wav")
  1977. fi
  1978. forcecounter=$((forcecounter+1))
  1979. target="./$targetpath/${dir}/force/$targetfile"
  1980. if [ "$verbosity" = "1" ]; then
  1981. echo "Converting ${src} to ${target}"
  1982. fi
  1983. cp -b "${src}" "${target}"
  1984. ;;
  1985.  
  1986. hswing**([0-9]).wav)
  1987. if [ "$hswingcounter" -lt 10 ]; then
  1988. targetfile=$(printf %q "swingh0$hswingcounter.wav")
  1989. else
  1990. targetfile=$(printf %q "swingh$hswingcounter.wav")
  1991. fi
  1992. hswingcounter=$((hswingcounter+1))
  1993. target="./$targetpath/${dir}/swingh/$targetfile"
  1994. if [ "$verbosity" = "1" ]; then
  1995. echo "Converting ${src} to ${target}"
  1996. fi
  1997. cp -b "${src}" "${target}"
  1998. ;;
  1999.  
  2000. hum**([0-9]).wav)
  2001. if [ "$humcounter" -lt 10 ]; then
  2002. targetfile=$(printf %q "hum0$humcounter.wav")
  2003. else
  2004. targetfile=$(printf %q "hum$humcounter.wav")
  2005. fi
  2006. humcounter=$((humcounter+1))
  2007. target="./$targetpath/${dir}/hum/$targetfile"
  2008. if [ "$verbosity" = "1" ]; then
  2009. echo "Converting ${src} to ${target}"
  2010. fi
  2011. cp -b "${src}" "${target}"
  2012. ;;
  2013.  
  2014. lswing**([0-9]).wav)
  2015. if [ "$lswingcounter" -lt 10 ]; then
  2016. targetfile=$(printf %q "swingl0$lswingcounter.wav")
  2017. else
  2018. targetfile=$(printf %q "swingl$lswingcounter.wav")
  2019. fi
  2020. lswingcounter=$((lswingcounter+1))
  2021. target="./$targetpath/${dir}/swingl/$targetfile"
  2022. if [ "$verbosity" = "1" ]; then
  2023. echo "Converting ${src} to ${target}"
  2024. fi
  2025. cp -b "${src}" "${target}"
  2026. ;;
  2027.  
  2028. in**([0-9]).wav)
  2029. if [ "$incounter" -lt 10 ]; then
  2030. targetfile=$(printf %q "in0$incounter.wav")
  2031. else
  2032. targetfile=$(printf %q "in$incounter.wav")
  2033. fi
  2034. incounter=$((incounter+1))
  2035. target="./$targetpath/${dir}/in/$targetfile"
  2036. if [ "$verbosity" = "1" ]; then
  2037. echo "Converting ${src} to ${target}"
  2038. fi
  2039. cp -b "${src}" "${target}"
  2040. ;;
  2041.  
  2042. out**([0-9]).wav)
  2043. if [ "$outcounter" -lt 10 ]; then
  2044. targetfile=$(printf %q "out0$outcounter.wav")
  2045. else
  2046. targetfile=$(printf %q "out$outcounter.wav")
  2047. fi
  2048. outcounter=$((outcounter+1))
  2049. target="./$targetpath/${dir}/out/$targetfile"
  2050. if [ "$verbosity" = "1" ]; then
  2051. echo "Converting ${src} to ${target}"
  2052. fi
  2053. cp -b "${src}" "${target}"
  2054. ;;
  2055.  
  2056. lock**([0-9]).wav)
  2057. if [ "$lockcounter" -lt 10 ]; then
  2058. targetfile=$(printf %q "lock0$lockcounter.wav")
  2059. else
  2060. targetfile=$(printf %q "lock$lockcounter.wav")
  2061. fi
  2062. lockcounter=$((lockcounter+1))
  2063. target="./$targetpath/${dir}/lock/$targetfile"
  2064. if [ "$verbosity" = "1" ]; then
  2065. echo "Converting ${src} to ${target}"
  2066. fi
  2067. cp -b "${src}" "${target}"
  2068. ;;
  2069.  
  2070. # preon sounds are currently not supported by Xenopixel and therefore ignored.
  2071. # Uncomment counter above and code here and adapt targetfile if needed later.
  2072. # preon**([0-9]).wav)
  2073. # if [ "$preoncounter" -lt 10 ]; then
  2074. # targetfile=$(printf %q "preon0$preoncounter.wav")
  2075. # else
  2076. # targetfile=$(printf %q "preon$preoncounter.wav")
  2077. # fi
  2078. # preoncounter=$((preoncounter+1))
  2079. # target="./${targetpath}/${dir}/preon/${targetfile}"
  2080. # if [ "$verbosity" = "1" ]; then
  2081. # echo "Converting ${src} to ${target}"
  2082. # fi
  2083. # cp -b "${src}" "${target}"
  2084. # ;;
  2085.  
  2086. # spin sounds are currently not supported by Xenopixel and therefore ignored.
  2087. # Uncomment counter above and code here and adapt targetfile if needed later.
  2088. # spin**([0-9]).wav)
  2089. # if [ "$spincounter" -lt 10 ]; then
  2090. # targetfile=$(printf %q "spin0$spincounter.wav")
  2091. # else
  2092. # targetfile=$(printf %q "spin$spincounter.wav")
  2093. # fi
  2094. # spincounter=$((spincounter+1))
  2095. # target="./$targetpath/${dir}/spin/$targetfile"
  2096. # if [ "$verbosity" = "1" ]; then
  2097. # echo "Converting ${src} to ${target}"
  2098. # fi
  2099. # cp -b "${src}" "${target}"
  2100. # ;;
  2101.  
  2102. # stab sounds are currently not supported by Xenopixel and therefore ignored.
  2103. # Uncomment counter above and code here and adapt targetfile if needed later.
  2104. # stab**([0-9]).wav)
  2105. # if [ "$stabcounter" -lt 10 ]; then
  2106. # targetfile=$(printf %q "stab0$stabcounter.wav")
  2107. # else
  2108. # targetfile=$(printf %q "stab$stabcounter.wav")
  2109. # fi
  2110. # stabcounter=$((stabcounter+1))
  2111. # target="./$targetpath/${dir}/stab/$targetfile"
  2112. # if [ "$verbosity" = "1" ]; then
  2113. # echo "Converting ${src} to ${target}"
  2114. # fi
  2115. # cp -b "${src}" "${target}"
  2116. # ;;
  2117.  
  2118. # Accent Swing sounds are currently not supported by Xenopixel and therefore ignored.
  2119. # Uncomment counter above and code here and adapt targetfile if needed later.
  2120. # swing**([0-9]).wav)
  2121. # if [ "$swingcounter" -lt 10 ]; then
  2122. # targetfile=$(printf %q "swng0$swingcounter.wav")
  2123. # else
  2124. # targetfile=$(printf %q "swng$swingcounter.wav")
  2125. # fi
  2126. # swingcounter=$((swingcounter+1))
  2127. # target="./$targetpath/${dir}/swng/$targetfile"
  2128. # if [ "$verbosity" = "1" ]; then
  2129. # echo "Converting ${src} to ${target}"
  2130. # fi
  2131. # cp -b "${src}" "${target}"
  2132. # ;;
  2133.  
  2134. track**([0-9]).wav)
  2135. if [ "$trackcounter" -lt 10 ]; then
  2136. targetfile=$(printf %q "track0$trackcounter.wav")
  2137. else
  2138. targetfile=$(printf %q "track$trackcounter.wav")
  2139. fi
  2140. trackcounter=$((trackcounter+1))
  2141. target="./$targetpath/${dir}/tracks/$targetfile"
  2142. if [ "$verbosity" = "1" ]; then
  2143. echo "Converting ${src} to ${target}"
  2144. fi
  2145. cp -b "${src}" "${target}"
  2146. ;;
  2147.  
  2148. *)
  2149. echo "No match found, ignoring file $src"
  2150.  
  2151. esac
  2152. done
  2153.  
  2154. echo Coverted soundfont saved in "${targetpath}"
  2155. done
  2156.  
  2157. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  2158. echo "before the conversion and was renamed to avoid accidental overwriting."
  2159. echo " "
  2160.  
  2161. #-------------------------------------------------------------------------------------------------------------------------------------
  2162.  
  2163. elif [ "$boardchoice" = "PtoP" ]; then
  2164. echo "You chose Proffie to Proffie Soundfont renaming."
  2165. echo "Do you wish to rename a single soundfont (enter '1') or a folder containing several soundfonts in subfolders (enter '2')?"
  2166. echo "If you choose 2, Make sure each sub-folder only contains one soundfont. Otherwise the soundfonts will get mixed!"
  2167.  
  2168. read selection
  2169.  
  2170. if [ "$selection" = "1" ]; then
  2171. echo "You chose to rename a single soundfont. Please enter the name of the font folder containting the soundfont files."
  2172. echo "You may need to enter the path if it's a subfolder of where you are (such as 'SoundfontMaker/Font')"
  2173.  
  2174. read input
  2175. dirs=$(find "$input" -maxdepth 0 -type d)
  2176.  
  2177. echo "Found the following soundfont folder:"
  2178. echo $dirs
  2179. echo "Does this folder only contain one soundfont? (y/n)"
  2180.  
  2181. read input2
  2182.  
  2183. if [ "$input2" = "y" ]; then
  2184. echo "Continuing renaming"
  2185. else
  2186. echo "Aborting program"
  2187. exit
  2188. fi
  2189.  
  2190. elif [ "$selection" = "2" ]; then
  2191. echo "You chose to rename several soundfonts. Each soundfont must be in a single subfolder."
  2192. echo "Please enter the name of the folder containing the soundfont folders."
  2193.  
  2194. read input
  2195. dirs=$(find "$input" -mindepth 1 -maxdepth 1 -type d)
  2196.  
  2197. echo "Found the following directories for soundfonts:"
  2198. echo $dirs
  2199. echo "Does each of these folders only contain one soundfont? (y/n)"
  2200.  
  2201. read input2
  2202.  
  2203. if [ "$input2" = "y" ]; then
  2204. echo "Continuing renaming"
  2205. else
  2206. echo "Aborting program"
  2207. exit
  2208. fi
  2209.  
  2210. else
  2211. echo "Your selection is invalid. Aborting program"
  2212. exit
  2213. fi
  2214.  
  2215. echo "Do you wish a detailed renaming progess report ('1') or only the imporant steps ('2')?"
  2216. echo "Warning, the detailed report may produce a lot of console output!"
  2217.  
  2218. read verbosity
  2219.  
  2220. if [ "$verbosity" = "1" ]; then
  2221. echo "Logging progress to console"
  2222. else
  2223. echo "Logging only important steps"
  2224. fi
  2225.  
  2226. for dir in ${dirs[@]}; do
  2227.  
  2228. sounds=$(find "$dir" -type f -name '*.wav')
  2229.  
  2230. echo Converting soundfont in "${dir}".
  2231.  
  2232. targetpath="Converted_to_Proffie"
  2233. mkdir -p "${targetpath}/${dir}"
  2234.  
  2235. counter=1
  2236. oldeffect="old"
  2237.  
  2238. for src in ${sounds[@]}; do
  2239. effectfile="${src//[0-9]/}"
  2240. effect="${effectfile##*/}"
  2241. effect="${effect%.*}"
  2242. if [[ "$effect" != "$oldeffect" ]]; then
  2243. counter=1
  2244. fi
  2245. if [ $counter = 2 ]; then
  2246. mkdir -p "${targetpath}/${dir}/${effect}"
  2247. mv "${target}" "./${targetpath}/${dir}/${effect}/${targetfile}"
  2248. echo "Moving ${targetfile} into ${dir}/${effect} subfolder"
  2249. fi
  2250. if [ "${#effect}" -gt 6 ] || [ "$counter" -gt 9 ]; then
  2251. targetfile=$(printf %q "${effect}$counter.wav")
  2252. else
  2253. targetfile=$(printf %q "${effect}0$counter.wav")
  2254. fi
  2255. if [ $counter -ge 2 ]; then
  2256. target="./${targetpath}/${dir}/${effect}/${targetfile}"
  2257. else
  2258. target="./${targetpath}/${dir}/${targetfile}"
  2259. fi
  2260. if [ "$verbosity" = "1" ]; then
  2261. echo "Converting ${src} to ${target}"
  2262. fi
  2263. cp -b "${src}" "${target}"
  2264. counter=$((counter+1))
  2265. oldeffect="${effect}"
  2266. done
  2267.  
  2268. echo Coverted soundfont saved in "${targetpath}"
  2269. done
  2270.  
  2271. echo "Soundfont conversion complete. If you see files with a '~' at the end, this file already existed in the output folder"
  2272. echo "before the conversion and was renamed to avoid accidental overwriting."
  2273. echo " "
  2274. fi
Add Comment
Please, Sign In to add comment