question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@thi.ng/colored-noise] white() returns rnd.norm is not a function

See original GitHub issue

It’s pseudo code

import { blue, green, pink, red, violet, white } from '@thi.ng/colored-noise';
import { take } from '@thi.ng/transducers';

/**
 * Noise source
 *
 * @param duration - 
 */
function getNoise(duration: number): number[] {
  return [
    ...take<number>(
      duration,
      white()
    ),
   ];
}

An error similar to the following is output.

white.js:11 Uncaught TypeError: rnd.norm is not a function

It did not reproduce with other noises (such as blue, green, pink, red, violet).

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
postspectacularcommented, Nov 23, 2022

Hi @logue - just wanted to let you know that this update is released now as v1.0.0

https://github.com/thi-ng/umbrella/blob/develop/packages/colored-noise/CHANGELOG.md#100-2022-11-23

1reaction
postspectacularcommented, Nov 6, 2022

Understood & if uniform args are required, then I’d propose to replace the current function args with a config object/interface, e.g.:

export interface ColoredNoiseOpts {
    numBins: number;
    scale: number;
    rnd: IRandom;
}

Then we can update the generators like so and you can get rid of your conditional:

export function* red(opts: Partial<ColoredNoiseOpts>) {
    const { numBins, scale, rnd } = {
        numBins: 2,
        scale: 1,
        rnd: SYSTEM,
        ...opts
    };
    // ....
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Colors of noise
1.1 White noise · 1.2 Pink noise · 1.3 Brownian noise · 1.4 Blue noise · 1.5 Violet noise · 1.6 Grey noise....
Read more >
About Colored Noise
In audio, the most common color encountered is 'pink noise': Realized as sound, white noise sounds like the hiss of an untuned FM...
Read more >
LearnOpenGL - Basic Lighting
The object is quite dark, but not completely since ambient lighting is applied (note that the light cube is unaffected because we use...
Read more >
Noise
White Noise; Stable Distributions; Dispersion does not imply variance (!); T Student; Colored Noise. Pink Noise; Brown Noise; Black Noise.
Read more >
Generate colored noise signal - MATLAB
Create the dsp.ColoredNoise object and set its properties. Call the object with arguments, as if it were a function. To learn ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found