Setting an instrument macro mapping

Is it possible to set the Instrument Macro Mapping in the API?

From the docs…

-- Linked parameter. Can be a sample FX- or modulation parameter. Never nil.[].macros[].mappings[].parameter  
 -> [read-only, renoise.DeviceParameter]  

Here the .parameter is read only so how can I set the mapping target?

Also one other thing, is it possible to set the ‘Pitch Range’ in the pitch modulation window?