Skip to content

Instantly share code, notes, and snippets.

@fukuroder
fukuroder / FIR-LPF-Least-Squares-Fitting.rb
Last active December 23, 2015 17:39
Finite impulse response low-pass filter using least squares fitting.
# coding: utf-8
#------------------------------------------------------------
# FIR-LPF-Least-Squares-Fitting.rb
#
# Created by fukuroda (https://github.com/fukuroder)
#------------------------------------------------------------
require "matrix"
@fukuroder
fukuroder / fm_synthesis_test.html
Last active December 28, 2015 12:29
FM synthesis test using Web Audio API (Google Chrome only) >>> http://fukuroder.sakura.ne.jp/gist/7501079/fm_synthesis_test.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>fm synthesis test</title>
<script src='http://code.jquery.com/jquery-2.1.1.min.js'></script>
<script>
$(function(){
//--------------
// AudioContext
@fukuroder
fukuroder / local_wave_file_play_test.html
Last active December 28, 2015 12:29
local wave file play test using Web Audio API (Google Chrome only)>>> http://fukuroder.sakura.ne.jp/gist/7501137/local_wave_file_play_test.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>local wave file play test</title>
<script src='http://code.jquery.com/jquery-2.1.1.min.js'></script>
<script>
$(function(){
var bufferSource;
var gainNode;
@fukuroder
fukuroder / wave_play_asio.cpp
Last active December 29, 2015 10:39
wave file player (ASIO)
/*
* wave_play_asio.cpp
*
* Created by fukuroda (https://github.com/fukuroder)
*/
// ASIO -> http://www.steinberg.net/en/company/developer.html
#include "asiosys.h"
#include "asio.h"
#include "asiodrivers.h"
@fukuroder
fukuroder / wave_play_wasapi_shared.cpp
Last active July 8, 2021 06:38
wave file player (WASAPI shared mode)
/*
* wave_play_wasapi_shared.cpp
*
* Created by fukuroda (https://github.com/fukuroder)
*/
// windows API
#include <windows.h>
#include <audioclient.h>
#include <mmdeviceapi.h>
@fukuroder
fukuroder / wave_play_wasapi_exclusive.cpp
Last active July 25, 2020 04:54
wave file player (WASAPI exclusive mode)
/*
* wave_play_wasapi_exclusive.cpp
*
* Created by fukuroda (https://github.com/fukuroder)
*/
// windows API
#include <windows.h>
#include <audioclient.h>
#include <mmdeviceapi.h>
@fukuroder
fukuroder / Main.hx
Last active April 25, 2019 14:06
Local audio file player using Web Audio API (Haxe/JS) >>> http://fukuroder.sakura.ne.jp/gist/9981854
package ;
import js.Browser;
import js.html.audio.*; // Web Audio API
import js.html.File;
import js.html.FileReader;
import js.html.InputElement;
import js.JQuery;
import js.Lib;
@fukuroder
fukuroder / alsa_flac_test.cpp
Last active August 29, 2015 14:05
Raspberry PiでFLACファイル再生するテスト
/*
* alsa_flac_test.cpp
*
* Created by fukuroda (https://github.com/fukuroder)
*/
// g++ alsa_flac_test.cpp -std=c++0x -O3 -lasound -lsndfile
#include<alsa/asoundlib.h> // sudo apt-get install libasound2-dev
#include<sndfile.h> // sudo apt-get install libsndfile1-dev
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>local wave file streaming test</title>
<script src='http://code.jquery.com/jquery-2.1.1.min.js'></script>
<script>
$(function(){
// HTML5 audio
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>SoundCloud + Web Audio API test</title>
<script src='http://code.jquery.com/jquery-2.1.1.min.js'></script>
<script src='http://connect.soundcloud.com/sdk.js'></script>
<script>
$(function(){
// default URL