Skip to content

Commit b99e134

Browse files
author
rohsa
committed
Add equalizer feature
1 parent beea391 commit b99e134

11 files changed

+1178
-156
lines changed

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ to share around the internet. Although it was designed for
1111
the code here can be used freely by anyone, with no restrictions.
1212
There are now many instances, including
1313
[Banbeucmas](https://banbeu.com/graph/tool/),
14-
[HypetheSonics](https://www.hypethesonics.com/iemdbc/), and
14+
[HypetheSonics](https://www.hypethesonics.com/iemdbc/),
15+
[Rohsa](https://rohsa.gitlab.io/graphtool/), and
1516
[Super\* Review](https://squig.link/), which has links to even more of
1617
them. If you're interested in using it for your own graphs, see
1718
[Configuring.md](Configuring.md) and ask me about any questions that

Diff for: config.js

+17-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Configuration options
22
const init_phones = ["HTH67"], // Optional. Which graphs to display on initial load. Note: Share URLs will override this set
33
DIR = "data/", // Directory where graph files are stored
4-
data_format = "AudioTools", // Accepts "AudioTools," "REW," or "other"
54
default_channels = ["L","R"], // Which channels to display. Avoid javascript errors if loading just one channel per phone
65
default_normalization = "dB", // Sets default graph normalization mode. Accepts "dB" or "Hz"
76
default_norm_db = 60, // Sets default dB normalization point
@@ -28,8 +27,14 @@ const init_phones = ["HTH67"], // Optional. Which graphs to
2827
targetDashed = false, // If true, makes target curves dashed lines
2928
targetColorCustom = false, // If false, targets appear as a random gray value. Can replace with a fixed color value to make all targets the specified color, e.g. "black"
3029
labelsPosition = "default", // Up to four labels will be grouped in a specified corner. Accepts "top-left," bottom-left," "bottom-right," and "default"
31-
stickyLabels = false, // "Sticky" labels
32-
analyticsEnabled = false; // Enables Google Analytics 4 measurement of site usage
30+
stickyLabels = true, // "Sticky" labels
31+
analyticsEnabled = false, // Enables Google Analytics 4 measurement of site usage
32+
extraEnabled = true, // Enable extra features
33+
extraUploadEnabled = true, // Enable upload function
34+
extraEQEnabled = true, // Enable parametic eq function
35+
extraEQBands = 10, // Default EQ bands available
36+
extraEQBandsMax = 20, // Max EQ bands available
37+
extraToneGeneratorEnabled = true; // Enable tone generator function
3338

3439
// Specify which targets to display
3540
const targets = [
@@ -64,26 +69,13 @@ function watermark(svg) {
6469

6570

6671

67-
// Set up tsvParse (?) with default values for AudioTools and REW measurements
68-
function initTsvParse() {
69-
if ( data_format.toLowerCase() === "audiotools" ) {
70-
var dataStart = 3,
71-
dataEnd = 482;
72-
} else if ( data_format.toLowerCase() === "rew" ) {
73-
var dataStart = 14,
74-
dataEnd = 493;
75-
} else {
76-
// If exporting data from something other than AudioTools or REW, edit these vals to indicate on which lines of your text files the measurements data begins and ends
77-
var dataStart = 2,
78-
dataEnd = 482;
79-
}
80-
81-
tsvParse = fr => d3.tsvParseRows(fr).slice(dataStart,dataEnd)
82-
.map(r=>r.map(d=>+d));
72+
// Parse fr text data from REW or AudioTool format with whatever separator
73+
function tsvParse(fr) {
74+
return fr.split(/[\r\n]/)
75+
.map(l => l.trim()).filter(l => l && l[0] !== '*')
76+
.map(l => l.split(/[\s,]+/).map(e => parseFloat(e)).slice(0, 2))
77+
.filter(t => !isNaN(t[0]) && !isNaN(t[1]));
8378
}
84-
initTsvParse();
85-
86-
8779

8880
// Apply stylesheet based layout options above
8981
function setLayout() {
@@ -242,7 +234,8 @@ setupGraphAnalytics();
242234

243235

244236
// If alt_header is enabled, these are the items added to the header
245-
let headerLogoImgUrl = "cringraph-logo.svg",
237+
let headerLogoText = null,
238+
headerLogoImgUrl = "cringraph-logo.svg",
246239
headerLinks = [
247240
{
248241
name: "Sample",
@@ -287,4 +280,4 @@ let tutorialDefinitions = [
287280
width: '10%',
288281
description: 'Lorem ipsum.'
289282
}
290-
]
283+
]

Diff for: config_hp.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
const DIR = "data_hp/";
2-
// Get data (as a list of [x,y] pairs) from an FR file
3-
const tsvParse = fr => d3.tsvParseRows(fr).slice(2,482)
4-
.map(r=>r.map(d=>+d));
52

63
// Add a watermark to the graph.
74
function watermark(svg) {
@@ -23,7 +20,7 @@ const scale_smoothing = 0.2;
2320

2421
const targets = [
2522
{ type:"Neutral" , files:["IEF Neutral"] },
26-
{ type:"Preference", files:['IEF "Harman"'] }
23+
{ type:"Preference", files:["IEF Harman"] }
2724
];
2825

2926
// const init_phones = [ "HD650", "IEF Neutral Target" ];
File renamed without changes.

0 commit comments

Comments
 (0)