torstenanders Posted November 22, 2017 Share Posted November 22, 2017 I want to translate individual MIDI velocity integers into Opusmodus velocities (i.e. dynamics symbols like p and f). I am aware that I can do this with vector-to-velocity, but I am surprised that this transformation is seemingly so difficult. Below is a function that can do that, but perhaps Opusmodus itself should make this more simple. (defun MIDI-velocity->OMN-velocity (velocity) "Translates individual MIDI velocity integers into Opusmodus velocity symbols. Example: (MIDI-velocity->OMN-velocity 100) => fff" (let ((scaled-velo (/ velocity 127.0))) ; scale into range 0-1 (second (vector-to-velocity 0.0 1.0 `(1.0 ,scaled-velo 0))))) Best, Torsten Quote Link to comment Share on other sites More sharing options...
opmo Posted November 22, 2017 Share Posted November 22, 2017 Can't be simpler: (get-velocity '(90 39 58 49)) Quote Link to comment Share on other sites More sharing options...
torstenanders Posted November 22, 2017 Author Share Posted November 22, 2017 Ah, great! The documentation does not mention that the input can also be MIDI velocity integers, so I missed that. Best, Torsten added 2 minutes later BTW: I needed that to translate values from OpenMusic data objects into Opusmodus. I am currently working on a library that will bring OpenMusic functions/methods to Opusmodus... Best, Torsten lviklund, Stephane Boussuge and loopyc 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.