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.

91 lines
2.8KB

  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. {"Attenuator"}, // With a level knob and not much else.
  9. {"Blank"}, // No parameters or ports. Serves no purpose except visual.
  10. {"Chorus"},
  11. {"Clock generator", "Clock"},
  12. {"Clock modulator"}, // Clock dividers, multipliers, etc.
  13. {"Compressor"}, // With threshold, ratio, knee, etc parameters.
  14. {"Controller"}, // Use only if the artist "performs" with this module. Simply having knobs is not enough. Examples: on-screen keyboard, XY pad.
  15. {"Delay"},
  16. {"Digital"},
  17. {"Distortion"},
  18. {"Drum", "Drums", "Percussion"},
  19. {"Dual"}, // 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.
  20. {"Dynamics"},
  21. {"Effect"},
  22. {"Envelope follower"},
  23. {"Envelope generator"},
  24. {"Equalizer", "EQ"},
  25. {"Expander"}, // Expands the functionality of a "mother" module when placed next to it. Expanders should inherit the tags of its mother module.
  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"},
  45. {"Quad"}, // 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.
  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. {"Speech"},
  56. {"Switch"},
  57. {"Synth voice"}, // A synth voice must have, at the minimum, a built-in oscillator and envelope.
  58. {"Tuner"},
  59. {"Utility"}, // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc.
  60. {"Visual"},
  61. {"Vocoder"},
  62. {"Voltage-controlled amplifier", "Amplifier", "VCA", "Voltage controlled amplifier"},
  63. {"Waveshaper"},
  64. };
  65. int findId(const std::string& tag) {
  66. std::string lowercaseTag = string::lowercase(tag);
  67. for (int tagId = 0; tagId < (int) tagAliases.size(); tagId++) {
  68. for (const std::string& alias : tagAliases[tagId]) {
  69. if (string::lowercase(alias) == lowercaseTag)
  70. return tagId;
  71. }
  72. }
  73. return -1;
  74. }
  75. std::string getTag(int tagId) {
  76. assert(0 <= tagId && tagId < (int) tagAliases.size());
  77. return tagAliases[tagId][0];
  78. }
  79. } // namespace tag
  80. } // namespace rack