Limiting dynamic range



  • For my instrument (flute) I have normalised the samples to roughly -3db. In HISE I want to try to restore the dynamic range of the instrument. For the flute the low register can't be played too loudly and the high register can't be played softly. What would be the best way to limit the dynamic range?

    I can use a note number mod on the gain to prevent the gain being too high on the low notes, but how do I stop the gain being too low on the high notes?



  • @d-healey I've used this script in Kontakt that I think would do what you need. Maybe you can find a way to incorporate in HISE.

    on init
      declare $SampleVolume
      declare $Sense := 0		{ used in dynamics control }
      declare $adjustedVelocity    	{ used in dynamics control }
      declare $DynamicRange		{ used in dynamics control }
      declare $VolumeOffset := 0  	{ used in dynamics control }
    
      { ------------------------------ END DECLARE VARIABLES }
    
    
     
      { --------------------------------------------------------------- DROP DOWN MENUS }
    
      declare ui_menu $Sensitivity
      add_menu_item ($Sensitivity, "Dynamic",0)  {full dynamic range, standard volume gradient}
      add_menu_item ($Sensitivity, "Detailed",1)  { full dynamic range, raised volume of low hits, lowered vol of high hits}
      add_menu_item ($Sensitivity, "Light",2)  { limited dynamic range -  top 1/4 sample zones not used}
      add_menu_item ($Sensitivity, "Heavy",3)  { limited dynamic range - bottom 1/4 sample zones not used}
    
    
    end on
    { -------------------------------------------------------------- END INIT }
    
    
    
    { --------------------------------- SENSITIVITY UI HANDLER } 
    on ui_control($Sensitivity)
     select ($Sensitivity)
        case 0  {Dynamic}
    		$Sense := 0
    		$DynamicRange := 0
    		$VolumeOffset := 0
    	case 1 {Detailed}
    		$Sense := 130   {100 = standard dynamic, 180 = very detailed }
    		$DynamicRange := 0
    		$VolumeOffset := -4250 {vol decrease compensation}
    	case 2 {Light}
    		$Sense := 0
    		$DynamicRange := 1
    		$VolumeOffset := 3650 {vol increase compensation}
    	case 3 {Heavy}
    		$Sense := 0
    		$DynamicRange := 2
    		$VolumeOffset := -1750 {vol decrease compensation}
    	end select
    end on
    
    { ------------------------------------------------------------------------------------------------------- MAIN NOTE CONTROL } 
    on note
    
    
    	{ ------------- adjust incoming velocity based on UI DynamicRange setting }
    	 $adjustedVelocity := $EVENT_VELOCITY
    	 select ($DynamicRange)
    		case 0
    		case 1
    			$adjustedVelocity := ($EVENT_VELOCITY*3/4)
    		case 2
    			$adjustedVelocity := ($EVENT_VELOCITY*3/4)+31
    	end select
    	change_velo($EVENT_ID,$adjustedVelocity)
    
    
    { --------- REDUCE VOLUME FOR LOWER VELOCITY NOTES }
    	$SampleVolume := (128 - $EVENT_VELOCITY)*($minimumVolume +$Sense)
    	$SampleVolume := $SampleVolume + $VolumeOffset
    	change_vol($EVENT_ID, $SampleVolume, 0)
    
    end on
    
    


  • @d-healey Another option is to use different samplers for Hi Med Low velocity levels... then you can adjust the output gain of each separately.



  • @dustbro Thanks for the code snippet. I'm not sure it will work in my case though. I have volume controlled by CC, I am starting to think a scripted solution is going to be the way forward though so I'll see what I can borrow from your snippet 🙂


Log in to reply
 

1
Online

277
Users

739
Topics

4.8k
Posts

Looks like your connection to Forum was lost, please wait while we try to reconnect.