Getting a Looperman loop into REAPER
There is no Looperman plugin for REAPER, and there cannot honestly
be one that talks to the site directly. ReaScript's Lua ships no
HTTP client and no HTML parser. The workable shape is a local server that
does the fetching, plus a short script that asks it for a file and inserts
the result. That is what LoopHaven is for — the DAW side stays three lines
of reaper.ExecProcess.
Why the DAW cannot do this itself
| What the task needs | ReaScript Lua has |
|---|---|
| HTTP request with cookies | Nothing built in |
| Scrape a filter form | Nothing built in |
| Run a process | reaper.ExecProcess |
| Place a file on a track | reaper.InsertMedia |
Two of four is enough if you stop trying to make the DAW smart. The split that works: the local API knows the site, the script knows the project.
Step 1 — run the local API
pip install "loophaven[mcp]"
python -m uvicorn loophaven.api.app:app --host 127.0.0.1 --port 8000
# the file you want, chosen once, outside the DAW
curl "http://127.0.0.1:8000/api/download/info/loop/436799"
Keep the port on loopback. The server has no authentication, by design: it is a personal local service, not something to expose on a network.
Step 2 — a ReaScript that pulls one file
Save as loophaven_fetch.lua in your REAPER Scripts folder, then
run it from the Actions window. It downloads into a Media
subfolder beside the project and inserts the file at the edit cursor.
-- loophaven_fetch.lua — starting point, not a tested add-on
-- Requires: the LoopHaven API running on 127.0.0.1:8000
local API = "http://127.0.0.1:8000"
local ID = "436799" -- change, or prompt with reaper.GetUserInputs
local KIND = "loop" -- "loop" or "acapella"
local FORMAT = "mp3" -- "mp3" = free preview, "wav" = needs a session
local _, proj = reaper.EnumProjects(-1, "")
local dir = proj ~= "" and proj:match("^(.*)[/\\]") or reaper.GetResourcePath()
local media = dir .. "/Media"
reaper.RecursiveCreateDirectory(media, 0)
local url = API .. "/api/download/audio/" .. KIND .. "/" .. ID
local dest = media .. "/loophaven_" .. KIND .. "_" .. ID .. "." .. FORMAT
-- -s -L -f: quiet, follow redirects, fail on HTTP error instead of saving a page
local cmd = string.format(
'curl -s -L -f -o "%s" "%s"', dest:gsub('"', ''), url)
local ok = reaper.ExecProcess(cmd, 60000)
if not ok or ok ~= 0 then
reaper.ShowMessageBox(
"Fetch failed. Check that the API is running and that the session is open.",
"LoopHaven", 0)
return
end
reaper.InsertMedia(dest, 0)
reaper.UpdateArrange()
Read this before relying on it. This snippet is a
documented starting point, not a shipped feature — it has not been tested
across REAPER versions or platforms. ExecProcess needs
curl on PATH, which is not guaranteed on Windows
before build 1803. -f matters: without it, curl
happily saves an HTML quota page with a .wav extension and the
failure only appears later, in the arrange window.
Step 3 — preview first, download second
Point FORMAT at mp3 while you are still choosing.
Previews cost nothing and need no account; a WAV costs quota and needs an open
session. Auditioning ten candidates as MP3 and downloading one as WAV is the
difference between a search and a harvest.
# two searches, no files written at all
haven search --genre "Boom Bap" --bpm 90 --key Am --limit 5
haven search --genre Trap --bpm 140 --limit 5 --json
What this deliberately does not do
- It does not time-stretch or match tempo. A loop at
128 BPM dropped into a 140 BPM project plays at the wrong speed until you
set the item's playback rate or enable beat-based stretching. The API
reports
bpmandtime_signatureso you can decide; it does not silently conform anything. - It does not place audio on a musical grid. Insertion is at the edit cursor, on the selected track. Quantising a loop is an arrangement decision, not a fetch.
- It does not batch-download a genre. See the two limits: one of them belongs to your account and the other belongs to Looperman, and neither is retried automatically.
- It does not work in Ableton, Logic or FL Studio either. The same split applies — local endpoint, then whatever that DAW offers for file import — but nothing here plugs into those hosts.
Other hosts in one sentence each
| Host | The practical route |
|---|---|
| REAPER | ReaScript + ExecProcess, or drop the file in the project's Media folder |
| Ableton Live | Watch a folder, or drag from the browser — the API just writes the file |
| FL Studio | Same: export to a folder, import from the browser |
| Anything else | If it can read a file from disk, it can read what this fetches |
The value is not integration depth. It is that the file arrives with a
correct name, a correct extension, and a record of what it is — instead of a
.wav that is secretly a quota page.
Next: letting an agent do the searching, or what happens when you hit the quota.