Skip to content

Instantly share code, notes, and snippets.


CobaltXII CobaltXII

View GitHub Profile
View synth.js
// this function returns the frequency in Hz of a given note in a given octave
// i used this page to get the formula:
// and i used this page to get the reference frequency:
function getNoteFrequency(note, octave)
// capital letter means it's a sharp
// this notation is what piano letter notes uses
var notes = ['c', 'C', 'd', 'D', 'e', 'f', 'F', 'g', 'G', 'a', 'A', 'b'];
View Message.hpp
#pragma once
#include <array>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <map>
#include <string>
#include <tuple>
#include <type_traits>
CobaltXII /
Last active Jun 11, 2021
C4RN4G3 protocol

C4RN4G3 protocol

Data Types

Signed integers use 2's complement for negative values. Floating-point numbers must fulfill the requirements of IEEE 754. All data types are little-endian.

#include <cstdint>
#include <limits>
View desert.json


Cosmos is an OpenCL accelerated n-body simulator. It can be used to render n-body simulations at a high speed.


Using Cosmos is a two step process. First, you must output binary data of the results of a n-body simulation. Second, you render this to a high-resolution image sequence. Cosmos provides two tools for these purposes, cosmos_simulate and cosmos_render.

Unfortunately, the Cosmos toolchain does not provide an easy way to tweak initial conditions or parameters. However, it does come with a great set of pre-defined conditions and parameters. If you want to modify these, you will have to edit the source code before compiling. If you want to find places where you can edit parameters, search for the text PARAM in all source files.

View cgol.cpp
// Cellular automata? Awesome.
#include "../boiler/boiler.h"
#include <vector>
#include <utility>
#include <iostream>
typedef unsigned char cell;
View todo.txt
To do
- [x] Quad tree compression
- [ ] GLSL smallpt
- [ ] CPU smallpt
- [ ] Dithering library
- [ ] All RGB
- [ ] Chip-8 emulator
- [ ] Chip-8 assembler
- [ ] Chip-8 disassembler
View n_body_image.cpp
// Emptyness? Awesome.
#include "stb_image_write.h"
#include <vector>
#include <utility>
#include <sstream>
#include <iostream>
View bisqwit_jingle.cpp
#include <SDL2/SDL.h>
#include <cmath>
// An audio driver. This audio driver will define a callback that will
// generate a waveform which is passed to SDL. SDL passes this waveform to
// the OS, where it is output to a physical device.
struct audio_driver