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.

84 lines
2.6KB

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