Browse Source

Generate ModularGrid-VCVLibrary.json.

v1
Andrew Belt 4 years ago
parent
commit
12916d7d3c
2 changed files with 138 additions and 2 deletions
  1. +100
    -2
      ModularGrid-VCVLibrary.json
  2. +38
    -0
      scripts/generate_mg.py

+ 100
- 2
ModularGrid-VCVLibrary.json View File

@@ -1,4 +1,102 @@
[
{"mgModuleId": 4759, "vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Clouds"},
{"mgModuleId": 18802, "vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Tides"}
{
"mgModuleId": 6927,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Braids"
},
{
"mgModuleId": 16165,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Plaits"
},
{
"mgModuleId": 4606,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Elements"
},
{
"mgModuleId": 2578,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Tides"
},
{
"mgModuleId": 18802,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Tides2"
},
{
"mgModuleId": 4759,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Clouds"
},
{
"mgModuleId": 5791,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Warps"
},
{
"mgModuleId": 7411,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Rings"
},
{
"mgModuleId": 2529,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Links"
},
{
"mgModuleId": 8253,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Kinks"
},
{
"mgModuleId": 2912,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Shades"
},
{
"mgModuleId": 3055,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Branches"
},
{
"mgModuleId": 8925,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Blinds"
},
{
"mgModuleId": 8924,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Veils"
},
{
"mgModuleId": 2579,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Frames"
},
{
"mgModuleId": 16507,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Stages"
},
{
"mgModuleId": 16508,
"vcvUrl": "https://library.vcvrack.com/AudibleInstruments/Marbles"
},
{
"mgModuleId": 7070,
"vcvUrl": "https://library.vcvrack.com/Befaco/EvenVCO"
},
{
"mgModuleId": 6702,
"vcvUrl": "https://library.vcvrack.com/Befaco/Rampage"
},
{
"mgModuleId": 8071,
"vcvUrl": "https://library.vcvrack.com/Befaco/ABC"
},
{
"mgModuleId": 7069,
"vcvUrl": "https://library.vcvrack.com/Befaco/SpringReverb"
},
{
"mgModuleId": 7073,
"vcvUrl": "https://library.vcvrack.com/Befaco/Mixer"
},
{
"mgModuleId": 7074,
"vcvUrl": "https://library.vcvrack.com/Befaco/SlewLimiter"
},
{
"mgModuleId": 6588,
"vcvUrl": "https://library.vcvrack.com/Befaco/DualAtenuverter"
},
{
"mgModuleId": 304,
"vcvUrl": "https://library.vcvrack.com/ESeries/E340"
}
]

+ 38
- 0
scripts/generate_mg.py View File

@@ -0,0 +1,38 @@
import sys
import os
import glob
import json
import re
import requests


mg_filename = "ModularGrid-VCVLibrary.json"
# with open(mg_filename) as f:
# mg = json.load(f)
mg = []

for manifest_filename in glob.glob('manifests/*.json'):
slug = os.path.splitext(os.path.basename(manifest_filename))[0]
with open(manifest_filename) as f:
plugin = json.load(f)

for module in plugin.get("modules", []):
mg_url = module.get("modularGridUrl")
if not mg_url:
continue

r = requests.get(mg_url)
m = re.search(r'data-module-id = "(\d+)"', r.text)
mg_id = m.group(1)
if not mg_id:
continue
mg_id = int(mg_id)

library_url = f"https://library.vcvrack.com/{plugin['slug']}/{module['slug']}"
module_data = {"mgModuleId": mg_id, "vcvUrl": library_url}
mg.append(module_data)
print(mg_id)
print(library_url)

with open(mg_filename, 'w') as f:
json.dump(mg, f, indent=2)

Loading…
Cancel
Save