Skip to content

Commit

Permalink
Version 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hvianna committed May 3, 2021
2 parents 057ee6f + cb71722 commit 48bfbb3
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 98 deletions.
4 changes: 4 additions & 0 deletions .well-known/brave-rewards-verification.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a Brave Rewards publisher verification file.

Domain: audiomotion.dev
Token: a91d5cb66865661e9009a87d50ddab91363600ce53d32ecceccfe62af9c6a57a
11 changes: 11 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
=========

## version 3.3.0 (2021-05-03)

### Added: {docsify-ignore}

+ New horizontal mirroring effect; see [`mirror`](README.md#mirror-number) property - thanks [@lexterror](https://github.com/lexterror) for suggesting this feature.

### Improvements: {docsify-ignore}

+ `colorStops` type definition updated for improved compatibility ([see #17](https://github.com/hvianna/audioMotion-analyzer/pull/17)) - props to [@Staijn1](https://github.com/Staijn1).


## version 3.2.1 (2021-04-03)

+ Fixes an undefined property error.
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ I originally wrote it as part of my [**audioMotion**](https://audiomotion.me) mu
+ High-resolution real-time dual channel audio spectrum analyzer
+ Logarithmic frequency scale with customizable range
+ Visualize discrete frequencies or octave bands based on the equal tempered scale
+ Optional effects: vintage LEDs, luminance bars, customizable reflection, radial visualization
+ Customizable Web Audio API parameters: FFT size, sensitivity and time-smoothing constant
+ Optional effects: vintage LEDs, luminance bars, mirroring and reflection, radial visualization
+ Customizable sensitivity, FFT size and time-smoothing constant
+ Comes with 3 predefined color gradients - easily add your own!
+ Fullscreen support, ready for retina / HiDPI displays
+ Zero-dependency native ES6+ module (ESM), less than 20kB minified
Expand Down Expand Up @@ -105,6 +105,7 @@ options = {<br>
&emsp;&emsp;[maxFreq](#maxfreq-number): **22000**,<br>
&emsp;&emsp;[minDecibels](#mindecibels-number): **-85**,<br>
&emsp;&emsp;[minFreq](#minfreq-number): **20**,<br>
&emsp;&emsp;[mirror](#mirror-number): **0**,<br>
&emsp;&emsp;[mode](#mode-number): **0**,<br>
&emsp;&emsp;[onCanvasDraw](#oncanvasdraw-function): *undefined*,<br>
&emsp;&emsp;[onCanvasResize](#oncanvasresize-function): *undefined*,<br>
Expand Down Expand Up @@ -388,6 +389,22 @@ The maximum practical value is half the sampling rate ([`audioCtx.sampleRate`](#

It is preferable to use the [`setFreqRange()`](#setfreqrange-minfreq-maxfreq-) method and set both values at once, to prevent `minFreq` being higher than the current `maxFreq` or vice-versa at a given moment.

### `mirror` *number*

*Available since v3.3.0*

Horizontal mirroring effect. Valid values are:

mirror | Effect
:-----:|--------
-1 | Mirrors the analyzer to the left (low frequencies at the center of screen)
0 | Disables mirror effect (default)
1 | Mirrors the analyzer to the right (high frequencies at the center of screen)

**Note:** when [`radial`](#radial-boolean) is **_true_**, both `1` and `-1` will produce the same effect.

Defaults to **0**.

### `mode` *number*

Current visualization mode.
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: [".well-known"]
13 changes: 10 additions & 3 deletions demo/fluid.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="styles.css" rel="stylesheet">
</head>

<body>
<body class="wide">
<header>
<h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | fluid layout demo</h1>
<ul class="header-nav">
Expand Down Expand Up @@ -80,6 +80,8 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | fl
<option value="40">40</option>
<option value="60">60</option>
<option value="100">100</option>
<option value="500">500</option>
<option value="1000">1000</option>
</select>
</label>

Expand Down Expand Up @@ -137,7 +139,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | fl
<fieldset>
<legend>mode 10 only</legend>
<label class="label">lineWidth
<input type="range" min="0" max="9" step="1" data-setting="lineWidth">
<input type="range" min="0" max="5" step="1" data-setting="lineWidth">
<div class="value"></div>
</label>

Expand All @@ -158,7 +160,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | fl
</fieldset>

<fieldset>
<legend>Reflex effect</legend>
<legend>Reflex & Mirror</legend>
<label class="label">reflexRatio
<input type="range" min="0" max=".9" step=".1" data-setting="reflexRatio">
<div class="value"></div>
Expand All @@ -175,6 +177,11 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | fl
</label>

<button data-prop="reflexFit">reflexFit</button>

<label class="label">mirror
<input type="range" min="-1" max="1" step="1" data-setting="mirror">
<div class="value"></div>
</label>
</fieldset>

<fieldset>
Expand Down
17 changes: 17 additions & 0 deletions demo/fluid.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const presets = [
fillAlpha: .6,
gradient: 'rainbow',
lineWidth: 2,
mirror: -1,
radial: false,
reflexAlpha: 1,
reflexBright: 1,
Expand Down Expand Up @@ -74,6 +75,22 @@ const presets = [
showPeaks: true,
overlay: false
}
},
{
name: 'Testing config 1',
options: {
mode: 10,
gradient: 'rainbow',
reflexRatio: .4,
showBgColor: true,
showPeaks: true,
showScaleX: false,
mirror: -1,
maxFreq: 8000,
overlay: true,
lineWidth: 2,
fillAlpha: .2
}
}
];

Expand Down
9 changes: 7 additions & 2 deletions demo/multi.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | mu
<fieldset>
<legend>mode 10 only</legend>
<label class="label">lineWidth
<input type="range" id="line_width" min="0" max="9" step="1" data-setting="lineWidth">
<input type="range" id="line_width" min="0" max="5" step="1" data-setting="lineWidth">
<div class="value"></div>
</label>

Expand All @@ -149,7 +149,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | mu
</fieldset>

<fieldset>
<legend>Reflex effect</legend>
<legend>Reflex & Mirror</legend>
<label class="label">reflexRatio
<input type="range" min="0" max=".9" step=".1" data-setting="reflexRatio">
<div class="value"></div>
Expand All @@ -166,6 +166,11 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | mu
</label>

<button data-prop="reflexFit">reflexFit</button>

<label class="label">mirror
<input type="range" min="-1" max="1" step="1" data-setting="mirror">
<div class="value"></div>
</label>
</fieldset>
</div>

Expand Down
11 changes: 8 additions & 3 deletions demo/overlay.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link href="styles.css" rel="stylesheet">
</head>

<body>
<body class="wide">
<header>
<h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | overlay demo</h1>
<ul class="header-nav">
Expand Down Expand Up @@ -128,7 +128,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | ov
<fieldset>
<legend>mode 10 only</legend>
<label class="label">lineWidth
<input type="range" id="line_width" min="0" max="9" step="1" data-setting="lineWidth">
<input type="range" id="line_width" min="0" max="5" step="1" data-setting="lineWidth">
<div class="value"></div>
</label>

Expand All @@ -149,7 +149,7 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | ov
</fieldset>

<fieldset>
<legend>Reflex effect</legend>
<legend>Reflex & Mirror</legend>
<label class="label">reflexRatio
<input type="range" min="0" max=".9" step=".1" data-setting="reflexRatio">
<div class="value"></div>
Expand All @@ -166,6 +166,11 @@ <h1><a href="https://audiomotion.dev" class="logo">audioMotion-analyzer</a> | ov
</label>

<button data-prop="reflexFit">reflexFit</button>

<label class="label">mirror
<input type="range" min="-1" max="1" step="1" data-setting="mirror">
<div class="value"></div>
</label>
</fieldset>

<fieldset>
Expand Down
5 changes: 4 additions & 1 deletion demo/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ body {
max-width: 100%;
width: 1000px;
}
body.wide {
width: 1200px;
}

a {
color: #b5c6d0;
Expand Down Expand Up @@ -235,7 +238,7 @@ ul {

/* overlay */
#container.overlay {
height: 563px;
height: 675px;
margin: 0 auto;
position: relative;
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "audiomotion-analyzer",
"description": "High-resolution real-time graphic audio spectrum analyzer JavaScript module with no dependencies.",
"version": "3.2.1",
"version": "3.3.0",
"main": "./src/audioMotion-analyzer.js",
"module": "./src/audioMotion-analyzer.js",
"types": "./src/index.d.ts",
Expand Down
Loading

0 comments on commit 48bfbb3

Please sign in to comment.