osc 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README +7 -7
- data/README.en +6 -6
- data/lib/osc.rb +4 -4
- data/sample/getmjd.pde +65 -0
- data/sample/{getmjd.ens → getmjd4.ens} +0 -0
- data/sample/getmjd5.ens +0 -0
- metadata +41 -42
- data/sample/getmjd.mxt +0 -59
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 6cdfca3f8c9ed9e5d6aebeddb18ff81063382dad
|
4
|
+
data.tar.gz: 44a252b6c345db68640c7d37afd5153b288a9280
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5ebcc8d51972ba149448e46d77335aaeb80b212b0c6de3f9c8e2583a115bdcc0ad318bd9318aba84a6214e73d9c677808666029c2121b7468a47cef30ef1487f
|
7
|
+
data.tar.gz: cd3b19df301aa7aa7490b263bbc1c03454a2d6d726bb59e90fc1a608904aee24a01502d6ae5d29768c3c2ded1ec78373ac8f891f1adda2320556d521a9d4b402
|
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2005-2014, Tadayoshi Funaba
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without
|
5
|
+
modification, are permitted provided that the following conditions are
|
6
|
+
met:
|
7
|
+
|
8
|
+
1. Redistributions of source code must retain the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer.
|
10
|
+
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright
|
12
|
+
notice, this list of conditions and the following disclaimer in the
|
13
|
+
documentation and/or other materials provided with the
|
14
|
+
distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
20
|
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
21
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
22
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
23
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
24
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
25
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
26
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
OSC
|
1
|
+
OSC モジュール
|
2
2
|
==============
|
3
3
|
|
4
|
-
OSC
|
5
|
-
|
4
|
+
OSC はオブジェクト指向スクリプト言語 Ruby のための、「オープンサウンド・
|
5
|
+
コントロール」モジュールです。
|
6
6
|
|
7
7
|
|
8
|
-
|
8
|
+
インストール
|
9
9
|
------------
|
10
10
|
|
11
|
-
|
11
|
+
スクリプト "install.rb" をつかいます。
|
12
12
|
|
13
13
|
$ ruby install.rb config
|
14
14
|
$ ruby install.rb setup
|
15
15
|
($ su)
|
16
16
|
# ruby install.rb install
|
17
17
|
|
18
|
-
|
18
|
+
くわしくは、"ruby install.rb --help" としてください。
|
19
19
|
|
20
20
|
|
21
|
-
|
21
|
+
ふなばただよし
|
22
22
|
mailto:tadf@funaba.org
|
23
23
|
http://www.funaba.org/
|
data/README.en
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
An "OSC" module
|
2
|
-
|
2
|
+
===============
|
3
3
|
|
4
|
-
OSC is an "OpenSound Control" module for an object
|
5
|
-
|
4
|
+
OSC is an "OpenSound Control" module for an object-oriented scripting
|
5
|
+
language Ruby.
|
6
6
|
|
7
7
|
|
8
8
|
Install
|
9
|
-
|
9
|
+
-------
|
10
10
|
|
11
11
|
Use the script "install.rb".
|
12
12
|
|
@@ -15,9 +15,9 @@ Use the script "install.rb".
|
|
15
15
|
($ su)
|
16
16
|
# ruby install.rb install
|
17
17
|
|
18
|
-
For more information, type "ruby install.rb
|
18
|
+
For more information, type "ruby install.rb --help".
|
19
19
|
|
20
20
|
|
21
21
|
Tadayoshi Funaba
|
22
22
|
mailto:tadf@funaba.org
|
23
|
-
http://www.funaba.org/
|
23
|
+
http://www.funaba.org/
|
data/lib/osc.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
# osc.rb: Written by Tadayoshi Funaba 2005,2006
|
2
|
-
# $Id: osc.rb,v 1.
|
1
|
+
# osc.rb: Written by Tadayoshi Funaba 2005,2006,2014
|
2
|
+
# $Id: osc.rb,v 1.5 2014-04-06 17:22:25+09 tadf Exp $
|
3
3
|
|
4
4
|
require 'forwardable'
|
5
5
|
require 'socket'
|
@@ -72,7 +72,7 @@ module OSC
|
|
72
72
|
|
73
73
|
def getc
|
74
74
|
raise EOFError if rem < 1
|
75
|
-
c = @str[@index]
|
75
|
+
c = @str[@index].ord
|
76
76
|
skip(1)
|
77
77
|
c
|
78
78
|
end
|
@@ -131,7 +131,7 @@ module OSC
|
|
131
131
|
end
|
132
132
|
elsif id =~ /\//
|
133
133
|
address = id
|
134
|
-
if io.getc ==
|
134
|
+
if io.getc == ?,.ord
|
135
135
|
tags = decode_string(io)
|
136
136
|
args = []
|
137
137
|
tags.scan(/./) do |t|
|
data/sample/getmjd.pde
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
import oscP5.*;
|
2
|
+
|
3
|
+
OscP5 oscP5;
|
4
|
+
int receiveAtPort;
|
5
|
+
int sendToPort;
|
6
|
+
String host;
|
7
|
+
String oscP5event;
|
8
|
+
int year = year();
|
9
|
+
int month = month();
|
10
|
+
int day = day();
|
11
|
+
|
12
|
+
void initOsc() {
|
13
|
+
receiveAtPort = 10002;
|
14
|
+
sendToPort = 10000;
|
15
|
+
host = "localhost";
|
16
|
+
oscP5event = "oscEvent";
|
17
|
+
oscP5 = new OscP5(this, host, sendToPort, receiveAtPort, oscP5event);
|
18
|
+
}
|
19
|
+
|
20
|
+
void oscEvent(OscIn oscIn) {
|
21
|
+
int mjd = int(oscIn.getFloat(0));
|
22
|
+
writemjd(mjd);
|
23
|
+
}
|
24
|
+
|
25
|
+
void setup() {
|
26
|
+
size(288, 288);
|
27
|
+
background(0);
|
28
|
+
PFont font;
|
29
|
+
// font = loadFont("sansserif.plain-48.vlw");
|
30
|
+
// textFont(font, 48);
|
31
|
+
textSize(48);
|
32
|
+
textAlign(CENTER);
|
33
|
+
writecivil(year, month, day);
|
34
|
+
initOsc();
|
35
|
+
}
|
36
|
+
|
37
|
+
void mousePressed() {
|
38
|
+
OscMessage civil = new OscMessage("/getmjd/civil");
|
39
|
+
civil.add(new Float(year));
|
40
|
+
civil.add(new Float(month));
|
41
|
+
civil.add(new Float(day));
|
42
|
+
oscP5.send(civil);
|
43
|
+
}
|
44
|
+
|
45
|
+
void writecivil(int year, int month, int day) {
|
46
|
+
String s = str(year) + "-";
|
47
|
+
if (month < 10) {
|
48
|
+
s += "0";
|
49
|
+
}
|
50
|
+
s += str(month) + "-";
|
51
|
+
if (day < 10) {
|
52
|
+
s += "0";
|
53
|
+
}
|
54
|
+
s += str(day);
|
55
|
+
fill(192);
|
56
|
+
text(s, width/2, height/3*1+48/3);
|
57
|
+
}
|
58
|
+
|
59
|
+
void writemjd(int mjd) {
|
60
|
+
String s = "= " + str(mjd) + "MJD";
|
61
|
+
fill(192);
|
62
|
+
text(s, width/2, height/3*2+48/3);
|
63
|
+
}
|
64
|
+
|
65
|
+
void draw(){}
|
Binary file
|
data/sample/getmjd5.ens
ADDED
Binary file
|
metadata
CHANGED
@@ -1,75 +1,74 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: osc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Tadayoshi Funaba
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-04-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: gopt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.0'
|
17
20
|
type: :runtime
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
20
|
-
requirements:
|
21
|
-
- - "
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
24
|
-
version:
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.0'
|
25
27
|
description:
|
26
28
|
email: tadf@funaba.org
|
27
29
|
executables: []
|
28
|
-
|
29
30
|
extensions: []
|
30
|
-
|
31
31
|
extra_rdoc_files: []
|
32
|
-
|
33
|
-
|
32
|
+
files:
|
33
|
+
- LICENSE
|
34
34
|
- README
|
35
35
|
- README.en
|
36
36
|
- lib/osc.rb
|
37
37
|
- sample/dumbserver.rb
|
38
|
-
- sample/getmjd.ens
|
39
|
-
- sample/getmjd.mxt
|
40
38
|
- sample/getmjd.pd
|
39
|
+
- sample/getmjd.pde
|
41
40
|
- sample/getmjd.rb
|
41
|
+
- sample/getmjd4.ens
|
42
|
+
- sample/getmjd5.ens
|
42
43
|
- sample/joy-test.rb
|
43
44
|
- sample/joy.ens
|
44
45
|
- sample/joy.pd
|
45
46
|
- sample/joy.rb
|
46
47
|
- sample/localtest.rb
|
47
48
|
- sample/send.rb
|
48
|
-
|
49
|
-
|
49
|
+
homepage: http://www.funaba.org/code
|
50
|
+
licenses:
|
51
|
+
- BSD 2-Clause
|
52
|
+
metadata: {}
|
50
53
|
post_install_message:
|
51
54
|
rdoc_options: []
|
52
|
-
|
53
|
-
require_paths:
|
55
|
+
require_paths:
|
54
56
|
- lib
|
55
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
-
requirements:
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
57
59
|
- - ">="
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version:
|
60
|
-
|
61
|
-
|
62
|
-
requirements:
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
63
64
|
- - ">="
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version:
|
66
|
-
version:
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
67
|
requirements: []
|
68
|
-
|
69
68
|
rubyforge_project: tadf
|
70
|
-
rubygems_version:
|
69
|
+
rubygems_version: 2.2.2
|
71
70
|
signing_key:
|
72
|
-
specification_version:
|
73
|
-
summary: OSC is an "OpenSound Control" module for an object-oriented scripting language
|
71
|
+
specification_version: 4
|
72
|
+
summary: OSC is an "OpenSound Control" module for an object-oriented scripting language
|
73
|
+
Ruby.
|
74
74
|
test_files: []
|
75
|
-
|
data/sample/getmjd.mxt
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
max v2;
|
2
|
-
#N vpatcher 424 40 805 528;
|
3
|
-
#P origin 0 -149;
|
4
|
-
#P window setfont "Sans Serif" 9.;
|
5
|
-
#P newex 250 267 68 9109513 osc-route /mjd;
|
6
|
-
#P newex 242 233 81 9109513 osc-route /getmjd;
|
7
|
-
#P newex 98 206 27 9109513 t b f;
|
8
|
-
#P newex 139 207 27 9109513 t b f;
|
9
|
-
#P button 117 37 15 0;
|
10
|
-
#P newex 101 123 52 9109513 unpack i i i;
|
11
|
-
#P message 112 65 26 9109513 date;
|
12
|
-
#P newex 107 93 40 9109513 date;
|
13
|
-
#P user incdec 64 157 15 15 0 0;
|
14
|
-
#P user incdec 110 157 15 15 0 0;
|
15
|
-
#P user incdec 156 157 15 15 0 0;
|
16
|
-
#P button 279 333 15 0;
|
17
|
-
#P newex 121 345 27 9109513 t b s;
|
18
|
-
#P number 268 302 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
|
19
|
-
#P newex 242 197 80 9109513 opensoundcontrol;
|
20
|
-
#P newex 246 163 71 9109513 udp-read 10000;
|
21
|
-
#P newex 75 417 124 9109513 udp-write 192.168.1.2 10000;
|
22
|
-
#P message 86 314 98 9109513 /getmjd/civil \$1 \$2 \$3;
|
23
|
-
#P button 49 245 15 0;
|
24
|
-
#P number 161 183 35 9 1 31 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
|
25
|
-
#P number 115 183 35 9 1 12 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
|
26
|
-
#P number 69 183 35 9 1950 2050 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
|
27
|
-
#P newex 106 282 48 9109513 pack f f f;
|
28
|
-
#P newex 97 380 80 9109513 opensoundcontrol;
|
29
|
-
#P comment 32 183 100 9109513 civil;
|
30
|
-
#P comment 234 302 100 9109513 mjd;
|
31
|
-
#P comment 78 37 100 9109513 today;
|
32
|
-
#P connect 24 0 8 0;
|
33
|
-
#P connect 23 0 8 0;
|
34
|
-
#P connect 18 0 5 0;
|
35
|
-
#P connect 21 2 5 0;
|
36
|
-
#P connect 3 0 10 0;
|
37
|
-
#P connect 4 0 9 0;
|
38
|
-
#P connect 14 1 3 0;
|
39
|
-
#P connect 14 0 3 0;
|
40
|
-
#P connect 6 0 24 0;
|
41
|
-
#P connect 19 0 21 0;
|
42
|
-
#P connect 5 0 4 0;
|
43
|
-
#P connect 8 0 4 0;
|
44
|
-
#P connect 20 0 19 0;
|
45
|
-
#P connect 22 0 20 0;
|
46
|
-
#P connect 17 0 6 0;
|
47
|
-
#P connect 21 0 6 0;
|
48
|
-
#P connect 9 0 14 0;
|
49
|
-
#P connect 24 1 4 1;
|
50
|
-
#P connect 7 0 23 0;
|
51
|
-
#P connect 23 1 4 2;
|
52
|
-
#P connect 16 0 7 0;
|
53
|
-
#P connect 21 1 7 0;
|
54
|
-
#P connect 11 0 12 0;
|
55
|
-
#P connect 12 1 25 0;
|
56
|
-
#P connect 25 0 26 0;
|
57
|
-
#P connect 26 0 13 0;
|
58
|
-
#P connect 13 0 15 0;
|
59
|
-
#P pop;
|