The PRE tool depends on the available API. This API does not give direct access to be able to edit directly in the Phrase Editor. That is, it is not possible to use OSC messages to play notes (sound) and thus be able to edit them in the Phrase Editor (add/delete notes).
In fact, as far as I know, the API for the phrase editor “is incomplete”. It is not as advanced as for the Pattern Editor. Moreover, if you select the Phrase Editor, PRE cannot record any, because the Pattern Editor is not selected. In this case, from the PRE, the OSC messages will play the constructed phrases, even if you have the Phrase Editor with the “edit mode” enabled.
It is as if the API was prepared to expand things, but there is a lack of content so that the tool programmer can work extensively with the phrases (edit in the Phrase Editor through OSC). I don’t know if there is any “hidden” direct way of doing it. If there is, let expert someone comment.
I am referencing Renoise 3.2.0 / 3.2.1 at all times…
For trigger notes, inside OSC exists this messages (used in the PRE):
/renoise/trigger/note_off(number,number,number)
/renoise/trigger/note_on(number,number,number,number)
This only works with the Pattern Editor. There are no 2 equivalent messages that do the same but only for the Phrase Editor. Therefore, it is not possible to add this way of operating.
If you have a phrase with a note in the first column of the first line, you can get the value of the note:
print(renoise.song().selected_phrase:line(1):note_column(1).note_value)
If it is C-4, the note_value = 48
That is, it is possible to enter the notes in the Phrase Editor, but not from OSC:
renoise.song().selected_phrase:line(1):note_column(1).note_value=48
or the note-OFF:
renoise.song().selected_phrase:line(1):note_column(1).note_value=120
or clear the note:
renoise.song().selected_phrase:line(1):note_column(1).note_value=121
But the notes will not sound! Renoise (and your API) is not yet designed/finished for this. The only way from the API to sound the notes is to use OSC.
By the way, in the API I think there is no “selected_line” for the Phrase Editor. Have I missed something? This prevents locating the current line to be able to edit over it. Everything seems to indicate that the API is incomplete for editing phrases.