Jump to content
Sign in to follow this  
torstenanders

Translating MIDI velocities into OMN velocities

Recommended Posts

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

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Topics

    • By JulioHerrlein
      Dear Friends,
       
      I have a suggestion to Opusmodus. Maybe a Midi In Collect funcionality could be handy.
      For example, the possibility to plug in a midi controller and collect data, for example, pitches
       from the midi in.  Chords could be collected already with syntax, i.e., like (c4e4g4) and melodies like (c4 e4 g4).
      A function could transform a midi input in lenghts, like c=1/16, d=1/8, or something like this.
      Or even a simple DAW=like recorder (with metronome) to get some motifs and transform it in OMN.
      If you begin working with pre-defined  material, the things can go long.
       
      Just some ideas...
      Best,
      Julio
    • By InLight-Tone
      I was wondering if it's possible to use midi velocity values 1-127 for the velocity parameter?
      I noticed I could use floating point.
      Any examples of using standard midi velocity instead of dynamic symbols?
      Thanks again, I'll try to keep these basic questions to a minimum if possible! 😏
    • By Hencleeday
      Dear All,
       
      completely newbie in this field and very eager to learn!
       
      I've just watched and replicated the steps from  Stephane Boussuge's video "Import Midi from Logic" to import some midi files. What I would like now is to generate variation from the input rhythm, pitch, figures, gestures given and decide locally how many of x figures and their permutations. Any tips?
      Thanks in advance!
       
      Best,
      André Hencleeday
×
×
  • Create New...