Skip to content

Commit 0a957c2

Browse files
authored
Merge branch 'master' into add-view-#3
2 parents 94c9e1f + 48d0dda commit 0a957c2

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

.profile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run build

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# socketjam
2+
3+
A simple <a href="http://socket.io/">`socket.io`</a> based collaborative music-making app using a <a href="http://paperjs.org/">Paper.js</a> interface and <a href="https://tonejs.github.io/">Tone.js</a> driven synthesis
4+

app/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ const socket = require('./socket')
44
const spaceCircle = require('./views/spaceCircle')
55
const coolBlobs = require('./views/coolBlobs')
66

7+
StartAudioContext(Tone.context, '#test').then(function(){
8+
9+
})
10+
11+
const drums = require('./basic-beat')
12+
13+
714
const canvas = document.getElementById('paperCanvas');
815
paper.setup(canvas);
916
paper.install(window);

index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<script type="text/javascript" src="socket/socket.io.js"></script>
1111
<script type="text/javascript" src="paper/paper-full.js"></script>
1212
<script type="text/javascript" src="startaudiocontext/StartAudioContext.js"></script>
13-
<!--<script type="text/paperscript" src="js/ui.js" canvas="paperCanvas"></script>-->
1413
</head>
1514
<body>
1615
<div id="test">

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@
2323
"chalk": "^1.1.3",
2424
"express": "^4.14.0",
2525
"http": "0.0.0",
26-
"paper": "^0.10.2",
26+
"nodemon": "^1.11.0",
2727
"path": "^0.12.7",
2828
"socket.io": "^1.7.2",
29+
"startaudiocontext": "^1.2.0",
2930
"tone": "^0.9.0",
30-
"volleyball": "^1.4.1"
31+
"volleyball": "^1.4.1",
32+
"webpack": "^1.14.0"
3133
}
3234
}

public/js/ui.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ for (var i = 0; i < count; i++) {
6464
var placedSymbol = symbol.place(center);
6565
// symbol.fillColor.hue += (Math.random() * 8)
6666
placedSymbol.scale(i / count);
67-
placedSymbol.direction = 2 * Math.PI * Math.random()
67+
placedSymbol.direction = 2 * Math.PI * Math.random();
68+
if (i === 50) console.log(placedSymbol);
6869
}
6970

7071
// The onFrame function is called up to 60 times a second:
@@ -74,13 +75,15 @@ function onFrame(event) {
7475
for (var i = 0; i < count; i++) {
7576
var item = project.activeLayer.children[i];
7677

77-
// Move the item 1/20th of its width. This way
78+
79+
// Move the item 1/20th of its width in the direction of its motion. This way
7880
// larger circles move faster than smaller circles:
7981
var speed = item.bounds.width / 30;
8082
item.position.x += Math.cos(item.direction) * speed;
8183
item.position.y += Math.sin(item.direction) * speed;
8284

8385
// If the item has the view, move it back
86+
8487
if (item.bounds.left > view.size.width) {
8588
item.position.x = item.bounds.width;
8689
}
@@ -96,7 +99,6 @@ function onFrame(event) {
9699
}
97100
}
98101

99-
100102
tool.minDistance = 1;
101103
tool.maxDistance = 45;
102104

@@ -113,7 +115,6 @@ function onMouseDown(event) {
113115
}
114116

115117
socket.on('mouseDown', function(event) {
116-
// console.log(event);
117118
var path = new Path();
118119
path.fillColor = {
119120
hue: Math.random() * 360,

0 commit comments

Comments
 (0)