A Supercollider synth def (scsyndef
) file parser written in javascript.
The JSFiddle preview is here.
Sonic Pi has a lot of precompiled scsyndef
files that can be found here. The synth sources are in the parent directory.
#Blue_Danube-RF.rb | |
#coded for sonic pi by Robin Newman, January 2024 | |
#from https://musescore.com/user/29230024/scores/5161782 by andreamotas4 | |
#Creative Commons Copyright Waiver | |
use_synth :blade | |
use_synth_defaults amp: 0.3 | |
s=0.9;r=0.15 | |
with_fx :reverb, room: 0.8,mix: 0.6 do | |
with_fx :level,amp: 1.2 do | |
a1=[] |
language | contributors | filename | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
gleam |
|
learngleam.gleam |
RUN TESTS | |
>============================================================================ | |
fn foo(x,y) { | |
"A" println | |
\a,b{ print(a,b,"; ") }(x@,y@) | |
"B" println | |
} | |
foo([2,3,4,5],[9,8,7,6]) | |
"done" println |
↗ |
// Allows to call a Android java function asynchronously | |
// spawn long running computations/io on the Java/Android without blocking the JS/Website running inside the WebView | |
// Eg. const result = await callAndroidAsync('javaFunction', { param1: 'value1', param2: 'value2' }) | |
// Please give a star if you find this useful | |
export async function callAndroidAsync(javaFuncName, params) { | |
const rand = 'asyncJava_' + Math.floor(Math.random() * 1000000) | |
window[rand] = {} | |
// func called from android |
#!/usr/bin/env python3 | |
# encoding: utf-8 | |
"""Use instead of `python3 -m http.server` when you need CORS""" | |
import sys | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
class CORSRequestHandler(SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_header('Access-Control-Allow-Origin', '*') |
function* delays() { | |
let a = yield delay(800, "Hello, I'm an"); | |
console.log(a); | |
let b = yield delay(400, "async coroutine!"); | |
console.log(b); | |
} | |
const coroutine = nextValue => iterator => { | |
const { done, value } = iterator.next(nextValue); |