├── .babelrc
├── .editorconfig
├── .env.example
├── .eslintignore
├── .eslintrc
├── .gitignore
├── _redirects
├── package-lock.json
├── package.json
├── postcss.config.js
├── src
├── .DS_Store
├── browserconfig.xml
├── favicon
│ ├── android-icon-144x144.png
│ ├── android-icon-192x192.png
│ ├── android-icon-36x36.png
│ ├── android-icon-48x48.png
│ ├── android-icon-72x72.png
│ ├── android-icon-96x96.png
│ ├── apple-icon-114x114.png
│ ├── apple-icon-120x120.png
│ ├── apple-icon-144x144.png
│ ├── apple-icon-152x152.png
│ ├── apple-icon-180x180.png
│ ├── apple-icon-57x57.png
│ ├── apple-icon-60x60.png
│ ├── apple-icon-72x72.png
│ ├── apple-icon-76x76.png
│ ├── apple-icon-precomposed.png
│ ├── apple-icon.png
│ ├── browserconfig.xml
│ ├── favicon-16x16.png
│ ├── favicon-32x32.png
│ ├── favicon-96x96.png
│ ├── favicon.ico
│ ├── favicon.png
│ ├── manifest.json
│ ├── ms-icon-144x144.png
│ ├── ms-icon-150x150.png
│ ├── ms-icon-310x310.png
│ ├── ms-icon-70x70.png
│ └── og.png
├── fonts
│ └── montserrat
│ │ ├── montserrat-v10-latin-700.woff
│ │ ├── montserrat-v10-latin-700.woff2
│ │ ├── montserrat-v10-latin-italic.woff
│ │ ├── montserrat-v10-latin-italic.woff2
│ │ ├── montserrat-v10-latin-regular.woff
│ │ └── montserrat-v10-latin-regular.woff2
├── images
│ ├── .DS_Store
│ ├── Schematics.sketch
│ ├── audio-node.svg
│ ├── audio-prop.svg
│ ├── compose.jpg
│ ├── conf.jpg
│ ├── create.jpg
│ ├── delay.svg
│ ├── devtools.png
│ ├── distortion.svg
│ ├── effects.jpg
│ ├── envelope-schema-custom.png
│ ├── envelope-schema-custom.svg
│ ├── envelope-schema-exponential.png
│ ├── envelope-schema-exponential.svg
│ ├── envelope-schema.png
│ ├── envelope-schema.svg
│ ├── envelope.png
│ ├── envelope.svg
│ ├── flanger.svg
│ ├── graphics.sketch
│ ├── guitar.jpg
│ ├── mic.png
│ ├── mic.svg
│ ├── midi-contoller.jpg
│ ├── osc-gain-prop.svg
│ ├── osc-gain.svg
│ ├── pedalboard.jpg
│ ├── play.jpg
│ ├── remote.png
│ ├── reverb.svg
│ ├── sam.jpg
│ ├── sam2.jpg
│ ├── sawtooth.png
│ ├── sawtooth.svg
│ ├── sine.png
│ ├── sine.svg
│ ├── square.png
│ ├── square.svg
│ ├── triangle.png
│ ├── triangle.svg
│ ├── twitter.png
│ ├── twitter.svg
│ └── volume.svg
├── index.html
├── js
│ ├── components
│ │ ├── Code
│ │ │ ├── Code.js
│ │ │ ├── code.scss
│ │ │ ├── index.js
│ │ │ └── prism.css
│ │ ├── Columns
│ │ │ ├── Columns.js
│ │ │ ├── columns.scss
│ │ │ └── index.js
│ │ ├── Deck
│ │ │ ├── Deck.js
│ │ │ └── index.js
│ │ ├── Icon
│ │ │ ├── Icon.js
│ │ │ └── index.js
│ │ ├── Image
│ │ │ ├── Image.js
│ │ │ ├── image.scss
│ │ │ └── index.js
│ │ ├── List
│ │ │ ├── List.js
│ │ │ ├── index.js
│ │ │ └── list.scss
│ │ ├── Slide
│ │ │ ├── Slide.js
│ │ │ ├── index.js
│ │ │ └── slide.scss
│ │ ├── Sound
│ │ │ ├── Sound.js
│ │ │ ├── index.js
│ │ │ └── sound.scss
│ │ ├── Subtitle
│ │ │ ├── Subtitle.js
│ │ │ ├── index.js
│ │ │ └── subtitle.scss
│ │ ├── Text
│ │ │ ├── Text.js
│ │ │ ├── index.js
│ │ │ └── text.scss
│ │ ├── Title
│ │ │ ├── Title.js
│ │ │ ├── index.js
│ │ │ └── title.scss
│ │ ├── Twitter
│ │ │ ├── Twitter.js
│ │ │ ├── index.js
│ │ │ └── twitter.scss
│ │ ├── Volume
│ │ │ ├── Volume.js
│ │ │ ├── index.js
│ │ │ └── volume.scss
│ │ └── Wave
│ │ │ ├── Wave.js
│ │ │ ├── index.js
│ │ │ └── wave.scss
│ ├── index.js
│ ├── services
│ │ ├── Composer.js
│ │ └── Keyboard.js
│ └── slides
│ │ ├── About
│ │ ├── About.js
│ │ └── index.js
│ │ ├── Compose
│ │ ├── Code
│ │ │ ├── Code.js
│ │ │ └── index.js
│ │ ├── Intro
│ │ │ ├── Intro.js
│ │ │ └── index.js
│ │ ├── Musicfns
│ │ │ ├── Fns.js
│ │ │ ├── Fns2.js
│ │ │ └── index.js
│ │ ├── Random
│ │ │ ├── Random.js
│ │ │ └── index.js
│ │ ├── Scale
│ │ │ ├── Scale.js
│ │ │ └── index.js
│ │ └── Simple
│ │ │ ├── Simple.js
│ │ │ └── index.js
│ │ ├── Create
│ │ ├── Envelopes
│ │ │ ├── Envelopes.js
│ │ │ └── index.js
│ │ ├── EnvelopesCode
│ │ │ ├── EnvelopesCode.js
│ │ │ └── index.js
│ │ ├── EnvelopesCodeExponential
│ │ │ ├── EnvelopesCodeExponential.js
│ │ │ └── index.js
│ │ ├── EnvelopesCodeFrequency
│ │ │ ├── EnvelopesCodeFrequency.js
│ │ │ └── index.js
│ │ ├── EnvelopesCodeRelease
│ │ │ ├── EnvelopesCodeRelease.js
│ │ │ └── index.js
│ │ ├── EnvelopesExponential
│ │ │ ├── EnvelopesExponential.js
│ │ │ └── index.js
│ │ ├── EnvelopesFrequency
│ │ │ ├── EnvelopesFrequency.js
│ │ │ └── index.js
│ │ ├── EnvelopesSchema
│ │ │ ├── EnvelopesSchema.js
│ │ │ └── index.js
│ │ ├── EnvelopesSchemaExponential
│ │ │ ├── EnvelopesSchemaExponential.js
│ │ │ └── index.js
│ │ ├── Frequency
│ │ │ ├── Frequency.js
│ │ │ └── index.js
│ │ ├── Intro
│ │ │ ├── Intro.js
│ │ │ └── index.js
│ │ ├── Nodes
│ │ │ ├── Nodes.js
│ │ │ └── index.js
│ │ ├── NodesDetail
│ │ │ ├── Nodes.js
│ │ │ └── index.js
│ │ ├── NodesIntro
│ │ │ ├── NodesIntro.js
│ │ │ └── index.js
│ │ ├── NodesProps
│ │ │ ├── Nodes.js
│ │ │ └── index.js
│ │ ├── NodesPropsDetail
│ │ │ ├── Nodes.js
│ │ │ └── index.js
│ │ ├── Oscillator
│ │ │ ├── Oscillator.js
│ │ │ └── index.js
│ │ ├── OscillatorCode
│ │ │ ├── OscillatorCode.js
│ │ │ └── index.js
│ │ ├── OscillatorTypes
│ │ │ ├── OscillatorTypes.js
│ │ │ └── index.js
│ │ ├── OscillatorTypesCode
│ │ │ ├── OscillatorTypesCode.js
│ │ │ └── index.js
│ │ ├── Sawtooth
│ │ │ ├── Sawtooth.js
│ │ │ └── index.js
│ │ ├── Sine
│ │ │ ├── Sine.js
│ │ │ └── index.js
│ │ ├── Square
│ │ │ ├── Square.js
│ │ │ └── index.js
│ │ ├── Synth
│ │ │ ├── Atom.js
│ │ │ ├── Synth.js
│ │ │ └── index.js
│ │ └── Triangle
│ │ │ ├── Triangle.js
│ │ │ └── index.js
│ │ ├── Devtools
│ │ ├── DevTools.js
│ │ └── index.js
│ │ ├── DevtoolsImage
│ │ ├── DevtoolsImage.js
│ │ └── index.js
│ │ ├── Effects
│ │ ├── AudioEffects
│ │ │ ├── AudioEffects.js
│ │ │ └── index.js
│ │ ├── AudioEffectsCode
│ │ │ ├── AudioEffectsCode.js
│ │ │ └── index.js
│ │ ├── DelayCode
│ │ │ ├── DelayCode.js
│ │ │ └── index.js
│ │ ├── DelayPreview
│ │ │ ├── DelayPreview.js
│ │ │ └── index.js
│ │ ├── DelaySchema
│ │ │ ├── DelaySchema.js
│ │ │ └── index.js
│ │ ├── Distortion
│ │ │ ├── Distortion.js
│ │ │ └── index.js
│ │ ├── DistortionCode
│ │ │ ├── DistortionCode.js
│ │ │ └── index.js
│ │ ├── DistortionPreview
│ │ │ ├── DistortionPreview.js
│ │ │ └── index.js
│ │ ├── DistortionSchema
│ │ │ ├── DistortionSchema.js
│ │ │ └── index.js
│ │ ├── FlangerCode
│ │ │ ├── FlangerCode.js
│ │ │ └── index.js
│ │ ├── FlangerPreview
│ │ │ ├── FlangerPreview.js
│ │ │ └── index.js
│ │ ├── FlangerSchema
│ │ │ ├── FlangerSchema.js
│ │ │ └── index.js
│ │ ├── Intro
│ │ │ ├── Intro.js
│ │ │ └── index.js
│ │ ├── Other
│ │ │ ├── Other.js
│ │ │ └── index.js
│ │ ├── Pedalboard
│ │ │ ├── Pedalboard.js
│ │ │ └── index.js
│ │ ├── ReverbCode
│ │ │ ├── ReverbCode.js
│ │ │ └── index.js
│ │ ├── ReverbPreview
│ │ │ ├── ReverbPreview.js
│ │ │ └── index.js
│ │ ├── ReverbSchema
│ │ │ ├── ReverbSchema.js
│ │ │ └── index.js
│ │ ├── Volume
│ │ │ ├── Volume.js
│ │ │ └── index.js
│ │ ├── VolumeCode
│ │ │ ├── VolumeCode.js
│ │ │ └── index.js
│ │ └── VolumeSchema
│ │ │ ├── VolumeSchema.js
│ │ │ └── index.js
│ │ ├── Fun
│ │ ├── Demo
│ │ │ ├── Demo.js
│ │ │ └── index.js
│ │ ├── Fun
│ │ │ ├── Fun.js
│ │ │ └── index.js
│ │ ├── Intro
│ │ │ ├── Intro.js
│ │ │ └── index.js
│ │ └── Remote
│ │ │ ├── Remote.js
│ │ │ └── index.js
│ │ ├── Links
│ │ ├── Links.js
│ │ └── index.js
│ │ ├── Midi
│ │ ├── MidiCode
│ │ │ ├── MidiCode.js
│ │ │ └── index.js
│ │ ├── MidiCodeSend
│ │ │ ├── MidiCodeSend.js
│ │ │ └── index.js
│ │ ├── MidiController
│ │ │ ├── MidiController.js
│ │ │ └── index.js
│ │ ├── MidiIntro
│ │ │ ├── MidiIntro.js
│ │ │ └── index.js
│ │ └── MidiTest
│ │ │ ├── MidiTest.js
│ │ │ └── index.js
│ │ ├── Play
│ │ ├── Buffer
│ │ │ ├── Buffer.js
│ │ │ └── index.js
│ │ ├── Fetch
│ │ │ ├── Fetch.js
│ │ │ └── index.js
│ │ ├── Input
│ │ │ ├── Input.js
│ │ │ └── index.js
│ │ ├── Intro
│ │ │ ├── Intro.js
│ │ │ └── index.js
│ │ └── Tag
│ │ │ ├── Tag.js
│ │ │ └── index.js
│ │ ├── Summary
│ │ ├── Summary.js
│ │ └── index.js
│ │ ├── Thanks
│ │ ├── Thanks.js
│ │ └── index.js
│ │ └── Title
│ │ ├── ConfIntro.js
│ │ ├── Title.js
│ │ └── index.js
├── manifest.json
├── scss
│ ├── _colors.scss
│ ├── _font.scss
│ ├── _normalize.scss
│ └── styles.scss
└── sound
│ └── hall-reverb.ogg
├── webpack.config.babel.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["latest", "stage-0"],
3 | "plugins": [["transform-react-jsx", { "pragma": "h" }]]
4 | }
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig is awesome: http://EditorConfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Unix-style newlines with a newline ending every file
7 | [*]
8 | end_of_line = lf
9 | insert_final_newline = true
10 |
11 | # Matches multiple files with brace expansion notation
12 | # Set default charset
13 | [*.{js,scss,html}]
14 | charset = utf-8
15 | indent_style = space
16 | indent_size = 4
17 |
18 | # Matches the exact files either package.json or .travis.yml
19 | [{package.json,.babelrc, manifest.json}]
20 | indent_style = space
21 | indent_size = 2
22 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/.env.example
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | # Ignore vendor files
2 | src/js/Vendor/*
3 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "env": {
4 | "browser": true,
5 | "es6": true,
6 | "node": true,
7 | },
8 | "globals": {
9 | __BROWSER__: true,
10 | },
11 | "rules": {
12 | 'arrow-body-style': 0,
13 | 'arrow-parens': [2, 'as-needed'],
14 | 'arrow-spacing': 2,
15 | 'constructor-super': 2,
16 | 'generator-star-spacing': 2,
17 | 'no-class-assign': 2,
18 | 'no-confusing-arrow': 2,
19 | 'no-const-assign': 2,
20 | 'no-dupe-class-members': 2,
21 | 'no-duplicate-imports': 2,
22 | 'no-new-symbol': 2,
23 | 'no-restricted-imports': 2,
24 | 'no-this-before-super': 2,
25 | 'no-useless-computed-key': 2,
26 | 'no-useless-constructor': 2,
27 | 'no-useless-rename': 2,
28 | 'no-var': 2,
29 | 'object-shorthand': 2,
30 | 'prefer-arrow-callback': 2,
31 | 'prefer-const': 2,
32 | 'prefer-numeric-literals': 2,
33 | 'prefer-rest-params': 2,
34 | 'prefer-spread': 2,
35 | 'prefer-template': 2,
36 | 'require-yield': 2,
37 | 'rest-spread-spacing': 2,
38 | 'sort-imports': 0,
39 | 'symbol-description': 2,
40 | 'template-curly-spacing': 2,
41 | 'yield-star-spacing': 2,
42 | 'block-spacing': 2,
43 | 'brace-style': 2,
44 | 'camelcase': [2, {properties: 'never'}],
45 | 'comma-dangle': [2, 'always-multiline'],
46 | 'comma-spacing': 2,
47 | 'comma-style': 2,
48 | 'computed-property-spacing': 2,
49 | 'consistent-this': 2,
50 | 'eol-last': 2,
51 | 'func-call-spacing': 2,
52 | 'func-names': 2,
53 | 'func-style': 0,
54 | 'id-blacklist': 2,
55 | 'id-length': 0,
56 | 'id-match': 2,
57 | 'indent': [2, 4, {SwitchCase: 1}],
58 | 'jsx-quotes': 2,
59 | 'key-spacing': 2,
60 | 'keyword-spacing': 2,
61 | 'line-comment-position': 2,
62 | 'linebreak-style': 2,
63 | 'lines-around-comment': 0,
64 | 'lines-around-directive': 2,
65 | 'max-depth': 2,
66 | 'max-len': 0,
67 | 'max-lines': 0,
68 | 'max-nested-callbacks': 2,
69 | 'max-params': 0,
70 | 'max-statements': 0,
71 | 'max-statements-per-line': 2,
72 | 'multiline-ternary': 0,
73 | 'new-parens': 2,
74 | 'newline-after-var': 0,
75 | 'newline-before-return': 2,
76 | 'newline-per-chained-call': 0,
77 | 'no-array-constructor': 2,
78 | 'no-bitwise': 2,
79 | 'no-continue': 2,
80 | 'no-inline-comments': 2,
81 | 'no-lonely-if': 2,
82 | 'no-mixed-operators': 2,
83 | 'no-mixed-spaces-and-tabs': 2,
84 | 'no-multiple-empty-lines': 2,
85 | 'no-negated-condition': 2,
86 | 'no-nested-ternary': 2,
87 | 'no-new-object': 2,
88 | 'no-plusplus': 0,
89 | 'no-restricted-syntax': 2,
90 | 'no-tabs': 2,
91 | 'no-ternary': 0,
92 | 'no-trailing-spaces': 2,
93 | 'no-underscore-dangle': 2,
94 | 'no-unneeded-ternary': 2,
95 | 'no-whitespace-before-property': 2,
96 | 'object-curly-newline': 0,
97 | 'object-property-newline': 0,
98 | 'one-var': 0,
99 | 'one-var-declaration-per-line': 2,
100 | 'operator-assignment': 2,
101 | 'operator-linebreak': 2,
102 | 'padded-blocks': [2, 'never'],
103 | 'quote-props': [2, 'consistent-as-needed'],
104 | 'quotes': [2, 'single'],
105 | 'require-jsdoc': 0,
106 | 'semi': 2,
107 | 'semi-spacing': 2,
108 | 'sort-keys': 0,
109 | 'sort-vars': 2,
110 | 'space-before-blocks': 2,
111 | 'space-before-function-paren': [2, {anonymous: 'always', named: 'never'}],
112 | 'space-in-parens': 2,
113 | 'space-infix-ops': 2,
114 | 'space-unary-ops': 2,
115 | 'spaced-comment': 0,
116 | 'unicode-bom': 2,
117 | 'wrap-regex': 2,
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | dist/
3 | .env
4 | csr.pem
5 | key.pem
6 | server.crt
7 | yarn-error.log
8 |
--------------------------------------------------------------------------------
/_redirects:
--------------------------------------------------------------------------------
1 |
2 | # Redirect sambego.be to sambeg.tech
3 | https://audio.sambego.be/* https://audio.sambego.tech/:splat 301!
4 |
5 | # Suport the history API
6 | /* /index.html 200
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "build:prod": "NODE_ENV=production rm -rf dist/ && webpack -p --env production",
4 | "build:dev": "webpack-dev-server --content-base dist --inline --hot --progress",
5 | "git:clean": "git fetch -p",
6 | "lint": "eslint src/js",
7 | "test:jest": "jest",
8 | "rebuild:sass": "npm rebuild node-sass"
9 | },
10 | "dependencies": {
11 | "audio-effects": "^1.2.4",
12 | "autoprefixer": "^7.1.4",
13 | "babel-core": "^6.26.0",
14 | "babel-eslint": "^8.0.1",
15 | "babel-loader": "^7.1.2",
16 | "babel-plugin-transform-react-jsx": "^6.24.1",
17 | "babel-preset-env": "^1.6.0",
18 | "babel-preset-latest": "^6.24.1",
19 | "babel-preset-stage-0": "^6.24.1",
20 | "classnames": "^2.2.5",
21 | "copy-webpack-plugin": "^4.0.1",
22 | "css-loader": "^0.28.7",
23 | "eslint": "^4.7.2",
24 | "eslint-loader": "^1.9.0",
25 | "extract-text-webpack-plugin": "^3.0.0",
26 | "file-loader": "^0.11.2",
27 | "frequency-calculator": "^0.0.8",
28 | "html-webpack-include-assets-plugin": "^1.0.0",
29 | "html-webpack-plugin": "^2.30.1",
30 | "keycode": "^2.1.8",
31 | "linkref": "^1.0.1",
32 | "node-sass": "^4.5.3",
33 | "postcss-loader": "^2.0.6",
34 | "preact": "^8.2.5",
35 | "preact-render-to-string": "^3.6.3",
36 | "preact-router": "^2.5.7",
37 | "prismjs": "^1.8.1",
38 | "proptypes": "^1.1.0",
39 | "raw-loader": "^0.5.1",
40 | "sass-loader": "^6.0.6",
41 | "style-loader": "^0.18.2",
42 | "svg-inline-loader": "^0.8.0",
43 | "webpack": "^3.6.0",
44 | "webpack-dev-server": "^2.8.2",
45 | "webpack-dotenv-plugin": "^2.0.2"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [require('autoprefixer')()],
3 | };
4 |
--------------------------------------------------------------------------------
/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/.DS_Store
--------------------------------------------------------------------------------
/src/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | #5FB3B3
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/favicon/android-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-144x144.png
--------------------------------------------------------------------------------
/src/favicon/android-icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-192x192.png
--------------------------------------------------------------------------------
/src/favicon/android-icon-36x36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-36x36.png
--------------------------------------------------------------------------------
/src/favicon/android-icon-48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-48x48.png
--------------------------------------------------------------------------------
/src/favicon/android-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-72x72.png
--------------------------------------------------------------------------------
/src/favicon/android-icon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/android-icon-96x96.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-114x114.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-120x120.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-144x144.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-152x152.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-180x180.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-57x57.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-60x60.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-72x72.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-76x76.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon-precomposed.png
--------------------------------------------------------------------------------
/src/favicon/apple-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/apple-icon.png
--------------------------------------------------------------------------------
/src/favicon/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 | #ffffff
--------------------------------------------------------------------------------
/src/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/src/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/src/favicon/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/favicon-96x96.png
--------------------------------------------------------------------------------
/src/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/favicon.ico
--------------------------------------------------------------------------------
/src/favicon/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/favicon.png
--------------------------------------------------------------------------------
/src/favicon/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "App",
3 | "icons": [
4 | {
5 | "src": "\/android-icon-36x36.png",
6 | "sizes": "36x36",
7 | "type": "image\/png",
8 | "density": "0.75"
9 | },
10 | {
11 | "src": "\/android-icon-48x48.png",
12 | "sizes": "48x48",
13 | "type": "image\/png",
14 | "density": "1.0"
15 | },
16 | {
17 | "src": "\/android-icon-72x72.png",
18 | "sizes": "72x72",
19 | "type": "image\/png",
20 | "density": "1.5"
21 | },
22 | {
23 | "src": "\/android-icon-96x96.png",
24 | "sizes": "96x96",
25 | "type": "image\/png",
26 | "density": "2.0"
27 | },
28 | {
29 | "src": "\/android-icon-144x144.png",
30 | "sizes": "144x144",
31 | "type": "image\/png",
32 | "density": "3.0"
33 | },
34 | {
35 | "src": "\/android-icon-192x192.png",
36 | "sizes": "192x192",
37 | "type": "image\/png",
38 | "density": "4.0"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/src/favicon/ms-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/ms-icon-144x144.png
--------------------------------------------------------------------------------
/src/favicon/ms-icon-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/ms-icon-150x150.png
--------------------------------------------------------------------------------
/src/favicon/ms-icon-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/ms-icon-310x310.png
--------------------------------------------------------------------------------
/src/favicon/ms-icon-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/ms-icon-70x70.png
--------------------------------------------------------------------------------
/src/favicon/og.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/favicon/og.png
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-700.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-700.woff
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-700.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-700.woff2
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-italic.woff
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-italic.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-italic.woff2
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-regular.woff
--------------------------------------------------------------------------------
/src/fonts/montserrat/montserrat-v10-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/fonts/montserrat/montserrat-v10-latin-regular.woff2
--------------------------------------------------------------------------------
/src/images/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/.DS_Store
--------------------------------------------------------------------------------
/src/images/Schematics.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/Schematics.sketch
--------------------------------------------------------------------------------
/src/images/compose.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/compose.jpg
--------------------------------------------------------------------------------
/src/images/conf.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/conf.jpg
--------------------------------------------------------------------------------
/src/images/create.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/create.jpg
--------------------------------------------------------------------------------
/src/images/delay.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/devtools.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/devtools.png
--------------------------------------------------------------------------------
/src/images/distortion.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/effects.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/effects.jpg
--------------------------------------------------------------------------------
/src/images/envelope-schema-custom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/envelope-schema-custom.png
--------------------------------------------------------------------------------
/src/images/envelope-schema-custom.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/envelope-schema-exponential.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/envelope-schema-exponential.png
--------------------------------------------------------------------------------
/src/images/envelope-schema-exponential.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/envelope-schema.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/envelope-schema.png
--------------------------------------------------------------------------------
/src/images/envelope-schema.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/envelope.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/envelope.png
--------------------------------------------------------------------------------
/src/images/envelope.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/graphics.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/graphics.sketch
--------------------------------------------------------------------------------
/src/images/guitar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/guitar.jpg
--------------------------------------------------------------------------------
/src/images/mic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/mic.png
--------------------------------------------------------------------------------
/src/images/mic.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/midi-contoller.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/midi-contoller.jpg
--------------------------------------------------------------------------------
/src/images/pedalboard.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/pedalboard.jpg
--------------------------------------------------------------------------------
/src/images/play.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/play.jpg
--------------------------------------------------------------------------------
/src/images/remote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/remote.png
--------------------------------------------------------------------------------
/src/images/sam.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/sam.jpg
--------------------------------------------------------------------------------
/src/images/sam2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/sam2.jpg
--------------------------------------------------------------------------------
/src/images/sawtooth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/sawtooth.png
--------------------------------------------------------------------------------
/src/images/sawtooth.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/sine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/sine.png
--------------------------------------------------------------------------------
/src/images/sine.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/square.png
--------------------------------------------------------------------------------
/src/images/square.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/triangle.png
--------------------------------------------------------------------------------
/src/images/triangle.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/images/twitter.png
--------------------------------------------------------------------------------
/src/images/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/images/volume.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | A deep dive into the web-audio API.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
70 |
71 |
72 |
73 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/src/js/components/Code/Code.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import Prism from 'prismjs';
4 | import styles from './code.scss';
5 | import './prism.css';
6 |
7 | const Code = ({ code, lang }) => {
8 | return (
9 |
25 | );
26 | };
27 |
28 | Code.propTypes = {
29 | children: propTypes.string.isRequired,
30 | };
31 |
32 | Code.defaultProps = {
33 | lang: 'javascript',
34 | };
35 |
36 | export default Code;
37 |
--------------------------------------------------------------------------------
/src/js/components/Code/code.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Code styles
3 | */
4 |
5 | .code {
6 | padding: 1rem;
7 | min-width: 50vw;
8 |
9 | background: #1b2b34;
10 |
11 | border-radius: 0.5rem;
12 | box-shadow: 1.5rem 1.5rem 5rem 0 rgba(#000, 0.2),
13 | -1.5rem -1.5rem 5rem 0 rgba(#000, 0.2),
14 | -1.5rem 1.5rem 5rem 0 rgba(#000, 0.2),
15 | 1.5rem -1.5rem 5rem 0 rgba(#000, 0.2);
16 |
17 | text-align: left;
18 |
19 | code {
20 | display: block;
21 | }
22 |
23 | pre {
24 | padding: 0;
25 | margin: 0;
26 |
27 | text-align: left;
28 |
29 | background: none;
30 | }
31 | }
32 |
33 | .header {
34 | padding: 0 1rem;
35 |
36 | text-align: left;
37 | }
38 |
39 | .red,
40 | .yellow,
41 | .green {
42 | display: inline-block;
43 | width: 1.2rem;
44 | height: 1.2rem;
45 | margin: 0 0.5rem 0 0;
46 |
47 | border-radius: 50%;
48 | }
49 |
50 | .red {
51 | background: #ec5f67;
52 | }
53 |
54 | .yellow {
55 | background: yellow;
56 | }
57 |
58 | .green {
59 | background: #99c794;
60 | }
61 |
62 | .snippet {
63 | padding: 1rem;
64 |
65 | code,
66 | pre {
67 | color: #cdd3de;
68 | font-size: 2vw;
69 | line-height: 120%;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/js/components/Code/index.js:
--------------------------------------------------------------------------------
1 | import Code from './Code';
2 | export default Code;
3 |
--------------------------------------------------------------------------------
/src/js/components/Code/prism.css:
--------------------------------------------------------------------------------
1 | code[class*='language-'],
2 | pre[class*='language-'] {
3 | font-family: Consolas, Menlo, Monaco, 'Andale Mono WT', 'Andale Mono',
4 | 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono',
5 | 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L',
6 | 'Courier New', Courier, monospace;
7 | font-size: 14px;
8 | line-height: 1.375;
9 | direction: ltr;
10 | text-align: left;
11 | white-space: pre;
12 | word-spacing: normal;
13 | word-break: normal;
14 | -moz-tab-size: 4;
15 | -o-tab-size: 4;
16 | tab-size: 4;
17 | -webkit-hyphens: none;
18 | -moz-hyphens: none;
19 | -ms-hyphens: none;
20 | hyphens: none;
21 | background: #2b303b;
22 | color: #cdd3de;
23 | }
24 | pre[class*='language-']::-moz-selection,
25 | pre[class*='language-'] ::-moz-selection,
26 | code[class*='language-']::-moz-selection,
27 | code[class*='language-'] ::-moz-selection {
28 | text-shadow: none;
29 | background: #cdd3de;
30 | }
31 | pre[class*='language-']::selection,
32 | pre[class*='language-'] ::selection,
33 | code[class*='language-']::selection,
34 | code[class*='language-'] ::selection {
35 | text-shadow: none;
36 | background: #cdd3de;
37 | }
38 | pre[class*='language-'] {
39 | padding: 1em;
40 | margin: 0.5em 0;
41 | overflow: auto;
42 | }
43 | :not(pre) > code[class*='language-'] {
44 | padding: 0.1em;
45 | border-radius: 0.3em;
46 | }
47 | .token.comment,
48 | .token.prolog,
49 | .token.doctype,
50 | .token.cdata {
51 | color: #65737e;
52 | }
53 | .token.punctuation {
54 | color: #c0c5ce;
55 | }
56 | .token.namespace {
57 | opacity: 0.7;
58 | }
59 | .token.operator,
60 | .token.boolean,
61 | .token.number {
62 | color: #d08770;
63 | }
64 | .token.property {
65 | color: #ebcb8b;
66 | }
67 | .token.tag {
68 | color: #8fa1b3;
69 | }
70 | .token.string {
71 | color: #96b5b4;
72 | }
73 | .token.selector {
74 | color: #b48ead;
75 | }
76 | .token.attr-name {
77 | color: #d08770;
78 | }
79 | .token.entity,
80 | .token.url,
81 | .language-css .token.string,
82 | .style .token.string {
83 | color: #96b5b4;
84 | }
85 | .token.attr-value,
86 | .token.keyword,
87 | .token.control,
88 | .token.directive,
89 | .token.unit {
90 | color: #a3be8c;
91 | }
92 | .token.statement,
93 | .token.regex,
94 | .token.atrule {
95 | color: #96b5b4;
96 | }
97 | .token.placeholder,
98 | .token.variable,
99 | .token.function {
100 | color: #6699cc;
101 | }
102 | .token.deleted {
103 | text-decoration: line-through;
104 | }
105 | .token.inserted {
106 | border-bottom: 1px dotted #eff1f5;
107 | text-decoration: none;
108 | }
109 | .token.italic {
110 | font-style: italic;
111 | }
112 | .token.important,
113 | .token.bold {
114 | font-weight: bold;
115 | }
116 | .token.important {
117 | color: #bf616a;
118 | }
119 | .token.entity {
120 | cursor: help;
121 | }
122 | pre > code.highlight {
123 | outline: 0.4em solid #bf616a;
124 | outline-offset: 0.4em;
125 | }
126 |
--------------------------------------------------------------------------------
/src/js/components/Columns/Columns.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './columns.scss';
4 |
5 | const Columns = ({ children }) => {
6 | const renderColumns = () => {
7 | return children.map(child => {
8 | return cloneElement(child, {
9 | className: styles.column,
10 | });
11 | });
12 | };
13 |
14 | return {renderColumns()}
;
15 | };
16 |
17 | Columns.propTypes = {
18 | children: propTypes.element.isRequired,
19 | };
20 |
21 | export default Columns;
22 |
--------------------------------------------------------------------------------
/src/js/components/Columns/columns.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Column styles
3 | */
4 |
5 | .columns {
6 | display: flex;
7 | width: 100%;
8 | }
9 |
10 | .column {
11 | flex: 1;
12 | display: flex;
13 | align-items: center;
14 | justify-content: center;
15 | flex-direction: column;
16 | padding: 4rem;
17 |
18 | text-align: center;
19 | }
20 |
--------------------------------------------------------------------------------
/src/js/components/Columns/index.js:
--------------------------------------------------------------------------------
1 | import Columns from './Columns';
2 | export default Columns;
3 |
--------------------------------------------------------------------------------
/src/js/components/Deck/Deck.js:
--------------------------------------------------------------------------------
1 | import { h, render, Component, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import Twitter from '../Twitter';
4 | import Keyboard from '../../services/Keyboard';
5 |
6 | class Deck extends Component {
7 | state = {
8 | slide: parseInt(window.location.pathname.split('/')[1]) || 0,
9 | };
10 |
11 | componentWillMount() {
12 | this.KeyboardLeftListener = Keyboard.on('left', () =>
13 | this.getPreviousSlide()
14 | );
15 | this.KeyboardRightListener = Keyboard.on('right', () =>
16 | this.getNextSlide()
17 | );
18 | this.KeyboardUpListener = Keyboard.on('page up', () =>
19 | this.getPreviousSlide()
20 | );
21 | this.KeyboardDownListener = Keyboard.on('page down', () =>
22 | this.getNextSlide()
23 | );
24 | }
25 |
26 | componentWillUnmount() {
27 | Keyboard.off(this.KeyboardLeftListener);
28 | Keyboard.off(this.KeyboardRightListener);
29 | Keyboard.off(this.KeyboardUpListener);
30 | Keyboard.off(this.KeyboardDownListener);
31 | }
32 |
33 | getPreviousSlide() {
34 | if (this.state.slide === 0) {
35 | return;
36 | }
37 |
38 | this.setState({ slide: this.state.slide - 1 });
39 | history.pushState(undefined, undefined, this.state.slide);
40 | }
41 |
42 | getNextSlide() {
43 | if (this.state.slide === this.props.children.length - 1) {
44 | return;
45 | }
46 |
47 | this.setState({ slide: this.state.slide + 1 });
48 | history.pushState(undefined, undefined, this.state.slide);
49 | }
50 |
51 | renderSlide = () => {
52 | return this.props.children[this.state.slide];
53 | };
54 |
55 | render() {
56 | return (
57 |
58 | {this.renderSlide()}
59 |
60 |
61 | );
62 | }
63 | }
64 |
65 | Deck.propTypes = {
66 | children: propTypes.element.isRequired,
67 | };
68 |
69 | export default Deck;
70 |
--------------------------------------------------------------------------------
/src/js/components/Deck/index.js:
--------------------------------------------------------------------------------
1 | import Deck from './Deck';
2 | export default Deck;
3 |
--------------------------------------------------------------------------------
/src/js/components/Icon/Icon.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 |
4 | const EnvelopesSchema = ({ src, style }) => {
5 | return ;
6 | };
7 |
8 | EnvelopesSchema.propTypes = {
9 | src: propTypes.element.isRequired,
10 | style: propTypes.object,
11 | };
12 |
13 | export default EnvelopesSchema;
14 |
--------------------------------------------------------------------------------
/src/js/components/Icon/index.js:
--------------------------------------------------------------------------------
1 | import Icon from './Icon';
2 | export default Icon;
3 |
--------------------------------------------------------------------------------
/src/js/components/Image/Image.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import classnames from 'classnames';
4 | import styles from './image.scss';
5 |
6 | const Image = ({ children, src, style, color }) => {
7 | const classes = classnames(styles.image, {
8 | [styles.overlay]: color,
9 | });
10 |
11 | return (
12 |
20 | );
21 | };
22 |
23 | Image.propTypes = {
24 | children: propTypes.element.isRequired,
25 | src: propTypes.string.isRequired,
26 | };
27 |
28 | export default Image;
29 |
--------------------------------------------------------------------------------
/src/js/components/Image/image.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Image styles
3 | */
4 |
5 | .image {
6 | position: relative;
7 |
8 | background-position: 50% !important;
9 | background-size: cover !important;
10 | background: no-repeat;
11 | }
12 |
13 | .overlay {
14 | background-blend-mode: multiply;
15 | }
16 |
--------------------------------------------------------------------------------
/src/js/components/Image/index.js:
--------------------------------------------------------------------------------
1 | import Image from './Image';
2 | export default Image;
3 |
--------------------------------------------------------------------------------
/src/js/components/List/List.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './list.scss';
4 |
5 | const List = ({ children }) => {
6 | const renderItems = () => {
7 | return children.map(child => {
8 | return cloneElement(child, {
9 | className: styles.item,
10 | });
11 | });
12 | };
13 |
14 | return ;
15 | };
16 |
17 | List.propTypes = {
18 | children: propTypes.element.isRequired,
19 | };
20 |
21 | export default List;
22 |
--------------------------------------------------------------------------------
/src/js/components/List/index.js:
--------------------------------------------------------------------------------
1 | import List from './List';
2 | export default List;
3 |
--------------------------------------------------------------------------------
/src/js/components/List/list.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * List styles
3 | */
4 |
5 | .list {
6 | padding: 0;
7 | margin: 0;
8 | list-style: none;
9 | }
10 |
11 | .item {
12 | padding: 2rem 0;
13 | margin: 0;
14 | list-style: none;
15 |
16 | font-size: 3vw;
17 | }
18 |
--------------------------------------------------------------------------------
/src/js/components/Slide/Slide.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './slide.scss';
4 |
5 | const Slide = ({ children }) => {
6 | return {children}
;
7 | };
8 |
9 | Slide.propTypes = {
10 | children: propTypes.element.isRequired,
11 | };
12 |
13 | export default Slide;
14 |
--------------------------------------------------------------------------------
/src/js/components/Slide/index.js:
--------------------------------------------------------------------------------
1 | import Slide from './Slide';
2 | export default Slide;
3 |
--------------------------------------------------------------------------------
/src/js/components/Slide/slide.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Slide styles
3 | */
4 |
5 | .slide {
6 | display: flex;
7 | width: 100vw;
8 | height: 100vh;
9 | align-items: center;
10 | justify-content: center;
11 | flex-direction: column;
12 |
13 | text-align: center;
14 | }
15 |
--------------------------------------------------------------------------------
/src/js/components/Sound/Sound.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './sound.scss';
4 |
5 | const Sound = ({ onClick, style }) => {
6 | return ;
7 | };
8 |
9 | Sound.propTypes = {
10 | onClick: propTypes.func.isRequired,
11 | style: propTypes.object,
12 | };
13 |
14 | export default Sound;
15 |
--------------------------------------------------------------------------------
/src/js/components/Sound/index.js:
--------------------------------------------------------------------------------
1 | import Sound from './Sound';
2 | export default Sound;
3 |
--------------------------------------------------------------------------------
/src/js/components/Sound/sound.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Sound styles
3 | */
4 |
5 | .sound {
6 | transition: opacity 0.4s ease-in-out;
7 |
8 | width: 8vw;
9 | height: 8vw;
10 | margin: 0 1vw;
11 |
12 | background: #5fb3b3 url('../../../images/mic.png') 50% 50% no-repeat;
13 | background-size: 3vw 5vw;
14 |
15 | opacity: 0.8;
16 |
17 | border: none;
18 | border-radius: 50%;
19 |
20 | cursor: pointer;
21 |
22 | &:hover {
23 | opacity: 1;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/js/components/Subtitle/Subtitle.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './subtitle.scss';
4 |
5 | const Subtitle = ({ children }) => {
6 | return {children}
;
7 | };
8 |
9 | Subtitle.propTypes = {
10 | children: propTypes.element.isRequired,
11 | };
12 |
13 | export default Subtitle;
14 |
--------------------------------------------------------------------------------
/src/js/components/Subtitle/index.js:
--------------------------------------------------------------------------------
1 | import Subtitle from './Subtitle';
2 | export default Subtitle;
3 |
--------------------------------------------------------------------------------
/src/js/components/Subtitle/subtitle.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Subitle styles
3 | */
4 |
5 | .subtitle {
6 | font-size: 4.5vw;
7 | font-weight: 700;
8 | text-transform: uppercase;
9 | }
10 |
--------------------------------------------------------------------------------
/src/js/components/Text/Text.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './text.scss';
4 |
5 | const Text = ({ children }) => {
6 | return {children}
;
7 | };
8 |
9 | Text.propTypes = {
10 | children: propTypes.element.isRequired,
11 | };
12 |
13 | export default Text;
14 |
--------------------------------------------------------------------------------
/src/js/components/Text/index.js:
--------------------------------------------------------------------------------
1 | import Text from './Text';
2 | export default Text;
3 |
--------------------------------------------------------------------------------
/src/js/components/Text/text.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Text styles
3 | */
4 |
5 | .text {
6 | margin: 2rem 0;
7 | font-size: 3vw;
8 | line-height: 150%;
9 | }
10 |
--------------------------------------------------------------------------------
/src/js/components/Title/Title.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './title.scss';
4 |
5 | const Title = ({ children }) => {
6 | return {children}
;
7 | };
8 |
9 | Title.propTypes = {
10 | children: propTypes.element.isRequired,
11 | };
12 |
13 | export default Title;
14 |
--------------------------------------------------------------------------------
/src/js/components/Title/index.js:
--------------------------------------------------------------------------------
1 | import Title from './Title';
2 | export default Title;
3 |
--------------------------------------------------------------------------------
/src/js/components/Title/title.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Title styles
3 | */
4 |
5 | .title {
6 | font-size: 6vw;
7 | font-weight: 700;
8 | text-transform: uppercase;
9 | }
10 |
--------------------------------------------------------------------------------
/src/js/components/Twitter/Twitter.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import propTypes from 'proptypes';
3 | import styles from './twitter.scss';
4 |
5 | const Twitter = () => {
6 | return (
7 |
12 | Sambego
13 |
14 | );
15 | };
16 |
17 | export default Twitter;
18 |
--------------------------------------------------------------------------------
/src/js/components/Twitter/index.js:
--------------------------------------------------------------------------------
1 | import Twitter from './Twitter';
2 | export default Twitter;
3 |
--------------------------------------------------------------------------------
/src/js/components/Twitter/twitter.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * twitter styles
3 | */
4 |
5 | .twitter {
6 | position: fixed;
7 | bottom: 2rem;
8 | left: 2rem;
9 |
10 | padding: 0 0 0 2rem;
11 |
12 | background: transparent url('../../../images/twitter.png') 0 0 no-repeat;
13 | background-size: 2rem;
14 |
15 | box-shadow: none;
16 |
17 | color: #1b2b34;
18 | font-weight: 700;
19 | text-decoration: none;
20 | }
21 |
--------------------------------------------------------------------------------
/src/js/components/Volume/Volume.js:
--------------------------------------------------------------------------------
1 | import { h, render, Component } from 'preact';
2 | import propTypes from 'proptypes';
3 | import linkRef from 'linkref';
4 | import styles from './volume.scss';
5 |
6 | class Wave extends Component {
7 | static propTypes = {
8 | input: propTypes.stream,
9 | };
10 |
11 | constructor(...args) {
12 | super(...args);
13 |
14 | this.audioContext = new AudioContext();
15 | this.points = [1, 5, 10, 5, 1];
16 | this.state = {
17 | volume: 0,
18 | };
19 | }
20 |
21 | componentDidMount() {
22 | this.start();
23 | this.canvasContext = this.refs.canvas.getContext('2d');
24 | this.canvasContext.canvas.width = this.refs.canvas.offsetWidth;
25 | this.canvasContext.canvas.height = this.refs.canvas.offsetHeight;
26 | }
27 |
28 | start() {
29 | navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
30 | this.setState({ running: true });
31 | this.processAudioInput(stream);
32 |
33 | window.requestAnimationFrame(this.drawWave.bind(this));
34 | });
35 | }
36 |
37 | stop() {
38 | this.setState({ running: false });
39 | }
40 |
41 | calculateX(index) {
42 | // prettier-ignore
43 | return ((this.canvasContext.canvas.width / this.points.length) * (index + 0.5));
44 | }
45 |
46 | calculateY(index) {
47 | // prettier-ignore
48 | return (this.canvasContext.canvas.height - ((this.canvasContext.canvas.height / 2) / (100 / (this.points[index] * (this.state.volume * 200)))));
49 | }
50 |
51 | drawWave() {
52 | this.canvasContext.clearRect(
53 | 0,
54 | 0,
55 | this.canvasContext.canvas.width,
56 | this.canvasContext.canvas.height
57 | );
58 |
59 | this.canvasContext.beginPath();
60 | this.canvasContext.moveTo(0, this.canvasContext.canvas.height);
61 |
62 | this.points.forEach((point, index) => {
63 | if (index < this.points.length - 1) {
64 | // prettier-ignore
65 | this.canvasContext.quadraticCurveTo(
66 | this.calculateX(index),
67 | this.calculateY(index),
68 | ((this.calculateX(index) + this.calculateX(index + 1)) / 2),
69 | ((this.calculateY(index) + this.calculateY(index + 1)) / 2)
70 | );
71 | } else {
72 | // prettier-ignore
73 | this.canvasContext.quadraticCurveTo(
74 | this.calculateX(index),
75 | this.calculateY(index),
76 | ((this.calculateX(index) + this.canvasContext.canvas.width) / 2),
77 | ((this.calculateY(index) + this.canvasContext.canvas.height) / 2)
78 | );
79 | }
80 | });
81 |
82 | this.canvasContext.quadraticCurveTo(
83 | this.canvasContext.canvas.width,
84 | this.canvasContext.canvas.height,
85 | this.canvasContext.canvas.width,
86 | this.canvasContext.canvas.height
87 | );
88 | this.canvasContext.fillStyle = '#5FB3B3';
89 | this.canvasContext.fill();
90 |
91 | if (this.state.running) {
92 | window.requestAnimationFrame(this.drawWave.bind(this));
93 | }
94 | }
95 |
96 | calculateVolume(event) {
97 | const buffer = event.inputBuffer.getChannelData(0);
98 | const volume = 0;
99 | let total = 0;
100 |
101 | buffer.forEach(sample => {
102 | total += sample * sample;
103 | });
104 |
105 | const rms = Math.sqrt(total / buffer.length);
106 |
107 | this.setState({ volume: Math.max(rms, volume) });
108 | }
109 |
110 | processAudioInput(stream) {
111 | this.inputNode = this.audioContext.createMediaStreamSource(stream);
112 | this.audioProcessorNode = this.audioContext.createScriptProcessor(256);
113 | this.audioProcessorNode.onaudioprocess = this.calculateVolume.bind(
114 | this
115 | );
116 | this.inputNode.connect(this.audioProcessorNode);
117 | this.audioProcessorNode.connect(this.audioContext.destination);
118 | }
119 |
120 | render() {
121 | return (
122 |
128 | );
129 | }
130 | }
131 |
132 | export default Wave;
133 |
--------------------------------------------------------------------------------
/src/js/components/Volume/index.js:
--------------------------------------------------------------------------------
1 | import Volume from './Volume';
2 | export default Volume;
3 |
--------------------------------------------------------------------------------
/src/js/components/Volume/volume.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Volume styles
3 | */
4 |
5 | .canvas {
6 | position: absolute;
7 | z-index: -1;
8 | }
9 |
--------------------------------------------------------------------------------
/src/js/components/Wave/Wave.js:
--------------------------------------------------------------------------------
1 | import { h, render, Component } from 'preact';
2 | import propTypes from 'proptypes';
3 | import linkRef from 'linkref';
4 | import styles from './wave.scss';
5 |
6 | class Wave extends Component {
7 | static propTypes = {
8 | color: propTypes.string,
9 | context: propTypes.object,
10 | input: propTypes.object,
11 | onClick: propTypes.func,
12 | };
13 |
14 | static defaultProps = {
15 | color: '#EC5f67',
16 | onClick: () => true,
17 | };
18 |
19 | componentDidMount() {
20 | this.start();
21 | this.canvasContext = this.refs.canvas.getContext('2d');
22 | this.canvasContext.canvas.width = this.refs.canvas.offsetWidth;
23 | this.canvasContext.canvas.height = this.refs.canvas.offsetHeight;
24 | }
25 |
26 | start() {
27 | if (this.props.input) {
28 | this.setState({ running: true });
29 | this.processAudioInput();
30 |
31 | window.requestAnimationFrame(this.drawWave.bind(this));
32 | }
33 | }
34 |
35 | stop() {
36 | this.setState({ running: false });
37 | }
38 |
39 | calculateX(index) {
40 | // prettier-ignore
41 | return (index * this.canvasContext.canvas.width) / (this.bufferLength - 1);
42 | }
43 |
44 | calculateY(index) {
45 | // prettier-ignore
46 | return (((this.canvasContext.canvas.height / 2) * (this.audioData[index] / this.analyserNode.fftSize)));
47 | }
48 |
49 | drawWave() {
50 | this.analyserNode.getByteTimeDomainData(this.audioData);
51 |
52 | this.canvasContext.clearRect(
53 | 0,
54 | 0,
55 | this.canvasContext.canvas.width,
56 | this.canvasContext.canvas.height
57 | );
58 |
59 | this.canvasContext.beginPath();
60 | this.audioData.forEach((point, index) => {
61 | if (index === 0) {
62 | this.canvasContext.moveTo(
63 | this.calculateX(index),
64 | this.calculateY(index)
65 | );
66 | } else {
67 | this.canvasContext.moveTo(
68 | this.calculateX(index - 1),
69 | this.calculateY(index - 1)
70 | );
71 | }
72 |
73 | this.canvasContext.quadraticCurveTo(
74 | this.calculateX(index),
75 | this.calculateY(index),
76 | (this.calculateX(index) + this.calculateX(index + 1)) / 2,
77 | (this.calculateY(index) + this.calculateY(index + 1)) / 2
78 | );
79 | });
80 |
81 | this.canvasContext.lineCap = 'round';
82 | this.canvasContext.lineWidth = 12;
83 | this.canvasContext.strokeStyle = this.props.color;
84 | this.canvasContext.stroke();
85 |
86 | if (this.state.running) {
87 | window.requestAnimationFrame(this.drawWave.bind(this));
88 | }
89 | }
90 |
91 | processAudioInput() {
92 | this.analyserNode = this.props.context.createAnalyser();
93 | this.analyserNode.fftSize = 128;
94 | this.bufferLength = this.analyserNode.frequencyBinCount;
95 | this.audioData = new Uint8Array(this.bufferLength);
96 | this.props.input.connect(this.analyserNode);
97 | }
98 |
99 | render() {
100 | return (
101 |
107 | );
108 | }
109 | }
110 |
111 | export default Wave;
112 |
--------------------------------------------------------------------------------
/src/js/components/Wave/index.js:
--------------------------------------------------------------------------------
1 | import Wave from './Wave';
2 | export default Wave;
3 |
--------------------------------------------------------------------------------
/src/js/components/Wave/wave.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Wave styles
3 | */
4 |
5 | .canvas {
6 | width: 100%;
7 | }
8 |
--------------------------------------------------------------------------------
/src/js/index.js:
--------------------------------------------------------------------------------
1 | import '../scss/styles.scss';
2 |
3 | import { h, render } from 'preact';
4 | import Router from 'preact-router';
5 | import Deck from './components/Deck';
6 | import Title from './slides/Title';
7 | import About from './slides/About';
8 | import Summary from './slides/Summary';
9 | import PlayIntro from './slides/Play/Intro';
10 | import PlayTag from './slides/Play/Tag';
11 | import PlayFetch from './slides/Play/Fetch';
12 | import PlayBuffer from './slides/Play/Buffer';
13 | import PlayInput from './slides/Play/Input';
14 | import CreateIntro from './slides/Create/Intro';
15 | import CreateNodesIntro from './slides/Create/NodesIntro';
16 | import CreateNodes from './slides/Create/Nodes';
17 | import CreateNodesDetail from './slides/Create/NodesDetail';
18 | import CreateNodesProps from './slides/Create/NodesProps';
19 | import CreateNodesPropsDetail from './slides/Create/NodesPropsDetail';
20 | import CreateOscillator from './slides/Create/Oscillator';
21 | import CreateOscillatorCode from './slides/Create/OscillatorCode';
22 | import CreateOscillatorTypes from './slides/Create/OscillatorTypes';
23 | import CreateOscillatorTypesCode from './slides/Create/OscillatorTypesCode';
24 | import CreateSine from './slides/Create/Sine';
25 | import CreateTriangle from './slides/Create/Triangle';
26 | import CreateSquare from './slides/Create/Square';
27 | import CreateSawtooth from './slides/Create/Sawtooth';
28 | import CreateFrequency from './slides/Create/Frequency';
29 | import CreateEnvelopesSchema from './slides/Create/EnvelopesSchema';
30 | import CreateEnvelopes from './slides/Create/Envelopes';
31 | import CreateEnvelopesCode from './slides/Create/EnvelopesCode';
32 | import CreateEnvelopesFrequency from './slides/Create/EnvelopesFrequency';
33 | import CreateEnvelopesCodeRelease from './slides/Create/EnvelopesCodeRelease';
34 | import CreateEnvelopesCodeFrequency from './slides/Create/EnvelopesCodeFrequency';
35 | import CreateEnvelopesExponential from './slides/Create/EnvelopesExponential';
36 | import CreateEnvelopesSchemaExponential from './slides/Create/EnvelopesSchemaExponential';
37 | import CreateEnvelopesCodeExponential from './slides/Create/EnvelopesCodeExponential';
38 | import Synth from './slides/Create/Synth';
39 | import Atom from './slides/Create/Synth/Atom';
40 | import ComposeIntro from './slides/Compose/Intro';
41 | import ComposeScale from './slides/Compose/Scale';
42 | import ComposeSimple from './slides/Compose/Simple';
43 | import ComposeRandom from './slides/Compose/Random';
44 | import ComposeCode from './slides/Compose/Code';
45 | import Musicfns from './slides/Compose/Musicfns';
46 | import Musicfns2 from './slides/Compose/Musicfns/Fns2';
47 | import EffectsIntro from './slides/Effects/Intro';
48 | import EffectsPedalboard from './slides/Effects/Pedalboard';
49 | import EffectsVolume from './slides/Effects/Volume';
50 | import EffectsVolumeSchema from './slides/Effects/VolumeSchema';
51 | import EffectsVolumeCode from './slides/Effects/VolumeCode';
52 | import EffectsDistortion from './slides/Effects/Distortion';
53 | import EffectsDistortionPreview from './slides/Effects/DistortionPreview';
54 | import EffectsDistortionSchema from './slides/Effects/DistortionSchema';
55 | import EffectsDistortionCode from './slides/Effects/DistortionCode';
56 | import EffectsDelayPreview from './slides/Effects/DelayPreview';
57 | import EffectsDelaySchema from './slides/Effects/DelaySchema';
58 | import EffectsDelayCode from './slides/Effects/DelayCode';
59 | import EffectsFlangerPreview from './slides/Effects/FlangerPreview';
60 | import EffectsFlangerSchema from './slides/Effects/FlangerSchema';
61 | import EffectsFlangerCode from './slides/Effects/FlangerCode';
62 | import EffectsReverbPreview from './slides/Effects/ReverbPreview';
63 | import EffectsReverbSchema from './slides/Effects/ReverbSchema';
64 | import EffectsReverbCode from './slides/Effects/ReverbCode';
65 | import EffectsOther from './slides/Effects/Other';
66 | import EffectsAudioEffects from './slides/Effects/AudioEffects';
67 | import EffectsAudioEffectsCode from './slides/Effects/AudioEffectsCode';
68 | import Devtools from './slides/Devtools';
69 | import DevtoolsImage from './slides/DevtoolsImage';
70 | import FunIntro from './slides/Fun/Intro';
71 | import Demo from './slides/Fun/Demo';
72 | import MidiIntro from './slides/Midi/MidiIntro';
73 | import MidiController from './slides/Midi/MidiController';
74 | import MidiCode from './slides/Midi/MidiCode';
75 | import MidiCodeSend from './slides/Midi/MidiCodeSend';
76 | import MidiTest from './slides/Midi/MidiTest';
77 | import Fun from './slides/Fun/Fun';
78 | import Remote from './slides/Fun/Remote';
79 | import Links from './slides/Links';
80 | import Thanks from './slides/Thanks';
81 |
82 | import ConfIntro from './slides/Title/ConfIntro';
83 |
84 | console.log('----------------');
85 | console.log('Checking what\'s under the hood? Let me make it easy for you!');
86 | console.log('The source of this presentation can be found at: https://github.com/sambego/deep-dive');
87 | console.log('Yes I know, it\'s all a bit of a hack :)');
88 | console.log('Want to create your own presentations using React components? Check here: https://sambego.github.io/diorama-demo');
89 | console.log('Got more questions? Contact me at https://twitter.com/sambego');
90 | console.log('----------------');
91 |
92 | render(
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 | ,
169 | document.body
170 | );
171 |
--------------------------------------------------------------------------------
/src/js/services/Composer.js:
--------------------------------------------------------------------------------
1 | export default class Composer {
2 | context = new AudioContext();
3 | bpm = 70.0;
4 | currentTime = 0;
5 | notesPerMeasure = 4;
6 | notes = [];
7 |
8 | calculateLength(length) {
9 | return 60 / this.bpm / length;
10 | }
11 |
12 | add(length = 4, frequency = 400, pause = false) {
13 | const noteLength = this.calculateLength(length);
14 |
15 | if (!pause) {
16 | this.notes.push({
17 | frequency,
18 | startTime: this.currentTime,
19 | endTime: this.currentTime + noteLength,
20 | });
21 | }
22 |
23 | this.currentTime += noteLength;
24 | }
25 |
26 | play() {
27 | const now = this.context.currentTime;
28 |
29 | this.notes.forEach(note => {
30 | const oscillator = this.context.createOscillator();
31 | oscillator.frequency.value = note.frequency;
32 | oscillator.connect(this.context.destination);
33 | oscillator.start(now + note.startTime);
34 | oscillator.stop(now + note.endTime);
35 | });
36 |
37 | this.notes = [];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/js/services/Keyboard.js:
--------------------------------------------------------------------------------
1 | import keycode from 'keycode';
2 |
3 | export default class Keyboard {
4 | static isKey(event, key, callback) {
5 | if (keycode(event) === key) {
6 | callback();
7 | }
8 | }
9 |
10 | static on(key, callback) {
11 | const listener = event => this.isKey(event, key, callback);
12 |
13 | window.addEventListener('keyup', listener);
14 |
15 | return listener;
16 | }
17 |
18 | static off(listener) {
19 | window.removeEventListener('keyup', listener);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/js/slides/About/About.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Columns from '../../components/Columns';
4 | import Image from '../../components/Image';
5 | import Subtitle from '../../components/Subtitle';
6 | import List from '../../components/List';
7 | import Sam from '../../../images/sam2.jpg';
8 |
9 | const About = () => {
10 | return (
11 |
12 |
13 |
21 |
22 | Sam Bellen
23 |
24 | Developer Evangelist
25 | Auth0
26 | Google Developer Expert
27 | Fronteers
28 |
29 |
30 |
31 |
32 | );
33 | };
34 |
35 | export default About;
36 |
--------------------------------------------------------------------------------
/src/js/slides/About/index.js:
--------------------------------------------------------------------------------
1 | import About from './About';
2 | export default About;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Code/Code.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const ComposeCode = () => {
6 | const code =
7 | '...\nconst now = audioContext.currentTime;\nconst oscillator = audioContext.createOscillator();\noscillator.start(now);\noscillator.stop(now + 100);\n\nconst oscillator2 = audioContext.createOscillator();\noscillator2.start(now + 100);\noscillator2.stop(now + 200);\n...';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default ComposeCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Code/index.js:
--------------------------------------------------------------------------------
1 | import Code from './Code';
2 | export default Code;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Intro/Intro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Columns from '../../../components/Columns';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Image from '../../../components/Image';
6 | import Compose from '../../../../images/compose.jpg';
7 |
8 | const Intro = () => {
9 | return (
10 |
11 |
12 |
13 | Compose Sounds
14 |
15 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Intro;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Intro/index.js:
--------------------------------------------------------------------------------
1 | import Intro from './Intro';
2 | export default Intro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Musicfns/Fns.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Fns = () => {
6 | return (
7 |
8 |
9 |
14 | music-fns.netlify.com
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Fns;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Musicfns/Fns2.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Fns2 = () => {
6 | return (
7 |
8 |
9 |
14 | github.com/madewithlove/music-fns
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Fns2;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Musicfns/index.js:
--------------------------------------------------------------------------------
1 | import Fns from './Fns';
2 | export default Fns;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Random/Random.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import FrequencyCalculator from 'frequency-calculator';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 | import Composer from '../../../services/Composer';
7 |
8 | const Random = () => {
9 | const audioContext = new AudioContext();
10 |
11 | const playSound = () => {
12 | const composer = new Composer(audioContext);
13 | let i = 0;
14 |
15 | for (; i < 20; i++) {
16 | composer.add(
17 | Math.floor(Math.random() * 8) + 1,
18 | Math.floor(Math.random() * 2000) + 200
19 | );
20 | }
21 |
22 | composer.play();
23 | };
24 |
25 | return (
26 |
27 | Compose a Random song
28 |
29 |
30 | );
31 | };
32 |
33 | export default Random;
34 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Random/index.js:
--------------------------------------------------------------------------------
1 | import Random from './Random';
2 | export default Random;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Scale/Scale.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import FrequencyCalculator from 'frequency-calculator';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 | import Composer from '../../../services/Composer';
7 |
8 | const Scale = () => {
9 | const audioContext = new AudioContext();
10 |
11 | const playSound = () => {
12 | const composer = new Composer(audioContext);
13 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('C', 4));
14 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('D', 4));
15 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 4));
16 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('F', 4));
17 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('G', 4));
18 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('A', 4));
19 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('B', 4));
20 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('C', 5));
21 | composer.play();
22 | };
23 |
24 | return (
25 |
26 | Compose a simple scale
27 |
28 |
29 | );
30 | };
31 |
32 | export default Scale;
33 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Scale/index.js:
--------------------------------------------------------------------------------
1 | import Scale from './Scale';
2 | export default Scale;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Simple/Simple.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import FrequencyCalculator from 'frequency-calculator';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 | import Composer from '../../../services/Composer';
7 |
8 | const Simple = () => {
9 | const audioContext = new AudioContext();
10 |
11 | const playSound = () => {
12 | const composer = new Composer(audioContext);
13 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 5));
14 | composer.add(
15 | 8,
16 | FrequencyCalculator.calculateFrequencyByNote('Dsharp', 5)
17 | );
18 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 5));
19 | composer.add(
20 | 8,
21 | FrequencyCalculator.calculateFrequencyByNote('Dsharp', 5)
22 | );
23 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 5));
24 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('B', 4));
25 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('D', 5));
26 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('C', 5));
27 | composer.add(2, FrequencyCalculator.calculateFrequencyByNote('A', 4));
28 | composer.add(4, 0, true);
29 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('C', 3));
30 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 3));
31 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('A', 4));
32 | composer.add(2, FrequencyCalculator.calculateFrequencyByNote('B', 4));
33 | composer.add(4, 0, true);
34 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('E', 3));
35 | composer.add(
36 | 4,
37 | FrequencyCalculator.calculateFrequencyByNote('Gsharp', 3)
38 | );
39 | composer.add(4, FrequencyCalculator.calculateFrequencyByNote('B', 4));
40 | composer.add(2, FrequencyCalculator.calculateFrequencyByNote('C', 5));
41 | composer.play();
42 | };
43 |
44 | return (
45 |
46 | Compose a simple song
47 |
48 |
49 | );
50 | };
51 |
52 | export default Simple;
53 |
--------------------------------------------------------------------------------
/src/js/slides/Compose/Simple/index.js:
--------------------------------------------------------------------------------
1 | import Simple from './Simple';
2 | export default Simple;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Envelopes/Envelopes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Sound from '../../../components/Sound';
5 | import Envelope from '../../../../images/envelope.png';
6 |
7 | const Envelopes = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const gain = audioContext.createGain();
11 | const attackTime = 1;
12 | const releaseTime = 1;
13 | const duration = 500;
14 |
15 | oscillator.connect(gain);
16 | gain.connect(audioContext.destination);
17 |
18 | gain.gain.value = 0;
19 | oscillator.start();
20 |
21 | const playSound = () => {
22 | gain.gain.setValueAtTime(0, audioContext.currentTime);
23 | gain.gain.linearRampToValueAtTime(
24 | 1,
25 | audioContext.currentTime + attackTime
26 | );
27 |
28 | // prettier-ignore
29 | window.setTimeout(() => {
30 | gain.gain.linearRampToValueAtTime(
31 | 0,
32 | audioContext.currentTime + releaseTime
33 | );
34 | }, (attackTime * 1000) + duration);
35 | };
36 |
37 | return (
38 |
39 | Linear Envelopes
40 |
48 |
49 | );
50 | };
51 |
52 | export default Envelopes;
53 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Envelopes/index.js:
--------------------------------------------------------------------------------
1 | import Envelopes from './Envelopes';
2 | export default Envelopes;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCode/EnvelopesCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const EnvelopesCode = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\nconst gain = audioContext.createGain();\nconst attackTime = 1;\n\n// Start the oscillator\noscillator.start();\n\n// Set the value of our gain to 0\ngain.gain.setValueAtTime(0, audioContext.currentTime);\n\n// Ramp up to a gain of 1 during\ngain.gain.linearRampToValueAtTime(\n 1,\n (audioContext.currentTime + attackTime)\n);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCode/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesCode from './EnvelopesCode';
2 | export default EnvelopesCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeExponential/EnvelopesCodeExponential.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const EnvelopesCodeExponential = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\nconst gain = audioContext.createGain();\nconst attackTime = 1;\n\n// Start the oscillator\noscillator.start();\n\n// Set the value of our gain to 0\ngain.gain.setValueAtTime(0.001, audioContext.currentTime);\n\n// Ramp up to a gain of 1 during\ngain.gain.exponentialRampToValueAtTime(\n 1,\n (audioContext.currentTime + attackTime)\n);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesCodeExponential;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeExponential/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesCodeExponential from './EnvelopesCodeExponential';
2 | export default EnvelopesCodeExponential;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeFrequency/EnvelopesCodeFrequency.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const EnvelopesCodeFrequency = () => {
6 | const code =
7 | '...\n\noscillator.frequency.setValueAtTime(200, audioContext.currentTime);\n\noscillator.frequency.linearRampToValueAtTime(\n 800,\n audioContext.currentTime + attackTime\n);\n\noscillator.frequency.linearRampToValueAtTime(\n 200,\n audioContext.currentTime + releaseTime\n);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesCodeFrequency;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeFrequency/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesCodeFrequency from './EnvelopesCodeFrequency';
2 | export default EnvelopesCodeFrequency;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeRelease/EnvelopesCodeRelease.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const EnvelopesCodeRelease = () => {
6 | const code =
7 | '...\n\nconst releaseTime = 1;\n\n...\n\ngain.gain.linearRampToValueAtTime(\n 0,\n (audioContext.currentTime + releaseTime)\n);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesCodeRelease;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesCodeRelease/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesCodeRelease from './EnvelopesCodeRelease';
2 | export default EnvelopesCodeRelease;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesExponential/EnvelopesExponential.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Sound from '../../../components/Sound';
5 | import Envelope from '../../../../images/envelope.png';
6 |
7 | const EnvelopesExponential = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const gain = audioContext.createGain();
11 | const attackTime = 3;
12 | const releaseTime = 1;
13 | const duration = 500;
14 |
15 | oscillator.connect(gain);
16 | gain.connect(audioContext.destination);
17 |
18 | gain.gain.value = 0;
19 | oscillator.start();
20 |
21 | const playSound = () => {
22 | gain.gain.setValueAtTime(0.001, audioContext.currentTime);
23 | gain.gain.exponentialRampToValueAtTime(
24 | 1,
25 | audioContext.currentTime + attackTime
26 | );
27 |
28 | // prettier-ignore
29 | window.setTimeout(() => {
30 | gain.gain.exponentialRampToValueAtTime(
31 | 0.001,
32 | audioContext.currentTime + releaseTime
33 | );
34 | }, (attackTime * 1000) + duration);
35 | };
36 |
37 | return (
38 |
39 | Exponential Envelopes
40 |
48 |
49 | );
50 | };
51 |
52 | export default EnvelopesExponential;
53 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesExponential/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesExponential from './EnvelopesExponential';
2 | export default EnvelopesExponential;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesFrequency/EnvelopesFrequency.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Sound from '../../../components/Sound';
5 | import Envelope from '../../../../images/envelope.png';
6 |
7 | const EnvelopesFrequency = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const gain = audioContext.createGain();
11 | const attackTime = 1;
12 | const releaseTime = 1;
13 | const duration = 500;
14 |
15 | oscillator.connect(gain);
16 | gain.connect(audioContext.destination);
17 |
18 | gain.gain.value = 0;
19 | oscillator.start();
20 |
21 | const playSound = () => {
22 | gain.gain.setValueAtTime(0, audioContext.currentTime);
23 | oscillator.frequency.setValueAtTime(200, audioContext.currentTime);
24 | gain.gain.linearRampToValueAtTime(
25 | 1,
26 | audioContext.currentTime + attackTime
27 | );
28 | oscillator.frequency.linearRampToValueAtTime(
29 | 800,
30 | audioContext.currentTime + attackTime
31 | );
32 |
33 | // prettier-ignore
34 | window.setTimeout(() => {
35 | gain.gain.linearRampToValueAtTime(
36 | 0,
37 | audioContext.currentTime + releaseTime
38 | );
39 | oscillator.frequency.linearRampToValueAtTime(
40 | 200,
41 | audioContext.currentTime + releaseTime
42 | );
43 | }, (attackTime * 1000) + duration);
44 | };
45 |
46 | return (
47 |
48 | Linear Envelopes
49 |
57 |
58 | );
59 | };
60 |
61 | export default EnvelopesFrequency;
62 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesFrequency/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesFrequency from './EnvelopesFrequency';
2 | export default EnvelopesFrequency;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesSchema/EnvelopesSchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/envelope-schema.svg';
6 |
7 | const EnvelopesSchema = () => {
8 | return (
9 |
10 | Linear Envelopes
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesSchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesSchema/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesSchema from './EnvelopesSchema';
2 | export default EnvelopesSchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesSchemaExponential/EnvelopesSchemaExponential.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/envelope-schema-exponential.svg';
6 |
7 | const EnvelopesSchemaExponential = () => {
8 | return (
9 |
10 | Exponential envelopes
11 |
12 |
13 | );
14 | };
15 |
16 | export default EnvelopesSchemaExponential;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/EnvelopesSchemaExponential/index.js:
--------------------------------------------------------------------------------
1 | import EnvelopesSchemaExponential from './EnvelopesSchemaExponential';
2 | export default EnvelopesSchemaExponential;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Frequency/Frequency.js:
--------------------------------------------------------------------------------
1 | import { h, render, Component } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 |
6 | class Frequency extends Component {
7 | audioContext = new AudioContext();
8 | oscillator = this.audioContext.createOscillator();
9 | up = true;
10 |
11 | constructor(...args) {
12 | super(...args);
13 |
14 | this.oscillator.frequency.value = 300;
15 | this.oscillator.start();
16 |
17 | this.interval = window.setInterval(() => {
18 | if (this.up) {
19 | this.oscillator.frequency.value += 10;
20 | } else {
21 | this.oscillator.frequency.value -= 10;
22 | }
23 |
24 | if (this.oscillator.frequency.value === 300) {
25 | this.up = true;
26 | }
27 |
28 | if (this.oscillator.frequency.value === 3000) {
29 | this.up = false;
30 | }
31 | }, 10);
32 | }
33 |
34 | componentWillUnmount() {
35 | window.clearInterval(this.interval);
36 | }
37 |
38 | render() {
39 | return (
40 |
41 | Frequency
42 |
43 |
44 | );
45 | }
46 | }
47 |
48 | export default Frequency;
49 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Frequency/index.js:
--------------------------------------------------------------------------------
1 | import Frequency from './Frequency';
2 | export default Frequency;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Intro/Intro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Columns from '../../../components/Columns';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Image from '../../../components/Image';
6 | import Create from '../../../../images/create.jpg';
7 |
8 | const Intro = () => {
9 | return (
10 |
11 |
12 |
20 |
21 | Create Sounds
22 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Intro;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Intro/index.js:
--------------------------------------------------------------------------------
1 | import Intro from './Intro';
2 | export default Intro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Nodes/Nodes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/audio-node.svg';
6 |
7 | const Nodes = () => {
8 | return (
9 |
10 | Connecting nodes
11 |
12 |
13 | );
14 | };
15 |
16 | export default Nodes;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Nodes/index.js:
--------------------------------------------------------------------------------
1 | import Nodes from './Nodes';
2 |
3 | export default Nodes;
4 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesDetail/Nodes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/osc-gain.svg';
6 |
7 | const Nodes = () => {
8 | return (
9 |
10 | Connecting nodes
11 |
12 |
13 | );
14 | };
15 |
16 | export default Nodes;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesDetail/index.js:
--------------------------------------------------------------------------------
1 | import Nodes from './Nodes';
2 |
3 | export default Nodes;
4 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesIntro/NodesIntro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Title from '../../../components/Title';
4 |
5 | const Nodes = () => {
6 | return (
7 |
8 | Let's talk about nodes
9 |
10 | );
11 | };
12 |
13 | export default Nodes;
14 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesIntro/index.js:
--------------------------------------------------------------------------------
1 | import Nodes from './NodesIntro';
2 |
3 | export default Nodes;
4 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesProps/Nodes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/audio-prop.svg';
6 |
7 | const Nodes = () => {
8 | return (
9 |
10 | Connecting nodes and properties
11 |
12 |
13 | );
14 | };
15 |
16 | export default Nodes;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesProps/index.js:
--------------------------------------------------------------------------------
1 | import Nodes from './Nodes';
2 |
3 | export default Nodes;
4 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesPropsDetail/Nodes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/osc-gain-prop.svg';
6 |
7 | const Nodes = () => {
8 | return (
9 |
10 | Connecting nodes and properties
11 |
12 |
13 | );
14 | };
15 |
16 | export default Nodes;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/NodesPropsDetail/index.js:
--------------------------------------------------------------------------------
1 | import Nodes from './Nodes';
2 |
3 | export default Nodes;
4 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Oscillator/Oscillator.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Sound from '../../../components/Sound';
5 |
6 | const Oscillator = () => {
7 | const audioContext = new AudioContext();
8 |
9 | const playSound = () => {
10 | const oscillator = audioContext.createOscillator();
11 |
12 | oscillator.connect(audioContext.destination);
13 | oscillator.start();
14 |
15 | window.setTimeout(() => {
16 | oscillator.stop();
17 | }, 1600);
18 | };
19 |
20 | return (
21 |
22 | Hit me baby!
23 |
24 |
25 | );
26 | };
27 |
28 | export default Oscillator;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Oscillator/index.js:
--------------------------------------------------------------------------------
1 | import Oscillator from './Oscillator';
2 | export default Oscillator;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorCode/OscillatorCode.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const OscillatorCode = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\n\noscillator.connect(audioContext.destination);\noscillator.start();';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default OscillatorCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorCode/index.js:
--------------------------------------------------------------------------------
1 | import OscillatorCode from './OscillatorCode';
2 | export default OscillatorCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorTypes/OscillatorTypes.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Sound from '../../../components/Sound';
5 | import Sine from '../../../../images/sine.png';
6 | import Triangle from '../../../../images/triangle.png';
7 | import Square from '../../../../images/square.png';
8 | import Sawtooth from '../../../../images/sawtooth.png';
9 |
10 | const OscillatorTypes = () => {
11 | const audioContext = new AudioContext();
12 |
13 | const playSound = (type = 'sine', frequency = 400) => {
14 | const oscillator = audioContext.createOscillator();
15 |
16 | oscillator.connect(audioContext.destination);
17 | oscillator.type = type;
18 | oscillator.frequency.value = frequency;
19 | oscillator.start();
20 |
21 | window.setTimeout(() => {
22 | oscillator.stop();
23 | }, 1600);
24 | };
25 |
26 | const playSine = () => {
27 | playSound();
28 | };
29 |
30 | const playTriangle = () => {
31 | playSound('triangle', 800);
32 | };
33 |
34 | const playSquare = () => {
35 | playSound('square', 1200);
36 | };
37 |
38 | const playSawtooth = () => {
39 | playSound('sawtooth', 1600);
40 | };
41 |
42 | return (
43 |
44 | Types of oscillators
45 |
46 |
54 |
62 |
70 |
78 |
79 |
80 | );
81 | };
82 |
83 | export default OscillatorTypes;
84 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorTypes/index.js:
--------------------------------------------------------------------------------
1 | import OscillatorTypes from './OscillatorTypes';
2 | export default OscillatorTypes;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorTypesCode/OscillatorTypesCode.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const OscillatorTypesCode = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\n\noscillator.type = \'sine\'; // square, triangle, sawtooth or custom\noscillator.frequency.value = 400; // A frequency in Hz\n\noscillator.connect(audioContext.destination);\noscillator.start();';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default OscillatorTypesCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Create/OscillatorTypesCode/index.js:
--------------------------------------------------------------------------------
1 | import OscillatorTypesCode from './OscillatorTypesCode';
2 | export default OscillatorTypesCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Sawtooth/Sawtooth.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 |
6 | const Sawtooth = () => {
7 | const audioContext = new AudioContext();
8 | const oscillator = audioContext.createOscillator();
9 |
10 | oscillator.type = 'sawtooth';
11 | oscillator.frequency.value = 1000;
12 | oscillator.start();
13 |
14 | return (
15 |
16 | Sawtooth wave
17 |
18 |
19 | );
20 | };
21 |
22 | export default Sawtooth;
23 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Sawtooth/index.js:
--------------------------------------------------------------------------------
1 | import Sawtooth from './Sawtooth';
2 | export default Sawtooth;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Sine/Sine.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 |
6 | const Sine = () => {
7 | const audioContext = new AudioContext();
8 | const oscillator = audioContext.createOscillator();
9 |
10 | oscillator.frequency.value = 1000;
11 | oscillator.start();
12 |
13 | return (
14 |
15 | Sine wave
16 |
17 |
18 | );
19 | };
20 |
21 | export default Sine;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Sine/index.js:
--------------------------------------------------------------------------------
1 | import Sine from './Sine';
2 | export default Sine;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Square/Square.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 |
6 | const Square = () => {
7 | const audioContext = new AudioContext();
8 | const oscillator = audioContext.createOscillator();
9 |
10 | oscillator.type = 'square';
11 | oscillator.frequency.value = 1000;
12 | oscillator.start();
13 |
14 | return (
15 |
16 | Square wave
17 |
18 |
19 | );
20 | };
21 |
22 | export default Square;
23 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Square/index.js:
--------------------------------------------------------------------------------
1 | import Square from './Square';
2 | export default Square;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Synth/Atom.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Atom = () => {
6 | return (
7 |
8 |
9 |
14 | atom.io/packages/atom-synth
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Atom;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Synth/Synth.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Synth = () => {
6 | return (
7 |
8 |
9 |
14 | sambego.github.io/synthesizer/
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Synth;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Synth/index.js:
--------------------------------------------------------------------------------
1 | import Synth from './Synth';
2 | export default Synth;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Triangle/Triangle.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 |
6 | const Trangle = () => {
7 | const audioContext = new AudioContext();
8 | const oscillator = audioContext.createOscillator();
9 |
10 | oscillator.type = 'triangle';
11 | oscillator.frequency.value = 1000;
12 | oscillator.start();
13 |
14 | return (
15 |
16 | Trangle wave
17 |
18 |
19 | );
20 | };
21 |
22 | export default Trangle;
23 |
--------------------------------------------------------------------------------
/src/js/slides/Create/Triangle/index.js:
--------------------------------------------------------------------------------
1 | import Triangle from './Triangle';
2 | export default Triangle;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Devtools/DevTools.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Subtitle from '../../components/Subtitle';
4 |
5 | const Devtools = () => {
6 | return (
7 |
8 | What about debugging?
9 |
10 | );
11 | };
12 |
13 | export default Devtools;
14 |
--------------------------------------------------------------------------------
/src/js/slides/Devtools/index.js:
--------------------------------------------------------------------------------
1 | import Devtools from './DevTools';
2 | export default Devtools;
3 |
--------------------------------------------------------------------------------
/src/js/slides/DevtoolsImage/DevtoolsImage.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Image from '../../components/Image';
4 | import Devtools from '../../../images/devtools.png';
5 |
6 | const DevtoolsImage = () => {
7 | return (
8 |
9 |
17 |
18 | );
19 | };
20 |
21 | export default DevtoolsImage;
22 |
--------------------------------------------------------------------------------
/src/js/slides/DevtoolsImage/index.js:
--------------------------------------------------------------------------------
1 | import DevtoolsImage from './DevtoolsImage';
2 | export default DevtoolsImage;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/AudioEffects/AudioEffects.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Text from '../../../components/Text';
5 |
6 | const AudioEffects = () => {
7 | return (
8 |
9 | Audio Effects
10 |
11 |
16 | https://github.com/sambego/audio-effects
17 |
18 |
19 |
20 | );
21 | };
22 |
23 | export default AudioEffects;
24 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/AudioEffects/index.js:
--------------------------------------------------------------------------------
1 | import AudioEffects from './AudioEffects';
2 | export default AudioEffects;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/AudioEffectsCode/AudioEffectsCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const AudioEffectsCode = () => {
6 | const code =
7 | 'import {Input, Distortion, Delay, Output} from \'audio-effects\';\n\nconst audioContext = new AudioContext();\nconst input = new Input(audioContext);\nconst distortion = new Distortion(audioContext);\nconst delay = new Delay(audioContext);\nconst output = new Output(audioContext);\n\n// Get the user\'s audio input\ninput.getUserMedia();\n\n// Chain it all together\ninput.connect(distortion).connect(delay).connect(output);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default AudioEffectsCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/AudioEffectsCode/index.js:
--------------------------------------------------------------------------------
1 | import AudioEffectsCode from './AudioEffectsCode';
2 | export default AudioEffectsCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelayCode/DelayCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const DelayCode = () => {
6 | const code =
7 | '...\n\nconst delayNode = audioContext.createDelay();\ndelayNode.delayTime.value = 1; // 1 second delay\n\n...';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default DelayCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelayCode/index.js:
--------------------------------------------------------------------------------
1 | import DelayCode from './DelayCode';
2 | export default DelayCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelayPreview/DelayPreview.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import { Delay } from 'audio-effects';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 |
7 | const DelayPreview = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const oscillator2 = audioContext.createOscillator();
11 | const gain = audioContext.createGain();
12 | const gain2 = audioContext.createGain();
13 | const delay = new Delay(audioContext);
14 |
15 | oscillator.frequency.value = 200;
16 | oscillator.connect(gain);
17 | gain.connect(audioContext.destination);
18 |
19 | oscillator2.frequency.value = 200;
20 | delay.speed = 0.5;
21 | oscillator2.connect(delay.node);
22 | delay.connect(gain2);
23 | gain2.connect(audioContext.destination);
24 |
25 | const play1 = () => {
26 | oscillator.start();
27 |
28 | window.setTimeout(() => {
29 | oscillator.stop();
30 | }, 400);
31 | };
32 |
33 | const play2 = () => {
34 | oscillator2.start();
35 |
36 | window.setTimeout(() => {
37 | oscillator2.stop();
38 | }, 400);
39 | };
40 |
41 | return (
42 |
43 | Delay
44 |
45 |
46 |
47 |
48 |
49 | );
50 | };
51 |
52 | export default DelayPreview;
53 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelayPreview/index.js:
--------------------------------------------------------------------------------
1 | import DelayPreview from './DelayPreview';
2 | export default DelayPreview;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelaySchema/DelaySchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/delay.svg';
6 |
7 | const DelaySchema = () => {
8 | return (
9 |
10 | Delay
11 |
12 |
13 | );
14 | };
15 |
16 | export default DelaySchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DelaySchema/index.js:
--------------------------------------------------------------------------------
1 | import DelaySchema from './DelaySchema';
2 | export default DelaySchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Distortion/Distortion.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import { Distortion } from 'audio-effects';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Wave from '../../../components/Wave';
6 | import Sound from '../../../components/Sound';
7 |
8 | const EffectDistortion = () => {
9 | const audioContext = new AudioContext();
10 | const oscillator = audioContext.createOscillator();
11 | const distortion = new Distortion(audioContext);
12 |
13 | oscillator.frequency.value = 300;
14 | oscillator.start();
15 |
16 | oscillator.connect(distortion.node);
17 |
18 | return (
19 |
20 | Distortion
21 |
26 |
27 | );
28 | };
29 |
30 | export default EffectDistortion;
31 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Distortion/index.js:
--------------------------------------------------------------------------------
1 | import Distortion from './Distortion';
2 | export default Distortion;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionCode/DistortionCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const DistortionCode = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\nconst waveShaper = audioContext.createWaveShaper();\n\nwaveShaper.oversample = \'4x\';\nwaveShaper.curve = fancyMathToCalculateCurve();\n\noscillator.connect(waveShaper);\nwaveShaper.connect(audioContext.destination);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default DistortionCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionCode/index.js:
--------------------------------------------------------------------------------
1 | import DistortionCode from './DistortionCode';
2 | export default DistortionCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionPreview/DistortionPreview.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import { Distortion } from 'audio-effects';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 |
7 | const DistortionPreview = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const oscillator2 = audioContext.createOscillator();
11 | const gain = audioContext.createGain();
12 | const gain2 = audioContext.createGain();
13 | const distortion = new Distortion(audioContext);
14 |
15 | oscillator.frequency.value = 100;
16 | oscillator.start();
17 | gain.gain.value = 0;
18 | oscillator.connect(gain);
19 | gain.connect(audioContext.destination);
20 |
21 | oscillator2.frequency.value = 100;
22 | oscillator2.start();
23 | gain2.gain.value = 0;
24 | oscillator2.connect(distortion.node);
25 | distortion.connect(gain2);
26 | gain2.connect(audioContext.destination);
27 |
28 | const play1 = () => {
29 | gain.gain.value = 1;
30 |
31 | window.setTimeout(() => {
32 | gain.gain.value = 0;
33 | }, 1000);
34 | };
35 |
36 | const play2 = () => {
37 | gain2.gain.value = 1;
38 |
39 | window.setTimeout(() => {
40 | gain2.gain.value = 0;
41 | }, 1000);
42 | };
43 |
44 | return (
45 |
46 | Distortion
47 |
48 |
49 |
50 |
51 |
52 | );
53 | };
54 |
55 | export default DistortionPreview;
56 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionPreview/index.js:
--------------------------------------------------------------------------------
1 | import DistortionPreview from './DistortionPreview';
2 | export default DistortionPreview;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionSchema/DistortionSchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/distortion.svg';
6 |
7 | const DistortionSchema = () => {
8 | return (
9 |
10 | Distortion
11 |
12 |
13 | );
14 | };
15 |
16 | export default DistortionSchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/DistortionSchema/index.js:
--------------------------------------------------------------------------------
1 | import DistortionSchema from './DistortionSchema';
2 | export default DistortionSchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerCode/FlangerCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const FlangerCode = () => {
6 | const code =
7 | '...\n\nconst oscillatorNode = audioContext.createOscillator();\noscillatorNode.type = \'sine\';\noscillatorNode.frequency.value = 1000; // 1000Hz\n\n...';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default FlangerCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerCode/index.js:
--------------------------------------------------------------------------------
1 | import FlangerCode from './FlangerCode';
2 | export default FlangerCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerPreview/FlangerPreview.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import { Flanger } from 'audio-effects';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 |
7 | const FlangerPreview = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const oscillator2 = audioContext.createOscillator();
11 | const gain = audioContext.createGain();
12 | const gain2 = audioContext.createGain();
13 | const flanger = new Flanger(audioContext);
14 |
15 | oscillator.frequency.value = 200;
16 | oscillator.connect(gain);
17 | gain.connect(audioContext.destination);
18 |
19 | oscillator2.frequency.value = 200;
20 | flanger.delay = 0.004;
21 | flanger.depth = 0.4;
22 | oscillator2.connect(flanger.node);
23 | flanger.connect(gain2);
24 | gain2.connect(audioContext.destination);
25 |
26 | const play1 = () => {
27 | oscillator.start();
28 |
29 | window.setTimeout(() => {
30 | oscillator.stop();
31 | }, 400);
32 | };
33 |
34 | const play2 = () => {
35 | oscillator2.start();
36 |
37 | window.setTimeout(() => {
38 | oscillator2.stop();
39 | }, 4000);
40 | };
41 |
42 | return (
43 |
44 | Flanger
45 |
46 |
47 |
48 |
49 |
50 | );
51 | };
52 |
53 | export default FlangerPreview;
54 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerPreview/index.js:
--------------------------------------------------------------------------------
1 | import FlangerPreview from './FlangerPreview';
2 | export default FlangerPreview;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerSchema/FlangerSchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/flanger.svg';
6 |
7 | const FlangerSchema = () => {
8 | return (
9 |
10 | Flanger
11 |
12 |
13 | );
14 | };
15 |
16 | export default FlangerSchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/FlangerSchema/index.js:
--------------------------------------------------------------------------------
1 | import FlangerSchema from './FlangerSchema';
2 | export default FlangerSchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Intro/Intro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Columns from '../../../components/Columns';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Image from '../../../components/Image';
6 | import Effects from '../../../../images/effects.jpg';
7 |
8 | const Intro = () => {
9 | return (
10 |
11 |
12 |
20 |
21 | Add Effects
22 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Intro;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Intro/index.js:
--------------------------------------------------------------------------------
1 | import Intro from './Intro';
2 | export default Intro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Other/Other.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import List from '../../../components/List';
5 |
6 | const Other = () => {
7 | return (
8 |
9 | Other audio nodes
10 |
11 | AnalyserNode
12 | BiquadFilterNode
13 | ChannelSplitterNode
14 | ChannelMergerNode
15 | PannerNode
16 | DynamicsCompressorNode
17 | ...
18 |
19 |
20 | );
21 | };
22 |
23 | export default Other;
24 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Other/index.js:
--------------------------------------------------------------------------------
1 | import Other from './Other';
2 | export default Other;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Pedalboard/Pedalboard.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Image from '../../../components/Image';
4 | import pedalboard from '../../../../images/pedalboard.jpg';
5 |
6 | const Pedalboard = () => {
7 | return (
8 |
9 |
18 |
19 | );
20 | };
21 |
22 | export default Pedalboard;
23 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Pedalboard/index.js:
--------------------------------------------------------------------------------
1 | import Pedalboard from './Pedalboard';
2 | export default Pedalboard;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbCode/ReverbCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const ReverbCode = () => {
6 | const code =
7 | '...\n\nconst convolverNode = audioContext.createConvolver();\n\nfetch(\'path/to/impulse-response-file\', {\n method: \'get\'\n})\n.then(response => response.arrayBuffer())\n.then(buffer => {\n audioContext.decodeAudioData(buffer, buffer => {\n convolverNode.buffer = buffer;\n });\n});\n\n...';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default ReverbCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbCode/index.js:
--------------------------------------------------------------------------------
1 | import ReverbCode from './ReverbCode';
2 | export default ReverbCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbPreview/ReverbPreview.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import { Reverb } from 'audio-effects';
3 | import Slide from '../../../components/Slide';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Sound from '../../../components/Sound';
6 | import irf from '../../../../sound/hall-reverb.ogg';
7 |
8 | const ReverbPreview = () => {
9 | const audioContext = new AudioContext();
10 | const oscillator = audioContext.createOscillator();
11 | const oscillator2 = audioContext.createOscillator();
12 | const gain = audioContext.createGain();
13 | const gain2 = audioContext.createGain();
14 | const reverb = new Reverb(audioContext);
15 |
16 | Reverb.getInputResponseFile(irf).then(buffer => {
17 | reverb.buffer = buffer;
18 | });
19 |
20 | oscillator.frequency.value = 100;
21 | oscillator.type = 'sawtooth';
22 | oscillator.connect(gain);
23 | gain.connect(audioContext.destination);
24 |
25 | oscillator2.frequency.value = 100;
26 | oscillator2.type = 'sawtooth';
27 | oscillator2.connect(reverb.node);
28 | reverb.connect(gain2);
29 | gain2.connect(audioContext.destination);
30 |
31 | const play1 = () => {
32 | oscillator.start();
33 |
34 | window.setTimeout(() => {
35 | oscillator.stop();
36 | }, 400);
37 | };
38 |
39 | const play2 = () => {
40 | oscillator2.start();
41 |
42 | window.setTimeout(() => {
43 | oscillator2.stop();
44 | }, 400);
45 | };
46 |
47 | return (
48 |
49 | Reverb
50 |
51 |
52 |
53 |
54 |
55 | );
56 | };
57 |
58 | export default ReverbPreview;
59 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbPreview/index.js:
--------------------------------------------------------------------------------
1 | import ReverbPreview from './ReverbPreview';
2 | export default ReverbPreview;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbSchema/ReverbSchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/reverb.svg';
6 |
7 | const ReverbSchema = () => {
8 | return (
9 |
10 | Reverb
11 |
12 |
13 | );
14 | };
15 |
16 | export default ReverbSchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/ReverbSchema/index.js:
--------------------------------------------------------------------------------
1 | import ReverbSchema from './ReverbSchema';
2 | export default ReverbSchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Volume/Volume.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Wave from '../../../components/Wave';
5 | import Sound from '../../../components/Sound';
6 |
7 | const Intro = () => {
8 | const audioContext = new AudioContext();
9 | const oscillator = audioContext.createOscillator();
10 | const gain = audioContext.createGain();
11 |
12 | oscillator.frequency.value = 2000;
13 | oscillator.start();
14 |
15 | oscillator.connect(gain);
16 |
17 | const toggleVolume = () => {
18 | if (gain.gain.value === 1) {
19 | gain.gain.value = 0.2;
20 | } else {
21 | gain.gain.value = 1;
22 | }
23 | };
24 |
25 | return (
26 |
27 | Volume
28 |
34 |
35 | );
36 | };
37 |
38 | export default Intro;
39 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/Volume/index.js:
--------------------------------------------------------------------------------
1 | import Volume from './Volume';
2 | export default Volume;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/VolumeCode/VolumeCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const VolumeCode = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\nconst oscillator = audioContext.createOscillator();\nconst gain = audioContext.createGain();\n\ngain.gain.value = 0.5; // Value from 0 to 1\n\noscillator.connect(gain);\ngain.connect(audioContext.destination);';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default VolumeCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/VolumeCode/index.js:
--------------------------------------------------------------------------------
1 | import VolumeCode from './VolumeCode';
2 | export default VolumeCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/VolumeSchema/VolumeSchema.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 | import Icon from '../../../components/Icon';
5 | import Schema from '../../../../images/volume.svg';
6 |
7 | const VolumeSchema = () => {
8 | return (
9 |
10 | Volume
11 |
12 |
13 | );
14 | };
15 |
16 | export default VolumeSchema;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Effects/VolumeSchema/index.js:
--------------------------------------------------------------------------------
1 | import VolumeSchema from './VolumeSchema';
2 | export default VolumeSchema;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Demo/Demo.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Demo = () => {
6 | return (
7 |
8 |
9 |
14 | pedalboard.sambego.be
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Demo;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Demo/index.js:
--------------------------------------------------------------------------------
1 | import Demo from './Demo';
2 | export default Demo;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Fun/Fun.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Image from '../../../components/Image';
4 | import Remote from '../../../../images/remote.png';
5 |
6 | const Fun = () => {
7 | return (
8 |
9 |
17 |
18 | );
19 | };
20 |
21 | export default Fun;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Fun/index.js:
--------------------------------------------------------------------------------
1 | import Fun from './Fun';
2 | export default Fun;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Intro/Intro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Columns from '../../../components/Columns';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Image from '../../../components/Image';
6 | import Guitar from '../../../../images/guitar.jpg';
7 |
8 | const Intro = () => {
9 | return (
10 |
11 |
12 |
13 | Live audio?
14 |
15 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Intro;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Intro/index.js:
--------------------------------------------------------------------------------
1 | import Intro from './Intro';
2 | export default Intro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Remote/Remote.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const Remote = () => {
6 | return (
7 |
8 |
9 |
14 | pedalboard-remote.sambego.be
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default Remote;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Fun/Remote/index.js:
--------------------------------------------------------------------------------
1 | import Remote from './Remote';
2 | export default Remote;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Links/Links.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import List from '../../components/List';
4 |
5 | const Thanks = () => {
6 | return (
7 |
8 |
9 |
10 |
15 | https://github.com/sambego/audio-effects
16 |
17 |
18 |
19 |
24 | https://github.com/sambego/frequency-calculator
25 |
26 |
27 |
28 |
33 | https://github.com/sambego/oscilloscope.js
34 |
35 |
36 |
37 |
42 | https://pedalboard.sambego.be
43 |
44 |
45 |
46 |
47 | );
48 | };
49 |
50 | export default Thanks;
51 |
--------------------------------------------------------------------------------
/src/js/slides/Links/index.js:
--------------------------------------------------------------------------------
1 | import Links from './Links';
2 | export default Links;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiCode/MidiCode.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const MidiCode = () => {
6 | const code =
7 | 'navigator.requestMIDIAccess().then(midi => {\n const inputs = midi.inputs.values(),\n devices = [],\n i;\n\n for (i = inputs.next(); i && !i.done; i = inputs.next()) {\n devices.push(i.value);\n }\n\n devices[0].onmidimessage = message => {\n // Incomming message from the first midi-device\n };\n});';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default MidiCode;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiCode/index.js:
--------------------------------------------------------------------------------
1 | import MidiCode from './MidiCode';
2 | export default MidiCode;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiCodeSend/MidiCodeSend.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const MidiCodeSend = () => {
6 | const code =
7 | 'navigator.requestMIDIAccess().then(midi => {\n // Note on, middle C, full velocity\n const noteOnMessage = [0x90, 60, 0x7f];\n // Note off, middle C\n const noteOffMessage = [0x80, 60, 0x40];\n // Assume we know the port ID\n const output = midiAccess.outputs.get(portID);\n\n output.send(noteOnMessage);\n output.send(noteOffMessage, window.performance.now() + 1000);\n});';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default MidiCodeSend;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiCodeSend/index.js:
--------------------------------------------------------------------------------
1 | import MidiCodeSend from './MidiCodeSend';
2 | export default MidiCodeSend;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiController/MidiController.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Image from '../../../components/Image';
4 | import controller from '../../../../images/midi-contoller.jpg';
5 |
6 | const MidiController = () => {
7 | return (
8 |
9 |
18 |
19 | );
20 | };
21 |
22 | export default MidiController;
23 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiController/index.js:
--------------------------------------------------------------------------------
1 | import MidiController from './MidiController';
2 | export default MidiController;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiIntro/MidiIntro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Subtitle from '../../../components/Subtitle';
4 |
5 | const MidiIntro = () => {
6 | return (
7 |
8 |
9 | What if we could control everything with hardware?
10 |
11 |
12 | );
13 | };
14 |
15 | export default MidiIntro;
16 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiIntro/index.js:
--------------------------------------------------------------------------------
1 | import MidiIntro from './MidiIntro';
2 | export default MidiIntro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiTest/MidiTest.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Text from '../../../components/Text';
4 |
5 | const MidiTest = () => {
6 | return (
7 |
8 |
9 |
14 | Let's try it out!
15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default MidiTest;
22 |
--------------------------------------------------------------------------------
/src/js/slides/Midi/MidiTest/index.js:
--------------------------------------------------------------------------------
1 | import MidiTest from './MidiTest';
2 | export default MidiTest;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Buffer/Buffer.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const Buffer = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\n...\n.then(audioBuffer => {\n // Create a buffer source node from the audioBuffer we loaded\n const bufferSource = audioContext.createBufferSource(audioBuffer);\n\n // Connect the buffer source node to the speakers\n bufferSource.connect(audioContext.destination);\n\n // Start the audio\n bufferSource.start(0);\n});';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default Buffer;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Buffer/index.js:
--------------------------------------------------------------------------------
1 | import Buffer from './Buffer';
2 | export default Buffer;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Fetch/Fetch.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const Fetch = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\n\nfetch(\'url/to/next/big/hit.mp3\', {\n method: \'get\',\n})\n.then(response => response.arrayBuffer())\n.then(buffer => audioContext.decodeAudioData(buffer));\n.then(audioBuffer => ... );// Now we have an audio buffer';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default Fetch;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Fetch/index.js:
--------------------------------------------------------------------------------
1 | import Fetch from './Fetch';
2 | export default Fetch;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Input/Input.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const Input = () => {
6 | const code =
7 | 'const audioContext = new AudioContext();\n\nnavigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {\n const mediaStreamSource = audioContext.createMediaStreamSource(stream);\n\n mediaStreamSource.connect(audioContext.destination);\n});';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default Input;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Input/index.js:
--------------------------------------------------------------------------------
1 | import Input from './Input';
2 | export default Input;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Intro/Intro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Columns from '../../../components/Columns';
4 | import Subtitle from '../../../components/Subtitle';
5 | import Image from '../../../components/Image';
6 | import Play from '../../../../images/play.jpg';
7 |
8 | const Intro = () => {
9 | return (
10 |
11 |
12 |
13 | Play Sounds
14 |
15 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default Intro;
29 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Intro/index.js:
--------------------------------------------------------------------------------
1 | import Intro from './Intro';
2 | export default Intro;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Tag/Tag.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../../components/Slide';
3 | import Code from '../../../components/Code';
4 |
5 | const Tag = () => {
6 | const code =
7 | '';
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | export default Tag;
17 |
--------------------------------------------------------------------------------
/src/js/slides/Play/Tag/index.js:
--------------------------------------------------------------------------------
1 | import Tag from './Tag';
2 | export default Tag;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Summary/Summary.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import List from '../../components/List';
4 |
5 | const Summary = () => {
6 | return (
7 |
8 |
9 |
10 | Play sounds
11 |
12 |
13 | Create sounds
14 |
15 |
16 | Compose melodies and rhytms
17 |
18 |
19 | Add effects
20 |
21 |
22 | Live audio
23 |
24 |
25 |
26 | );
27 | };
28 |
29 | export default Summary;
30 |
--------------------------------------------------------------------------------
/src/js/slides/Summary/index.js:
--------------------------------------------------------------------------------
1 | import Summary from './Summary';
2 | export default Summary;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Thanks/Thanks.js:
--------------------------------------------------------------------------------
1 | import { h, render } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Subtitle from '../../components/Subtitle';
4 | import List from '../../components/List';
5 |
6 | const Thanks = () => {
7 | return (
8 |
9 | Thank you!
10 |
11 |
12 |
17 | https://audio.sambego.be
18 |
19 |
20 | @sambego
21 |
22 |
23 | );
24 | };
25 |
26 | export default Thanks;
27 |
--------------------------------------------------------------------------------
/src/js/slides/Thanks/index.js:
--------------------------------------------------------------------------------
1 | import Thanks from './Thanks';
2 | export default Thanks;
3 |
--------------------------------------------------------------------------------
/src/js/slides/Title/ConfIntro.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Columns from '../../components/Columns';
4 | import Image from '../../components/Image';
5 | import Subtitle from '../../components/Subtitle';
6 | import List from '../../components/List';
7 | import Conf from '../../../images/conf.jpg';
8 |
9 | const ConfIntro = () => {
10 | return (
11 |
12 |
21 |
22 | );
23 | };
24 |
25 | export default ConfIntro;
26 |
--------------------------------------------------------------------------------
/src/js/slides/Title/Title.js:
--------------------------------------------------------------------------------
1 | import { h, render, cloneElement } from 'preact';
2 | import Slide from '../../components/Slide';
3 | import Title from '../../components/Title';
4 | import Volume from '../../components/Volume';
5 |
6 | const TitleSlide = () => {
7 | return (
8 |
9 | Web Audio
10 |
11 |
12 | );
13 | };
14 |
15 | export default TitleSlide;
16 |
--------------------------------------------------------------------------------
/src/js/slides/Title/index.js:
--------------------------------------------------------------------------------
1 | import Title from './Title';
2 | export default Title;
3 |
--------------------------------------------------------------------------------
/src/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Web Audio",
3 | "name": "A deep dive into the web-audio API.",
4 | "icons": [
5 | {
6 | "src": "/android-icon-36x36.png",
7 | "sizes": "36x36",
8 | "type": "image/png",
9 | "density": "0.75"
10 | },
11 | {
12 | "src": "/android-icon-48x48.png",
13 | "sizes": "48x48",
14 | "type": "image/png",
15 | "density": "1.0"
16 | },
17 | {
18 | "src": "/android-icon-72x72.png",
19 | "sizes": "72x72",
20 | "type": "image/png",
21 | "density": "1.5"
22 | },
23 | {
24 | "src": "/android-icon-96x96.png",
25 | "sizes": "96x96",
26 | "type": "image/png",
27 | "density": "2.0"
28 | },
29 | {
30 | "src": "/android-icon-144x144.png",
31 | "sizes": "144x144",
32 | "type": "image/png",
33 | "density": "3.0"
34 | },
35 | {
36 | "src": "/android-icon-192x192.png",
37 | "sizes": "192x192",
38 | "type": "image/png",
39 | "density": "4.0"
40 | }
41 | ],
42 | "start_url": "/",
43 | "display": "standalone",
44 | "background_color": "#ffffff",
45 | "theme_color": "#5FB3B3",
46 | "gcm_sender_id": "103953800507"
47 | }
48 |
--------------------------------------------------------------------------------
/src/scss/_colors.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Colors
3 | */
4 |
5 | $green: #5fb3b3;
6 |
--------------------------------------------------------------------------------
/src/scss/_font.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Custom google font
3 | */
4 |
5 | /* montserrat-regular - latin */
6 | @font-face {
7 | font-family: 'Montserrat';
8 | font-style: normal;
9 | font-weight: 400;
10 | src: local('Montserrat Regular'), local('Montserrat-Regular'),
11 | url('../fonts/montserrat/montserrat-v10-latin-regular.woff2')
12 | format('woff2'),
13 | url('../fonts/montserrat/montserrat-v10-latin-regular.woff')
14 | format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
15 | }
16 |
17 | /* montserrat-italic - latin */
18 | @font-face {
19 | font-family: 'Montserrat';
20 | font-style: italic;
21 | font-weight: 400;
22 | src: local('Montserrat Italic'), local('Montserrat-Italic'),
23 | url('../fonts/montserrat/montserrat-v10-latin-italic.woff2')
24 | format('woff2'),
25 | url('../fonts/montserrat/montserrat-v10-latin-italic.woff')
26 | format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
27 | }
28 |
29 | /* montserrat-700 - latin */
30 | @font-face {
31 | font-family: 'Montserrat';
32 | font-style: normal;
33 | font-weight: 700;
34 | src: local('Montserrat Bold'), local('Montserrat-Bold'),
35 | url('../fonts/montserrat/montserrat-v10-latin-700.woff2')
36 | format('woff2'),
37 | url('../fonts/montserrat/montserrat-v10-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
38 | }
39 |
--------------------------------------------------------------------------------
/src/scss/_normalize.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Enable box-sizing: border-box by default.
3 | */
4 | * {
5 | box-sizing: border-box;
6 | }
7 |
8 | /**
9 | * Set the html font-size to 10px, this makes the calculation of REM values
10 | * easier.
11 | * Set the default font-family;
12 | */
13 | html {
14 | font-size: 10px;
15 | height: 100%;
16 |
17 | font-family: 'montserrat', Helvetica, Arial, sans-serif;
18 | color: #1b2b34;
19 | }
20 |
21 | /**
22 | * Reset the body font-size to a default 1.6rem (16px).
23 | */
24 | body {
25 | padding: 0;
26 | margin: 0;
27 | height: 100%;
28 |
29 | font-size: 1.6rem;
30 | }
31 |
32 | /**
33 | * Hide the scrollbar
34 | */
35 | ::-webkit-scrollbar {
36 | display: none;
37 | }
38 |
39 | /**
40 | * Pre tag
41 | */
42 | pre {
43 | display: inline;
44 | padding: 0.5rem;
45 |
46 | background: rgba(#5fb3b3, 0.6);
47 |
48 | border-radius: 0.5rem;
49 | }
50 |
51 | a {
52 | box-shadow: 0px 1px 0 0 #000000;
53 |
54 | color: #1b2b34;
55 | text-decoration: none;
56 | }
57 |
--------------------------------------------------------------------------------
/src/scss/styles.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Use this file to import other styles
3 | */
4 |
5 | @import 'font';
6 | @import 'normalize';
7 |
--------------------------------------------------------------------------------
/src/sound/hall-reverb.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Sambego/deep-dive/2fc52a7bb35e196681189d1f47dbc08b9ceee0fe/src/sound/hall-reverb.ogg
--------------------------------------------------------------------------------
/webpack.config.babel.js:
--------------------------------------------------------------------------------
1 | import webpack from 'webpack';
2 | import path from 'path';
3 | import fs from 'fs';
4 | import DotenvPlugin from 'webpack-dotenv-plugin';
5 | import ExtractTextPlugin from 'extract-text-webpack-plugin';
6 | import HtmlWebpackPlugin from 'html-webpack-plugin';
7 | import CopyWebpackPlugin from 'copy-webpack-plugin';
8 |
9 | const createConfig = (env = 'development') => {
10 | return {
11 | entry: {
12 | script: './src/js/index.js',
13 | },
14 | output: {
15 | path: path.resolve(__dirname, 'dist'),
16 | filename: '[name].[hash].js',
17 | },
18 | module: {
19 | rules: [
20 | {
21 | test: /\.js$/,
22 | exclude: /node_modules/,
23 | use: ['babel-loader', 'eslint-loader'],
24 | },
25 | {
26 | test: /\.scss$/,
27 | exclude: /node_modules/,
28 | use: ExtractTextPlugin.extract({
29 | fallback: ['style-loader'],
30 | use: [
31 | 'css-loader?modules&importLoaders=0&localIdentName=[name]__[local]___[hash:base64:5]',
32 | 'postcss-loader',
33 | 'sass-loader',
34 | ],
35 | }),
36 | },
37 | {
38 | test: /\.css$/,
39 | use: ExtractTextPlugin.extract({
40 | fallback: ['style-loader'],
41 | use: ['css-loader'],
42 | }),
43 | },
44 | {
45 | test: /\.(png|jpg|woff|woff2|ogg)$/,
46 | use: 'file-loader?name=[name].[ext]',
47 | },
48 | {
49 | test: /\.(xml|html|txt|md)$/,
50 | use: 'raw-loader',
51 | },
52 | {
53 | test: /\.svg$/,
54 | use: 'svg-inline-loader',
55 | },
56 | ],
57 | },
58 | devtool: 'source-map',
59 | plugins: [
60 | new DotenvPlugin({
61 | sample: './.env.example',
62 | path: './.env',
63 | }),
64 | new webpack.LoaderOptionsPlugin({
65 | minimize: true,
66 | debug: false,
67 | }),
68 | new ExtractTextPlugin({
69 | filename: '[name].[contenthash].css',
70 | allChunks: true,
71 | disable: env !== 'production',
72 | }),
73 | new HtmlWebpackPlugin({
74 | template: './src/index.html',
75 | }),
76 | new CopyWebpackPlugin([
77 | {
78 | context: './src/favicon/',
79 | from: '**/*',
80 | },
81 | {
82 | from: './src/manifest.json',
83 | },
84 | {
85 | from: './src/browserconfig.xml',
86 | },
87 | {
88 | from: "./_redirects"
89 | },
90 | ]),
91 | ],
92 | devServer: {
93 | port: process.env.PORT || 1337,
94 | host: '127.0.0.1',
95 | publicPath: '/',
96 | contentBase: './src',
97 | historyApiFallback: true,
98 | https: false,
99 | },
100 | };
101 | };
102 |
103 | module.exports = createConfig;
104 |
--------------------------------------------------------------------------------