Skip to content

Add equalizer feature #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ to share around the internet. Although it was designed for
the code here can be used freely by anyone, with no restrictions.
There are now many instances, including
[Banbeucmas](https://banbeu.com/graph/tool/),
[HypetheSonics](https://www.hypethesonics.com/iemdbc/), and
[HypetheSonics](https://www.hypethesonics.com/iemdbc/),
[Rohsa](https://rohsa.gitlab.io/graphtool/), and
[Super\* Review](https://squig.link/), which has links to even more of
them. If you're interested in using it for your own graphs, see
[Configuring.md](Configuring.md) and ask me about any questions that
Expand Down
41 changes: 17 additions & 24 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Configuration options
const init_phones = ["HTH67"], // Optional. Which graphs to display on initial load. Note: Share URLs will override this set
DIR = "data/", // Directory where graph files are stored
data_format = "AudioTools", // Accepts "AudioTools," "REW," or "other"
default_channels = ["L","R"], // Which channels to display. Avoid javascript errors if loading just one channel per phone
default_normalization = "dB", // Sets default graph normalization mode. Accepts "dB" or "Hz"
default_norm_db = 60, // Sets default dB normalization point
Expand All @@ -28,8 +27,14 @@ const init_phones = ["HTH67"], // Optional. Which graphs to
targetDashed = false, // If true, makes target curves dashed lines
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"
labelsPosition = "default", // Up to four labels will be grouped in a specified corner. Accepts "top-left," bottom-left," "bottom-right," and "default"
stickyLabels = false, // "Sticky" labels
analyticsEnabled = false; // Enables Google Analytics 4 measurement of site usage
stickyLabels = true, // "Sticky" labels
analyticsEnabled = false, // Enables Google Analytics 4 measurement of site usage
extraEnabled = true, // Enable extra features
extraUploadEnabled = true, // Enable upload function
extraEQEnabled = true, // Enable parametic eq function
extraEQBands = 10, // Default EQ bands available
extraEQBandsMax = 20, // Max EQ bands available
extraToneGeneratorEnabled = true; // Enable tone generator function

// Specify which targets to display
const targets = [
Expand Down Expand Up @@ -64,26 +69,13 @@ function watermark(svg) {



// Set up tsvParse (?) with default values for AudioTools and REW measurements
function initTsvParse() {
if ( data_format.toLowerCase() === "audiotools" ) {
var dataStart = 3,
dataEnd = 482;
} else if ( data_format.toLowerCase() === "rew" ) {
var dataStart = 14,
dataEnd = 493;
} else {
// 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
var dataStart = 2,
dataEnd = 482;
}

tsvParse = fr => d3.tsvParseRows(fr).slice(dataStart,dataEnd)
.map(r=>r.map(d=>+d));
// Parse fr text data from REW or AudioTool format with whatever separator
function tsvParse(fr) {
return fr.split(/[\r\n]/)
.map(l => l.trim()).filter(l => l && l[0] !== '*')
.map(l => l.split(/[\s,;]+/).map(e => parseFloat(e)).slice(0, 2))
.filter(t => !isNaN(t[0]) && !isNaN(t[1]));
}
initTsvParse();



// Apply stylesheet based layout options above
function setLayout() {
Expand Down Expand Up @@ -242,7 +234,8 @@ setupGraphAnalytics();


// If alt_header is enabled, these are the items added to the header
let headerLogoImgUrl = "cringraph-logo.svg",
let headerLogoText = null,
headerLogoImgUrl = "cringraph-logo.svg",
headerLinks = [
{
name: "Sample",
Expand Down Expand Up @@ -287,4 +280,4 @@ let tutorialDefinitions = [
width: '10%',
description: 'Lorem ipsum.'
}
]
]
5 changes: 1 addition & 4 deletions config_hp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const DIR = "data_hp/";
// Get data (as a list of [x,y] pairs) from an FR file
const tsvParse = fr => d3.tsvParseRows(fr).slice(2,482)
.map(r=>r.map(d=>+d));

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

const targets = [
{ type:"Neutral" , files:["IEF Neutral"] },
{ type:"Preference", files:['IEF "Harman"'] }
{ type:"Preference", files:["IEF Harman"] }
];

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