Skip to content

Instantly share code, notes, and snippets.

View ananthp's full-sized avatar

Ananth Pattabiraman ananthp

View GitHub Profile
import array
import struct
def float_to_16_bit_pcm(raw_floats):
floats = array.array('f', raw_floats)
samples = [sample * 32767 for sample in floats]
raw_ints = struct.pack("<%dh" % len(samples), *samples)
return raw_ints
@ananthp
ananthp / gist:8a1f33c49b256b3c069f
Last active August 29, 2015 14:03
Stuff on top of windows

Basics

  • Firefox. Sync
  • Chrome. Sync
  • MSOffice / LibreOffice
  • GVim / Notepad++

Audio

  • Reaper
@astrojuanlu
astrojuanlu / bezier_curves.py
Last active September 25, 2023 13:09
Interactive Bézier curves with Python using just matplotlib.
import matplotlib
matplotlib.use('webagg')
import numpy as np
from scipy.special import binom
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
@rpattabi
rpattabi / stuff_on_top_of_ubuntu.md
Created April 28, 2012 05:02
Stuff On Top of Ubuntu

Stuff to install or setup on top of default ubuntu installation

Launcher

Remove libre office. Add ..

  • Update Manager
  • System Monitor
  • Terminal
@oparrish
oparrish / audio_tag.rb
Created March 6, 2012 15:55
Jekyll tag plugin for creating HTML 5 audio element based on a list of source files
module Jekyll
class AudioTag < Liquid::Tag
def initialize(tag_name, files, tokens)
super
@files = files
end
def render(context)
HTML << '<audio controls="controls">'
@endolith
endolith / Perfect_FFT.py
Last active June 16, 2023 08:25
Perfect FFT
from numpy import linspace, cos, pi, absolute
from numpy.fft import fft, fftfreq, fftshift
import matplotlib.pyplot as plt
# Sampling rate
fs = 64 # Hz
# Time is from 0 to 1 seconds, but leave off the endpoint, so
# that 1.0 seconds is the first sample of the *next* chunk
length = 1 # second