Topic: RPC API changes in Pianoteq 9

The RPC API has changed in Pianoteq 9 that may require changes to applications that use this interface. This is not mentioned in the change (release) notes. I have observed the following changes:

  • Parameter symbols are now lowercase and use underscore instead of spaces, e.g. "Post Effect Gain" becomes "post_effect_gain".

  • Effects parameter symbols have lost the square braces and dots and use underscore separators, e.g. "Effect[1].Param[1]" becomes "effect_1_param_1".

  • Parameter indices have changed, e.g. Guitar Legato id changes from 52 to 167.

I am not aware of any documentation for the API. Is there a document or is there an API command that will show available commands, etc.?

The paramter values are normalised (0.0..1.0) but there is no indication of the parameter type (float, bool, etc.) or its natural range, e.g. -60dB..+6dB. It would be advantageous if the parameter info included parameter type and range, e.g. {'id': 'mic_1_bus_1_volume', 'index': 76, 'name': 'Mic 1 Bus 1 Volume', 'normalized_value': 0.75, 'text': '0', 'unit': 'dB', 'type': 'float', 'min': '-59.0', 'max':'6.0'}.

Re: RPC API changes in Pianoteq 9

i would like to know the answers to your question myself.  docs for the API would be extremely helpful.  all i know (which you also probably know) is that in ptq8 if you start up a server and load it into the browser, it shows a list of commands and a sample python script.

i.e. (ptq is link to the binary)

$ ptq --serve ""
Listening for JSON-RPC on http://127.0.0.1:8081/jsonrpc

then loading up that page gives some info.

i don't know what happens in ptq9 because i still have to upgrade ...

Re: RPC API changes in Pianoteq 9

Parameter indices should not be relied upon, it is the IDs that are expected to be stable.

Well.. except between v8 and v9.

That was not a planned change, but more a side effect of fixing issues with parameter ids for the various plugin formats (AU, AUv3, VST3, LV2...) which all have specific requirements like "not dot ever in ids" or "square brackets break everything"

You should be able to convert from old ids to new ids by just lowercasing everything, replacing every sequence of characters not in [a-z0-9] by a single '_'.

Sorry for that.

Re: RPC API changes in Pianoteq 9

If you don't want to deal with the normalised values then you can set via the "text" field directly e.g.

rpc("setParameters", params = [{ "list" : {"id":"volume","text":"-20.0"} }])

For max/min values and types etc. I can check them here by loading PTQ as an AU in Logic and going to the Controls panel which shows them all with sliders that range from min to max.

This btw means that at least the AU interface is exporting the information, so someone *could* knock up an AU host to load PTQ and print it all out.

Re: RPC API changes in Pianoteq 9

xooorx wrote:

someone *could* knock up an AU host to load PTQ and print it all out.

OK its not quite that simple but I've managed to get some information via the AU route.

The AU interface does not provide user-units min and max values. It *could* provide a unit name but PianoTeq leaves this blank.
(The RPC interface occasionally provides a unit name but mostly also leaves this blank)

The AU interface tells you if a parameter is discrete or continuous, and can provide a user-facing *string* for any normalised value you give it. So you can get min and max strings by giving it 0.0 or 1.0 e.g.

"Velocity Offset" is continuous, min = "-1.00", max = "+1.00"
"Volume" is continuous, min = "Off", max = "+12.0"
"Equalizer Switch" is indexed, min = "Off", max = "On"

Beware though that even if you can glean the min/max from the strings, you still don't know what curve is followed between the two! However volume is getting from -infinity to +12.0 it will not be by a linear fade.

AU can provide all the strings for a discrete enumerated value. In PianoTeq these are all "Off"|"On" switches except for Bounce Sync Speed which covers...
"16d","16","16t","8d" [...loads more here...] "1/32d","1/32","1/32t"

AU gives specific parameter names ("Eff 2 PEQ1G") while RPC gives generic ("Eff 2 Param 2"). There are some other differences with effect parameter value handling that I haven't got to the bottom of.

Having said all that, here is a dump of what I got from AU:

Condition|continuous|0|10.00
Dynamics|continuous|1|100
Volume|continuous|Off|+12.0
Velocity Offset|continuous|-1.00|+1.00
Post Effect Gain|continuous|-12.0|+12.0
Morphing|continuous|0|100
Equalizer Switch|indexed|Off|On
Aftertouch|continuous|0|1.00
Diapason|continuous|20.0|3380.0
Sustain Pedal|continuous|0|1.00
Soft Pedal|continuous|0|1.00
Sostenuto Pedal|continuous|0|1.00
Harmonic Pedal|continuous|0|1.00
Rattle Pedal|continuous|0|1.00
Buff Stop Pedal|continuous|0|1.00
Celeste Pedal|continuous|0|1.00
Mozart Rail|continuous|0|1.00
Super Sostenuto|continuous|0|1.00
Pinch Harmonic Pedal|continuous|0|1.00
Glissando Pedal|indexed|Off|On
Thunder Pedal|continuous|0|1.00
Harpsichord Register 1|indexed|Off|On
Harpsichord Register 2|indexed|Off|On
Harpsichord Register 3|indexed|Off|On
Reversed Sustain|continuous|0|1.00
Pitch Bend|continuous|-4800|+4800
Unison Width|continuous|0|20.00
Octave Stretching|continuous|0.95|3.00
Unison Balance|continuous|-1.00|+1.00
Direct Sound Duration|continuous|0|5.00
Hammer Noise|continuous|0.10|3.00
Hammer Hardness|continuous|-1.00|+1.00
Hammer Hardness Piano|continuous|0|2.00
Hammer Hardness Mezzo|continuous|0|2.00
Hammer Hardness Forte|continuous|0|2.00
Spectrum Profile 1|continuous|-15.0|+15.0
Spectrum Profile 2|continuous|-15.0|+15.0
Spectrum Profile 3|continuous|-15.0|+15.0
Spectrum Profile 4|continuous|-15.0|+15.0
Spectrum Profile 5|continuous|-15.0|+15.0
Spectrum Profile 6|continuous|-15.0|+15.0
Spectrum Profile 7|continuous|-15.0|+15.0
Spectrum Profile 8|continuous|-15.0|+15.0
Hammer Tone|continuous|-1.00|+1.00
Strike Point|continuous|1/64.0|1/2.0
Pinch Harmonic Point|continuous|1/64.0|1/2.0
Pickup Symmetry|continuous|0|1.00
Pickup Distance|continuous|0.20|2.00
Soft Level|continuous|0|1.00
Clavinet Low Mic|continuous|-1.00|+1.00
Clavinet High Mic|continuous|-1.00|+1.00
Impedance|continuous|0.10|20.00
Impedance Cutoff|continuous|0.30|3.00
Impedance Slope|continuous|0.20|10.00
String Length|continuous|0.80|10.00
Sympathetic Resonance|continuous|0|5.00
Duplex Scale Resonance|continuous|0|20.00
Quadratic Effect|continuous|0|20.00
Hammer Tine Noise|continuous|-100.00|+25.00
Blooming Energy|continuous|0|2.00
Blooming Inertia|continuous|0.10|3.00
Stereo Width|continuous|0|5.00
Lid Position|continuous|0|1.00
Mic Level Compensation|indexed|Off|On
Mic Delay Compensation|indexed|Off|On
Head X position|continuous|-10.000|+10.000
Head Y position|continuous|-6.000|+6.000
Head Z position|continuous|0|3.500
Head Diameter|continuous|10.000|50.000
Head Angle|continuous|-180.0|+180.0
Mic 1 Mic Switch|indexed|Off|On
Mic 1 X position|continuous|-10.000|+10.000
Mic 1 Y position|continuous|-6.000|+6.000
Mic 1 Z position|continuous|0|3.500
Mic 1 Azimuth|continuous|-180.0|+180.0
Mic 1 Elevation|continuous|-180.0|+180.0
Mic 1 Bus 1 Volume|continuous|Off|+6.0
Mic 1 Bus 1 Pan|continuous|-1.00|+1.00
Mic 2 Mic Switch|indexed|Off|On
Mic 2 X position|continuous|-10.000|+10.000
Mic 2 Y position|continuous|-6.000|+6.000
Mic 2 Z position|continuous|0|3.500
Mic 2 Azimuth|continuous|-180.0|+180.0
Mic 2 Elevation|continuous|-180.0|+180.0
Mic 2 Bus 1 Volume|continuous|Off|+6.0
Mic 2 Bus 1 Pan|continuous|-1.00|+1.00
Mic 3 Mic Switch|indexed|Off|On
Mic 3 X position|continuous|-10.000|+10.000
Mic 3 Y position|continuous|-6.000|+6.000
Mic 3 Z position|continuous|0|3.500
Mic 3 Azimuth|continuous|-180.0|+180.0
Mic 3 Elevation|continuous|-180.0|+180.0
Mic 3 Bus 1 Volume|continuous|Off|+6.0
Mic 3 Bus 1 Pan|continuous|-1.00|+1.00
Mic 4 Mic Switch|indexed|Off|On
Mic 4 X position|continuous|-10.000|+10.000
Mic 4 Y position|continuous|-6.000|+6.000
Mic 4 Z position|continuous|0|3.500
Mic 4 Azimuth|continuous|-180.0|+180.0
Mic 4 Elevation|continuous|-180.0|+180.0
Mic 4 Bus 1 Volume|continuous|Off|+6.0
Mic 4 Bus 1 Pan|continuous|-1.00|+1.00
Mic 5 Mic Switch|indexed|Off|On
Mic 5 X position|continuous|-10.000|+10.000
Mic 5 Y position|continuous|-6.000|+6.000
Mic 5 Z position|continuous|0|3.500
Mic 5 Azimuth|continuous|-180.0|+180.0
Mic 5 Elevation|continuous|-180.0|+180.0
Mic 5 Bus 1 Volume|continuous|Off|+6.0
Mic 5 Bus 1 Pan|continuous|-1.00|+1.00
Mic 6 Mic Switch|indexed|Off|On
Mic 6 X position|continuous|-10.000|+10.000
Mic 6 Y position|continuous|-6.000|+6.000
Mic 6 Z position|continuous|0|3.500
Mic 6 Azimuth|continuous|-180.0|+180.0
Mic 6 Elevation|continuous|-180.0|+180.0
Mic 6 Bus 1 Volume|continuous|Off|+6.0
Mic 6 Bus 1 Pan|continuous|-1.00|+1.00
Mic 7 Mic Switch|indexed|Off|On
Mic 7 X position|continuous|-10.000|+10.000
Mic 7 Y position|continuous|-6.000|+6.000
Mic 7 Z position|continuous|0|3.500
Mic 7 Azimuth|continuous|-180.0|+180.0
Mic 7 Elevation|continuous|-180.0|+180.0
Mic 7 Bus 1 Volume|continuous|Off|+6.0
Mic 7 Bus 1 Pan|continuous|-1.00|+1.00
Mic 8 Mic Switch|indexed|Off|On
Mic 8 X position|continuous|-10.000|+10.000
Mic 8 Y position|continuous|-6.000|+6.000
Mic 8 Z position|continuous|0|3.500
Mic 8 Azimuth|continuous|-180.0|+180.0
Mic 8 Elevation|continuous|-180.0|+180.0
Mic 8 Bus 1 Volume|continuous|Off|+6.0
Mic 8 Bus 1 Pan|continuous|-1.00|+1.00
Sound Speed|continuous|200|500
Wall distance|continuous|0|6.00
Lid|indexed|Off|On
Mute|continuous|0|1.00
Damper Noise|continuous|Off|+24
Damper Position|continuous|1/64.0|1/2.0
Last Damper|continuous|0|128
Pedal Noise|continuous|Off|+25
Key Release Noise|continuous|Off|+25
Damping Duration|continuous|0.03|10.00
Keyboard Range Switch|indexed|Off|On
Bounce Switch|indexed|Off|On
Bounce Delay|continuous|50.00|1000.00
Bounce Sync|indexed|Off|On
Bounce Sync Speed|indexed|16d|16|16t|8d|8|8t|4d|4|4t|2d|2|2t|1d|1|1t|1/2d|1/2|1/2t|1/4d|1/4|1/4t|1/8d|1/8|1/8t|1/16d|1/16|1/16t|1/32d|1/32|1/32t
Bounce Velocity Sensitivity|continuous|0|100
Bounce Delay Loss|continuous|0|100
Bounce Velocity Loss|continuous|0|100
Bounce Humanization|continuous|0|100
NFX Lfo Shape|continuous|0|2.00
NFX Lfo Skew|continuous|-1.00|+1.00
NFX Lfo Rate|continuous|0|25.00
NFX Lfo Phase|continuous|0|360
NFX Lfo Phase Locked|indexed|Off|On
NFX Onset Duration|continuous|0|5.00
NFX Vibrato|continuous|0|100
NFX Vibrato Offset|continuous|-1.00|+1.00
NFX Tremolo Depth|continuous|0|50.00
NFX Tremolo Phase|continuous|0|360
Attack Envelope|continuous|0|10.0000
Smear|continuous|0|1.00
Virtuosity|continuous|0|1.00
Fret|continuous|0|19
Guitar Legato|continuous|0|2.00
Guitar easy fingering|indexed|Off|On
Guitar Body|continuous|0|1.00
Eff 1 Switch|indexed|Off|On
Eff 1 DelMix|continuous|0|100
Eff 1 DelTime|continuous|1|1000
Eff 1 DelFb|continuous|0|100
Eff 1 DelTone|continuous|-1.00|+1.00
Eff 1 DelPol|indexed|Off|On
Eff 1 DelPing|indexed|Off|On
Eff 1 Param 7|continuous|0|1.00
Eff 1 Param 8|continuous|0|1.00
Eff 2 Switch|indexed|Off|On
Eff 2 PEQ1F|continuous|40|22050
Eff 2 PEQ1G|continuous|-25.0|+25.0
Eff 2 PEQ1Q|continuous|0.01|100.00
Eff 2 PEQ1T|continuous|Peak|Tilt
Eff 2 PEQ2F|continuous|40|22050
Eff 2 PEQ2G|continuous|-25.0|+25.0
Eff 2 PEQ2Q|continuous|0.01|100.00
Eff 2 PEQ2T|continuous|Peak|Tilt
Eff 3 Switch|indexed|Off|On
Eff 3 PEQ1F|continuous|40|22050
Eff 3 PEQ1G|continuous|-25.0|+25.0
Eff 3 PEQ1Q|continuous|0.01|100.00
Eff 3 PEQ1T|continuous|Peak|Tilt
Eff 3 PEQ2F|continuous|40|22050
Eff 3 PEQ2G|continuous|-25.0|+25.0
Eff 3 PEQ2Q|continuous|0.01|100.00
Eff 3 PEQ2T|continuous|Peak|Tilt
Reverb Switch|indexed|Off|On
Reverb Duration|continuous|0|5.00
Reverb Mix|continuous|Off|+50.0
Room Dimensions|continuous|5.00|50.00
Reverb Pre-delay|continuous|0|0.200
Reverb Early Reflections|continuous|-20.0|+20.0
Reverb Tone|continuous|-1.00|+1.00
Reverb Envelope|continuous|-200.0|0
Reverb Resampling|continuous|50|200
Reverb Highpass Cutoff|continuous|20.00|1000.00
Limiter Switch|indexed|Off|On
Limiter Sharpness|continuous|0|2.00
Limiter Threshold|continuous|-25|0
Limiter Gain|continuous|-30|+6