Control audio with this slick api for controlling one or many audio tracks at simultaneously.
This method plays the audio track from the current position (default position if not set is 0, the beginning)
function TinyPS() { | |
var listeners = new Set(); | |
return { | |
pub: (...args) => Array.from(listeners).forEach(listener => listener(...args)), | |
sub: listener => listeners.add(listener) && listener, | |
unsub: listener => listeners.delete(listener), | |
wipe: () => listeners.clear() | |
}; | |
} |
function EventSystem(){ | |
var events = {}; | |
var event = function () { | |
var nameSpaces = Array.from(arguments); | |
var single = nameSpaces.length === 1; | |
var eventName = nameSpaces.join("/"); | |
if(!events.hasOwnProperty(eventName)){ | |
events[eventName]=[]; | |
} | |
return { |
const fs = require("fs"); | |
function logError(msg,data) { | |
console.log("Error: "+msg,data||""); | |
} | |
var path = process.argv[2]; | |
var num1 = process.argv[3]; | |
var num2 = process.argv[4]; | |
var num3 = process.argv[5]; |
var generateRandomRythem = (weight) => { | |
let hit = "x", rythem = "--------".split(""); | |
for (let i = 0; i < ( weight || 4 ); i++) { | |
rythem[Math.floor(Math.random()*rythem.length-1)] = "x"; | |
} | |
return rythem.concat(rythem).join(""); | |
} | |
console.log(generateRandomRythem(6)); |
function sha1HashString(str) | |
Dim hexStr, x, aBytes, sha1 | |
aBytes = CreateObject("System.Text.UTF8Encoding").GetBytes_4(str) | |
set sha1 = CreateObject("System.Security.Cryptography.SHA1Managed") | |
sha1.Initialize() | |
aBytes = sha1.ComputeHash_2( (aBytes) ) | |
for x=1 to lenb(aBytes) | |
hexStr= hex(ascb(midb( (aBytes),x,1))) | |
if len(hexStr)=1 then hexStr="0" & hexStr | |
sha1HashString=sha1HashString & hexStr |
<Window x:Class="TestApp.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:TestApp" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="450" Width="800"> | |
<Grid> | |
<Button Content="Generate progression" HorizontalAlignment="Center" Margin="0,210,0,181" VerticalAlignment="Center" Width="136" RenderTransformOrigin="-0.006,0.236" Click="Button_Click" Height="29"/> |
const fs = require("fs"); | |
var read = path => fs.readFileSync(path, 'utf8'), config; | |
config = { | |
path: "./GMAB", | |
out: "./", | |
listen: false, | |
sourcePages: "./src" |
Set objFSO = CreateObject("Scripting.FileSystemObject") | |
Function say(msg) | |
WScript.Echo(msg) | |
End Function | |
Function readFile (filename) | |
If objFSO.FileExists(filename) Then | |
Set file = objFSO.OpenTextFile(filename, 1) | |
readFile = file.ReadAll |