Skip to content

Instantly share code, notes, and snippets.

View ricardomatias's full-sized avatar
🎯
W R K S P L Y

Ricardo Matias ricardomatias

🎯
W R K S P L Y
View GitHub Profile
@ricardomatias
ricardomatias / PicoMIDItoCV.py
Created May 18, 2023 11:13 — forked from axwax/PicoMIDItoCV.py
Raspberry Pi Pico based MIDI to CV converter using an MCP4725 12-bit DAC.
# MIDI to CV converter for Raspberry Pi Pico and MCP4725 DAC by @AxWax
#
# Demo: https://www.youtube.com/watch?v=aGfQHL1jU4I
#
# This is heavily based on and requires
# the SimpleMIDIDecoder library by @diyelectromusic, which can be found at
# https://diyelectromusic.wordpress.com/2021/06/13/raspberry-pi-pico-midi-channel-router/
#
#
# Wiring:
@ricardomatias
ricardomatias / pwm.cpp
Created May 16, 2023 12:35
pico pwm irq
#include "hardware/pwm.h"
#include "hardware/clocks.h"
#include "hardware/irq.h"
#include "pico/binary_info.h"
#include "pico/cyw43_arch.h"
#include "pico/stdlib.h"
#include "sonovolt/time.h"
#define LED_PIN 15
#define PWM_PIN LED_PIN
@ricardomatias
ricardomatias / video_to_gif.sh
Created January 11, 2023 10:16 — forked from Olshansk/video_to_gif.sh
A handy bash function to convert a video (e.g. a screen cap) to a gif using ffmpeg in your shell
function video_to_gif {
local input_video_path="$1"
local output_gif_path="$2"
local fps="${3:-10}"
local scale="${4:-1080}"
local loop="${5:-0}"
ffmpeg -i "${input_video_path}" -vf "setpts=PTS/1,fps=${fps},scale=${scale}:-2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop $loop "${output_gif_path}"
}
package org.ygl.openrndr.demos
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.BufferMultisample
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.colorBuffer
import org.openrndr.draw.renderTarget
import org.openrndr.draw.shadeStyle
import org.openrndr.draw.vertexBuffer
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.color.mix
import org.openrndr.color.rgb
import org.openrndr.draw.isolatedWithTarget
import org.openrndr.draw.renderTarget
import org.openrndr.extra.compositor.compose
import org.openrndr.extra.compositor.draw
import org.openrndr.extra.compositor.post
@ricardomatias
ricardomatias / wgsl_3d_sdf.md
Created August 4, 2021 15:28 — forked from munrocket/wgsl_3d_sdf.md
3D SDF Primitives in WGSL

3D SDF Primitives in WGSL

How to use this gist:

  1. Build a sphere tracer with WebGPU (paper, paper2, youtube)
  2. Create model with sdf functions from here
  3. Add light and shadows
  4. ???
  5. PROFIT

This code tested in Chrome and Firefox, should work on PC too. Press star and subscribe.

@ricardomatias
ricardomatias / output.svg
Created December 21, 2020 11:30
Patches
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<script>
export let text = null;
let showText = false;
setTimeout(() => (showText = true), 1000);
</script>
{#if text && showText}
<p>
{text}
@ricardomatias
ricardomatias / curved-structure
Created June 12, 2020 10:31
Sverchok.0.6.0.0 (32b697d) | Blender.2.90.0Alpha | curved-structure | 2020.06.12 | 12:31
{
"export_version": "0.079",
"framed_nodes": {},
"groups": {},
"nodes": {
"A Number": {
"bl_idname": "SvNumberNode",
"height": 100.0,
"hide": false,
"label": "Surface Res",
@ricardomatias
ricardomatias / FFT.c
Created April 3, 2020 15:58 — forked from lukicdarkoo/FFT.c
Basic implementation of Cooley-Tukey FFT algorithm in C++
#include "FFT.h"
void fft(int *x_in,
std::complex<double> *x_out,
int N) {
// Make copy of array and apply window
for (int i = 0; i < N; i++) {
x_out[i] = std::complex<double>(x_in[i], 0);
x_out[i] *= 1; // Window