Giter VIP home page Giter VIP logo

Comments (6)

oubiwann avatar oubiwann commented on June 24, 2024

Looks like the BPM voltage is this:

Voltage BPM
-2 30
-1 60
0 120
1 240
~1.322 300

So ... for x from -2 to 1 Volts:

  • y = 2^(x + 2) * 30 BPM -->
  • y/30 = 2^(x + 2) -->
  • log2(y/30) = x + 2 -->
  • x = log2(y/30) - 2

This checks out:

lfe> (- (math:log2 (/ 300 30)) 2)
1.3219280948873622

from undermidi.

oubiwann avatar oubiwann commented on June 24, 2024

Using 4 MIDI CC inputs to generate BPM voltages (the more, the smoother it is between higher BPMs) ...

cc val (0,1,2,3) volts bpm
0,0,0,0 -2 30
127,0,0,0 -1.177 53
127,127,0,0 -0.344 95
127,127,127,0 0.489 168
127,127,127,127 1.321 30

Screenshot of used modules:

Screenshot 2021-12-31 at 4 13 01 AM

In the above, the offset modules are set to the following:

  • offset: -2V
  • scale: 0.3315
  • order of operations: scale then offset

and then for the umix module:

  • input gain: -12 db
  • hard output clipping

from undermidi.

oubiwann avatar oubiwann commented on June 24, 2024

Looks like I found a better solution:

Screenshot 2021-12-31 at 5 28 35 AM

the exponent module configured with:

  • shape: -5
  • shape depth: 1
  • input voltage range: 10

offset module:

  • offset: -2
  • scale: 0.33655

This setup gives the following spread:

cc val bpm
0 30
32 97
64 157
92 228
128 300

The differences between those:

lfe> (- 97 30)
67
lfe> (- 157 97)
60
lfe> (- 228 157)
71
lfe> (- 300 228)
72

That's as close as I could get to linear 😉

This experiment was accomplished with the following setup:

Screenshot 2021-12-31 at 5 43 58 AM

from undermidi.

oubiwann avatar oubiwann commented on June 24, 2024

The one downside of that last approach was that, as the 300 BPM mark is approached, resolution is lost and things get pretty jumpy. In fact, long before the 300 BPM mark.

Good new/bad news:

  • VCV Rack now supports 14-bit MIDI
  • This is a cumbersome approach and it's too smooth as the BPM count grows higher ...

It requires a couple of right-click changes to the MIDI CC - CV module:

Screenshot 2021-12-31 at 1 48 50 PM

(uncheck "Smooth" and check "14-bit ...")

With that change, the following was able to generate a perfectly smooth, continuous BPM ramp, from 30 to 300, no BPMs left behind:

lfe> (list-comp ((<- x (lists:seq 0 127)) (<- y (lists:seq 0 127 5)))
       (um:bank-select x y 0) (timer:sleep 250))

I suspect what I'll end up doing is generating a list of BPM/bank select tuples ...

from undermidi.

oubiwann avatar oubiwann commented on June 24, 2024

That's basically an LFO ramp: raw input (once the bank select calls are received by VCV Rack) is from 0 to 10V. VCV Rack crashes if I don't put a sleep between calls, but I was able to bring it down to a 100 millisecond wait instead of 250. With the 5-step jumps in y, this is incrementing 0.003 Volts every 100 ms, so that works out to about 5.5 minutes to do the whole ramp.

from undermidi.

oubiwann avatar oubiwann commented on June 24, 2024

Not quite there, but close:

lfe> (set msbs-lsbs (list-comp ((<- msb (lists:seq 0 127)) (<- lsb (lists:seq 0 127 5))) (list msb lsb)))
lfe> (set select-voltages (list-comp ((<- y (lists:seq 30 300))) (* 3.010299956639812 (math:log2 (/ y 30)))))
lfe> (set ordered (lists:foldl (lambda (x acc) 
                                 (lists:append acc `(#(,(+ 0.003 (element 1 (lists:last acc))) ,x)))) 
                               '(#(0 (0 0)))
                               msbs-lsbs))
lfe> (set indexed (maps:from_list ordered))
lfe> (set keys (maps:keys indexed))
lfe> (defun closest (x) (lutil-math:get-closest (lists:nth x select-voltages) keys))
lfe> (set select-msbs-lsbs (list-comp ((<- i (lists:seq 1 (length select-voltages))))
       (mref indexed (closest i))))

lfe> (list-comp ((<- msb-lsb select-msbs-lsbs)) (um:bank-select msb-lsb 0) (timer:sleep 500))

(defun bpm (bpm)
  (um:bank-select (lists:nth (- bpm 29) select-msbs-lsbs) 0))

from undermidi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.