Jump to content


Photo

Renoise 3.1.1 - help with print() showing in terminal


  • Please log in to reply
6 replies to this topic

#1 Aisjam

Aisjam

    New Member

  • Normal Members
  • Pip
  • 4 posts

Posted 07 December 2018 - 01:16

Hello,

 

c# programmer and first time lua user.

 

i am writing a controller setup for my Arturia Keylab mkii and has been going well. I have written a custom function to overwrite the way duplex lights buttons as the keylab handles them differently, however i haven't been able to get any of my print() to show in the terminal from my custom lua scripts so i cant see whats going wrong. 

 

been searching around for an answer. i have managed to get the testpad.lua to print to terminal but none of my other scripts. is there something i am missing? do i need to connect the scripted i created to terminal somehow? i am running Windows 10.

 

Any information is greatly appreciated



#2 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1599 posts
  • Gender:Male
  • Location:Spain

Posted 07 December 2018 - 03:40

Hello,

 

c# programmer and first time lua user.

 

i am writing a controller setup for my Arturia Keylab mkii and has been going well. I have written a custom function to overwrite the way duplex lights buttons as the keylab handles them differently, however i haven't been able to get any of my print() to show in the terminal from my custom lua scripts so i cant see whats going wrong. 

 

been searching around for an answer. i have managed to get the testpad.lua to print to terminal but none of my other scripts. is there something i am missing? do i need to connect the scripted i created to terminal somehow? i am running Windows 10.

 

Any information is greatly appreciated

 

Use the Renoise native terminal for scripting.

 

You can create any function, and within it invoke a print (). If you invoke the function, print () will work.
 
For example:
--define the function
local function the_print()
  local text = "The long text 1."
  print("Print inside the function:", text)
end

--invoke the function
the_print()

--or...
print("The long text 2.")

--or...
print(renoise.song().selected_line_index) --return a index number

To do tests, you can use the file TestPad.lua ("Execute" button), or your main.lua, after of write the code save the file.

 

You can use print(), oprint(), or rprint(), depending on what you need. Look in the documentation for what everything is.

 

Maybe you would find it more comfortable to use auto_reload_debug("your_dialog") inside your main.lua. Thus, each time you modify anything, it will autoexecute itself.


Maybe this forum should move elsewhere ...


Edited by Raul (ulneiz), 07 December 2018 - 03:37.

:excl: Development of my tools: Piano Roll EditorKangarooX120SamRenderPhraseTouch

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#3 Neurogami

Neurogami

    Big Super GrandMasta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Scottsdale AZ
  • Interests:Art, music, technology

Posted 07 December 2018 - 03:42

Are you sure your code is getting loaded?



#4 Raul (ulneiz)

Raul (ulneiz)

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1599 posts
  • Gender:Male
  • Location:Spain

Posted 07 December 2018 - 03:50

http://forum.renoise...-lua-scripting/


:excl: Development of my tools: Piano Roll EditorKangarooX120SamRenderPhraseTouch

 

:excl: My API wishlist R3.1 (updated 24 July 2017):

Spoiler

 

:excl: My Renoise 3.1 wishlist (updated 26 September 2017):

Spoiler

#5 Conner_Bw

Conner_Bw

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7183 posts
  • Gender:Male
  • Location:Montreal, Quebec, Canada

Posted 07 December 2018 - 22:12

There are 3 types of prints in Renoise. oprint for objects, rprint for tables, print for everything else.

 

Here's a `dbug` print (from Grid Pie) that may help you. (It figures out which print to use automatically)

function dbug(msg)
  local base_types = {
    ["nil"]=true, ["boolean"]=true, ["number"]=true,
    ["string"]=true, ["thread"]=true, ["table"]=true
  }
  if not base_types[type(msg)] then oprint(msg)
  elseif type(msg) == 'table' then rprint(msg)
  else print(msg) end
end

cpu Lenovo X220, Intel i7-2640M @ 2.80GHz ×4 os Windows 10 / Ubuntu 16.04 LTS
My Homepage » : My Renoise Tools » : Normalize Your Sig » : MBC Archives »


#6 Aisjam

Aisjam

    New Member

  • Normal Members
  • Pip
  • 4 posts

Posted 08 December 2018 - 12:57

Are you sure your code is getting loaded?

 

Yep... that is the one. my folder/file names were not the same so my script wasn't running my overriding class.

 

Thank you all for your information. It really helped out.


  • Neurogami likes this

#7 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 7008 posts
  • Gender:Male
  • Location:Berlin
  • Interests:wildlife + urban trekking

Posted 09 December 2018 - 11:24

print() to show in the terminal from my custom lua scripts so i cant see whats going wrong. 

 

Not to complicate things, but I want to point out that Duplex is making use of a method called TRACE (link)

For large projects, this might be interesting as you can enable/disable which parts to show via pattern matching.

So you can mix this with smaller, more "temporary" print() statements if you like. 


Tracking with Stuff. API wishlist | Soundcloud