Merge pull request #1213 from tidalcycles/spectrum

add basic spectrum function
This commit is contained in:
Felix Roos 2024-12-23 11:53:11 +01:00 committed by GitHub
commit 26cc7e2920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 156 additions and 2 deletions

View file

@ -133,3 +133,10 @@ registerWidget('_pitchwheel', (id, options = {}, pat) => {
const ctx = getCanvasWidget(id, options).getContext('2d');
return pat.pitchwheel({ ...options, ctx, id });
});
registerWidget('_spectrum', (id, options = {}, pat) => {
let _size = options.size || 200;
options = { width: _size, height: _size, ...options, size: _size / 5 };
const ctx = getCanvasWidget(id, options).getContext('2d');
return pat.spectrum({ ...options, ctx, id });
});