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.

93 lines
2.5KB

  1. #include <tag.hpp>
  2. #include <string.hpp>
  3. #include <map>
  4. namespace rack {
  5. namespace tag {
  6. const std::vector<std::vector<std::string>> tagAliases = {
  7. {"Arpeggiator"},
  8. // With a level knob and not much else.
  9. {"Attenuator"},
  10. // No parameters or ports. Serves no purpose except visual.
  11. {"Blank"},
  12. {"Chorus"},
  13. {"Clock generator", "Clock"},
  14. // Clock dividers, multipliers, etc.
  15. {"Clock modulator"},
  16. // With threshold, ratio, knee, etc parameters.
  17. {"Compressor"},
  18. // Use only if the artist "performs" with this module. Simply having knobs is not enough. Examples: on-screen keyboard, XY pad.
  19. {"Controller"},
  20. {"Delay"},
  21. {"Digital"},
  22. {"Distortion"},
  23. {"Drum", "Drums", "Percussion"},
  24. // The core functionality times two. If multiple channels are a requirement for the module to exist (ring modulator, mixer, etc), it is not a Dual module.
  25. {"Dual"},
  26. {"Dynamics"},
  27. {"Effect"},
  28. {"Envelope follower"},
  29. {"Envelope generator"},
  30. {"Equalizer", "EQ"},
  31. // Expands the functionality of a "mother" module when placed next to it. Expanders should inherit the tags of its mother module.
  32. {"Expander"},
  33. {"External"},
  34. {"Filter", "VCF", "Voltage controlled filter"},
  35. {"Flanger"},
  36. {"Function generator"},
  37. {"Granular"},
  38. {"Limiter"},
  39. {"Logic"},
  40. {"Low-frequency oscillator", "LFO", "Low frequency oscillator"},
  41. {"Low-pass gate", "Low pass gate", "Lowpass gate"},
  42. {"MIDI"},
  43. {"Mixer"},
  44. {"Multiple"},
  45. {"Noise"},
  46. {"Oscillator", "VCO", "Voltage controlled oscillator"},
  47. {"Panning", "Pan"},
  48. {"Phaser"},
  49. {"Physical modeling"},
  50. {"Polyphonic", "Poly"},
  51. // The core functionality times four. If multiple channels are a requirement for the module to exist (ring modulator, mixer, etc), it is not a Quad module.
  52. {"Quad"},
  53. {"Quantizer"},
  54. {"Random"},
  55. {"Recording"},
  56. {"Reverb"},
  57. {"Ring modulator"},
  58. {"Sample and hold", "S&H", "Sample & hold"},
  59. {"Sampler"},
  60. {"Sequencer"},
  61. {"Slew limiter"},
  62. {"Switch"},
  63. // A synth voice must have, at the minimum, a built-in oscillator and envelope.
  64. {"Synth voice"},
  65. {"Tuner"},
  66. // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc.
  67. {"Utility"},
  68. {"Visual"},
  69. {"Vocoder"},
  70. {"Voltage-controlled amplifier", "Amplifier", "VCA", "Voltage controlled amplifier"},
  71. {"Waveshaper"},
  72. };
  73. int findId(const std::string& tag) {
  74. std::string lowercaseTag = string::lowercase(tag);
  75. for (int tagId = 0; tagId < (int) tagAliases.size(); tagId++) {
  76. for (const std::string& alias : tagAliases[tagId]) {
  77. if (string::lowercase(alias) == lowercaseTag)
  78. return tagId;
  79. }
  80. }
  81. return -1;
  82. }
  83. } // namespace tag
  84. } // namespace rack