Skip to content

Commit

Permalink
]°++><++°[
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaudry committed Sep 24, 2024
1 parent 0807e53 commit 073ca37
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion p5-experiments/plottable/etemontreal001.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function savepng() {
save("etemontreal001.png");
}

var font
var font
var fSize = 12
var alea = []
function preload() {
Expand Down
8 changes: 5 additions & 3 deletions p5-experiments/plottable/noline004.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ function savepng() {
}

var fSize = 17
var bowie
function preload() {
font = loadFont("../fonts/1CAMBam_Stick_9.ttf");
bowie = loadFont("../fonts/1CAMBam_Stick_9.ttf");
sourcecode = loadStrings('noline004.js');
}

function draw() {
background(230, 80, 50)
strokeWeight(2)
rad = actualwidth * 0.25
translate(leftmargin+rad, topmargin+rad)
anniversaire(7, rad)
Expand Down Expand Up @@ -43,7 +45,6 @@ function anniversaire(iter, rad) {
x4 = (rad ) * cos(radians(inita + 270 + mov))
y4 = (rad ) * sin(radians(inita + 270 + mov))
stroke(50,0,100)
strokeWeight(1)
nucleus(x1, y1, x2, y2, x3, y3, x4, y4)
}
}
Expand Down Expand Up @@ -97,8 +98,9 @@ function nucleus(x1, y1, x2, y2, x3, y3, x4, y4) {


function showcredits(posx, posy) {
textFont(bowie)
textSize(fSize);
noStroke()
stroke(0,0,100)
fill(0,0,100)
var c = "al.my.re [noline 004). 20 September 2024"
text(c, posx, posy)
Expand Down
4 changes: 2 additions & 2 deletions p5-experiments/plottable/plottableframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
//h=96*11=1056

var echelle = 1
var w = 816 * echelle
var h = 1056 * echelle
var w = 1122 * echelle
var h = 1587 * echelle
var rightmargin = 0.96 * w
var leftmargin = 0.04 * w
var topmargin = 0.05 * h
Expand Down
3 changes: 3 additions & 0 deletions programming-keynote/proze2art001.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<head>
<meta charset="UTF-8">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/15.1.3/Tone.js"></script>
<style>
body {
padding: 0;
Expand Down Expand Up @@ -48,6 +49,8 @@
</div>

<script src="proze2art001.js"></script>
<script src="http://unpkg.com/tone"></script>

</body>

</html>
18 changes: 12 additions & 6 deletions programming-keynote/proze2art001.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ var testresults = [];
var index, indexlo, indexhi;
var table;
var testw, testh, nbrows;

var synth
const now = Tone.now();
function setup() {
w = windowWidth
h = windowHeight
Expand All @@ -17,6 +18,7 @@ function setup() {
nbrows = 100;
testw = w * 0.5
testh = h / nbrows
synth = new Tone.Synth().toDestination();
//frameRate(10)
}

Expand Down Expand Up @@ -62,15 +64,19 @@ function ikeda(index) {
translate(w * 0.5, h * 0.5)
var t = testresults[index]
noStroke()
if (t.verdict == 1) { fill(0, 0, 100) }
if (t.verdict == 1) {
fill(0, 0, 100)
synth.triggerAttack("C4", now);
// wait one second before triggering the release
synth.triggerRelease(now + 1); }
else { fill(0, 0, 0) }
rect(-testw, -testh, testw, testh*2)
if(index>0){
if(t.test!=testresults[index-1].test){r=1}
rect(-testw, -testh, testw, testh * 2)
if (index > 0) {
if (t.test != testresults[index - 1].test) { r = 1 }
}
if (t.test == 1) { fill(0, 0, 100); r += 0.01 }
else { fill(0, 0, 0); r += 0.01 }
stroke(0,0,100)
stroke(0, 0, 100)
rect(0, -testh * r, testw, testh * 2 * r)
noStroke()
}
Expand Down

0 comments on commit 073ca37

Please sign in to comment.