This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
std::string operator*(std::string lhs, int rhs) | |
{ | |
std::string instance = lhs; | |
for (unsigned n = 1; n < abs(rhs); n++) | |
lhs.append(instance); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <iostream> | |
#include <string> | |
#include "dsound.h" | |
#include "mmreg.h" | |
#include "cguid.h" | |
HWND get_console_window(); | |
void hresult_log(HRESULT, std::string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random, pyaudio | |
from math import sin, cos, pi | |
from array import array | |
p = pyaudio.PyAudio() | |
τ = 2 * pi | |
SAMPLE_RATE = 44100 | |
LEN = SAMPLE_RATE * 4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <iostream> | |
#include "SDL2/SDL.h" | |
uint16_t const screen_width = 48 * 5; | |
uint16_t const screen_height = 32 * 5; | |
float const circle = 6.28318530; | |
template <typename T> struct vec2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <random> | |
#include <iostream> | |
#include "alsa/asoundlib.h" | |
unsigned const size = 1024; | |
unsigned const rate = 44100; | |
float const circle = 6.28318530; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdint> | |
#include <cassert> | |
#include <algorithm> | |
#include <iostream> | |
namespace DASM { | |
using u64 = uint64_t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq byte-compile-warnings '(cl-functions)) | |
(require 'package) | |
;; Any add to list for package-archives (to add marmalade or melpa) goes here | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/") t) | |
(package-initialize) | |
(set-frame-font "Fira Mono-11" nil t) | |
(setq inhibit-startup-screen t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if AVX2_ENABLED | |
__m256 read_vector(__m256 phase) { | |
phase = _mm256_mul_ps(phase, _mm256_set1_ps(TABLE_SIZE)); | |
__m256i a = _mm256_cvtps_epi32(_mm256_floor_ps(phase)); | |
__m256i b = _mm256_cvtps_epi32(_mm256_floor_ps(_mm256_add_ps(phase, _mm256_set1_ps(1)))); | |
__m256 t = _mm256_sub_ps(phase, _mm256_cvtepi32_ps(a)); | |
__m256 lower = _mm256_i32gather_ps(sin_table, a, 4); | |
__m256 upper = _mm256_i32gather_ps(sin_table, b, 4); |