Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
2.7KB

  1. #!/bin/bash
  2. # Script to start Carla bridges
  3. INSTALL_PREFIX="X-PREFIX-X"
  4. CARLA_PREFIX="$INSTALL_PREFIX"/lib/carla
  5. # ----------------------------------------------------------------------
  6. # Check for enough arguments
  7. if [ "$3"x == ""x ]; then
  8. echo "usage: $0 [arch] [mode] [filename] [label/uri]
  9. Possible archs:
  10. - \"native\"
  11. - \"posix32\"
  12. - \"posix64\"
  13. - \"win32\"
  14. - \"win64\"
  15. Possible modes:
  16. - \"internal\"
  17. - \"ladspa\"
  18. - \"dssi\"
  19. - \"lv2\"
  20. - \"vst\"
  21. - \"gig\"
  22. - \"sf2\"
  23. - \"sfz\"
  24. Examples:
  25. $0 native internal \"midiSplit\"
  26. $0 native dssi \"/usr/lib/dssi/hexter.so\" \"hexter\"
  27. $0 native lv2 \"/usr/lib/lv2/calf/\" \"http://calf.sourceforge.net/plugins/Compressor\"
  28. $0 native vst \"/usr/lib/vst/TAL-NoiseMaker.so\"
  29. "
  30. exit
  31. fi
  32. # ----------------------------------------------------------------------
  33. # Set client name (from environment)
  34. if [ "$CARLA_CLIENT_NAME"x == ""x ]; then
  35. CARLA_CLIENT_NAME="(none)"
  36. fi
  37. # ----------------------------------------------------------------------
  38. # Set variables
  39. RUN_ARCH="$1"
  40. RUN_MODE="$2"
  41. RUN_FILE="$3"
  42. RUN_LABEL="$4"
  43. # ----------------------------------------------------------------------
  44. # Fix arch for windows bridges
  45. if [ $RUN_ARCH == "win32" ]; then
  46. RUN_ARCH="win32.exe"
  47. fi
  48. if [ $RUN_ARCH == "win64" ]; then
  49. RUN_ARCH="win64.exe"
  50. fi
  51. # ----------------------------------------------------------------------
  52. # Check for existing carla folder
  53. if [ ! -d $CARLA_PREFIX ]; then
  54. echo "$0: Carla folder does not exist, is it installed?"
  55. exit
  56. fi
  57. # ----------------------------------------------------------------------
  58. # Check for existing arch binary
  59. CARLA_EXEC="$CARLA_PREFIX/carla-bridge-$RUN_ARCH"
  60. if [ ! -f $CARLA_EXEC ]; then
  61. echo "$0: Invalid arch (may not be installed)"
  62. exit
  63. fi
  64. # ----------------------------------------------------------------------
  65. # Check mode
  66. if [ "$RUN_MODE"x == "internal"x ]; then
  67. RUN_MODE="INTERNAL"
  68. RUN_LABEL="$RUN_FILE"
  69. elif [ "$RUN_MODE"x == "ladspa"x ]; then
  70. if [ "$RUN_LABEL"x == ""x ]; then
  71. echo "$0: LADSPA needs label"
  72. exit
  73. fi
  74. RUN_MODE="LADSPA"
  75. elif [ "$RUN_MODE"x == "dssi"x ]; then
  76. if [ "$RUN_LABEL"x == ""x ]; then
  77. echo "$0: DSSI needs label"
  78. exit
  79. fi
  80. RUN_MODE="DSSI"
  81. elif [ "$RUN_MODE"x == "lv2"x ]; then
  82. if [ "$RUN_LABEL"x == ""x ]; then
  83. echo "$0: LV2 needs uri"
  84. exit
  85. fi
  86. RUN_MODE="LV2"
  87. elif [ "$RUN_MODE"x == "vst"x ]; then
  88. RUN_MODE="VST"
  89. elif [ "$RUN_MODE"x == "gig"x ]; then
  90. RUN_MODE="GIG"
  91. elif [ "$RUN_MODE"x == "sf2"x ]; then
  92. RUN_MODE="SF2"
  93. elif [ "$RUN_MODE"x == "sfz"x ]; then
  94. RUN_MODE="SFZ"
  95. else
  96. echo "$0: Invalid mode"
  97. exit
  98. fi
  99. # ----------------------------------------------------------------------
  100. # Exec
  101. exec $CARLA_EXEC "null" "$RUN_MODE" "$RUN_FILE" "$CARLA_CLIENT_NAME" "$RUN_LABEL"