Hola hombres…
Just wrote some “quick and dirty” code for creating labels for the ends (beginnings?) of measures in loops…
Why the code?
Well, as many of you know, sometimes you “get” loops that are two (or more) measures long but are the
same sample(s) repeated twice. This can be a waste of storage space, so the obvious thing to do is to
chop that loop in half if possible.
I usually just use this technique for beat loops (such as bass drum, hi-hats, etc).
The following code supposes that:
- You know how many measures are in the loop.
(This usually requires a BPM chart, see below…) - Your loop hasn’t been chopped and is accurate length for looping.
(i.e., it’s in the form that a REPEAT of it would recreate a track).
Here’s the code…
;nyquist plug-in
;version 1
;type generate
;name "M3"
;action "measuring..."
; =========================================
;info "44.1 kHz AuDiO OnLy"
; ======================================================
;control MEZ "#ofM" int "#" 1 1 50
; ======================================================
(SETQ AUL (/ LEN 44100.000000))
; ======================================================
(SETQ MZL (/ AUL MEZ))
(SETQ NMT 0)
(SETQ NM MEZ)
(SETQ LOM NIL)
; ======================================================
(TAGBODY
LINE-002 (SETQ CMT (+ NMT MZL)) : (SETQ NMT CMT)
(SETQ T01 (CONS (LIST CMT "MeZ") LOM))
(SETQ LOM T01)
(SETQ RNM (- NM 1)) : (SETQ NM RNM)
(IF (> NM 0) (GO LINE-002))
)
; ======================================================
(PRINT "=====================")
(PRINT "Audio Length")
(PRINT "=====================")
(PRINT AUL)
(PRINT "=====================")
(PRINT "Measure LengthZ")
(PRINT "=====================")
(PRINT MZL)
(PRINT (* MZL 2))
(PRINT (* MZL 3))
(PRINT (* MZL 4))
(PRINT "=====================")
(PRINT "=====================")
(PRINT "=====================")
(PRINT LOM)
; ======================================================
As you can see, it’s not like my usual code (unpretty), but I’ve been really down about coding after some
recent “setbacks” trying to make GUI programs in Rapid-Q Basic, trying to read files in Qbasic, AND
figuring out that microphones “warp” your voice so you sound crappy unless you spend and arm and a leg
on one. As my once hero Anton Newcomb would have said in the 90s, “Take it from the man!”
Oh well, I’m more into Cancer Bats these days anyway…
In addition, the last part of the code (only available by pressing the DEBUG button at time of running)
doesn’t really work as (for some reason) the numbers get rounded to six decimal places. Works
“internally” though. ha ha.
Oh yeah, as for that BPM chart, you need something like this:
As you can see, such a chart is mega-helpfull.
Each measure is given two spaces for the shortest and longest length for that BPM for that particular number
of measures.
The RED cells are data that has been taken from actual loops.
The WHITE cells with itallic numbers are measurements calculated from RED cells.
I put a new sheet for each BPM, and then fill it in as I go.
As I said, mega-helpful for modern music and for using the above code…
Via Cons Dios XLISP coders!