CamillaDSP IIR format output?

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
But the filter parameters dont include a term of Fs - do they?
When the filter is applied to data the parameters are used to generate biquad coefficients which depend on the sample rate of the data.
 

Wirrunna

New Member
Joined
Jul 5, 2020
Messages
8
More  
Preamp, Processor or Receiver
NAD C725BEE
Front Speakers
Klipschorns
When the filter is applied to data the parameters are used to generate biquad coefficients which depend on the sample rate of the data.
Thank you for these explanations, I have turned off Decimate IR (my new Asus Zenbook has a 16core AMD cpu and 2TB SSD), I'll redo these measurements and EQs and build a new CamillaDSP config and listen to the results.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
The decimation would not have had any effect on the EQ filters (or anything else), the sample rate was still 12 times higher than the highest frequency in the measurement.
 

Wirrunna

New Member
Joined
Jul 5, 2020
Messages
8
More  
Preamp, Processor or Receiver
NAD C725BEE
Front Speakers
Klipschorns
The decimation would not have had any effect on the EQ filters (or anything else), the sample rate was still 12 times higher than the highest frequency in the measurement.
Thank you, but as an old assembler programmer then systems manager I wanted to test this end to end.
So, after turning off Decimate IR I re-measured, then EQ'd and the heading was indeed CamillaDSP (96kHz), then saved filter settings to YAML file, cut'n'pasted the filters into a new CamillaDSP config and loaded it - no errors the spacing is correct. As a bonus, the YAML file can reload the settings into the EQ for further tweaking after measuring the effect of the EQ filters.
Thank you, this has simplified the building of CamillaDSP configs.
 

TNT

Member
Thread Starter
Joined
Nov 29, 2020
Messages
66
John!

The CamillaDSP output is working great and I'm using it a lot.

Now, this is a silly request but I'll try anyways and it can of course be igonerd without hesitation :)

The Camilla .yml configuration file also defines a Pipeline to be defined - here, a list of used filters is assigned to channels....

- Would it be possible to, in addition to the list of biquads, add in the same file, a few rows below the biquad list, yet a list of all the defined filters in said file, like:

space, - (dash), space, space, name of filer, new line
space, - (dash), space, space, name of filer, new line
...
space, - (dash), space, space, name of filer, new line


Example of the additional list requested:

- hf eq x_1
- hf eq x_2
- hf eq x_3
- hf eq x_4
- hf eq x_5
- hf eq x_6

This would further speed up the work as well as reduce the chance for errors.

//
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
Not in that format, no. It isn't valid YAML so it would cause a parsing exception if the file was loaded again. I could add a pipeline entry with the filter names, that would appear immediately after the filters and look like this (where "filter" has been used as the label):

Code:
pipeline:
  names:
  - filter_1
  - filter_2
  - filter_3
  - filter_4
  - filter_5
  - filter_6
  - filter_7
  - filter_8
  - filter_9
  - filter_10
  - filter_11
  - filter_12
  - filter_13
  - filter_14
  type: Filter

Is that something everyone would want? Or would it create more work for people who don't want the pipeline entry?
 

TNT

Member
Thread Starter
Joined
Nov 29, 2020
Messages
66
Thats looks good!

In any way, one has to copy from your generated file and paste into a target .yml file - no way around that - can't be imported is as of now. And if a Camilla supported import process, it could distinguish between the sections anyway....

So if a distinct section is made for the Pipeline entries, I cant see how the could interfere with anything. Rather help.

If you don't put that in the pipeline section of the target .yml fie, the filters will never be used. The existing part is like a declaration, now you need to reference them also - in the pipeline :)

So I would think that for anyone using it now it would be helpful. One can of course ignore the proposed new section, c&p only the biquads filters only and do the rest via gui - i.e. just ignore pipeline aimed statement in the file..

My feature request is not limited to my personal need or behaviour as I can see it - everyone would benefit or at least not be affected :-)

//
 

Maximars

Registered
Joined
May 6, 2021
Messages
1
Hello!
CamillaDSP 2.0 has been released. There are interesting new filter types, such as Notch, Tilt. LS/HS with dB slope etc.
github.com/HEnquist/camilladsp#iir

Is there a chance that some of these filters will be implemented in REW? That would be great. What do you think of this John?
Thank you for everything.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
Notch is already supported, as are shelf filters with adjustable Q. No plans for a tilt filter, but you can achieve a similar effect with a low Q shelf.
 

G29

Member
Joined
Jun 20, 2019
Messages
95
More  
Main Amp
Quad Stereo Amp
DAC
OKTO Research DAC8
Computer Audio
i7-6700, Debian 12, custom VST3 feeding CamillaDSP, REW, RePhase, custom Driver Level DRC-FIR with 128-bit internal (i)FFTs, 8 - 64-bit 256K tap FIRs
Front Speakers
Heavily modified Magenpan 20.1 with FIR XOs
Subwoofers
DIY OB/Dipole
Other Equipment
Full Mark Levinson Stack
FWIW, I get spacing errors when importing the pipeline section of CamillaDSP 2.0.3 Biquds. All of the individual Biquad names need to be spaced over to the right by 2 spaces.

Other than that, they appear to be working properly.

The following section needs further indention.

Code:
pipeline:

  names:
  - L_1
  - L_2
  - L_3
  - L_4
  - L_5
  - L_6
  - L_7
  - L_8
  - L_9
  - L_10
  - L_11
  - L_12
  - L_13
  - L_14
  - L_15
  type: Filter



The CamillaDSP pipeline docs show the following indentations.

"names" is intented past "-type" by 2 and the individual names are further indented by 2.

Also, "-type" is at the type is at the top of the "paragraph".
Code:
pipeline:
  - type: Mixer
    description: "Expand to 4 channels"
    name: to4channels
    bypassed: false (*)
  - type: Filter
    description: "Left channel woofer"
    channel: 0
    bypassed: false (*)
    names:
      - lowpass_fir
      - peak1
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
I have no idea how to construct a Java object that SnakeYaml would turn into that format when dumped, so unless someone wants to volunteer that you'll have to make whatever changes are required manually.
 

G29

Member
Joined
Jun 20, 2019
Messages
95
More  
Main Amp
Quad Stereo Amp
DAC
OKTO Research DAC8
Computer Audio
i7-6700, Debian 12, custom VST3 feeding CamillaDSP, REW, RePhase, custom Driver Level DRC-FIR with 128-bit internal (i)FFTs, 8 - 64-bit 256K tap FIRs
Front Speakers
Heavily modified Magenpan 20.1 with FIR XOs
Subwoofers
DIY OB/Dipole
Other Equipment
Full Mark Levinson Stack
Hi John,

The change I am requesting is simple.

This ....

Code:
pipeline:
  names:
  - L_1
  - L_2
  - L_3
  - L_4
  - L_5
  - L_6
  - L_7
  - L_8
  - L_9
  - L_10
  - L_11
  - L_12
  - L_13
  - L_14
  - L_15
  type: Filter

should be ...

Code:
pipeline:
  - type: Filter
    names:
      - L_1
      - L_2
      - L_3
      - L_4
      - L_5
      - L_6
      - L_7
      - L_8
      - L_9
      - L_10
      - L_11
      - L_12
      - L_13
      - L_14
      - L_15

To be consistent with the CamillaDSP documentation and satiate the indention orientated parser from throwing errors.
  • "-type" is indented 2 spaces from the "pipeline:" block starting at column 0
  • "names:" is intended 2 spaces from the "-type" block starting at column 2
  • "-Biqad_N" is indented 2 spaces from the "names:" block starting at column 4

I hate column/space oriented parsers (space/tab conflicts). Reminds me of column ordered Fortran which I hated 40 years ago.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
I know what you want, but I don't know how to achieve it with SnakeYaml which generates the Yaml output CamillaDSP requires.
 

G29

Member
Joined
Jun 20, 2019
Messages
95
More  
Main Amp
Quad Stereo Amp
DAC
OKTO Research DAC8
Computer Audio
i7-6700, Debian 12, custom VST3 feeding CamillaDSP, REW, RePhase, custom Driver Level DRC-FIR with 128-bit internal (i)FFTs, 8 - 64-bit 256K tap FIRs
Front Speakers
Heavily modified Magenpan 20.1 with FIR XOs
Subwoofers
DIY OB/Dipole
Other Equipment
Full Mark Levinson Stack
Gotcha, thought you were using formatted print statements instead of a YAML library.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
I wish. It would be a matter of moments to hack the output, but then it wouldn't be possible to read the files back as the Yaml object loader would reject them.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
ChatGPT came to the rescue for the object format, so the missing hyphen is now present. It doesn't look quite like the Camilla example, but it is valid yaml (according to yamllint) and yaml allows any ordering of the items.

Code:
pipeline:
- names:
  - filter_1
  - filter_2
  - filter_3
  - filter_4
  - filter_5
  type: Filter
 

G29

Member
Joined
Jun 20, 2019
Messages
95
More  
Main Amp
Quad Stereo Amp
DAC
OKTO Research DAC8
Computer Audio
i7-6700, Debian 12, custom VST3 feeding CamillaDSP, REW, RePhase, custom Driver Level DRC-FIR with 128-bit internal (i)FFTs, 8 - 64-bit 256K tap FIRs
Front Speakers
Heavily modified Magenpan 20.1 with FIR XOs
Subwoofers
DIY OB/Dipole
Other Equipment
Full Mark Levinson Stack
Thanks John, but that appears to cause the same issue when merging with the other arguments such as the channel identifier.

I will make a sed script to do the indentions and extractions and then read the files into the appropriate sections with vi. Too bad YAML doesn't have #include "filename" constructs.

Code:
#!/bin/bash

# Grab the left filter names
echo ""                                   > L_names
echo "# Left REW filters"                >> L_names
echo ""                                  >> L_names
grep      "\- L_"             L_FULL.yml >> L_names
echo ""                                  >> L_names
# Indent filter names by 2 spaces
sed -i -e 's/\- L_/  - L_/'   L_names

# Strip off everything past "pipelines:", including "pipelines:"
sed -E    '/^pipeline:$/,$d'  L_FULL.yml > L.yml



# Grab the right filter names
echo ""                                   > R_names
echo "# Right REW filters"               >> R_names
echo ""                                  >> R_names
grep      "\- R_"             R_FULL.yml >> R_names
echo ""                                  >> R_names
# Indent filter names by 2 spaces
sed -i -e 's/\- R_/  - R_/'   R_names

# Strip off everything past "pipelines:", including "pipelines:"
sed -E    '/^pipeline:$/,$d'  R_FULL.yml > R.yml


echo ""                       > both.yml
echo "# [ %< REPLACE HERE"   >> both.yml
echo ""                      >> both.yml
echo "# Left REW Biquads"    >> both.yml
echo ""                      >> both.yml
cat L.yml                    >> both.yml
echo ""                      >> both.yml

echo ""                      >> both.yml
echo "# Right REW Biquads"   >> both.yml
echo ""                      >> both.yml
cat R.yml                    >> both.yml
echo ""                      >> both.yml
echo "# REPLACE HERE >% ]"   >> both.yml
echo ""                      >> both.yml



# Remove redundant "filters:"
sed -i -e 's/filters:/ /'   both.yml
 
Last edited:

G29

Member
Joined
Jun 20, 2019
Messages
95
More  
Main Amp
Quad Stereo Amp
DAC
OKTO Research DAC8
Computer Audio
i7-6700, Debian 12, custom VST3 feeding CamillaDSP, REW, RePhase, custom Driver Level DRC-FIR with 128-bit internal (i)FFTs, 8 - 64-bit 256K tap FIRs
Front Speakers
Heavily modified Magenpan 20.1 with FIR XOs
Subwoofers
DIY OB/Dipole
Other Equipment
Full Mark Levinson Stack
Hope this helps someone.

Here is an updated script that slices, dices, indents, aggregates and merges 2 stereo REW YAML files into a copy of your CDSP config file in the appropriate 3 sections (aggregate filter definitions, pipeline filter names list for entire left channel and pipeline filter names list for entire right channel).

The script will aggregate the filter definitions for both left and right channel files generated by REW into a single scratch file.
It will extract the left filter names into one scratch file and the right into another scratch file.
It will then create an aggregate output CDSP YAML file containing the original config input file by replacing the following # INSERT_REW_*_HERE comment flags with the contents of the corresponding scratch files to create a new config file with the biquads.
The original config file will remain unscathed (containing no added biquads, just the comment insert here flags).
The temporary scratch files will be deleted.
Finally, it will dump a diff of the SRC and DST files for visual inspection.

USAGE:
  • The YAML filters names are assumed to be "L" and "R" for left and right respectively when generated by REW.
    • e.g. L_1, L_2, L_3, .... and R_1, R_2, R_3, ....
  • Change the definition of SRC to your CDSP YAML config input file. Include path if not in current directory.
  • Change the definition of DST to your CDSP YAML config BIQUAD output file. Include path if not in current directory.
  • Change the definition of L_REW_BIQUADS to the name of your REW generated YAML output file for the left channel.
  • Change the definition of R_REW_BIQUADS to the name of your REW generated YAML output file for the right channel.
  • Add the following line to the filter definition section of your CamillaDSP config file. Comment will not impact the original file.
    • # INSERT_REW_BIQUADS_HERE
  • Add the following line to the pipeline section listing your entire left channel filter names. Comment will not impact original file.
    • # INSERT_REW_LEFT_NAMES_HERE
  • Add the following line to the pipeline section listing your entire right channel filter names. Comment will not impact original file.
    • # INSERT_REW_RIGHT_NAMES_HERE


Code:
#!/bin/bash

# Change the following 4 definitions to your environment
SRC="config.yml"
DST="config_biquads.yml"
L_REW_BIQUADS="L_FULL.yml"
R_REW_BIQUADS="R_FULL.yml"


# Grab the left filter names
echo ""                             > L_names
echo "# Left REW filters"          >> L_names
echo ""                            >> L_names
grep      "\- L_" ${L_REW_BIQUADS} >> L_names
echo ""                            >> L_names
# Indent filter names by 2 spaces
sed -i -e 's/\- L_/  - L_/'           L_names

# Strip off everything past "pipelines:", including "pipelines:"
sed -E '/^pipeline:$/,$d'  ${L_REW_BIQUADS} > L.yml



# Grab the right filter names
echo ""                             > R_names
echo "# Right REW filters"         >> R_names
echo ""                            >> R_names
grep      "\- R_" ${R_REW_BIQUADS} >> R_names
echo ""                            >> R_names
# Indent filter names by 2 spaces
sed -i -e 's/\- R_/  - R_/'           R_names

# Strip off everything past "pipelines:", including "pipelines:"
sed -E '/^pipeline:$/,$d'  ${R_REW_BIQUADS} > R.yml



echo ""                       > BOTH.yml
echo "# [ %< REPLACE HERE"   >> BOTH.yml
echo ""                      >> BOTH.yml
echo "# Left REW Biquads"    >> BOTH.yml
echo ""                      >> BOTH.yml
cat L.yml                    >> BOTH.yml
echo ""                      >> BOTH.yml

echo ""                      >> BOTH.yml
echo "# Right REW Biquads"   >> BOTH.yml
echo ""                      >> BOTH.yml
cat R.yml                    >> BOTH.yml
echo ""                      >> BOTH.yml
echo "# REPLACE HERE >% ]"   >> BOTH.yml
echo ""                      >> BOTH.yml

# Remove redundant "filters:"
sed -i -e 's/filters:/ /'   BOTH.yml


# Make changes to a copy of the config YAML file
# Replace the following flags with the contents of the temp files

# INSERT_REW_BIQUADS_HERE
# INSERT_REW_LEFT_NAMES_HERE
# INSERT_REW_RIGHT_NAMES_HERE


cp ${SRC} ${DST}

sed -e "s/INSERT_REW_BIQUADS_HERE/$(<BOTH.yml sed -e 's/[\&/]/\\&/g' -e 's/$/\\n/' | tr -d '\n')/g" -i ${DST}

sed -e "s/INSERT_REW_LEFT_NAMES_HERE/$(<L_names sed -e 's/[\&/]/\\&/g' -e 's/$/\\n/' | tr -d '\n')/g" -i ${DST}

sed -e "s/INSERT_REW_RIGHT_NAMES_HERE/$(<R_names sed -e 's/[\&/]/\\&/g' -e 's/$/\\n/' | tr -d '\n')/g" -i ${DST}

# Remove temporary scratch files
rm L_names R_names L.yml R.yml BOTH.yml

diff ${SRC} ${DST}

ls -lt ${SRC} ${DST}
 
Last edited:

Mike0815

New Member
Joined
Feb 19, 2020
Messages
30
Location
EU
More  
Other Equipment
CamillaDSP
Exported some IIR filters with beta 39 yesterday and received a camilla-gui pipeline error. Just importing filters without pipeline section works. So there seem to be still something wrong. Importing filters and pipeline (group of filters in pipeline view) worked before (beta 33?).
 
Last edited:

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
Are there any hints about what it doesn't like? If it is rejecting valid yaml which has its preferred formatting perhaps that is an issue for CamillaDSP to address.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,932
I'm guessing that the CamillaDSP issue will be the ordering of the properties. Yaml doesn't care about property order, but CamillaDSP might. I have made a change for the next build to force any "type" properties to the beginning of lists.
 

Mike0815

New Member
Joined
Feb 19, 2020
Messages
30
Location
EU
More  
Other Equipment
CamillaDSP
I also played around with indentation and type at the beginning of lists to reproduce this issue but could not figure out what's wrong with it.
Maybe this is really a camillagui issue since sometimes I get no error mark here but nothing really happens and nor filter nor pipelines are added.
 
Top Bottom