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.

92 lines
1.9KB

  1. #include <map>
  2. #include <tag.hpp>
  3. #include <string.hpp>
  4. namespace rack {
  5. namespace tag {
  6. /** See https://vcvrack.com/manual/Manifest#modules-tags for documentation of tags. */
  7. const std::vector<std::vector<std::string>> tagAliases = {
  8. {"Arpeggiator"},
  9. {"Attenuator"},
  10. {"Blank"},
  11. {"Chorus"},
  12. {"Clock generator", "Clock"},
  13. {"Clock modulator"},
  14. {"Compressor"},
  15. {"Controller"},
  16. {"Delay"},
  17. {"Digital"},
  18. {"Distortion"},
  19. {"Drum", "Drums", "Percussion"},
  20. {"Dual"},
  21. {"Dynamics"},
  22. {"Effect"},
  23. {"Envelope follower"},
  24. {"Envelope generator"},
  25. {"Equalizer", "EQ"},
  26. {"Expander"},
  27. {"External"},
  28. {"Filter", "VCF", "Voltage controlled filter"},
  29. {"Flanger"},
  30. {"Function generator"},
  31. {"Granular"},
  32. {"Hardware clone", "Hardware"},
  33. {"Limiter"},
  34. {"Logic"},
  35. {"Low-frequency oscillator", "LFO", "Low frequency oscillator"},
  36. {"Low-pass gate", "Low pass gate", "Lowpass gate"},
  37. {"MIDI"},
  38. {"Mixer"},
  39. {"Multiple"},
  40. {"Noise"},
  41. {"Oscillator", "VCO", "Voltage controlled oscillator"},
  42. {"Panning", "Pan"},
  43. {"Phaser"},
  44. {"Physical modeling"},
  45. {"Polyphonic", "Poly"},
  46. {"Quad"},
  47. {"Quantizer"},
  48. {"Random"},
  49. {"Recording"},
  50. {"Reverb"},
  51. {"Ring modulator"},
  52. {"Sample and hold", "S&H", "Sample & hold"},
  53. {"Sampler"},
  54. {"Sequencer"},
  55. {"Slew limiter"},
  56. {"Speech"},
  57. {"Switch"},
  58. {"Synth voice"},
  59. {"Tuner"},
  60. {"Utility"},
  61. {"Visual"},
  62. {"Vocoder"},
  63. {"Voltage-controlled amplifier", "Amplifier", "VCA", "Voltage controlled amplifier"},
  64. {"Waveshaper"},
  65. };
  66. int findId(const std::string& tag) {
  67. std::string lowercaseTag = string::lowercase(tag);
  68. for (int tagId = 0; tagId < (int) tagAliases.size(); tagId++) {
  69. for (const std::string& alias : tagAliases[tagId]) {
  70. if (string::lowercase(alias) == lowercaseTag)
  71. return tagId;
  72. }
  73. }
  74. return -1;
  75. }
  76. std::string getTag(int tagId) {
  77. assert(0 <= tagId && tagId < (int) tagAliases.size());
  78. return tagAliases[tagId][0];
  79. }
  80. } // namespace tag
  81. } // namespace rack