CrinGraph

CrinGraph on your own site

This guide explains the steps required to make CrinGraph display your own FR graphs, for example if by some remarkable circumstance you have managed to measure IEMs not yet on crinacle.com. If you have any trouble with setting CrinGraph, or any questions about the tool, just ask me! Use Github or the email in my profile.

There are two other steps to show people FR graphs that I may not be able to help with:

Checklist

These are the things you definitely need to change to make sure your page works and isn’t claiming it’s crinacle.com.

Configuring CrinGraph

The main page used to display graphs is graph.html, which defines the basic structure of a page and then includes a bunch of Javascript files that do the real work (at the end of the file). graph_free.html is identical but uses a different configuration file to remove some functionality. You will only need to use it if you intend to have both a free and a paid graph tool.

Ideally all configuration can be done simply by changing config.js. However, there are currently not very many configuration options. Ask if there’s something you want to change but can’t!

Here are the current configuration parameters:

The following parameters can be set to configure a restricted version of the graph tool. They are only present in config_free.js. If you don’t set them the tool will be unrestricted.

The following parameters are used to allow multiple samples per channel and different channel configurations than L/R. For example, config_hp.js is intended for headphones and shows only the right channel with five samples per channel.

The following parameters are for setting the initial samples to display, and enabling URL sharing. If enabled, URL sharing updates the page URL to reflect which samples are on the graph. Copying and opening that URL will open the page with those samples shown. For these parameters a headphone or target is identified by its filename.

Storing your FR files

All FR data is stored in its own file in the directory DIR you specify in config.js. To use this data, CrinGraph needs two things: an index which lists the available models, grouped by brand, and the FR curves themselves.

FR index: phone_book.json

The index is a JSON file called phone_book.json. By default it is located in the headphone directory DIR, but the setting PHONE_BOOK allows you to specify a different filepath. The file’s contents are a list of brands, where each brand is a list of models. A simple example of a brand:

  {
    "name":   "Elysian",
    "suffix": "Acoustic Labs",
    "phones": [ "Artemis"
              , "Eros"
              , "Minerva"
              , "Terminator" ]
  }

The only required attributes for a brand are its name (“name”) and a list of headphone models (“phones”). You can also add another part of the name using “suffix”. The suffix is included in the brand name when it’s used alone, but not as part of a model name: here the brand is “Elysian Acoustic Labs”, but the first headphone is the “Elysian Artemis”.

Each item in the “phones” array corresponds to a single headphone model. While an item might just be the model name as shown above, there are other possibilities as well. Two examples should cover most use cases:

The full list of options is as follows:

FR curves

Each frequency response curve (each channel of a headphone, and each target response) is stored in its own file. For targets this file must be named using the target name from config.js followed by “ Target.txt”, for instance “Diffuse Field Target.txt”. For headphones the file’s name is obtained from phone_book.json as described in the previous section. When a user selects a headphone, CrinGraph figures out its filename—for concreteness let’s say “New Primacy”—and looks for two files, one for each channel. Here it would try to read “New Primacy L.txt” and “New Primacy R.txt”. If one channel is not found it will ignore it and display the headphone with only one channel. If neither one is found it pops up an alert to say “Headphone not found!” and doesn’t display anything.

The headphone is converted from a text file to a Javascript array using the setting tsvParse. The default setting assumes that the file is a tab-separated value file, with two header lines which are discarded followed by 480 measurements (1/48 octave spacing). Each measurement is a frequency and an SPL value. Of course, you can use any format, as long as you can write the code to parse it!