Part.text = 'This is the test text to be inserted.' Song.newLane('MyMidiLane', type('Midi')) (Insert / delete notes, change midi effects like pitch wheel etc.) It can import / export regular midi files, so it will work with Fruity loops or whatever else you have.
There's an opensource music workstation, called Frinika, and you can script that in Javascript.