How to use the LUA API to write a Note-Off to a current phrase line (where the cursor currently is at) renoise.song().instruments[renoise.song().selected_instrument_index].phrases[renoise.song().selected_phrase_index].lines[renoise.song().selected_line_index].note_columns[renoise.song().selected_note_column_index].note_string=“OFF” but unfortunately this will write the “OFF” to where the cursor is in the pattern editor, not in the phrase editor.
Avoid making redundant calls, using a “local”: local song = renoise.song
Learn to use code shortcuts in the API to access more directly: song().selected_phrase:line(index)
The current API (API5 or API6) does not give access to the index of the line inside the phrase.
This is the index of the line within the pattern, not within the phrase: renoise.song().selected_line_index
You can ask @taktik to add something like this (or similar): renoise.song().phrase_selected_line_index (this does not exist!)
The current API (API5 or API6) does not give access to the index of the note column inside the phrase.
This is the index of the note column within the pattern, not within the phrase: renoise.song().selected_note_column_index
You can ask @taktik to add something like this (or similar): renoise.song().phrase_selected_note_column_index (this does not exist!)
Research yourself. I am not 100% sure. It is strange that the API does not have access to the index of the line or the index of the note column within the current phrase. These are two indexes necessary to be able to edit the current phrase from the API.
Regardless of all this, do not confuse pattern data with phrase data.
But in this case, it makes perfect sense to add these two indexes. It is not an “extra thing”, but rather a “missing thing”, to complete the API package.
Can you manipulate the visibility of the columns but not know the index (the position of the cursor inside the phrase)? What? There are less important things that are implemented. But the index of the note column and the index of the line are essential to know the position.
It is a matter of reasoning. In addition, they should be _observable.
@esaruoho I think the next issue is directly related. It is necessary for Renoise to keep the focus on the selected editor when the instrument editor window is separated.
In this case, the problem is that the pattern editor always “has priority” (I think it is badly programmed). In fact, the following occurs (R3.2.1):
Separate the instrument editor window.
Be sure to focus the phrase editor.
Go to the terminal and print: print(renoise.app().window.active_middle_frame). This query will return the value 1 (pattern editor), when it should be 3 (phrase editor), since it was the last editor focused.
In addition, OSC does not have specific trigger_on and trigger_off messages for phrases.
So I think there are three things missing to work with phrases properly:
Add selected_phrase.selected_line_index and selected_phrase.selected_line_index_observable for current phrase.
Inside the OSC, add trigger_on and trigger_off for phrases (sound and edit).
Fix the renoise.app().window.active_middle_frame so that the programmer has control of the focused frame at all times (pattern editor or phrase editor), even if the instrument editor window is separated.
Also, the phrase editor has another problem: it doesn’t have the option of follow the player’s position for the current phrase.
Also, the API also does not give access to the play and stop of the current phrase.
At least 5 essential features are missing and that @taktik should add/fix if he wants to give us access.
well, i’d love to know how many hundreds or thousands of euros one would need to pay @taktik to be able to get these API features in. am being pretty serious.
Probably the lack of time. Time is very undervalued and is more valuable than anything. Integrating these things involves two things:
Use time.
Do not use that time on something else.
There are many requests in the forums. I guess there is a list of priorities. Maybe the world of phrases is not in the top positions (it is necessary to attend to other things that are more necessary first).
I have seen requests for things that already exist. I have seen requests for things that can be done with tools. There are also this kind of requests, which complete the API gaps.
The other day I requested that access to the cursor position be added to the sample buffer. It does not exist in the API. They are small things that would facilitate many things. If you are busy with something else, all this can be a mountain. Or put another way, the benefit of attending to all these requests is almost nil. Thanks to this, no more Renoise licenses will be sold.
I don’t usually send emails to Renoise support. I did it once and dBlue answered me and he is in the forums.
But yes. For something to happen, I suppose you would have to convince Taktik widely directly. It seems that lately it is more accessible in the forums.