🖤
LA SHADER WIKI
  • LA SHADER WIKI
  • CURSOS
    • INTRODUCTORIOS
      • Live coding shaders por NODO Centro Cultral Digital
        • Motivaciones
        • Abril/Mayo 2022
          • Estructura de cada CLASE
          • CLASE 28/04
          • CLASE 05/05
          • CLASE 12/05
          • SDFs
          • Lista de funciones
        • Agosto/Septiembre 2021
        • Sobre nosotres
    • TEMÁTICOS
      • Computando visiones del CAOS en GLSL por CCEBA Media Lab
        • Clases
          • Clase 0
          • Clase 1
          • Clase 2
          • Clase 3
        • Material de consulta y referencia
        • Notas sobre referencias bibliográficas
          • Metamagical Themas: Questing for the Essence of Mind and Pattern by Douglas R. Hofstadter
          • Caos by James Gleick
          • The Fractal Geometry of Nature by Benoit Mandelbrot
        • Adicional: Noviembre 2022 - Grupo, presentaciones y generación de personajes
        • Quienes somos
      • Blobniverso: creación de universo moldeable a través del livecoding
        • Sobre el taller
          • Quienes somos
          • Herramientas
          • Código de conducta
        • Contenido
          • Presentación
          • Intro a GLSL
          • Introducción a mundos 3D
          • Cámara y Acción
          • Repaso + usando mouse y audio input
          • Luz
          • El Canvas como controller
          • Lista de funciones
          • Más referencias
        • Cositas
          • Demoscenes
          • Blobs
          • más cositas
  • CHARLAS
    • TALLER: INTRODUCCIÓN AL VIDEOARTE CON CÓDIGO
    • LIVECODING & CHILL
    • SHADER JAM
      • Cables.gl
      • Vedajs
        • Shjam
        • Demo Doodle grupal
      • Kodelife
  • workshops
    • 💻Live coding por TOPLAP BCN
      • Organización
        • Código de conducta
        • Herramientas
      • Bloque 0
      • Bloque 1
      • Bloque 2
      • Notas finales
      • BONUS
      • Cheatsheets
        • Funciones de GLSL
        • Transformaciones del espacio
        • Figuras
        • Color
        • Otras
  • RECURSOS
    • 📚Bibliografía
      • Tutoriales
      • Blogs
      • Historia
    • 🫂Comunidades
    • 📹Streams
    • ✍️Editores
      • 🕸️Frameworks
  • TRANSCURSO
    • 🥷Entrenamiento funcional
    • 🕯️TEMPLO DE SHADERS
    • ⚡PixelSpirit
Powered by GitBook
On this page
  1. CHARLAS
  2. SHADER JAM

Kodelife

PreviousDemo Doodle grupalNextLive coding por TOPLAP BCN

Last updated 1 year ago

Helpers

uniform sampler2D midi1;
ivec2 midiCoord(int offset)
{
    int x = offset % 32;
    int y = offset / 32;
    return ivec2(x,y);
}

float setMidi(int ccNumber){
  vec4 val = texture(midi1, vec2((1./32.) * midiCoord(3 * 127 + ccNumber)));
  return val.r;
}

#define PI 3.1415926538
float bpm(float bpm, float q, float intensity){
    // Adaptacion de funcion creada por Char Stiles
    // La idea es generar una funcion que sirva como especie de metronomo.
    // Devuelve un valor entre 0 y 1
    float bps = 60./bpm; // beats por segundo
    float bpmVis = tan((time*PI/q)/bps);
     return max(min(abs(bpmVis),1.),0.) * intensity; 
}
float bpmd(float b){
    // Discrete bpm
 return step(0.5,bpm(b,1.,1.)); 
}
float luma(vec3 color) { return dot(color, vec3(0.299, 0.587, 0.114)); }

float rand(vec2 n) {
    return fract(sin(dot(n, vec2(12.9898,12.1414))) * 83758.5453);
}
KodeLife | hexler.net
Logo