get all actually played notes on a line ?

Hello All,

I want to get all actually playing notes for the line where the edit cursor is ?

my goal is to display all of it in a little floating window.

Thx by advance :slight_smile:

This should get you started, a couple of loops:

first one prints the notes strings (c-4 etc), second loop prints their numerical values (0-121)

local pat_track = renoise.song().selected_pattern_track
local line = renoise.song().selected_line_index

--prints note_strings for selected line
for i = 1,12 do
  print(pat_track:line(line):note_column(i).note_string)
end

--prints note_values for selected line
for i = 1,12 do
  print(pat_track:line(line):note_column(i).note_value)
end

thx Ledger :slight_smile:

but it only read notes begining on a line.

is there any function to know what note are actually running for a certain line (between note on and note off) ?

I have quickly check the xvoicerunner of xlib: appropriate ? if yes any snippet somewhere ?

I see,

xvoicerunner may have some stuff, danoise would have to chip in or you could throw him a PM.

Here is a snippet though that reverse loops up the pattern columns from the current selected line. It prints the note, its line and its column. It breaks when it finds a note and moves on to the next column

local pat_track = renoise.song().selected_pattern_track
local sel_line = renoise.song().selected_line_index

for col = 1,12 do
  for line = sel_line,1,-1 do
    if pat_track:line(line):note_column(col).note_string ~= "---" then
      print(pat_track:line(line):note_column(col).note_string.." [col: "..col.." line: "..line.."]")
      break
    end
  end
end

print("\n")

edit: In the API you can also limit the loop to visible note columns with the API call:

renoise.song().tracks[].visible_note_columns, _observable
 -> [number, 0 OR 1-12, depending on the track type]

snippet updated to only scan visible columns:

local pat_track = renoise.song().selected_pattern_track
local sel_line = renoise.song().selected_line_index
local track = renoise.song().selected_track

for col = 1,track.visible_note_columns do
  for line = sel_line,1,-1 do
    if pat_track:line(line):note_column(col).note_string ~= "---" then
      print(pat_track:line(line):note_column(col).note_string.." [col: "..col.." line: "..line.."]")
      break
    end
  end
end

print("\n")

Thx a lot Ledger :slight_smile:

it helped me ! Iā€™m going to learn observers and gui api to wrote the complete thing.

You seems to be a lot involved in Renoise tools dev, so i ask another question:

is there any lua lib with compatibility with renoise for doing http requests a simple way (no socket handling) ?

I thing about doing a simple flask server in python for doing calculation on notes.

Ben.

Not sure if this might help? I`ve not delved into it or sockets myself:

https://forum.renoise.com/t/new-tool-3-0-request-web-server-library-for-renoise/43274

yeah ! i have downloaded it !

thinking about using websocket to have bidirectional communication (if i think well) !

Good luck with it!

Will be interested to see what you come up with if you`re sharing later.