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
// MIT License | |
// | |
// Copyright (c) 2023 Mitsutaka Okazaki | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
// サンプルレート変換: 移動平均フィルタの多段接続 | |
const WaveFile = require("wavefile"); | |
const fs = require("fs"); | |
function upsample(samples, M, useZero) { | |
const result = []; | |
for (let i = 0; i < samples.length; i++) { | |
const d = samples[i]; | |
for (let j = 0; j < M; j++) { |
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
// MIT License | |
// | |
// Copyright (c) 2022 Mitsutaka Okazaki | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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
localeIdentifier | Description | |
---|---|---|
af | Afrikaans | |
af_NA | Afrikaans (Namibia) | |
af_ZA | Afrikaans (South Africa) | |
agq | Aghem | |
agq_CM | Aghem (Cameroon) | |
ain | Ainu | |
ain_JP | Ainu (Japan) | |
ak | Akan | |
ak_GH | Akan (Ghana) |
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
LanguageTag | Description | |
---|---|---|
af | Afrikaans | |
af-NA | Afrikaans (Namibia) | |
af-ZA | Afrikaans (South Africa) | |
agq | Aghem | |
agq-CM | Aghem (Cameroon) | |
ak | Akan | |
ak-GH | Akan (Ghana) | |
am | Amharic | |
am-ET | Amharic (Ethiopia) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<script> | |
const BUF_SIZE = 16384; | |
let context; | |
let scriptNode; | |
function play() { | |
scriptNode = context.createScriptProcessor(BUF_SIZE, 1, 1); |
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
const sega_table = [ | |
0x0, | |
0x03ff, //, 01 109.346Hz A2 -10.329 cents | |
0x03c7, //, 02 115.678Hz A#2 -12.867 cents | |
0x0390, //, 03 122.654Hz B2 -11.489 cents | |
0x035d, //, 04 129.920Hz C3 -11.864 cents | |
0x032d, //, 05 137.590Hz C#3 -12.555 cents | |
0x02ff, //, 06 145.842Hz D3 -11.720 cents | |
0x02d4, //, 07 154.504Hz D#3 -11.836 cents | |
0x02ab, //, 08 163.779Hz E3 -10.911 cents |
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
const F = [57, 57, 57, 57, 77, 102, 128, 153]; | |
function ensureInt16Array(pcm: Int16Array | Uint8Array): Int16Array { | |
if (pcm instanceof Uint8Array) { | |
const result = new Int16Array(pcm.length); | |
for (let i = 0; i < pcm.length; i++) { | |
result[i] = (pcm[i] - 128) * 256; | |
} | |
return result; | |
} |
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
/** | |
* Sampling rate converter using sinc interporation. | |
* | |
* This code was made with reference to http://blog-yama.a-quest.com/?eid=970185 | |
*/ | |
/* LW is truncate length of sinc(x) calculation. | |
* Lower LW is faster, higher LW results better quality. | |
* LW must be a non-zero positive even number, no upper limit. | |
* LW=16 or greater is recommended. |
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
export type OPLLOperatorParam = { | |
am: number; | |
pm: number; | |
eg: number; | |
ml: number; | |
kr: number; | |
kl: number; | |
tl: number; | |
ar: number; | |
dr: number; |