Any PCM5102A board connected up to pins:
VIN = 3.3V (NOT 5V)
GND = GND
LCK = GPIO19/35 (PCM FS)
DIN = GPIO21/40 (PCM DOUT)
BCK = GPIO18/12 (PCM CLK)
const moveInArray = (arr, from, to) => { | |
if (to >= arr.length) { | |
var k = to - arr.length + 1 | |
while (k--) { | |
arr.push(undefined) | |
} | |
} | |
arr.splice(to, 0, arr.splice(from, 1)[0]) | |
return arr | |
} |
const timestamp = e => Math.floor(Date.now() / 1000) | |
const date = timestamp => new Date( timestamp * 1000 ) |
import { writable, get } from 'svelte/store' | |
const ERROR = 'error' | |
const SUCCESS = 'success' | |
const TRY = 'try' | |
function init() { | |
const { subscribe, set, update, get } = writable({ | |
log: [], |
StackExchange is ridiculous and won't let me reply to threads without becoming a regular member first.
Resources
These links cover everything you need to know:
#!/bin/bash | |
# Using pip install ffmpeg-normalize | |
for f in ${1}*.wav | |
do | |
echo $f | |
ffmpeg-normalize ${f} -of ${1}normalized/ -ext wav | |
done |
# brew install folderify | |
# brew install imagemagick | |
export function CalculatePixels( str, el ) { | |
try { | |
const value = parseFloat( str ) | |
const unit = str.replace(value, '').toLowerCase() | |
const { innerWidth, innerHeight } = window | |
const run = { | |
['%']: () => (el.offsetWidth * (value/100)), | |
px: () => value, | |
vw: () => (innerWidth * (value/100)), |
# Svelte 5 Explorations | |
I have been using Svelte 5 to refactor a creative coding toolkit previously written in Svelte 4. | |
The major change in coding style is to take full advantage of reactivity in JS classes (ie. .svelte.js files), and move logic out of components into JS clasees, with the component file only handling HTML/CSS rendering of a reactive Svelte object. | |
To do this, I uses a dual .svelte.js file to each .svelte file, and various base classes to handle singleton patterns with Map. | |
In doing so, the main unknown has been what pattern to use when syncronising a component's props with the attendant JS object. |