{
    "version": 1,
    "author": "Bimini Road",
    "tags": [
        "Output"
    ],
    "description": "This is an audio output module with master volume control, DC blocking, overdrive, and channel-independent peak detection.  Inside is a node-by-node tutorial explaining how it works.",
    "patch": {
        "id": "90a15e85-2709-4b37-8bda-bd641e363a78",
        "pan": {
            "x": -395.4005126953125,
            "y": -162.40142822265626
        },
        "zoom": 4.30088472366333,
        "nodes": [
            {
                "type": "Patch",
                "id": "d144ce9f-5c39-443c-8fbb-e4ccd3606bb9",
                "position": {
                    "x": 378.6505126953125,
                    "y": 84.40142059326172
                },
                "subPatch": {
                    "id": "3464b536-8a03-4b8e-b1be-cb03d83b6393",
                    "pan": {
                        "x": -89.72293090820313,
                        "y": 7.4832305908203129
                    },
                    "zoom": 0.8740161061286926,
                    "nodes": [
                        {
                            "type": "Text",
                            "id": "2cb5572a-bd01-4bbb-9be9-a9e847c46c2d",
                            "position": {
                                "x": 151.29103088378907,
                                "y": -303.263427734375
                            },
                            "text": "This is identical to the above - replicated so that each channel can have an independent peak detector.",
                            "width": 260.88702392578127
                        },
                        {
                            "type": "Expr",
                            "id": "4d9e657b-25f0-4354-9f1c-03f9d08ecf4b",
                            "position": {
                                "x": 296.8507080078125,
                                "y": -271.510986328125
                            },
                            "expr": "1+(Timer*-1)"
                        },
                        {
                            "type": "Timer",
                            "id": "938f0400-a4c5-44fe-9fac-f5a07006f0fb",
                            "position": {
                                "x": 201.22621154785157,
                                "y": -272.00946044921877
                            }
                        },
                        {
                            "type": "Text",
                            "id": "4dc7850a-165b-44e8-934d-b1e097a8c781",
                            "position": {
                                "x": 44.16444396972656,
                                "y": 87.06770324707031
                            },
                            "text": "\"If the channel peaks, reset the timer.\"",
                            "width": 174.1399688720703
                        },
                        {
                            "type": "Mapper",
                            "id": "3d5e0cba-67b7-4418-9bc5-826cdad84e01",
                            "position": {
                                "x": 518.4280395507813,
                                "y": -334.45074462890627
                            },
                            "c0": 0.0,
                            "c1": 0.215412437915802,
                            "c2": 1.0
                        },
                        {
                            "type": "Expr",
                            "id": "f71d912c-3478-4f50-9a9a-f5acb31ce0e7",
                            "position": {
                                "x": 22.447616577148439,
                                "y": -272.369873046875
                            },
                            "expr": "Input>1"
                        },
                        {
                            "type": "Text",
                            "id": "380a40e7-a44c-4cf8-aaf7-f1d1c9f2b7f8",
                            "position": {
                                "x": 507.7491455078125,
                                "y": -69.86709594726563
                            },
                            "text": "The mapper node takes the linear falling output from 1 to 0 and maps it to an exponential decrease.  This makes the RGB Node behave more like hardware peak detectors, where a the capacitor that lights the LED discharges in an exponential fashion.",
                            "width": 260.88702392578127
                        },
                        {
                            "type": "Text",
                            "id": "99cc5eaa-535f-4bfb-bd11-78b04ab9af8e",
                            "position": {
                                "x": 36.24259948730469,
                                "y": 385.662353515625
                            },
                            "text": "Above is the name of the module, exposed on the front panel.",
                            "width": 248.6120147705078
                        },
                        {
                            "type": "Text",
                            "id": "48080466-57a1-460c-b680-320a79225426",
                            "position": {
                                "x": 138.4170379638672,
                                "y": -1.4205589294433594
                            },
                            "text": "The timer begins at 0 and increases in value by seconds indefinitely unless it is reset.  The Timer is reset when it sees a non-zero positive value at its input.",
                            "width": 260.88702392578127
                        },
                        {
                            "type": "Text",
                            "id": "34c51d5c-3a21-450e-a0c4-81c05a2f8b74",
                            "position": {
                                "x": 291.50146484375,
                                "y": 217.37489318847657
                            },
                            "text": "This expression takes the output of the Timer and inverts it by multiplying it by -1.  Instead of increasing, the Timer is now decreasing.  1+the inverted Timer output will begin at 1 and decrease.  The timer will continue to go into the negative until the timer is reset again but, because the RGB Node only responds to positive numbers between 0 and 1, this doesn't matter.",
                            "width": 226.73399353027345
                        },
                        {
                            "type": "Input",
                            "id": "eeab734b-68e4-4658-aa7b-beb3623b77ca",
                            "position": {
                                "x": -746.5560302734375,
                                "y": -35.27654266357422
                            },
                            "name": "Right",
                            "exposedPosition": {
                                "x": 0.0,
                                "y": -15.0
                            }
                        },
                        {
                            "type": "Mapper",
                            "id": "16d14a90-dccc-46c2-b34a-e9ea7212bbed",
                            "position": {
                                "x": 518.1808471679688,
                                "y": -44.33156204223633
                            },
                            "c0": 0.0,
                            "c1": 0.215412437915802,
                            "c2": 1.0
                        },
                        {
                            "type": "Level",
                            "id": "44e92049-e690-4e1f-b831-f0affac34bc8",
                            "position": {
                                "x": -485.9782409667969,
                                "y": -34.73657989501953
                            },
                            "level": {
                                "value": 0.5,
                                "min": 0.0,
                                "max": 1.0
                            }
                        },
                        {
                            "type": "Text",
                            "id": "33422040-2356-4c3c-8492-4b4d8d09a408",
                            "position": {
                                "x": -888.352294921875,
                                "y": -19.84954833984375
                            },
                            "text": "These are the Left and Right inputs.  They are exposed on the front panel.",
                            "width": 153.90687561035157
                        },
                        {
                            "type": "Text",
                            "id": "8b9b2edc-97b1-4f57-a612-ff32282fd4ac",
                            "position": {
                                "x": 85.17472839355469,
                                "y": 417.2388916015625
                            },
                            "exposedPosition": {
                                "x": -10.0,
                                "y": 175.0
                            },
                            "text": "Audio Out",
                            "width": 256.0
                        },
                        {
                            "type": "Level",
                            "id": "959129aa-3023-42c7-9926-a0d2ae402ce9",
                            "position": {
                                "x": -485.7058410644531,
                                "y": -78.18106842041016
                            },
                            "level": {
                                "value": 0.5,
                                "min": 0.0,
                                "max": 1.0
                            }
                        },
                        {
                            "type": "Timer",
                            "id": "808d7ae5-f85d-4f78-a840-30a6f9e1814e",
                            "position": {
                                "x": 200.97901916503907,
                                "y": 18.109737396240236
                            }
                        },
                        {
                            "type": "Knob",
                            "id": "0cd43f13-c948-4dc7-a8ac-de48c6fa74b3",
                            "position": {
                                "x": -474.1475830078125,
                                "y": 60.910335540771487
                            },
                            "name": "Volume",
                            "knob": {
                                "value": 0.5,
                                "min": 0.0,
                                "max": 1.0
                            },
                            "exposedPosition": {
                                "x": 15.0,
                                "y": 135.0
                            }
                        },
                        {
                            "type": "Input",
                            "id": "178d1942-33e6-4df2-a5ef-b7a07a6196fb",
                            "position": {
                                "x": -741.66552734375,
                                "y": -79.4913558959961
                            },
                            "name": "Left",
                            "exposedPosition": {
                                "x": 0.0,
                                "y": 10.0
                            }
                        },
                        {
                            "type": "Text",
                            "id": "d6c9f9db-3849-4446-a862-8ebbcdca48a8",
                            "position": {
                                "x": -573.8316650390625,
                                "y": 159.0553436279297
                            },
                            "text": "This knob is on the front panel of the module.  It is connected to two individual level nodes that feed the left and right channels of the Speaker node.",
                            "width": 277.1890869140625
                        },
                        {
                            "type": "Expr",
                            "id": "3bc0a0d9-c936-4780-92eb-d2e220a3c4bd",
                            "position": {
                                "x": 296.603515625,
                                "y": 18.608226776123048
                            },
                            "expr": "1+(Timer*-1)"
                        },
                        {
                            "type": "Text",
                            "id": "af674179-fe44-49a8-bffe-5c84aba15c16",
                            "position": {
                                "x": 833.4814453125,
                                "y": 22.312236785888673
                            },
                            "text": "This is the peak detector light for the Right channel - it is exposed on the front panel inside the boundary of the Right input.",
                            "width": 260.88702392578127
                        },
                        {
                            "type": "Expr",
                            "id": "fd2280ae-4997-45dd-939a-1c17b5de9049",
                            "position": {
                                "x": 22.200424194335939,
                                "y": 17.749324798583986
                            },
                            "expr": "Input>1"
                        },
                        {
                            "type": "Speaker",
                            "id": "48fbdfb5-f693-4187-b6d8-acf1fe1b46a9",
                            "position": {
                                "x": 23.747024536132814,
                                "y": -57.37112808227539
                            }
                        },
                        {
                            "type": "RGBLight",
                            "id": "e02cf4b5-8cfd-45b6-a3b1-9f03352132ff",
                            "position": {
                                "x": 733.341064453125,
                                "y": -39.830753326416019
                            },
                            "exposedPosition": {
                                "x": 0.0,
                                "y": -15.0
                            }
                        },
                        {
                            "type": "RGBLight",
                            "id": "48a0ad17-5ad6-4a7a-b4c4-5c77e3ee26d0",
                            "position": {
                                "x": 735.661376953125,
                                "y": -329.79949951171877
                            },
                            "exposedPosition": {
                                "x": 0.0,
                                "y": 10.0
                            }
                        },
                        {
                            "type": "Text",
                            "id": "56a9a4ea-0534-4d73-baed-630583974b1b",
                            "position": {
                                "x": 29.929039001464845,
                                "y": -86.9408950805664
                            },
                            "text": "This is the Speaker node.  It is outputting to the Left and Right audio channels.  In the standalone version of Audulus, this output is your speakers or headphones.  When using Audulus with Audiobus, Aum, or DAWs, this audio output will continue in whatever chain of effects you have placed after it.",
                            "width": 248.6120147705078
                        },
                        {
                            "type": "Crossfade",
                            "id": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "position": {
                                "x": -133.414306640625,
                                "y": -18.892383575439454
                            }
                        },
                        {
                            "type": "Crossfade",
                            "id": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "position": {
                                "x": -135.54190063476563,
                                "y": -156.58987426757813
                            }
                        },
                        {
                            "type": "Expr",
                            "id": "e141adbd-8c23-4d07-9676-6eb2686a8f48",
                            "position": {
                                "x": -354.7333068847656,
                                "y": -126.43256378173828
                            },
                            "expr": "tanh(Input*4)"
                        },
                        {
                            "type": "Knob",
                            "id": "08c48a11-9db1-413e-bc37-be1f667e8b4a",
                            "position": {
                                "x": -169.04725646972657,
                                "y": 167.614013671875
                            },
                            "name": "Overdrive",
                            "knob": {
                                "value": 0.5,
                                "min": 0.0,
                                "max": 1.0
                            },
                            "exposedPosition": {
                                "x": 15.0,
                                "y": 70.0
                            }
                        },
                        {
                            "type": "Text",
                            "id": "46349bee-ac11-4a55-b1bb-2bcec03353e8",
                            "position": {
                                "x": -240.9686279296875,
                                "y": 275.11212158203127
                            },
                            "text": "This knob fades between the A input (no overdrive) and the B input (full overdrive) for both channels.",
                            "width": 231.60362243652345
                        },
                        {
                            "type": "Text",
                            "id": "d5044479-6493-45ec-9bd3-d3686fdf9e10",
                            "position": {
                                "x": -374.33203125,
                                "y": -156.2052459716797
                            },
                            "text": "The tanh(x) expression is a simple soft clipping expression.  Soft clipping is a kind of distortion that is similiar to transistor overdrive or tape saturation.  As values approach +1 or -1, they are squeezed along the hypertangent, meaning they get close to but never actually reach 1 or -1.  If they never reach (or go past) those values, they do no cause hard clipping distortion, which is when values exceed the -1 to +1 output range of Audulus (or exceed 0dB on your output meter).  The tanh(x) soft clipping expression sounds very natural, especially for being such a simple expression.  Its input is multiplied by 2 so that the distortion effect is more pronounced.  Feel free to change this to another value - even *10 sounds great.",
                            "width": 231.60362243652345
                        },
                        {
                            "type": "Expr",
                            "id": "29318336-4fea-4d97-8c35-44f59a3b8122",
                            "position": {
                                "x": -354.6597595214844,
                                "y": 10.79926872253418
                            },
                            "expr": "tanh(Input*4)"
                        },
                        {
                            "type": "Text",
                            "id": "bde689ae-9d29-49ff-a8f0-e0db35eb5ecd",
                            "position": {
                                "x": 837.1002807617188,
                                "y": -255.9042510986328
                            },
                            "text": "This is the peak detector light for the Left channel - it is exposed on the front panel inside the boundary of the Left input.",
                            "width": 260.88702392578127
                        },
                        {
                            "type": "DCBlocker",
                            "id": "36dd6e0d-9ad5-4bdb-aa53-e03b545cbb90",
                            "position": {
                                "x": -626.2886962890625,
                                "y": -35.95822525024414
                            }
                        },
                        {
                            "type": "DCBlocker",
                            "id": "dd2db4c1-6185-481c-ab82-33c697a06adc",
                            "position": {
                                "x": -626.3197021484375,
                                "y": -78.63609313964844
                            }
                        },
                        {
                            "type": "Text",
                            "id": "fae52ef0-7cba-4023-b193-8df7828d9a0a",
                            "position": {
                                "x": -629.20849609375,
                                "y": -107.51748657226563
                            },
                            "text": "The DC Blocker node prevents any DC-offset audio from passing through to the Speaker node.  If the speaker is fed a DC signal, the speaker is only being driven through half of its full cycle.  This can result in distortion, especially when mixing direct and alternating signals.",
                            "width": 153.90687561035157
                        }
                    ],
                    "wires": [
                        {
                            "from": "938f0400-a4c5-44fe-9fac-f5a07006f0fb",
                            "output": 0,
                            "to": "4d9e657b-25f0-4354-9f1c-03f9d08ecf4b",
                            "input": 0
                        },
                        {
                            "from": "f71d912c-3478-4f50-9a9a-f5acb31ce0e7",
                            "output": 0,
                            "to": "938f0400-a4c5-44fe-9fac-f5a07006f0fb",
                            "input": 0
                        },
                        {
                            "from": "4d9e657b-25f0-4354-9f1c-03f9d08ecf4b",
                            "output": 0,
                            "to": "3d5e0cba-67b7-4418-9bc5-826cdad84e01",
                            "input": 0
                        },
                        {
                            "from": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "output": 0,
                            "to": "f71d912c-3478-4f50-9a9a-f5acb31ce0e7",
                            "input": 0
                        },
                        {
                            "from": "3bc0a0d9-c936-4780-92eb-d2e220a3c4bd",
                            "output": 0,
                            "to": "16d14a90-dccc-46c2-b34a-e9ea7212bbed",
                            "input": 0
                        },
                        {
                            "from": "36dd6e0d-9ad5-4bdb-aa53-e03b545cbb90",
                            "output": 0,
                            "to": "44e92049-e690-4e1f-b831-f0affac34bc8",
                            "input": 0
                        },
                        {
                            "from": "0cd43f13-c948-4dc7-a8ac-de48c6fa74b3",
                            "output": 0,
                            "to": "44e92049-e690-4e1f-b831-f0affac34bc8",
                            "input": 1
                        },
                        {
                            "from": "dd2db4c1-6185-481c-ab82-33c697a06adc",
                            "output": 0,
                            "to": "959129aa-3023-42c7-9926-a0d2ae402ce9",
                            "input": 0
                        },
                        {
                            "from": "0cd43f13-c948-4dc7-a8ac-de48c6fa74b3",
                            "output": 0,
                            "to": "959129aa-3023-42c7-9926-a0d2ae402ce9",
                            "input": 1
                        },
                        {
                            "from": "fd2280ae-4997-45dd-939a-1c17b5de9049",
                            "output": 0,
                            "to": "808d7ae5-f85d-4f78-a840-30a6f9e1814e",
                            "input": 0
                        },
                        {
                            "from": "808d7ae5-f85d-4f78-a840-30a6f9e1814e",
                            "output": 0,
                            "to": "3bc0a0d9-c936-4780-92eb-d2e220a3c4bd",
                            "input": 0
                        },
                        {
                            "from": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "output": 0,
                            "to": "fd2280ae-4997-45dd-939a-1c17b5de9049",
                            "input": 0
                        },
                        {
                            "from": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "output": 0,
                            "to": "48fbdfb5-f693-4187-b6d8-acf1fe1b46a9",
                            "input": 0
                        },
                        {
                            "from": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "output": 0,
                            "to": "48fbdfb5-f693-4187-b6d8-acf1fe1b46a9",
                            "input": 1
                        },
                        {
                            "from": "16d14a90-dccc-46c2-b34a-e9ea7212bbed",
                            "output": 0,
                            "to": "e02cf4b5-8cfd-45b6-a3b1-9f03352132ff",
                            "input": 0
                        },
                        {
                            "from": "3d5e0cba-67b7-4418-9bc5-826cdad84e01",
                            "output": 0,
                            "to": "48a0ad17-5ad6-4a7a-b4c4-5c77e3ee26d0",
                            "input": 0
                        },
                        {
                            "from": "44e92049-e690-4e1f-b831-f0affac34bc8",
                            "output": 0,
                            "to": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "input": 0
                        },
                        {
                            "from": "29318336-4fea-4d97-8c35-44f59a3b8122",
                            "output": 0,
                            "to": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "input": 1
                        },
                        {
                            "from": "08c48a11-9db1-413e-bc37-be1f667e8b4a",
                            "output": 0,
                            "to": "ad825780-9056-4f55-ba61-783022aa93a5",
                            "input": 2
                        },
                        {
                            "from": "959129aa-3023-42c7-9926-a0d2ae402ce9",
                            "output": 0,
                            "to": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "input": 0
                        },
                        {
                            "from": "e141adbd-8c23-4d07-9676-6eb2686a8f48",
                            "output": 0,
                            "to": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "input": 1
                        },
                        {
                            "from": "08c48a11-9db1-413e-bc37-be1f667e8b4a",
                            "output": 0,
                            "to": "03109cca-5f2e-4e94-b278-7c0543a7cee2",
                            "input": 2
                        },
                        {
                            "from": "959129aa-3023-42c7-9926-a0d2ae402ce9",
                            "output": 0,
                            "to": "e141adbd-8c23-4d07-9676-6eb2686a8f48",
                            "input": 0
                        },
                        {
                            "from": "44e92049-e690-4e1f-b831-f0affac34bc8",
                            "output": 0,
                            "to": "29318336-4fea-4d97-8c35-44f59a3b8122",
                            "input": 0
                        },
                        {
                            "from": "eeab734b-68e4-4658-aa7b-beb3623b77ca",
                            "output": 0,
                            "to": "36dd6e0d-9ad5-4bdb-aa53-e03b545cbb90",
                            "input": 0
                        },
                        {
                            "from": "178d1942-33e6-4df2-a5ef-b7a07a6196fb",
                            "output": 0,
                            "to": "dd2db4c1-6185-481c-ab82-33c697a06adc",
                            "input": 0
                        }
                    ]
                }
            }
        ],
        "wires": []
    },
    "history": {
        "states": [
            {
                "id": "407b0f94-4ba7-4d8c-ab81-50f57eeb4254"
            }
        ],
        "current": "407b0f94-4ba7-4d8c-ab81-50f57eeb4254"
    },
    "undoStack": {
        "stack": [
            "407b0f94-4ba7-4d8c-ab81-50f57eeb4254"
        ],
        "current": 0
    }
}