Skip to content

Commit cab7c30

Browse files
fix katex and fractions
1 parent 51e74a7 commit cab7c30

File tree

4 files changed

+127
-185
lines changed

4 files changed

+127
-185
lines changed

packages/audiodocs/docs/guides/noise-generation.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import WhiteNoiseSrc from '!!raw-loader!@site/src/examples/NoiseGeneration/White
4343

4444
Pink noise, also known as 1/f noise (where "f" stands for frequency), is a type of signal or sound that has equal energy per octave. This means that the power spectral density (PSD) decreases inversely with frequency. In simpler terms, pink noise has more energy at lower frequencies and less energy at higher frequencies, which makes it sound softer and more balanced to the human ear than white noise.
4545

46-
To generate pink noise, we will use the effects of a $\dfrac{-3dB}{3}$ filter using the [Paul Kellet's refined method](https://www.musicdsp.org/en/latest/Filters/76-pink-noise-filter.html)
46+
To generate pink noise, we will use the effects of a $\dfrac{-3dB}{octave}$ filter using the [Paul Kellet's refined method](https://www.musicdsp.org/en/latest/Filters/76-pink-noise-filter.html)
4747

4848
```tsx
4949
const createPinkNoise = () => {
@@ -87,6 +87,8 @@ import PinkNoiseSrc from '!!raw-loader!@site/src/examples/NoiseGeneration/PinkNo
8787

8888
The last noise type I would like to describe is brownian noise (also known as Brown or red noise). Brownian noise is named after the Brownian motion phenomenon, where particles inside a fluid move randomly due to collisions with other particles. It relates to its sonic counterpart in that Brownian noise is characterized by a significant presence of low frequencies, with energy decreasing as the frequency increases. Brownian noise is believed to sound like waterfall.
8989

90+
Brownian noise, similarly to pink one, decreases in power by $\dfrac{12dB}{octave}$ and sounds similar to waterfall. The implementation is taken from article by Zach Denton, [How to Generate Noise with the Web Audio API](https://noisehack.com/generate-noise-web-audio-api/):
91+
9092

9193
```tsx
9294
const createBrownianNoise = () => {

packages/audiodocs/docusaurus.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
const lightCodeTheme = require('./src/theme/CodeBlock/highlighting-light.js');
55
const darkCodeTheme = require('./src/theme/CodeBlock/highlighting-dark.js');
6-
const math = require('remark-math');
7-
const katex = require('rehype-katex');
6+
import remarkMath from 'remark-math';
7+
import rehypeKatex from 'rehype-katex';
88
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
99

1010
const webpack = require('webpack');
@@ -44,8 +44,8 @@ const config = {
4444
breadcrumbs: false,
4545
sidebarCollapsible: false,
4646
sidebarPath: require.resolve('./sidebars.js'),
47-
remarkPlugins: [math],
48-
rehypePlugins: [katex],
47+
remarkPlugins: [remarkMath],
48+
rehypePlugins: [rehypeKatex],
4949
editUrl:
5050
'https://github.com/software-mansion/react-native-audio-api/edit/main/packages/audiodocs/docs',
5151
},
@@ -63,10 +63,10 @@ const config = {
6363

6464
stylesheets: [
6565
{
66-
href: 'https://cdn.jsdelivr.net/npm/katex@0.16.22/dist/katex.css',
66+
href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',
6767
type: 'text/css',
6868
integrity:
69-
'sha384-o3WH+1yEhq+grOgz1BVYTZPyTlMXrDxnjN1By9/ba94JqJhva6wFm2Hb+URQX53v',
69+
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
7070
crossorigin: 'anonymous',
7171
},
7272
],

packages/audiodocs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"@emotion/styled": "^11.14.0",
3030
"@mdx-js/react": "^3.0.0",
3131
"@mui/material": "^7.1.0",
32-
"@swmansion/t-rex-ui": "1.0.0",
3332
"@shopify/react-native-skia": "1.10.2",
33+
"@swmansion/t-rex-ui": "1.0.0",
3434
"@vercel/og": "^0.6.2",
3535
"babel-polyfill": "^6.26.0",
3636
"babel-preset-expo": "^9.2.2",
@@ -48,8 +48,8 @@
4848
"react-native-gesture-handler": "^2.16.0",
4949
"react-native-reanimated": "^3.8.1",
5050
"react-native-web": "^0.18.12",
51-
"rehype-katex": "5",
52-
"remark-math": "3",
51+
"rehype-katex": "7",
52+
"remark-math": "6",
5353
"source-map": "^0.7.4",
5454
"source-map-loader": "^4.0.1",
5555
"usehooks-ts": "^2.9.1"

0 commit comments

Comments
 (0)