memoscan
← all memos

Memo 0x23052d4a…d9f5d4 on Ethereum

.max(tone, highlightFill, isLargeAnchor || isHighlightMark || isHeavyInk ? 0.72 : 0); const density = Math.max(0.28, Math.min(0.62, 0.24 + strong * 0.38)); return grSeeded(column * 1201 + row * 379 + frame * 97 + 17) < density; } function svgSetCell(node, glyph, tone, style, column, row, frame, adaptiveScale = 1, motionFrame = frame, recoveredAdaptiveDenseAnchor = false, adaptiveSpec = null) { const isLargeAnchor = style === "2"; const isHighlightMark = style === "3"; const isHeavyInk = style === "4"; const isBackgroundStyle = style === "5"; const isEdge = grIsEdgeStyle(style); const isStoredDenseStyle = grIsDenseHighlightStyle(style); const isRecoveredLargeHighlight = recoveredAdaptiveDenseAnchor; const useRecoveredDenseAnchor = isRecoveredLargeHighlight && isStoredDenseStyle; const glowStyle = isStoredDenseStyle && !useRecoveredDenseAnchor ? "0" : style; const isAdaptiveClear = style === "1"; if (isAdaptiveClear) { svgClearCell(node); return false; } const isStoredSpace = glyph === " " || isBackgroundStyle; if (isStoredSpace) { const chars = SIGNAL_RITUAL_ENGINE.glyphs; const backgroundIndex = Math.max(1, Math.min(chars.length - 1, Math.floor(grSeeded(column * 181 + row * 557) * Math.min(4, chars.length - 1)))); glyph = chars[backgroundIndex] || "."; } if (!isEdge) glyph = grMotionGlyph(glyph, column, row, frame, tone); const isDenseHighlight = !isStoredSpace && ( useRecoveredDenseAnchor || (!isStoredDenseStyle && grShouldUseDenseHighlightGlyph(tone, style)) ); if (isDenseHighlight) { glyph = grDenseHighlightGlyph(tone, style, column, row, frame); } if (glyph === " " && tone < 0.02) { svgClearCell(node); return false; } const highlightFill = Math.max(grHighlightFill(tone), isHeavyInk ? 0.35 : 0); const fill = highlightFill > 0 || isHighlightMark || isHeavyInk || isDenseHighlight ? grRgbString(grHighlightInkColor(tone, highlightFill, isHighlightMark, isHeavyInk, isDenseHighlight)) : svgToneFill(tone); const usesAdaptiveBlock = Boolean(adaptiveSpec); const largeScale = usesAdaptiveBlock ? adaptiveSpec.scale : grHighlightCellScale(tone, style, column, row, frame, isRecoveredLargeHighlight); const sizeScale = grSizeGlitchScale(column, row, frame) * largeScale; const tuning = SIGNAL_RITUAL_ENGINE.visualRenderer.rendererTuning || {}; const bgAlpha = Math.max( tuning.backgroundAlphaMin ?? 0.02, Math.min(tuning.backgroundAlphaMax ?? 0.12, (tuning.backgroundAlphaBase ?? 0.035) + tone * (tuning.backgroundAlphaTone ?? 0.18)), ); const alpha = isStoredSpace ? bgAlpha : Math.max(0.82, Math.min(1, 0.86 + tone * 0.32)); const text = isHighlightMark || grShouldHighlightBlock(tone) ? "#" : glyph; const opacity = alpha.toFixed(3); const fontWeight = String(isStoredSpace ? 700 : isEdge ? 800 : grHighlightWeight(tone, style)); const glyphScale = tuning.glyphScale ?? 1.25; const usesFixedHighlightSize = isLargeAnchor || isHighlightMark || isHeavyInk || isDenseHighlight || isRecoveredLargeHighlight || usesAdaptiveBlock; const rawFontSize = usesFixedHighlightSize ? cell * (glyphScale + highlightFill * (tuning.highlightGlyphBoost ?? 0.38)) * sizeScale : cell * glyphScale * sizeScale; const maxFontSize = usesFixedHighlightSize ? rawFontSize : cell * (adaptiveScale > 1 ? Math.min(1.35, adaptiveScale * 1.12) : 1.2); const fontSize = String(Math.round(Math.min(rawFontSize, maxFontSize))); const rowOffset = rowOffsets[row] || 0; const centeredOffset = adaptiveSpec ? [adaptiveSpec.offsetX, adaptiveSpec.offsetY] : [0, 0]; const proceduralOffset = grProceduralGlyphOffset(column, row, motionFrame, tone); const tx = rowOffset + centeredOffset[0] + proceduralOffset[0]; const ty = centeredOffset[1] + proceduralOffset[1]; const transform = tx || ty ? "translate(" + tx + " " + ty + ")" : ""; node._grColumn = column; node._grRow = row; node._grTone = tone; node._grBaseRowOffset = rowOffset; node._grCenteredOffsetX = centeredOffset[0]; node._grCenteredOffsetY = centeredOffset[1]; if (node._grText !== text) { node.textContent = text; node._grText = text; } if (node._grFill !== fill) { node.setAttribute("fill", fill); node._grFill = fill; } if (node._grOpacity !== opacity) { node.setAttribute("opacity", opacity); node._grOpacity = opacity; } if (node._grFontSize !== fontSize) { node.setAttribute("font-size", fontSize); node._grFontSize = fontSize; } if (node._grFontWeight !== fontWeight) { node.setAttribute("font-weight", fontWeight); node._grFontWeight = fontWeight; } if (node._grStroke) { node.removeAttribute("stroke"); node._grStroke = ""; } if (node._grStrokeWidth) { node.removeAttribute("stroke-width"); node._grStrokeWidth = ""; } if (node._grTransform !== transform) { if (transform) node.setAttribute("transform", transform); else node.removeAttribute("transform"); node._grTransform = transform; } return !isStoredSpace && grShouldGlowCell(tone, glowStyle, highlightFill, column, row, motionFrame); } function svgSetProceduralTransform(node, frame) { if (!node || node._grText === "") return; const column = node._grColumn || 0; const row = node._grRow || 0; const tone = node._grTone || 0; const proceduralOffset = grProceduralGlyphOffset(column, row, frame, tone); const tx = (node._grBaseRowOffset || 0) + (node._grCenteredOffsetX || 0) + proceduralOffset[0]; const ty = (node._grCenteredOffsetY || 0) + proceduralOffset[1]; const transform = tx || ty ? "translate(" + tx + " " + ty + ")" : ""; if (node._grTransform !== transform) { if (transform) node.setAttribute("transform", transform); else node.removeAttribute("transform"); node._grTransform = transform; } } function svgMoveProceduralCells(targetCells, frame, targetGlowCells = null) { for (let index = 0; index < targetCells.length; index += 1) { svgSetProceduralTransform(targetCells[index], frame); if (targetGlowCells?.[index]) svgSetProceduralTransform(targetGlowCells[index], frame); } } function svgToneFill(tone) { const toneKey = Math.max(0, Math.min(15, Math.round(tone * 15))); const effects = SIGNAL_RITUAL_ENGINE.visualRenderer.effects || {}; const key = String(toneKey) + ":" + (effects.asciiBrightness || 0) + ":" + (effects.asciiMidtones || 0); if (!toneFillCache[key]) toneFillCache[key] = grRgbString(grInkColor(toneKey / 15)); return toneFillCache[key]; } function svgPooledRect(layer, pool, index, x, y, width, height, fill, opacity) { let rect = pool[index]; if (!rect) { rect = document.createElementNS(svgNs, "rect"); pool[index] = rect; layer.appendChild(rect); } const next = [x, y, width, height, fill, opacity.toFixed(3)]; const prev = rect._grRect || []; if (prev[0] !== next[0]) rect.setAttribute("x", next[0]); if (prev[1] !== next[1]) rect.setAttribute("y", next[1]); if (prev[2] !== next[2]) rect.setAttribute("width", next[2]); if (prev[3] !== next[3]) rect.setAttribute("height", next[3]); if (prev[4] !== next[4]) rect.setAttribute("fill", next[4]); if (prev[5] !== next[5]) rect.setAttribute("opacity", next[5]); rect._grRect = next; } function svgHideUnusedRects(pool, used) { for (let i = used; i < pool.length; i += 1) { if (pool[i]._grRect?.[5] === "0") continue; pool[i].setAttribute("opacity", "0"); pool[i]._grRect = [...(pool[i]._grRect || [0, 0, 0, 0, "#000", "0"])]; pool[i]._grRect[5] = "0"; } } function svgRenderEffects(frame) { const effects = grEffectSettings(); const fullWidth = columns * cell; const fullHeight = rows * cell; let scanRect = 0; let staticRect = 0; const scan = (effects.badScanlines || 0) / 100; if (scan > 0) { const spacing = Math.max(2, Math.round(9 - scan * 6)) * (SMOOTH_MARKETPLACE_MODE ? 2 : 1); for (let y = 0; y < fullHeight; y += spacing) { svgPooledRect(scanlinesLayer, scanlineRects, scanRect, 0, y, fullWidth, 1, "#000", Math.min(0.32, scan * 0.7)); scanRect += 1; } for (let y = Math.floor(frame % spacing); y < fullHeight; y += spacing * 7) { svgPooledRect(scanlinesLayer, scanlineRects, scanRect, 0, y, fullWidth, 1, "#fff", Math.min(0.18, scan * 0.42)); scanRect += 1; } } svgHideUnusedRects(scanlineRects, scanRect); const staticAmount = effects.asciiStatic ? (effects.asciiStaticAmount || 0) / 100 : 0; if (staticAmount > 0) { const opacity = Math.min(0.5, staticAmount * 0.72); const fleckCap = SMOOTH_MARKETPLACE_MODE ? 160 : 520; const flecks = Math.min(fleckCap, Math.round((fullWidth * fullHeight * staticAmount) / (SMOOTH_MARKETPLACE_MODE ? 2600 : 1100))); for (let i = 0; i < flecks; i += 1) { const x = Math.floor(grSmoothRandom(i * 977 + 83, frame * 0.18) * fullWidth); const y = Math.floor(grSmoothRandom(i * 977 + 84, frame * 0.16) * fullHeight); const sizeBoost = SMOOTH_MARKETPLACE_MODE ? 2.2 : 1; const size = Math.max(1, Math.floor(sizeBoost + grSmoothRandom(i * 977 + 85, frame * 0.08) * (staticAmount * 6 * sizeBoost))); svgPooledRect(staticLayer, staticRects, staticRect, x, y, size, size, grSeeded(i * 463 + frame * 79) > 0.5 ? "#ffffff" : "#000000", opacity); staticRect += 1; } } const compression = (effects.compressionScars || 0) / 100; if (compression > 0) { const block = Math.max(8, Math.round(28 - compression * 18)); const opacity = Math.min(0.22, compression * 0.55); for (let y = 0; y < fullHeight; y += block) { for (let x = 0; x < fullWidth; x += block) { if (grSeeded(x * 17 + y * 53 + frame * 101) > compression * 0.55) continue; svgPooledRect(staticLayer, staticRects, staticRect, x, y, Math.min(block, fullWidth - x), Math.min(block, fullHeight - y), grSeeded(x * 83 + y * 29 + frame * 43) > 0.5 ? "#ffffff" : "#000000", opacity); staticRect += 1; } } } const symbolDropout = (effects.symbolDropout || 0) / 100; if (symbolDropout > 0) { const block = Math.max(2, Math.round(cell * (1 + symbolDropout * (SMOOTH_MARKETPLACE_MODE ? 2.2 : 1.6)))); const opacity = Math.min(0.65, symbolDropout * 1.25); const bg = SIGNAL_RITUAL_ENGINE.visualRenderer.background || "#08090b"; for (let y = 0; y < fullHeight; y += block) { for (let x = 0; x < fullWidth; x += block) { if (grSeeded(x * 101 + y * 307 + frame * 131) < symbolDropout * 0.16) { svgPooledRect(staticLayer, staticRects, staticRect, x, y, block, block, bg, opacity); staticRect += 1; } } } } svgHideUnusedRects(staticRects, staticRect); const vignette = (effects.vignette || 0) / 100; vignetteLayer.setAttribute("opacity", Math.min(0.55, vignette * 0.9).toFixed(3)); } function svgRender(timelineFrame) { const procedural = grProceduralMotionEnabled(); const pureProcedural = grPureProceduralEnabled(); const motionFrame = procedural ? Math.max(0, Number(timelineFrame) || 0) : grPlaybackFrame(timelineFrame); const baseTimelineFrame = pureProcedural ? motionFrame : procedural ? grBaseTimelineFrameFromMotionClock(motionFrame) : timelineFrame; const frame = pureProcedural ? motionFrame : grPlaybackFrame(baseTimelineFrame); if (CACHE_FRAME_GROUPS) { svgShowCachedFrame(frame, timelineFrame); svgRenderEffects(frame); return; } if (procedural) { const repaintEvery = Math.max(1, PROCEDURAL_MOTION_CLOCK_FPS / PROCEDURAL_REPAINT_FPS); if (motionFrame < lastProceduralPaintFrame || motionFrame - lastProceduralPaintFrame >= repaintEvery) { svgPaintCells(cells, frame, null, motionFrame); svgRenderEffects(frame); lastProceduralPaintFrame = motionFrame; } else { svgMoveProceduralCells(cells, motionFrame); } return; } svgPaintCells(cells, frame); svgRenderEffects(frame); } function svgPaintCells(targetCells, frame, targetGlowCells = null, mot