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>
|// 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'];|
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.
|// Cellular automata? Awesome.|
|typedef unsigned char cell;|
|- [x] Quad tree compression|
|- [ ] GLSL smallpt|
|- [ ] CPU smallpt|
|- [ ] Dithering library|
|- [ ] All RGB|
|- [ ] Chip-8 emulator|
|- [ ] Chip-8 assembler|
|- [ ] Chip-8 disassembler|
|// Emptyness? Awesome.|
|// 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.|