Jump to content


Photo

get all actually played notes on a line ?


  • Please log in to reply
7 replies to this topic

#1 stygmate

stygmate

    New Member

  • Normal Members
  • Pip
  • 9 posts

Posted 25 March 2017 - 16:25

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 :)



#2 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 25 March 2017 - 19:12

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

Edited by Ledger, 25 March 2017 - 19:13.

--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#3 stygmate

stygmate

    New Member

  • Normal Members
  • Pip
  • 9 posts

Posted 25 March 2017 - 23:49

thx Ledger :)

 

 

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 ?



#4 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 26 March 2017 - 01:43

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, it`s line and it`s 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")

Edited by Ledger, 26 March 2017 - 01:56.

--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#5 stygmate

stygmate

    New Member

  • Normal Members
  • Pip
  • 9 posts

Posted 26 March 2017 - 11:44

Thx a lot Ledger :)

 

 

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.



#6 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 26 March 2017 - 13:55

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

 

http://forum.renoise...ry-for-renoise/


--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites


#7 stygmate

stygmate

    New Member

  • Normal Members
  • Pip
  • 9 posts

Posted 26 March 2017 - 13:59

yeah ! i have downloaded it !

 

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



#8 Ledger

Ledger

    Guruh Motha Fakka Knows More About Renoise Than Taktik

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 3333 posts
  • Gender:Male

Posted 26 March 2017 - 14:28

Good luck with it!

 

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


--> Lua For Beginners <--
--> Lua for newbies <--

My Scripts On Forum

Top Tip!

 

cpu : Xeon 1231 v3, os : Win 7 64bit, audio: Audient iD4
posts as 4tune @ KvR and some other music related sites