Skip to content

Commit 06d2b9e

Browse files
authored
Create jam-norns.js
1 parent 3fe6282 commit 06d2b9e

1 file changed

Lines changed: 139 additions & 0 deletions

File tree

jam-norns.js

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
await loadScript('https://6120.eu/public/midi.js')
2+
await loadScript('https://h.6120.eu/hydra-text.js')
3+
await loadScript('https://h.6120.eu/hydra-fractals.js')
4+
await loadScript('https://h.6120.eu/hydra-outputs.js')
5+
await loadScript('https://h.6120.eu/hydra-colorspaces.js')
6+
setResolution(2000,2000)
7+
oS.setLinear()
8+
await midi.start().show()
9+
10+
a.show()
11+
a.setScale(8)
12+
vn = 10
13+
sn = 45
14+
shape(vn, 1 / sn)
15+
.color(1, 0, 0)
16+
.scroll(
17+
() => time / sn,
18+
() => time / sn
19+
)
20+
.rotate(() => time / sn)
21+
.diff(
22+
shape(vn, 1 / sn)
23+
.color(0, 1, 0)
24+
.scroll(
25+
() => time / 1 / sn,
26+
() => time / 1 / sn
27+
)
28+
.rotate(() => time / 1 + a.fft[0])
29+
)
30+
.diff(
31+
shape(vn, 2 / sn)
32+
.color(0, 0, 1)
33+
.scroll(
34+
() => time / 2 / sn,
35+
() => time / 2 / sn
36+
)
37+
.rotate(() => time / 2 - a.fft[1])
38+
)
39+
.diff(
40+
shape(vn, 3 / sn)
41+
.color(1, 0, 0)
42+
.scroll(
43+
() => time / 3 / sn,
44+
() => time / 3 / sn
45+
)
46+
.rotate(() => time / 3 + a.fft[2])
47+
)
48+
.diff(
49+
shape(vn, 4 / sn)
50+
.color(0, 1, 0)
51+
.scroll(
52+
() => time / 4 / sn,
53+
() => time / 4 / sn
54+
)
55+
.rotate(() => time / 4 - a.fft[3])
56+
)
57+
.diff(
58+
shape(vn, 5 / sn)
59+
.color(0, 0, 1)
60+
.scroll(
61+
() => time / 5 / sn,
62+
() => time / 5 / sn
63+
)
64+
.rotate(() => time / 5 - a.fft[4])
65+
)
66+
.diff(
67+
shape(vn, 6 / sn)
68+
.color(0, 1, 1)
69+
.scroll(
70+
() => time / 6 / sn,
71+
() => time / 6 / sn
72+
)
73+
.rotate(() => time / 6 + a.fft[5])
74+
)
75+
.diff(
76+
shape(vn, 7 / sn)
77+
.color(1, 0, 1)
78+
.scroll(
79+
() => time / 7 / sn,
80+
() => time / 7 / sn
81+
)
82+
.rotate(() => time / 7 - a.fft[6])
83+
)
84+
.diff(
85+
shape(vn, 8 / sn)
86+
.color(1, 1, 0)
87+
.scroll(
88+
() => time / 8 / sn,
89+
() => time / 8 / sn
90+
)
91+
.rotate(() => time / 8 + a.fft[7])
92+
)
93+
.diff(
94+
shape(vn, 9 / sn)
95+
.color(1, 1, 1)
96+
.scroll(
97+
() => time / 9 / sn,
98+
() => time / 9 / sn
99+
)
100+
.rotate(() => time / 9 + a.fft[0])
101+
)
102+
.scale(0.3)
103+
.blend(o1,[.6,.1])
104+
.blend(o2,.8)
105+
.out(o1)
106+
a.setScale(1.5)
107+
a.setBins(8)
108+
c = 0
109+
crown = new Array(13).fill().reduce(
110+
(acc, e) =>
111+
acc.add(
112+
shape(3, 0.2, 0.2)
113+
.color(0.9, 0.6, 0.3)
114+
.rotate((c += 10), 0.1)
115+
),
116+
solid()
117+
)
118+
nnote=55
119+
m = midi.input().channel('*')
120+
m.onNote("*", ({ note, velocity, channel }) => {
121+
console.log("onCCevent")
122+
console.log(note)
123+
console.log(velocity)
124+
console.log(channel)
125+
nnote=note
126+
});
127+
crown
128+
.layer(voronoi().mask(noise(20).modulate(noise(10).luma(0.4, 0.9), 0.2)))
129+
.scale(()=>(nnote-48.0)/12)
130+
// .scale(()=>a.fft[0])
131+
.out(o2)
132+
a.show()
133+
// licensed with CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
134+
// by Nelson Vera
135+
// twitter: @nel_sonologia
136+
137+
osc(8,-0.5, 1).color(-1.5, -1.5, -1.5).blend(o0).rotate(-0.5, -0.5).modulate(shape(4).rotate(0.5, 0.5).scale(2).repeatX(2, 2).modulate(o0, () => mouse.x * 0.0005).repeatY(2, 2)).blend(o1,[.7,.7].smooth()).blend(o0,.9).out(o0)
138+
render(o0)
139+

0 commit comments

Comments
 (0)