Tag new functions
This commit is contained in:
parent
29fd541f1f
commit
b7827cb89f
3 changed files with 20 additions and 35 deletions
|
|
@ -2049,6 +2049,7 @@ export const { distort, dist } = registerControl(['distort', 'distortvol', 'dist
|
||||||
*
|
*
|
||||||
* @name distortvol
|
* @name distortvol
|
||||||
* @synonyms distvol
|
* @synonyms distvol
|
||||||
|
* @tags fx, superdough, supradough
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
* @example
|
* @example
|
||||||
* s("bd*4").bank("tr909").distort(2).distortvol(0.8)
|
* s("bd*4").bank("tr909").distort(2).distortvol(0.8)
|
||||||
|
|
@ -2059,6 +2060,7 @@ export const { distortvol } = registerControl('distortvol', 'distvol');
|
||||||
* Type of waveshaping distortion to apply.
|
* Type of waveshaping distortion to apply.
|
||||||
*
|
*
|
||||||
* @name distorttype
|
* @name distorttype
|
||||||
|
* @tags fx, superdough, supradough
|
||||||
* @synonyms disttype
|
* @synonyms disttype
|
||||||
* @param {number | string | Pattern} type type of distortion to apply
|
* @param {number | string | Pattern} type type of distortion to apply
|
||||||
* @example
|
* @example
|
||||||
|
|
@ -2487,6 +2489,7 @@ export const { polyTouch } = registerControl('polyTouch');
|
||||||
/**
|
/**
|
||||||
* The host to send open sound control messages to. Requires running the OSC bridge.
|
* The host to send open sound control messages to. Requires running the OSC bridge.
|
||||||
* @name oschost
|
* @name oschost
|
||||||
|
* @tags external_io
|
||||||
* @param {string | Pattern} oschost e.g. 'localhost'
|
* @param {string | Pattern} oschost e.g. 'localhost'
|
||||||
* @example
|
* @example
|
||||||
* note("c4").oschost('127.0.0.1').oscport(57120).osc();
|
* note("c4").oschost('127.0.0.1').oscport(57120).osc();
|
||||||
|
|
@ -2496,6 +2499,7 @@ export const { oschost } = registerControl('oschost');
|
||||||
/**
|
/**
|
||||||
* The port to send open sound control messages to. Requires running the OSC bridge.
|
* The port to send open sound control messages to. Requires running the OSC bridge.
|
||||||
* @name oscport
|
* @name oscport
|
||||||
|
* @tags external_io
|
||||||
* @param {number | Pattern} oscport e.g. 57120
|
* @param {number | Pattern} oscport e.g. 57120
|
||||||
* @example
|
* @example
|
||||||
* note("c4").oschost('127.0.0.1').oscport(57120).osc();
|
* note("c4").oschost('127.0.0.1').oscport(57120).osc();
|
||||||
|
|
|
||||||
|
|
@ -3128,6 +3128,7 @@ export const extend = stepRegister('extend', function (factor, pat) {
|
||||||
* `stepcat("a b".fast(2), "c d")` would be the same as `"[a b] [a b] c d"`.
|
* `stepcat("a b".fast(2), "c d")` would be the same as `"[a b] [a b] c d"`.
|
||||||
*
|
*
|
||||||
* TODO: find out how this function differs from extend
|
* TODO: find out how this function differs from extend
|
||||||
|
* @tags temporal
|
||||||
* @example
|
* @example
|
||||||
* stepcat(
|
* stepcat(
|
||||||
* sound("bd bd - cp").replicate(2),
|
* sound("bd bd - cp").replicate(2),
|
||||||
|
|
@ -3697,6 +3698,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Soft-clipping distortion
|
* Soft-clipping distortion
|
||||||
*
|
*
|
||||||
* @name soft
|
* @name soft
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3705,6 +3707,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Hard-clipping distortion
|
* Hard-clipping distortion
|
||||||
*
|
*
|
||||||
* @name hard
|
* @name hard
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3713,6 +3716,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Cubic polynomial distortion
|
* Cubic polynomial distortion
|
||||||
*
|
*
|
||||||
* @name cubic
|
* @name cubic
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3721,6 +3725,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Diode-emulating distortion
|
* Diode-emulating distortion
|
||||||
*
|
*
|
||||||
* @name diode
|
* @name diode
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3729,6 +3734,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Asymmetrical diode distortion
|
* Asymmetrical diode distortion
|
||||||
*
|
*
|
||||||
* @name asym
|
* @name asym
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3737,6 +3743,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Wavefolding distortion
|
* Wavefolding distortion
|
||||||
*
|
*
|
||||||
* @name fold
|
* @name fold
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3745,6 +3752,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Wavefolding distortion composed with sinusoid
|
* Wavefolding distortion composed with sinusoid
|
||||||
*
|
*
|
||||||
* @name sinefold
|
* @name sinefold
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
@ -3753,6 +3761,7 @@ export const morph = (frompat, topat, bypat) => {
|
||||||
* Distortion via Chebyshev polynomials
|
* Distortion via Chebyshev polynomials
|
||||||
*
|
*
|
||||||
* @name chebyshev
|
* @name chebyshev
|
||||||
|
* @tags fx
|
||||||
* @param {number | Pattern} distortion amount of distortion to apply
|
* @param {number | Pattern} distortion amount of distortion to apply
|
||||||
* @param {number | Pattern} volume linear postgain of the distortion
|
* @param {number | Pattern} volume linear postgain of the distortion
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,13 @@ const availableFunctions = (() => {
|
||||||
for (const doc of jsdocJson.docs) {
|
for (const doc of jsdocJson.docs) {
|
||||||
if (!isValid(doc)) continue;
|
if (!isValid(doc)) continue;
|
||||||
if (seen.has(doc.name)) continue;
|
if (seen.has(doc.name)) continue;
|
||||||
doc.tags = doc.tags?.filter((t) => t && typeof t === 'string') || [];
|
|
||||||
|
// jsdoc also uses "tags" for when you use @something in the comments and it doesn't know what
|
||||||
|
// @something is. We only want data from comments like `@tags fx, superdough` here.
|
||||||
|
// If nothing is specified, we default to "untagged" for debugging
|
||||||
|
doc.tags = doc.tags?.filter((t) => t && typeof t === 'string') || ['untagged'];
|
||||||
functions.push(doc);
|
functions.push(doc);
|
||||||
|
|
||||||
const synonyms = doc.synonyms || [];
|
const synonyms = doc.synonyms || [];
|
||||||
seen.add(doc.name);
|
seen.add(doc.name);
|
||||||
for (const s of synonyms) {
|
for (const s of synonyms) {
|
||||||
|
|
@ -38,16 +43,6 @@ const getInnerText = (html) => {
|
||||||
return div.textContent || div.innerText || '';
|
return div.textContent || div.innerText || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const GROUP_DISPLAY_NAMES = {
|
|
||||||
external_io: 'External I/O',
|
|
||||||
effects: 'Effects',
|
|
||||||
untagged: 'Untagged',
|
|
||||||
structure: 'Structure',
|
|
||||||
transforms: 'Transforms',
|
|
||||||
};
|
|
||||||
|
|
||||||
const GROUP_ORDER = ['effects', 'transforms', 'structure', 'untagged', 'external_io'];
|
|
||||||
|
|
||||||
export function Reference() {
|
export function Reference() {
|
||||||
const [search, setSearch] = useState('');
|
const [search, setSearch] = useState('');
|
||||||
const [selectedTag, setSelectedTag] = useState(null);
|
const [selectedTag, setSelectedTag] = useState(null);
|
||||||
|
|
@ -80,29 +75,6 @@ export function Reference() {
|
||||||
});
|
});
|
||||||
}, [search, selectedTag]);
|
}, [search, selectedTag]);
|
||||||
|
|
||||||
const visibleFunctionsByGroup = (() => {
|
|
||||||
const groups = {};
|
|
||||||
for (const doc of visibleFunctions) {
|
|
||||||
const group = (doc.tags || ['untagged'])[0];
|
|
||||||
if (!groups[group]) {
|
|
||||||
groups[group] = [];
|
|
||||||
}
|
|
||||||
groups[group].push(doc);
|
|
||||||
}
|
|
||||||
return groups;
|
|
||||||
})();
|
|
||||||
// console.log(visibleFunctionsByGroup);
|
|
||||||
|
|
||||||
// Sort and map group entries
|
|
||||||
const sortedGroups = Object.entries(visibleFunctionsByGroup).sort(([a], [b]) => {
|
|
||||||
const ai = GROUP_ORDER.indexOf(a);
|
|
||||||
const bi = GROUP_ORDER.indexOf(b);
|
|
||||||
if (ai === -1 && bi === -1) return a.localeCompare(b);
|
|
||||||
if (ai === -1) return 1;
|
|
||||||
if (bi === -1) return -1;
|
|
||||||
return ai - bi;
|
|
||||||
});
|
|
||||||
|
|
||||||
const tagCounts = {};
|
const tagCounts = {};
|
||||||
for (const doc of availableFunctions) {
|
for (const doc of availableFunctions) {
|
||||||
(doc.tags || ['untagged']).forEach((t) => {
|
(doc.tags || ['untagged']).forEach((t) => {
|
||||||
|
|
@ -114,7 +86,7 @@ export function Reference() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col h-full w-full p-2">
|
<div className="flex flex-col h-full w-full p-2">
|
||||||
<div className="w-full flex flex-col gap-2 h-1/3 mb-2">
|
<div className="w-full flex flex-col gap-2 h-2/5 mb-2">
|
||||||
<div className="w-full flex flex-col gap-2">
|
<div className="w-full flex flex-col gap-2">
|
||||||
<Textbox className="w-full" placeholder="Search" value={search} onChange={setSearch} />
|
<Textbox className="w-full" placeholder="Search" value={search} onChange={setSearch} />
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue