Arturia MiniLab Black pad sends the following settings as follows:
Pad 1 = Note C1, Midi Ch 10
Incrementing by 1 note for each pad up to Pad 8
For Pad 9 - 16
The pads send a CC message, not a Note Message
Pad 9 = CC Midi Ch 1, CC Number 22, CC value 127
When the pad is released, the following is sent.
Pad 9 = CC Midi Ch 1, CC Number 22, CC value 0
So a value of 127 means, being pressed and a value of 0 means a pad is released.
This is the default setting for the Arturia MiniLab Black.
If you've changed from these default settings, this script will not work until you either modifiy the script to your MiniLab changes or restore the default settings to the MiniLab.