# Simple Osc Example From Within Renoise

**URL:** <https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419>\
**Category:** Renoise Tool Development\
**Created:** [November 12, 2010, 11:02am UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419 "2010-11-12T11:02:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [November 12, 2010, 11:02am UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/1 "2010-11-12T11:02:42Z")

</div>

A simple OSC script that works out of the box.  
Simply enable the OSC server and then run the script and push the buttons.  
The script is fairly small enough to see the basic concept of sending an OSC message to the Renoise OSC server to respond to.  
1386 [com.vvoois.osc\_example\_1.xrnx](https://files.renoise.com/forum/uploads/1386-com.vvoois.osc_example_1.xrnx)

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 12, 2010, 12:40pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/2 "2010-11-12T12:40:57Z")

</div>

thanks will check it out

btw you cant drag n drop your script so it installs

EDIT:got it working with the how to manual install xrnx

wow this works really great,i will see if i can maybe add some more stuff to this

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 12, 2010, 4:44pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/3 "2010-11-12T16:44:04Z")

</div>

i have slowly starting to read the docs and doing some trial and error stuff to this

but one small thing im having problems "adding"buttons to the GUI of this

when i add say a button,and save it doesent show up in the GUI at all??

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 12, 2010, 5:59pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/4 "2010-11-12T17:59:52Z")

</div>

> [@Bantai](#):
>
> A classic mistake: the contents of the folder needs to be zipped, not the folder itself.

yeah i figured it out.

was wondering first im having some problems adding button to Vv code snippet  
what im looking into is adding buttons to (if its possible,still have to read all the documentation)loop curent pattern and stop looping current pattern

can anyone point me in the right direction??

---

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [November 12, 2010, 7:13pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/5 "2010-11-12T19:13:55Z")

</div>

> [@Bantai](#):
>
> Try this example.
> 
> Also, the original version contradicts itself by saying to set the OSC server to TCP in the Preferences, while the script itself is transmitting through UDP. They need to be the same.

Seems i need to fix a few things with the package…  
Yes it ws TCP at first but changed it to UDP to remove some hassle. (As UDP is the default anyway)  
Will fix this asap.  
 Fixed. I knew i had an archive with only the files and uploaded, i noticed i forgot to change the file-reference in the post…  
Had to delete the other one anyway with the text-bug.

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 12, 2010, 7:24pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/6 "2010-11-12T19:24:01Z")

</div>

thanks bantai,thats excactly what i wanted to do,i looked at your example and i tried doing exactly as you have done,when i tried adding to the GUI,but i kept getting messages like this one

\*\*\* main.lua:74: ‘}’ expected (to close ‘{’ at line 42) near ‘if’

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [November 15, 2010, 8:01pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/7 "2010-11-15T20:01:18Z")

</div>

> [@s-n-s](#):
>
> thanks bantai,thats excactly what i wanted to do,i looked at your example and i tried doing exactly as you have done,when i tried adding to the GUI,but i kept getting messages like this one
> 
> \*\*\* main.lua:74: ‘}’ expected (to close ‘{’ at line 42) near ‘if’

Ok, but that’s simply a message and not “a message like this one”.

As you improve as a coder you are expected to read the message. It’s just english telling you there’s a mistake. Fix it.

It says: In a file named main.lua, near line 74, it expects a bracket.

So your cut and paste job probably looks like:

```auto
  
 vb:button {  
 vb:button {  
 }  
  

```

When it should look like

```auto
  
 vb:button {  
 }  
 vb:button {  
 }  
  

```

Or something…

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 15, 2010, 9:07pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/8 "2010-11-15T21:07:07Z")

</div>

thanks conner

will look into it

---

<div class="post-metadata">

**Author:** ![dac514](https://forum.renoise.com/user_avatar/forum.renoise.com/dac514/32/100_2.png) [@dac514](https://forum.renoise.com/u/dac514)\
**Post date:** [November 15, 2010, 10:10pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/9 "2010-11-15T22:10:53Z")

</div>

> [@s-n-s](#):
>
> thanks conner
> 
> will look into it

Cool man. Persistence is the key.

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 16, 2010, 1:01am UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/10 "2010-11-16T01:01:22Z")

</div>

that works great.

so if i want to add block\_move\_forward and backward is it something like this

local o\_message = OscMessage(  
“/renoise/transport/loop/block\_move\_backwards”,{  
{tag=value}  
}  
)

send\_osc\_message(o\_message)  
end

function set\_block\_loop(enabled)(i still need to check what this should be replaced with)  
if client == nil then  
connect\_to\_server()  
end

local value = “F”  
if (enabled) then  
value = “T”  
end

and the same for forwards?

i have more time to look into this in the weekend

---

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [November 16, 2010, 4:36pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/11 "2010-11-16T16:36:56Z")

</div>

> [@s-n-s](#):
>
> that works great.
> 
> so if i want to add block\_move\_forward and backward is it something like this
> 
> local o\_message = OscMessage(  
> “/renoise/transport/loop/block\_move\_backwards”,{  
> {tag=value}  
> }  
> )
> 
> send\_osc\_message(o\_message)  
> end
> 
> function set\_block\_loop(enabled)(i still need to check what this should be replaced with)  
> if client == nil then  
> connect\_to\_server()  
> end
> 
> local value = “F”  
> if (enabled) then  
> value = “T”  
> end
> 
> and the same for forwards?
> 
> i have more time to look into this in the weekend

The message is “/renoise/transport/loop/block\_move\_backwards”,{{tag=value}} where value is what it supposed to be.  
block\_move only expects one parameter and only expects it as a tag True or False. This makes matters confusing specially with this boolean functionality in OSC, because people expect that booleans should be tagged differently and then True or False should then be submitted as a specified parameter with the tag.

Here is an example where more parameter expressions are send because more parameters are expected:

```lua
  
 o_message = OscMessage(  
 "/renoise/trigger/note_on",{  
 {tag="i",value=instrument_number},  
 {tag="i",value=track_number},  
 {tag="i",value=note_value},  
 {tag="i",value=velocity}  
 }  
 )  
  

```

tag = “i” stands for: The next parameter will be an integer value.  
f stands for a floating point figure  
s stands for string  
b stands for a an OSC blob. (I thought a message within a message)

You can find all these tag values in a table on this page:  
[http://opensoundcontrol.org/spec-1\_0](http://opensoundcontrol.org/spec-1_0)

Together with that info, it should at least not be too hard to understand working with OSC from within Renoise.  
Concocting OSC phrases in other tools like PD works a tat different though (Even though the principle is the same).

---

<div class="post-metadata">

**Author:** ![s-n-s](https://forum.renoise.com/letter_avatar/s-n-s/32/6_449c533f586939b6e5f246632a46421f.png) [@s-n-s](https://forum.renoise.com/u/s-n-s)\
**Post date:** [November 24, 2010, 8:04pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/12 "2010-11-24T20:04:01Z")

</div>

now i have some time looking into this again

so is this code more correct?

local value = “F”  
if (enabled) then  
value = “T”  
end

local o\_message = OscMessage(  
“/renoise/transport/loop/block\_move\_backwards”,{{tag=value}}  
}  
)  
o\_message = OscMessage(  
“/renoise/trigger/note\_on”,{  
{tag=“i”,value=instrument\_number},  
{tag=“i”,value=track\_number},  
{tag=“i”,value=note\_value},  
{tag=“i”,value=velocity}  
}

or something like that?

---

<div class="post-metadata">

**Author:** ![insane](https://forum.renoise.com/user_avatar/forum.renoise.com/insane/32/13064_2.png) [@insane](https://forum.renoise.com/u/insane)\
**Post date:** [November 24, 2010, 11:09pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/13 "2010-11-24T23:09:12Z")

</div>

This is why I didn’t start developing tools.

I might when I get more coding experience, however.

---

<div class="post-metadata">

**Author:** ![bluszcz](https://forum.renoise.com/user_avatar/forum.renoise.com/bluszcz/32/951_2.png) [@bluszcz](https://forum.renoise.com/u/bluszcz)\
**Post date:** [November 25, 2010, 8:39am UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/14 "2010-11-25T08:39:09Z")

</div>

What I need is really simply example how to using OSC / maybe work on duplex I can control knobs / sliders from DSP effects / mixer etc…

[quote=“vV”]  
A simple OSC script that works out of the box.  
Simply enable the OSC server and then run the script and push the buttons.  
The script is fairly small enough to see the basic concept of sending an OSC message to the Renoise OSC server to respond to.  
1386 [com.vvoois.osc\_example\_1.xrnx](https://files.renoise.com/forum/uploads/1386-com.vvoois.osc_example_1.xrnx)

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.renoise.com/user_avatar/forum.renoise.com/niall/32/537_2.png) [@Niall](https://forum.renoise.com/u/Niall)\
**Post date:** [November 28, 2010, 6:36pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/15 "2010-11-28T18:36:33Z")

</div>

Hi vV,

Not sure why, but the only thing this script seems to do is give a message that says:

/transport/loop/block with 1 arguments (REJECTED)

in my preferences osc panel.

Any ideas why this might be? All ports, protocols, etc seem to be correct.

---

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [November 28, 2010, 7:52pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/16 "2010-11-28T19:52:58Z")

</div>

> [@Niall](#):
>
> Hi vV,
> 
> Not sure why, but the only thing this script seems to do is give a message that says:
> 
> /transport/loop/block with 1 arguments (REJECTED)
> 
> in my preferences osc panel.
> 
> Any ideas why this might be? All ports, protocols, etc seem to be correct.

From which OSC client application are you originating the code, from within an extra Renoise session or did you ported my example to another OSC client side application like PD?

When I originate the above code from within another Renoise session I don’t get this error and if i make any changes to the OSC message where things might go wrong, i already get a Lua error on the client side, so the server does not even gets a chance to receive anything.  
I thought from certain other OSC client-apps, you need to send 0 or 1 to set a boolean bit instead of “F” or “T”.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.renoise.com/user_avatar/forum.renoise.com/niall/32/537_2.png) [@Niall](https://forum.renoise.com/u/Niall)\
**Post date:** [November 28, 2010, 8:46pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/17 "2010-11-28T20:46:56Z")

</div>

> [@vV](#):
>
> From which OSC client application are you originating the code, from within an extra Renoise session or did you ported my example to another OSC client side application like PD?
> 
> When I originate the above code from within another Renoise session I don’t get this error and if i make any changes to the OSC message where things might go wrong, i already get a Lua error on the client side, so the server does not even gets a chance to receive anything.  
> I thought from certain other OSC client-apps, you need to send 0 or 1 to set a boolean bit instead of “F” or “T”.

Nah, just doing it from within renoise natively.  
All I’ve done is download your tool and run it.

Although, all the osc stuff I had working before, doesn’t seem to work since I upgraded to 2.6 proper (as opposed to the beta releases)  
I don’t know what would’ve changed…

---

<div class="post-metadata">

**Author:** ![Moonriders](https://forum.renoise.com/user_avatar/forum.renoise.com/moonriders/32/1345_2.png) [@Moonriders](https://forum.renoise.com/u/Moonriders)\
**Post date:** [November 30, 2010, 6:12pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/18 "2010-11-30T18:12:47Z")

</div>

> [@Niall](#):
>
> Nah, just doing it from within renoise natively.  
> All I’ve done is download your tool and run it.
> 
> Although, all the osc stuff I had working before, doesn’t seem to work since I upgraded to 2.6 proper (as opposed to the beta releases)  
> I don’t know what would’ve changed…

Only idea I have is if you were editting the GlobalOscActions.lua from the program directory?

---

<div class="post-metadata">

**Author:** ![vvoois](https://forum.renoise.com/letter_avatar/vvoois/32/6_449c533f586939b6e5f246632a46421f.png) [@vvoois](https://forum.renoise.com/u/vvoois)\
**Post date:** [December 1, 2010, 5:37pm UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/19 "2010-12-01T17:37:25Z")

</div>

> [@101010](#):
>
> Only idea I have is if you were editting the GlobalOscActions.lua from the program directory?

Could be.  
I am only working with an out-of-the-box Renoise configuration.

---

<div class="post-metadata">

**Author:** ![Niall](https://forum.renoise.com/user_avatar/forum.renoise.com/niall/32/537_2.png) [@Niall](https://forum.renoise.com/u/Niall)\
**Post date:** [December 2, 2010, 8:49am UTC](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419/20 "2010-12-02T08:49:20Z")

</div>

pretty sure I haven’t, but I’ll double check.  
Might reinstall renoise.

[Next page](https://forum.renoise.com/t/simple-osc-example-from-within-renoise/30419.md?page=2)
