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.

129 lines
2.6KB

  1. import json
  2. import os
  3. scales = """
  4. Ionian (Major) 1-2-3-4-5-6-7
  5. Dorian 1-2-b3-4-5-6-b7
  6. Phrygian 1-b2-b3-4-5-b6-b7
  7. Lydian 1-2-3-#4-5-6-7
  8. Mixolydian 1-2-3-4-5-6-b7
  9. Aeolian (Minor) 1-2-b3-4-5-b6-b7
  10. Locrian 1-b2-b3-4-b5-b6-b7
  11. Aeolian 7 (Harmonic Minor) 1-2-b3-4-5-b6-7
  12. Locrian 6 1-b2-b3-4-b5-6-b7
  13. Ionian #5 1-2-3-4-#5-6-7
  14. Dorian #4 1-2-b3-#4-5-6-b7
  15. Phrygian 3 1-b2-3-4-5-b6-b7
  16. Lydian #2 1-#2-3-#4-5-6-7
  17. Locrian b4 bb7 1-b2-b3-b4-b5-b6-bb7
  18. Aeolian 6 7 (Melodic Minor) 1-2-b3-4-5-6-7
  19. Phrygian 6 1-b2-b3-4-5-6-b7
  20. Lydian #5 1-2-3-#4-#5-6-7
  21. Lydian b7 1-2-3-#4-5-6-b7
  22. Aeolian 3 1-2-3-4-5-b6-b7
  23. Locrian 2 1-2-b3-4-b5-b6-b7
  24. Locrian b4 1-b2-b3-b4-b5-b6-b7
  25. Bebop Dominant 1-2-3-4-5-6-#6-7
  26. Bebob Major 1-2-3-4-5-b6-6-7
  27. Bebob Minor 1-2-b3-3-4-5-6-b7
  28. Bebob Melodic Minor 1-2-b3-4-5-b6-6-7
  29. Blues Major 1-2-b3-3-5-6
  30. Blues Minor 1-b3-4-b5-5-b7
  31. Blues Diminished 1-b2-b3-3-b5-5-6-b7
  32. Blues Pentatonic 1-b3-4-5-b7
  33. Blues Rock'n'Roll 1-2-b3-3-4-b5-5-6-b7
  34. Byzantine 1-b2-3-4-5-b6-7
  35. Hungarian Minor 1-2-b3-b5-5-b6-7
  36. Hungarian Gypsy 1-2-b3-#4-5-b6-b7
  37. Spanish Gypsy 1-b2-3-4-5-b6-b7
  38. Major Pentatonic 1-2-3-5-6
  39. Neutral Pentatonic 1-2-4-5-b7
  40. Rock Pentatonic 1-b3-4-#5-b7
  41. Scottish Pentatonic 1-2-4-5-6
  42. Minor Pentatonic 1-b3-4-5-b7
  43. Whole 1-2-3-#4-#5-#6
  44. Whole-Half 1-2-b3-4-#4-#5-6-7
  45. Half-Whole 1-b2-b3-3-b5-5-6-b7
  46. Augmented 1-#2-3-5-#5-7
  47. Byzantine 1-b2-3-4-5-b6-7
  48. Chromatic 1-#1-2-#2-3-4-#4-5-#5-6-#6-7
  49. Enigmatic (Ascending) 1-b2-3-#4-#5-#6-7
  50. Enigmatic (Descending) 1-b2-3-4-b6-b7-7
  51. Hungarian Major 1-b3-3-b5-5-6-b7
  52. Hungarian Minor 1-2-b3-b5-5-b6-7
  53. Neapolitan Major 1-b2-b3-4-5-6-7
  54. Neapolitan Minor 1-b2-b3-4-5-b6-7
  55. Overtone 1-2-3-#4-5-6-b7
  56. Prometheus 1-2-3-b5-6-b7
  57. Prometheus Neapolitan 1-b2-3-b5-6-b7
  58. Spanish 8 Tone 1-b2-b3-3-4-b5-b6-b7
  59. """
  60. note_indexes = {
  61. "1": 0,
  62. "#1": 1,
  63. "b2": 1,
  64. "2": 2,
  65. "#2": 3,
  66. "b3": 3,
  67. "3": 4,
  68. "b4": 4,
  69. "4": 5,
  70. "#4": 6,
  71. "b5": 6,
  72. "5": 7,
  73. "#5": 8,
  74. "b6": 8,
  75. "6": 9,
  76. "bb7": 9,
  77. "#6": 10,
  78. "b7": 10,
  79. "7": 11,
  80. }
  81. dir = "presets/Quantizer"
  82. os.makedirs(dir, exist_ok=True)
  83. count = 0
  84. for line in scales.splitlines():
  85. if not line:
  86. continue
  87. data = {
  88. "plugin": "Fundamental",
  89. "model": "Quantizer",
  90. "version": "2.0.0",
  91. "params": [],
  92. "data": {
  93. "enabledNotes": [
  94. False,
  95. False,
  96. False,
  97. False,
  98. False,
  99. False,
  100. False,
  101. False,
  102. False,
  103. False,
  104. False,
  105. False,
  106. ]
  107. }
  108. }
  109. name, notes = line.split("\t")
  110. notes = notes.split("-")
  111. for note in notes:
  112. note_index = note_indexes[note]
  113. data["data"]["enabledNotes"][note_index] = True
  114. path = os.path.join(dir, f"{count:02d}_{name}.vcvm")
  115. print(path)
  116. print(data)
  117. with open(path, "w") as f:
  118. json.dump(data, f, indent=2)
  119. count += 1