/ Ref / Envelope (.knt) files

Songs.hz . Music API
Hz.Plugins . 3rd Party Plugins
General MIDI . MIDI CC . MIDI notes
Configure
home . Topics . Interface . Reference . Examples


.knt files are .JSON-format files that describe an audio envelope and can be used by, eg Hz.LFO and z.Filter. You can also use them in your own scripts with MusicAPI/Envelope.

To preview the file contents, just click on the file and the text is presented in the Code Editor.

To edit the file, you can right-click in the workspace panel and select Open Editor. This will provide open the Envelope Editor.

When interacting with Hz.LFO, you can copy-paste the knot files for immediate results. You can also copy the data into your song scripts and deliver it to plugins via LoadPreset.

File Format

The primary format for .knt files contains a data field which is an array of 3 values: x, y, power. The number of knots in the array is therefore data.length / 3. x and y values outside the range of [0,1] are clipped. Power values are typically in the range of [-5, 5] with 0 indicating a linear segment.

{
  "name": "E1",
  "data": [
    0,
    0.4046454767726162,
    4.4,
    0.3452901195146426,
    0.9804400977995122,
    0,
    0.5734536082474228,
    0.4070904645476766,
    0,
    0.6409451692363833,
    0.7298288508557457,
    0,
    0.7048969072164949,
    0.41075794621026795,
    0.24,
    0.7615979381443299,
    0.9669926650366751,
    1.76,
    0.8170103092783505,
    0.41442542787285996,
    0,
    0.8878865979381441,
    0.964547677261614,
    0,
    1,
    0.4034229828850858,
    0
  ],
  "smooth": true
}

For interoperation with other tools eg Vital, we also support a variant where the powers are kept separated from the knots.

{
  "name":"Staircase Down",
  "num_points":18,
  "points":[0.0,1.0,0.0,0.0,0.125,0.0,0.125,0.1428571343421936,0.25,0.1428571343421936,0.25,0.3035714626312256,0.375,0.3035714626312256,0.375,0.4226190447807312,0.5,0.4226190447807312,0.5,0.5833333134651184,0.625,0.5833333134651184,0.625,0.726190447807312,0.75,0.726190447807312,0.75,0.8571428656578064,0.875,0.8571428656578064,0.875,1.0,1.0,1.0,1.0,1.0],
  "powers":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],
  "smooth":true
}