Ethereal Phase # Ethereal Phase
An exploration between contrasting polarities and equilibrium inspired by electromagnetic waves.
Each 'Ethereal Phase' is unique to the transaction that generated it.
##

| Artist | [Audivit](https://audivit.xyz/) |
|:------------|:-----------|
| **Editions** | 500 |
| **Editions License** | [NIFTY](https://www.nftlicense.org/) |
| **Code License** | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
## Metadata
| Attribute | Possible Values |
|:------------|:-----------|
| Style |Ethereal, Glitch, Spectral |
| Palette | Hero, Smart, Dupont, Funken, Spritz, Decca, Villain, Monochrome |
| Crest | 0% to 100% / Amplitude detail |
| Frequency | 0% to 100% / Wave cycles |
| Flux | 0% to 100% / Wave flow force |
| Asymmetry | 0% to 100% / Skew of shadow wave | Dwell Before Bang | Time delay based on transaction hash |
| Compression | 0% to 100% / Max amplitude and wave border dimension |
## Extra Features
| Input | Action |
|:------------|:-----------|
| Press key [ **s** ] | Save high resolution 4000x4000 pixels file |
## Source Code
```
let decPairs, TX, TXN, EID, DIM, inDIM, WIDTH, HEIGHT, render, seed, palette, clr;
let pal1, pal2, pal3, pal4, pal5, pal6, pal7, pal8;
let metadataObj = {};
getHashData = (transactionID) => {
let transactions = [TX];
let transactionForTokenId = transactionID - 1;
let tokenData = { hash: transactions[transactionForTokenId] };
decPairs = [];
for (let i = 0; i < 32; i++) {
decPairs.push(parseInt(tokenData.hash.substr(2 * i + 2, 2), 16));
}
}
printMetadata = () => {
if (decPairs[29] <= 170) {
metadataObj.Style = "Ethereal";
} else if (decPairs[29] > 220 && decPairs[5] <= 150 && decPairs[10] >= 100) {
metadataObj.Style = "Glitch";
} else {
metadataObj.Style = "Spectral";
}
metadataObj.Palette = clr[0];
metadataObj.Crest = p.round(p.map(decPairs[9], 0, 255, 1, 100)) + "%";
metadataObj.Frequency = p.round(p.map(decPairs[15], 0, 255, 100, 1)) + "%";
metadataObj.Flux = p.round(p.map(decPairs[4], 0, 255, 1, 100)) + "%";
metadataObj.Asymmetry = p.round(p.map(decPairs[6], 0, 255, 1, 100)) + "%";
metadataObj.Compression = p.round(p.map(decPairs[7], 0, 255, 1, 100)) + "%";
metadataObj.transactionHash = TX;
console.log("transaction: ", metadataObj.transactionHash);
console.log("metadata: ", metadataObj);
}
p.keyTyped = () => {
if (p.keyCode === 83) {
render.save("Ethereal Phase #" + EID + ".tif");
}
}
p.myCustomRedrawAccordingToNewPropsHandler = (props) => {
if (props.transactionHash && props.square) {
TX = props.transactionHash;
TXN = props.tokenId;
EID = props.editionId;
WIDTH = window.innerWidth / props.square * 0.8;
HEIGHT = window.innerHeight / props.square * 0.8;
DIM = Math.min(WIDTH, HEIGHT);
inDIM = 1000;
getHashData(1);
p.randomSeed(+props.transactionHash.substr(0, 10));
seed = p.random(0, 255);
p.noiseSeed(seed);
p.createCanvas(DIM, DIM);
p.pixelDensity(2);
render = p.createGraphics(inDIM, inDIM, p.WEBGL);
render.setAttributes("alpha", false);
render.setAttributes("antialias", true);
render.pixelDensity(4);
render.smooth();
render.rectMode(p.CENTER);
let crest = p.map(decPairs[9], 0, 255, 1.0, 5.0);
let frequency = p.map(decPairs[15], 0, 255, 2.0, 5.0);
let flux = p.map(decPairs[4], 0, 255, 1.3, 1.5);
let asymmetry = p.map(decPairs[6], 0, 255, 1.0, 1.2);
let compression = p.map(decPairs[7], 0, 255, 0.3, 0.6);
if (decPairs[29] > 220 && decPairs[5] <= 150 && decPairs[10] >= 100) {
pal2 = ["Villain", "#FFF9F0", "#28FFBF", "#28FFBF", "#030303"];
pal1 = ["Hero", "#03506F", "#FF2442", "#FFF9F0", "#03506F"];
pal4 = ["Villain", "#FFF9F0", "#28FFBF", "#28FFBF", "#030303"];
pal5 = ["Funken", "#4E3D53", "#FFB200", "#FFF9F0", "#FFB200"];
pal6 = ["Decca", "#7F616D", "#FF4D6E", "#FFF9F0", "#FF4D6E"];
pal3 = ["Dupont", "#6D9598", "#FF2442", "#FFF9F0", "#FF2442"];
pal7 = ["Hero", "#03506F", "#FF2442", "#FFF9F0", "#03506F"];
pal8 = ["Decca", "#7F616D", "#FF4D6E", "#FFF9F0", "#FF4D6E"];
} else if (decPairs[29] <= 170) {
pal5 = ["Funken", "#4E3D53", "#FFB200", "#FFF9F0", "#FFB200"];
pal6 = ["Decca", "#7F616D", "#FF4D6E", "#FFF9F0", "#FF4D6E"];
pal2 = ["Smart", "#FFF9F0", "#00ADB5", "#FFF9F0", "#030303"];
pal1 = ["Hero", "#FF2442", "#03506F", "#FFF9F0", "#03506F"];
pal4 = ["Spritz", "#FF7869", "#FFC57E", "#FFF9F0", "#FFC57E"];
pal3 = ["Dupont", "#6D9598", "#FF2442", "#FFF9F0", "#FF2442"];
pal7 = ["Villain", "#28FFBF", "#030303", "#28FFBF", "#28FFBF"];
pal8 = ["Monochrome", "#FFF9F0", "#101010", "#FFF9F0", "#FFF9F0"];
} else {
pal2 = ["Hero", "#FF2442", "#03506F", "#FFF9F0", "#03506F"];
pal1 = ["Hero", "#FF2442", "#03506F", "#FFF9F0", "#03506F"];
pal4 = ["Dupont", "#6D9598", "#FF2442", "#FFF9F0", "#FF2442"];
pal5 = ["Funken", "#4E3D53", "#FFB200", "#FFF9F0", "#FFB200"];
pal6 = ["Decca", "#7F616D", "#FF4D6E", "#FFF9F0", "#FF4D6E"];
pal3 = ["Dupont", "#6D9598", "#FF2442", "#FFF9F0", "#FF2442"];
pal7 = ["Funken", "#4E3D53", "#FFB200", "#FFF9F0", "#FFB200"];
pal8 = ["Monochrome", "#FFF9F0", "#FFF9F0", "#FFF9F0", "#030303"];
}
let PLT = [
pal1, pal1, pal1, pal1,
pal2, pal2, pal2, pal2,
pal3, pal3, pal3, pal3,
pal4, pal4, pal4, pal4,
pal5, pal5, pal5, pal5,
pal6, pal6, pal6, pal6,
pal7, pal7, pal7, pal7,
pal8, pal8, pal8, pal8,
];
palette = p.round(p.map(decPairs[20], 1, 255, 0, 31));
clr = PLT[palette];
printMetadata();
console.log("noise_seed: ", seed);
render.background(clr[1]);
p.noiseDetail(crest);
render.noFill();
render.strokeWeight(inDIM / 70);
render.rectMode(p.CENTER);
render.rect(0, 0, inDIM, inDIM);
render.translate(-inDIM * 0.35, -inDIM * 0.35, -inDIM / 2);
render.push();
render.translate(-inDIM * 0.7, 0, 0);
render.beginShape();
for (let x = inDIM/5.5; x < inDIM*2.5; x++) {
let nx = p.map(x, 100, -inDIM, frequency, 0);
let y = inDIM * 0.95 * p.noise(nx / 2);
let z = inDIM + p.noise(nx / 2);
render.strokeWeight(inDIM * 0.06);
render.stroke(0, 20);
render.fill(clr[2]);
render.vertex(x, y, 0);
if (decPairs[29] <= 170) {
render.background(clr[1]);
render.strokeWeight(4);
render.stroke(clr[1]+"20");
render.vertex(x * flux / 2, y / 3, -1000);
render.vertex(x, y * 0.09, 0.0001);
render.vertex(x / asymmetry, y * compression * 2, 0.0001);
} else if (decPairs[29] > 220 && decPairs[5] <= 150 && decPairs[10] >= 100) {
render.background(clr[1]);
render.vertex(x * flux, z / 3, 0.2);
render.fill(p.random(clr));
render.strokeWeight(2);
render.vertex(x, y * 0.3, 0.0001);
render.vertex(x, y * compression / 1.5, 0.0001);
} else {
render.noFill();
render.stroke(clr[4] + "30")
render.strokeWeight(2);
render.vertex(x * flux, z / 3, 0);
render.vertex(x, y * 0.4, 0);
render.vertex(x / asymmetry, y * compression, 0);
}
}
render.endShape();
render.pop();
render.fill(clr[3]);
render.noStroke();
if( decPairs[29] <= 170){
render.translate(0, inDIM*0.3, -200);
render.rect(inDIM / 3, inDIM * 1.75, inDIM * 2, inDIM * 4);
} else {
render.translate(0, -2, -200);
render.rect(inDIM / 3, inDIM * 0.833, inDIM * 2, inDIM);
}
}
p.redraw();
}
p.draw = () => {
p.image(render, 0, 0, DIM, DIM);
p.noLoop();
}
```
↓ show full (8,208 bytes)