Old 09-18-2016, 01:36 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,674
Default Q: IP addresses and ports

I have no idea about IP addresses and ports (as used in oscii-bot scripts, and generally). Can someone explain them clearly?

I understand that oscii-bot needs to communicate with Reaper and with the MIDI control surface, in and out. So it needs 4 connections.

I see these examples in sample_script.txt
Code:
//        @input devicenameforcode MIDI "substring match" [skip]
//        @input devicenameforcode OSC "*:9000"
//        @input devicenameforcode OSC "192.168.1.2:9000"
@input r24 MIDI "ZOOM R"
//        @output devicenameforcode OSC "127.0.0.1:8000" [maxpacketsize] [sleepamt]
//        @output devicenameforcode MIDI "substring match" [skip]
@output localhost OSC "127.0.0.1:8000"
And, from other scripts:
Code:
@input osc_in OSC "*:9000"
@output osc_out OSC "localhost:8000"
@output midi_out MIDI "AlphaTrack"
@input midi_in MIDI "AlphaTrack"

@input in MIDI "Mix"
@input OSC_IN OSC "localhost:9000"
@output OSC_to_REAPER OSC "192.168.0.10:8000" 0 0
@output out MIDI "Mix"
So the four types are:
@input ... MIDI,
@output ... OSC,
@input ... OSC and
@output ... MIDI.
And the MIDI lines reference the MIDI device name, as seen in the Control Surface definition (is that right?).

Now, for the @input ... OSC:
-- the first item is some unique name, for use within the script
-- the IP address is sometimes '*', or 'localhost' or '192.168.1.2'
-- what do those 3 mean?
-- what's the difference?
-- the port number is (always?) 9000; why is that number used?
-- how do I know that nothing-else is using it?

And for the @output ... OSC:
-- the first item is some unique name, for use within the script
-- the IP address is sometimes or 'localhost' or '127.0.0.1 or '192.168.0.10'
-- what do those 3 mean?
-- what's the difference?
-- the port number is (always?) 8000; why is that number used?
-- how do I know that nothing-else is using it?

-- why don't the 2 OSC lines use the same IP address?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 09-20-2016, 06:07 PM   #2
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

Quote:
Originally Posted by DarkStar View Post
I have no idea about IP addresses and ports (as used in oscii-bot scripts, and generally). Can someone explain them clearly?
The IP address and port associate a network path for data to pass between Reaper to and from OSCII-Bot, and to and from OSCII-Bot and the Midi device. In practice this network path is likely to be all internal within the computer (workstation/laptop etc) that runs Reaper which perhaps makes it a little confusing: although passed using the IP network protocol, the data is just handed on between programmes within the computer rather than going over any external network.


The IP Address and port corresponds to part of the key network protocol defining the internet. The IP address identifies a unique network end point [like 23 Acacia Gardens, Anytown] whereas the port identifies a sub-classification of letter boxes at house addresses [e.g. one for newspapers, one for junk circulars, one for personal mail] - this https://technet.microsoft.com/en-us/.../cc958829.aspx whilst quite technical might be helpful to explain IP addresses and this https://en.wikipedia.org/wiki/Port_(...er_networking) explains ports


<snip>

Quote:
Originally Posted by DarkStar View Post
And the MIDI lines reference the MIDI device name, as seen in the Control Surface definition (is that right?)
Yes almost. It needs to match, or be a substring of, the appropriate Midi device name in preferences, Audio, Midi Device settings.

Quote:
Originally Posted by DarkStar View Post
Now, for the @input ... OSC:
-- the first item is some unique name, for use within the script
Yes
Quote:
Originally Posted by DarkStar View Post
-- the IP address is sometimes '*', or 'localhost' or '192.168.1.2'
-- what do those 3 mean?
-- what's the difference?
* means listen on any IP address as a wildcard
localhost is a standard name used to identify "this local computer" as a loopback - see https://en.wikipedia.org/wiki/Localhost
192.168.1.2 is a specific Class C IP address that happens to be allocated to this computer
Quote:
Originally Posted by DarkStar View Post
-- the port number is (always?) 9000; why is that number used?
-- how do I know that nothing-else is using it?
9000 and 8000 are Reaper OSC default ports borrowed (probably) from the fairly common "TouchOSC" device's implementation. One can change them from defaults if wished in the control surface settings. You don't "know" that nothing else is using the port but it won't matter since the port is being used to communicate solely between 2 end points and isn't in the reserved range below 1024 - see https://en.wikipedia.org/wiki/List_o...P_port_numbers
Use the defaults unless you have a specific external control surface device that can't be changed (unlikely) or are part of a complex network (unlikely in personal music making)

Quote:
Originally Posted by DarkStar View Post
And for the @output ... OSC:
-- the first item is some unique name, for use within the script
-- the IP address is sometimes or 'localhost' or '127.0.0.1 or '192.168.0.10'
-- what do those 3 mean?
-- what's the difference?
-- the port number is (always?) 8000; why is that number used?
-- how do I know that nothing-else is using it?

-- why don't the 2 OSC lines use the same IP address?
localhost and 127.0.0.1 are synonyms (i.e. name is equivalent to number)
192.168.0.10 is a different class C address uniquely allocated to another computer on another network. The examples asked about are from different setups running on different computers/networks so the unique IP address will be different.

Last edited by goldenarpharazon; 09-21-2016 at 01:44 AM.
goldenarpharazon is offline   Reply With Quote
Old 09-23-2016, 06:51 AM   #3
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,674
Default

Thank you for the explanations - now I just need to think them through.

PS - I've just got an Akai MIDImix and am very grateful for your MIDImix oscii-bot script. When I'm brave / knowledgeable enough I'll have a look at some ideas I have for that script too. Meanwhile, I'm working on this at the moment:

>>> https://i.imgur.com/lrzDUHo.png
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 09-23-2016, 10:04 AM   #4
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,674
Default

OK, so if oscii-bot and Reaper are on the same system, I think I can use 'localhost' for both the OSC input and output.

That sounds better than using '192.168... ' as the latter could be spotted by the Firewall software and possibly blocked. That is, if 'localhost' is not picked up by the Firewall.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 11-22-2019, 07:25 AM   #5
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,674
Default Q: New Router - new Local IP address?

Just to check:

This week I changed my Internet Service provider and use a new router. The OSC comms between my AKAI MIDIMix and Reaper no longer work and I think that my IP address must have changed.

When I run ipconfig /all in a Windows/CMD window, I see that the IP address listed for Ethernet is: 192.168.1.64 and that same address is displayed in Reaper's / Control Surface Settings for "Local IP".

Is that the number I need to use in the oscii-bot .txt file, in the line
@output OSC_to_REAPER OSC "192.168.1.2:8000" 0 0

I want to double-check as when I tried it last night somehow I managed to disconnect from the Internet and leave my router in an error state. Mercifully all is OK today.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 11-23-2019, 09:57 AM   #6
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

Yes. 192.168.1.64 will be correct to use.

Your new router has dynamically allocated this different address.
If you wish you can login to the new router and tell it to permanently associate this IP address (or any other chosen from the 192.168.1.n range) to the MAC address of your Reaper PC. Then the IP address will never change whilst you use your Reaper PC on the network of this router.
goldenarpharazon is offline   Reply With Quote
Old 11-24-2019, 07:07 AM   #7
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,674
Default

Thank you - it works OK; I got a bit concerned when i managed to mess up the router.

And I was slightly surprised that a broadband router can give a computer an IP address, rather than be told what the computer's IP address is.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...

Last edited by DarkStar; 11-25-2019 at 06:32 AM.
DarkStar is offline   Reply With Quote
Old 12-23-2019, 05:43 AM   #8
Plentos
Human being with feelings
 
Join Date: Dec 2018
Posts: 7
Default

Quote:
Originally Posted by DarkStar View Post
I have no idea about IP addresses and ports (as used in oscii-bot scripts, and generally). Can someone explain them clearly?

I understand that oscii-bot needs to communicate with Reaper and with the MIDI control surface, in and out. So it needs 4 connections.

I see these examples in sample_script.txt
Code:
//        @input devicenameforcode MIDI "substring match" [skip]
//        @input devicenameforcode OSC "*:9000"
//        @input devicenameforcode OSC "192.168.1.2:9000"
@input r24 MIDI "ZOOM R"
//        @output devicenameforcode OSC "127.0.0.1:8000" [maxpacketsize] [sleepamt]
//        @output devicenameforcode MIDI "substring match" [skip]
@output localhost OSC "127.0.0.1:8000"
And, from other scripts:
Code:
@input osc_in OSC "*:9000"
@output osc_out OSC "localhost:8000"
@output midi_out MIDI "AlphaTrack"
@input midi_in MIDI "AlphaTrack"

@input in MIDI "Mix"
@input OSC_IN OSC "localhost:9000"
@output OSC_to_REAPER OSC "192.168.0.10:8000" 0 0
@output out MIDI "Mix"
So the four types are:
@input ... MIDI,
@output ... OSC,
@input ... OSC and
@output ... MIDI.
And the MIDI lines reference the MIDI device name, as seen in the Control Surface definition (is that right?).

Now, for the @input ... OSC:
-- the first item is some unique name, for use within the script
-- the IP address is sometimes '*', or 'localhost' or '192.168.1.2'
-- what do those 3 mean?
-- what's the difference?
-- the port number is (always?) 9000; why is that number used?
-- how do I know that nothing-else is using it?

And for the @output ... OSC:
-- the first item is some unique name, for use within the script
-- the local IP address is sometimes or 'localhost' or '127.0.0.1 or '192.168.0.10'
-- what do those 3 mean?
-- what's the difference?
-- the port number is (always?) 8000; why is that number used?
-- how do I know that nothing-else is using it?

-- why don't the 2 OSC lines use the same IP address?
Hello,
I have the same problem as yours

Last edited by Plentos; 12-24-2019 at 08:03 AM.
Plentos is offline   Reply With Quote
Old 06-15-2022, 11:47 PM   #9
gordon514
Human being with feelings
 
Join Date: Jun 2022
Posts: 1
Default

Quote:
Originally Posted by goldenarpharazon View Post
The IP address and port associate a network path for data to pass between Reaper to and from OSCII-Bot, and to and from OSCII-Bot and the Midi device. In practice this network path is likely to be all internal within the computer (workstation/laptop etc) that runs Reaper which perhaps makes it a little confusing: although passed using the IP network protocol, the data is just handed on between programmes within the computer rather than going over any external network.


The IP Address and port corresponds to part of the key network protocol defining the internet. The IP address identifies a unique network end point [like 23 Acacia Gardens, Anytown] whereas the port identifies a sub-classification of letter boxes at house addresses [e.g. one for newspapers, one for junk circulars, one for personal mail] - this https://technet.microsoft.com/en-us/.../cc958829.aspx whilst quite technical might be helpful to explain IP addresses and this https://en.wikipedia.org/wiki/Port_(...er_networking) explains ports


<snip>



Yes almost. It needs to match, or be a substring of, the appropriate Midi device name in preferences, Audio, Midi Device settings.


Yes

* means listen on any IP address as a wildcard
localhost is a standard name used to identify "this local computer" as a loopback - see https://192-168-0-1.us
192.168.1.2 is a specific Class C IP address that happens to be allocated to this computer

9000 and 8000 are Reaper OSC default ports borrowed (probably) from the fairly common "TouchOSC" device's implementation. One can change them from defaults if wished in the control surface settings. You don't "know" that nothing else is using the port but it won't matter since the port is being used to communicate solely between 2 end points and isn't in the reserved range below 1024 - see https://en.wikipedia.org/wiki/List_o...P_port_numbers
Use the defaults unless you have a specific external control surface device that can't be changed (unlikely) or are part of a complex network (unlikely in personal music making)


localhost and 127.0.0.1 are synonyms (i.e. name is equivalent to number)
192.168.0.10 is a different class C address uniquely allocated to another computer on another network. The examples asked about are from different setups running on different computers/networks so the unique IP address will be different.
You solved my problem, thanks!
gordon514 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:55 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.