Vel, vel_f, velocity, velocity_f

Hi,

to set the veolicity of a midi note, two parameters:

  • vel : a midi value so from 0 to 127
  • vel_f : velocity float i presume, 127*vel_f value

Is there difference between vel and velocity ? it seems no. :slight_smile:

use_midi_defaults port: "loopmidi01", channel: "11"

notes_de_la_gamme = scale :c3, :ritusen, num_octaves: 3

live_loop :joueGamme do
  
  use_bpm 240
  midi 60,
    vel: 127/2 # midi value from 0 to 127
  
  sleep 0.5
  
  midi 60,
    vel_f: 0.5 # velocity float 1 = 127 so 0.5=127/2
  
  sleep 0.5
  
  midi notes_de_la_gamme.tick,
    velocity: 127/5,
    ##| is equal to velocity_f: 0.2,
    channel: 3
  
  sleep 1
  
end

Note that the midi command help section should mention we can use vel_f right ?

midi  note (number) 
Sends a MIDI note on event to all connected MIDI devices and all channels and then after sustain beats sends a MIDI note off event. Ensures MIDI trigger is synchronised with standard calls to play and sample. Co-operates completely with Sonic Pi’s timing system including time_warp. 
If note is specified as :off then all notes will be turned off (same as midi_all_notes_off). 
Introduced in v3.0 
Options

sustain:
Duration of note event in beats 
vel:
Velocity of note as a MIDI number 
on:
If specified and false/nil/0 will stop the midi on/off messages from being sent out. (Ensures all opts are evaluated in this call to midi regardless of value). 

Cheers