• SONAR
  • CAL Script: How to insert RPN?
2018/08/17 01:28:08
rogeriodec
In CAL I can insert some events:
(insert time channel NOTE key velocity duration)
(insert time channel CONTROL number value)
(insert time channel WHEEL value)
(insert time channel PATCH number bank) ;The ‘bank’ variable is optional
(insert time channel KEYAFT key value)
(insert time channel CHANAFT value)

 
But how can I insert RPN events?
2018/08/17 03:09:55
promidi
The way I get around this is to work out what combination of Controller events result in the equivalent RPN events.

CC 6     Data Entry Most Significant Bit(MSB)    
CC 32   Data Entry Least Significant Bit(MSB)
CC 100 Registered Parameter Number LSB (RPN)
CC 101 Registered Parameter Number MSB (RPN)

For instance, if I want to enter a Yamaha XG pitch pitch bend range (which is done via a RPN 0 event), I use the following

(do
    (int pitchbendrange 2)
    (getInt pitchbendrange "Please enter pitchbend Range" 0 24)
    (insert Now 0 CONTROL 100 0)
    (insert (+= Now 1) 0 CONTROL 101 0)
    (insert (+= Now 2) 0 CONTROL 6 pitchbendrange)
)

I also use a specially crafted Studioware panel that does the same thing but without needing CAL

Hope that helps.


© 2025 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account