Wednesday, January 2, 2013

midi messages, osc note on/off, stop all sounds - Renoise Forums

Jump to content

Example
#{example}
"); ipb.editor_values.get('templates')['togglesource'] = new Template("
??? Cancel Source Edit
"); ipb.editor_values.get('templates')['toolbar'] = new Template(""); ipb.editor_values.get('templates')['button'] = new Template("
  • "); ipb.editor_values.get('templates')['menu_item'] = new Template("
  • #{title}
  • "); ipb.editor_values.get('templates')['togglesource'] = new Template("
    ??? Cancel Source Edit
    "); ipb.editor_values.get('templates')['emoticons_showall'] = new Template(""); ipb.editor_values.get('templates')['emoticon_wrapper'] = new Template("

    Emoticons

    "); // Add smilies into the mix ipb.editor_values.set( 'show_emoticon_link', false ); ipb.editor_values.set( 'bbcodes', $H({"acronym":{"id":"8","title":"Acronym","desc":"Allows you to make an acronym that will display a description when moused over","tag":"acronym","useoption":"1","example":"[acronym='Laugh Out Loud']lol[/acronym]","switch_option":"0","menu_option_text":"Enter the description for this acronym (EG: Laugh Out Loud)","menu_content_text":"Enter the acronym (EG: lol)","single_tag":"0","optional_option":"0","image":""},"entry":{"id":"35","title":"Blog Entry Link","desc":"This tag provides an easy way to link to a blog entry.","tag":"entry","useoption":"1","example":"[entry=100]Click me![/entry]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"blog":{"id":"34","title":"Blog Link","desc":"This tag provides an easy way to link to a blog.","tag":"blog","useoption":"1","example":"[blog=100]Click me![/blog]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"code":{"id":"13","title":"Code","desc":"Allows you to enter general code","tag":"code","useoption":"0","example":"[code]$text = 'Some long code here';[/code]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"embed":{"id":"37","title":"embed","desc":"Allows you to embed video material","tag":"embed","useoption":"0","example":"[embed]src=http://video.google.com/googleplayer.swf?docId=-2823239341954301626&hl=nl width=478 height=326[/embed]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"extract":{"id":"33","title":"Extract Blog Entry","desc":"This will allow users to define an extract for an entry. Only this piece of the entry will be displayed on the main blog page and will show up in the RSS feed.","tag":"extract","useoption":"0","example":"[extract]This is an example![/extract]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"hr":{"id":"12","title":"Horizontal Rule","desc":"Adds a horizontal rule to separate text","tag":"hr","useoption":"0","example":"[hr]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"html":{"id":"15","title":"HTML Code","desc":"Allows you to enter formatted/syntax-highlighted HTML code","tag":"html","useoption":"0","example":"[html][/html]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"member":{"id":"31","title":"Member","desc":"Given a member name, a link is automatically generated to the member's profile","tag":"member","useoption":"1","example":"[member=admin] runs this site.","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"1","optional_option":"0","image":""},"php":{"id":"14","title":"PHP Code","desc":"Allows you to enter PHP code into a formatted/highlighted syntax box","tag":"php","useoption":"0","example":"[php]$variable = true;\n\nprint_r($variable);[/php]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"post":{"id":"6","title":"Post Link","desc":"This tag provides an easy way to link to a post.","tag":"post","useoption":"1","example":"[post=1]Click me![/post]","switch_option":"0","menu_option_text":"Enter the Post ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"snapback":{"id":"1","title":"Post Snap Back","desc":"This tag displays a little linked image which links back to a post - used when quoting posts from the board. Opens in same window by default.","tag":"snapback","useoption":"0","example":"[snapback]100[/snapback]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"spoiler":{"id":"7","title":"Spoiler","desc":"Spoiler tag","tag":"spoiler","useoption":"0","example":"[spoiler]Some hidden text[/spoiler]","switch_option":"0","menu_option_text":"","menu_content_text":"Enter the text to be masked","single_tag":"0","optional_option":"0","image":""},"sql":{"id":"16","title":"SQL Code","desc":"Allows you to enter formatted/syntax-highlighted SQL code","tag":"sql","useoption":"0","example":"[sql]SELECT p.*, t.* FROM posts p LEFT JOIN topics t ON t.tid=p.topic_id WHERE t.tid=7[/sql]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"topic":{"id":"5","title":"Topic Link","desc":"This tag provides an easy way to link to a topic","tag":"topic","useoption":"1","example":"[topic=1]Click me![/topic]","switch_option":"0","menu_option_text":"Enter the topic ID","menu_content_text":"Enter the title for this link","single_tag":"0","optional_option":"0","image":""},"twitter":{"id":"36","title":"Twitter","desc":"A tag to link to a user's twitter account","tag":"twitter","useoption":"0","example":"[twitter]userName[/twitter]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":"twitter.png"},"wiki":{"id":"38","title":"Wiki tag","desc":"This tag links to the wiki.","tag":"wiki","useoption":"0","example":"[wiki]Main Page[/wiki]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"xml":{"id":"17","title":"XML Code","desc":"Allows you to enter formatted/syntax-highlighted XML code","tag":"xml","useoption":"0","example":"[xml]\n \n Test\n \n[/xml]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"youtube":{"id":"45","title":"YouTube","desc":"Just add the Youtube code to embed it.","tag":"youtube","useoption":"0","example":"[youtube]zXuyVKUesbw[/youtube]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""},"br":{"id":"43","title":"[br]","desc":"Add an additional linebreak","tag":"br","useoption":"0","example":"[br][/br]","switch_option":"0","menu_option_text":"","menu_content_text":"","single_tag":"0","optional_option":"0","image":""}}) ); ipb.vars['emoticon_url'] = "http://forum.renoise.com/public/style_emoticons/default"; //Search Setup ipb.vars['search_type'] = 'forum'; ipb.vars['search_type_id'] = 62; ipb.vars['search_type_2'] = 'topic'; ipb.vars['search_type_id_2'] = 36920; // Delete stuff set up ipb.topic.deleteUrls['hardDelete'] = new Template("http://forum.renoise.com/index.php?app=forums&module=moderate&section=moderate&do=04&f=62&t=36920&st=&auth_key=880ea6a14ea49e853634fbdc5015a024&p=#{pid}"); ipb.topic.deleteUrls['softDelete'] = new Template("http://forum.renoise.com/index.php?app=forums&module=moderate&section=moderate&do=postchoice&tact=sdelete&t=36920&f=62&auth_key=880ea6a14ea49e853634fbdc5015a024&selectedpids[#{pid}]=#{pid}&pid=#{pid}"); //]]>
    • You cannot start a new topic
    • You cannot reply to this topic

    #1 User is offline ? glotze?

    • Group: Normal Members
    • Posts: 4
    • Joined: 29-December 12

    Posted Yesterday, 08:33 PM

    Hallo,

    I am really new to scripting in Lua, so i have some basic questions.
    I am normaly using PureData and dicided I could try to rebuild some of my PureData things with scripting in Renoise. So I need some basic tips to get startet.

    I realised through other threads that it is not possible to trigger an instrument via the api directly.
    I have to start the OSC Server connect me to this Server and send OSC messages to it right?

    I managed to to this verry simple with the OSC example.

    The i realised thanks to MXB and the irc channel how i can make timed actions in Lua. ( renoise.tool():add_timer(myfunc, 1000) )

    One thing i didn't solve was the use of midi in lua... i tried the following from the example but had no success. Any ideas what is missing?
    the example should print some text in the terminal but nothing shows up...

     -- midi input listener (function callback)  local inputs = renoise.Midi.available_input_devices() local midi_device = nil  if not table.is_empty(inputs) then   local device_name = inputs[1]      local function midi_callback(message)     assert(#message == 3)     assert(message[1] >= 0 and message[1] <= 0xff)     assert(message[2] >= 0 and message[2] <= 0xff)         assert(message[3] >= 0 and message[3] <= 0xff)          print(("%s: got MIDI %X %X %X"):format(device_name,        message[1], message[2], message[3]))   end    -- note: sysex callback would be a optional 2nd arg...   midi_device = renoise.Midi.create_input_device(     device_name, midi_callback)      -- stop dumping with 'midi_device:close()' ... end 

    additionally i have some understanding questions.
    - When i send note_off via OSC does this trigger an envelope which fads out my instrument?
    - does every send note_on osc signal trigger a new instrument play or does it stop the old instrument and plays it again. or do renoise play two instances at the same time so that they overlap?
    - do i have to send a note_off for samples like i do for pads? or do they automatically stop playing? do i have to do this for example for freeing the ram or so?
    - is there a simple way to stop mall playing activity from lua? or do i have to send osc messages to all instruments when i want to stop all sounds?
    - is there a way to change the transpose value of an instrument via midi, osc or lua?
    thats it for now...thanks! renoise is awesome!

    This post has been edited by glotze: Yesterday, 09:12 PM

    0


    #2 User is offline ? glotze?

    • Group: Normal Members
    • Posts: 4
    • Joined: 29-December 12

    Posted Yesterday, 08:59 PM

    here is an example how my first tests sound like:
    https://soundcloud.c...ka/lua-test-002

    0


    #3 User is offline ? vV?

    • Group: Moderator
    • Posts: 14385
    • Joined: 24-October 03
    • Gender:Male
    • Location:Netherlands

    Posted Yesterday, 09:25 PM

    View Postglotze, on 31 December 2012 - 08:33 PM, said:

    One thing i didn't solve was the use of midi in lua... i tried the following from the example but had no success. Any ideas what is missing?
    the example should print some text in the terminal but nothing shows up...


    It depends on what is midi inputs[1], have you first of all printed out the devicename for inputs[1]? Perhaps it is not the midi device that you are controlling.

    View Postglotze, on 31 December 2012 - 08:33 PM, said:

    additionally i have some understanding questions.
    - When i send note_off via OSC does this trigger an envelope which fads out my instrument?
    - does every send note_on osc signal trigger a new instrument play or does it stop the old instrument and plays it again. or do renoise play two instances at the same time so that they overlap?
    - do i have to send a note_off for samples like i do for pads? or do they automatically stop playing? do i have to do this for example for freeing the ram or so?
    - is there a simple way to stop mall playing activity from lua? or do i have to send osc messages to all instruments when i want to stop all sounds?
    - is there a way to change the transpose value of an instrument via midi, osc or lua?
    thats it for now...thanks! renoise is awesome!

    1 - It should be
    2 - If you don't send a note off, it will trigger a new note, but up to a maximum or 12 notes per track and 6 notes in NNA.
    3 - Notes only stop automatically playing if the sample isn't looped, frankly the whole NNA and note-off deal is just a serious gameplayer as control through Midi is.
    4 - You could create a custom OSC function in the GlobalOSCActions.lua of the scripts folder where you can simply perform a "stop song" play which should more or less act as panic and stop all instrument play, but i haven't tested this myself. There is an existing function /transport/panic.
    5 - See 4:add a custom made lua function that responds to a custom designed OSC call that would perform the API call by using the renoise.song() api. There are some testscripts in the scripts\Snippets folder where you can toy with and ofcourse you can inspect the contents of the GlobalOSCActions.lua to see which custom made lua functions are in there including the descriptions of what they are made for and how you can add your own.

    I believe this + PureData is a double-win.

    Vv....

    cpu Intel Core2 Quad CPUQ6600 @2.40GHz
    chipset nVidia nForce 4 SLI x16 -> Driver rev:5.1.2600.445 (management 4.4.5.0)
    mem 8 Gb 800Mhz
    os Win 7 64-bit SP1, DirectX 11
    audio ESI ESP1010e - > Driver rev:2.0.1.0
    video nVidia Geforce GTX580 - > Driver rev:306.23

    Renoise Official Manual

    0


    #4 User is offline ? glotze?

    • Group: Normal Members
    • Posts: 4
    • Joined: 29-December 12

    Posted Yesterday, 10:04 PM

    Hey vV,

    thanks for your answeres...this helps me a lot.

    when i print all midi devices, i get the following: "table: 0x6b764c0"
    i rechecked the first midi device is my midi controller. any ideas? is that right?

    0


    #5 User is offline ? KMaki?

    • Group: Normal Members
    • Posts: 464
    • Joined: 04-February 11
    • Gender:Male
    • Location:Tampere, Finland
    • Interests:Survival (e.g. breathing). Small scale renoise-tool-coding. The Melvins. Absurdity of it all. Zen / Not-zen. Wifey&Kids.

    Posted Yesterday, 10:53 PM

    View Postglotze, on 31 December 2012 - 10:04 PM, said:

    Hey vV,

    thanks for your answeres...this helps me a lot.

    when i print all midi devices, i get the following: "table: 0x6b764c0"
    i rechecked the first midi device is my midi controller. any ideas? is that right?

    I'm not that familiar with the midi or osc API trickery, but in this case I'd say using rprint instead of print would get you further. Rprint is an addition for recursively printing out lua tables. Instead of the "table: 0x6b764c0" (which I think is only the address at which the table holding the midi devices resides) you'll get a list of all the elements of the table.

    If those elements are some objects like say renoiseMidiDevice-objects (making this up as I go along), you can query even further by doing an oprint (Object print) on those.

    This post has been edited by KMaki: Yesterday, 10:54 PM

    Renoise (2.6->) 2.8 / Mac mini 2010 - 2.66GHz Intel Core 2 Duo - 4 Gb 1067 MHz DDR3 / OS X 10.8 / M-Audio Fast Track USB

    0


    #6 User is offline ? vV?

    • Group: Moderator
    • Posts: 14385
    • Joined: 24-October 03
    • Gender:Male
    • Location:Netherlands

    Posted Today, 12:00 AM

    View PostKMaki, on 31 December 2012 - 10:53 PM, said:

    but in this case I'd say using rprint instead


    that or oprint(object_table) Vv....

    cpu Intel Core2 Quad CPUQ6600 @2.40GHz
    chipset nVidia nForce 4 SLI x16 -> Driver rev:5.1.2600.445 (management 4.4.5.0)
    mem 8 Gb 800Mhz
    os Win 7 64-bit SP1, DirectX 11
    audio ESI ESP1010e - > Driver rev:2.0.1.0
    video nVidia Geforce GTX580 - > Driver rev:306.23

    Renoise Official Manual

    0


    #7 User is offline ? glotze?

    • Group: Normal Members
    • Posts: 4
    • Joined: 29-December 12

    Posted Today, 12:10 AM

    View PostKMaki, on 31 December 2012 - 10:53 PM, said:

    I'm not that familiar with the midi or osc API trickery, but in this case I'd say using rprint instead of print would get you further. Rprint is an addition for recursively printing out lua tables. Instead of the "table: 0x6b764c0" (which I think is only the address at which the table holding the midi devices resides) you'll get a list of all the elements of the table.

    If those elements are some objects like say renoiseMidiDevice-objects (making this up as I go along), you can query even further by doing an oprint (Object print) on those.

    that was the trick...thanks. controller was on [5]

    now how to handle the values the best way? create a table and set all values to 0. then fill the entrys with the values when something changes?
    i think this is important because otherwise i get NIL errors.

    is there something like a range mapper function in the api...
    like: func mapper(instart,inend,outstart,outend)

    0


    #8 User is offline ? Conner_Bw?

    • Group: Normal Members
    • Posts: 6552
    • Joined: 31-August 03
    • Gender:Male
    • Location:Montreal, Quebec, Canada

    Posted Today, 12:58 AM

    View PostKMaki, on 31 December 2012 - 10:53 PM, said:

    I'd say using rprint instead of print would get you further.

    View PostvV, on 01 January 2013 - 12:00 AM, said:

    that or oprint(object_table)

    I use this function to indiscriminately dump the info I want, whatever it is:

     -------------------------------------------------------------------------------- -- Debug print --------------------------------------------------------------------------------  function dbug(msg)   if DBUG_MODE == false then return end   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 

    Then you just type `dbug(whatever)` and it will always print something useful.

    Hope this helps.

    0


    #9 User is offline ? Conner_Bw?

    • Group: Normal Members
    • Posts: 6552
    • Joined: 31-August 03
    • Gender:Male
    • Location:Montreal, Quebec, Canada

    Posted Today, 01:05 AM

    View Postglotze, on 01 January 2013 - 12:10 AM, said:

    now how to handle the values the best way? create a table and set all values to 0. then fill the entrys with the values when something changes?
    i think this is important because otherwise i get NIL errors.

    is there something like a range mapper function in the api...
    like: func mapper(instart,inend,outstart,outend)

    I don't understand. Why not just check for nil? (== nil, ~= nil)

    I don't know of any mapper feature. I usually just use `for i=1,#foo do` where foo is a table and # means "count". But, there are some extended table functions like table.find() that could maybe help?

    see: https://code.google....dard.API.lua#72

    0


    Share this topic:


    • You cannot start a new topic
    • You cannot reply to this topic


    Source: http://forum.renoise.com/index.php?/topic/36920-midi-messages-osc-note-onoff-stop-all-sounds/

    Plaquemines Parish michigan football michigan football askew blue moon ann romney marco rubio

    No comments:

    Post a Comment

    Note: Only a member of this blog may post a comment.