Old 09-18-2016, 01:36 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 17,526
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: 123
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: 17,526
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: 17,526
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
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:28 PM.


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