A hands-on introduction to live-coded music in the browser
Strudel is a JavaScript-derived live-coding environment that lets you make music directly in a browser REPL. Each snippet you evaluate becomes part of a real-time musical texture.
| class Vec3 { | |
| constructor(x, y, z) { | |
| this.x = x; | |
| this.y = y; | |
| this.z = z; | |
| } | |
| add(v) { | |
| this.x += v.x; | |
| this.y += v.y; |
| @Injectable({scope: Scope.DEFAULT}) | |
| export class EventSchedulerService { | |
| private appName: string | |
| constructor( | |
| ) { | |
| } | |
| @Cron(CronScheduleEnum.TaskSchedule1) // <--- this caused warning | |
| async handleTaskSchedule() { |
| // ip-logger.js | |
| // Simple IP logger using Express | |
| // Run: node ip-logger.js | |
| // Requires: npm install express | |
| const express = require('express'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const PORT = process.env.PORT || 3000; |
| const http = require('http'); | |
| // Sample predefined JSON array (100 records for example) | |
| const data = Array.from({ length: 100000 }, (_, i) => ({ | |
| id: i + 1, | |
| name: `Item${i + 1}`, | |
| value: Math.random().toFixed(4) | |
| })); | |
| // Async generator to yield CSV chunks from JSON array |
| ffmpeg -i input.mp4 -filter:a loudnorm output.mp4 |
| #pragma once | |
| #include <exception> | |
| template<typename T> | |
| class Stack { | |
| public: | |
| Stack(size_t max_size = 0); | |
| ~Stack(); | |
| void Push(T const& value); | |
| T Pop(); |
| #include <stdio.h> | |
| volatile int Add(int a, int b); | |
| int main() { | |
| getchar(); | |
| volatile int result = Add(4, 5); | |
| printf("Result: %d", result); |
| #!/bin/bash | |
| while true; do | |
| ./YOUR_PROGRAM | |
| EXIT_CODE=$? | |
| if [ $EXIT_CODE -eq 0 ]; then | |
| echo "Exited successfully, not restarting." | |
| break | |
| else | |
| echo "Exited with error code $EXIT_CODE, restarting..." |
| #!/usr/bin/env python3 | |
| # https://www.shielder.it/blog/2021/07/qilinglab-release/ | |
| from qiling import Qiling | |
| from qiling.const import QL_VERBOSE | |
| from qiling.os.mapper import QlFsMappedObject | |
| import struct | |
| def u8(inp): | |
| return struct.unpack("<Q", inp) |