{"id":16209893,"url":"https://github.com/jdsherbert/audio-soft-clip-distortion","last_synced_at":"2025-04-07T21:17:24.724Z","repository":{"id":216375873,"uuid":"741174205","full_name":"JDSherbert/Audio-Soft-Clip-Distortion","owner":"JDSherbert","description":"Simple C++ implementation of a basic Soft Clip Distortion technique. Includes an example usage case with a simulated sinusoidal signal.","archived":false,"fork":false,"pushed_at":"2024-01-09T23:19:36.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T22:38:12.348Z","etag":null,"topics":["audio","audio-effect","audio-effects","audio-processing","cpp","distortion","distortion-effects","sine","sine-wave","sinewave","soft-clipping"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JDSherbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-09T21:10:47.000Z","updated_at":"2024-01-09T22:19:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd315765-a4b8-47dd-b93e-5967dbb3b498","html_url":"https://github.com/JDSherbert/Audio-Soft-Clip-Distortion","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"d8ed0d0d862f578dc715eec0931b3d6f62ed7e22"},"previous_names":["jdsherbert/audio-soft-clip-distortion"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FAudio-Soft-Clip-Distortion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FAudio-Soft-Clip-Distortion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FAudio-Soft-Clip-Distortion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JDSherbert%2FAudio-Soft-Clip-Distortion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JDSherbert","download_url":"https://codeload.github.com/JDSherbert/Audio-Soft-Clip-Distortion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730069,"owners_count":20986404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-effect","audio-effects","audio-processing","cpp","distortion","distortion-effects","sine","sine-wave","sinewave","soft-clipping"],"created_at":"2024-10-10T10:33:48.779Z","updated_at":"2025-04-07T21:17:24.706Z","avatar_url":"https://github.com/JDSherbert.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![image](https://github.com/JDSherbert/Audio-Soft-Clip-Distortion/assets/43964243/73ee52dc-d94a-47aa-882f-05fbca96f46d)\n\n# Audio: Soft Clip Distortion\n\n\u003c!-- Header Start --\u003e\n\u003ca href = \"https://learn.microsoft.com/en-us/cpp/cpp-language\"\u003e \u003cimg height=\"40\" img width=\"40\" src=\"https://cdn.simpleicons.org/c++\"\u003e \u003c/a\u003e\n\u003cimg align=\"right\" alt=\"Stars Badge\" src=\"https://img.shields.io/github/stars/jdsherbert/Audio-Soft-Clip-Distortion?label=%E2%AD%90\"/\u003e\n\u003cimg align=\"right\" alt=\"Forks Badge\" src=\"https://img.shields.io/github/forks/jdsherbert/Audio-Soft-Clip-Distortion?label=%F0%9F%8D%B4\"/\u003e\n\u003cimg align=\"right\" alt=\"Watchers Badge\" src=\"https://img.shields.io/github/watchers/jdsherbert/Audio-Soft-Clip-Distortion?label=%F0%9F%91%81%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" alt=\"Issues Badge\" src=\"https://img.shields.io/github/issues/jdsherbert/Audio-Soft-Clip-Distortion?label=%E2%9A%A0%EF%B8%8F\"/\u003e\n\u003cimg align=\"right\" src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FJDSherbert%2FAudio-Soft-Clip-Distortion%2Fhit-counter%2FREADME\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026labelColor=0E1128\u0026title=🔍\u0026style=for-the-badge\"\u003e\n\u003c!-- Header End --\u003e \n\n-----------------------------------------------------------------------\n\n\u003ca href=\"\"\u003e \n  \u003cimg align=\"left\" alt=\"Audio Processing\" src=\"https://img.shields.io/badge/Audio%20Processing-black?style=for-the-badge\u0026logo=audacity\u0026logoColor=white\u0026color=black\u0026labelColor=black\"\u003e \u003c/a\u003e\n  \n\u003ca href=\"https://choosealicense.com/licenses/mit/\"\u003e \n  \u003cimg align=\"right\" alt=\"License\" src=\"https://img.shields.io/badge/License%20:%20MIT-black?style=for-the-badge\u0026logo=mit\u0026logoColor=white\u0026color=black\u0026labelColor=black\"\u003e \u003c/a\u003e\n  \n\u003cbr\u003e\u003c/br\u003e\n\n-----------------------------------------------------------------------\n## Overview\nAudio distortion is an intentional modification of an audio signal to alter its waveform, introducing non-linearities and harmonic content that was not present in the original signal. Distortion can be applied for various artistic, creative, or practical reasons in music production, sound design, and audio processing. It's a versatile and powerful tool in music production and sound design. Whether applied to individual instruments, vocals, or entire mixes, distortion can shape the character and emotion of a sound. Musicians and producers leverage distortion's creative potential to craft unique and memorable sonic experiences in a wide range of musical genres.\n\nThe distortion effect implemented in this code is a basic form of soft clipping. Soft clipping is a non-linear process that rounds off the peaks of a waveform smoothly, resulting in a more gradual distortion compared to hard clipping.\n\nIn the code, the `tanh` function is used to apply soft clipping to each audio sample in the buffer. The `tanh` function produces a smooth, sigmoidal curve, which introduces a gentle distortion when applied to the audio signal. This type of distortion is often used in audio effects to create warm, saturated tones or simulate the characteristics of analog equipment.\n\nThis is also the technique I have used in my own product, the [Sherbert Clipper VST Effect](https://jdsherbert.itch.io/sherbert-clipper)\n\n## Clipping\n\n![image](https://github.com/JDSherbert/Audio-Soft-Clip-Distortion/assets/43964243/977b31c0-0aca-4114-a84d-8b31591b484f)\n\n#### Clipping Distortion \nClipping distortion occurs when the amplitude of a signal exceeds the maximum allowed value, causing the waveform to \"clip\" or get cut off at a certain level. Introduces harmonics, resulting in a more aggressive, gritty sound. It's normally used in guitar distortion pedals, rock music, and some electronic music genres.\n\n#### Waveshaping Distortion\nWaveshaping involves modifying the shape of the audio waveform using non-linear functions. Can produce a wide range of tonal variations, from subtle warmth to extreme fuzziness. Mostly used in various musical genres for creative sound shaping and experimentation.\n\n#### Saturation Distortion\nSaturation is a form of distortion that simulates the characteristics of analog saturation, where the signal is driven into the nonlinear region of a device. Adds harmonics, compression, and a warm, vintage feel to the sound. You'll normally see it applied to commonly applied to vocals, drums, and entire mixes in both music production and audio mastering.\n\n#### Modulation Distortion:\nModulation distortion involves the use of modulation effects, such as ring modulation or frequency modulation, to alter the frequency content of the audio signal. It can produce metallic, robotic, or frequency-shifted sounds. It's also often used in experimental music, electronic genres, and sound design.\n\n\n### Hard Clip vs Soft Clip\n\n![image](https://github.com/JDSherbert/Audio-Soft-Clip-Distortion/assets/43964243/b16984dc-806c-4939-864e-a320b489be88)\n\n\n## Challenges and Considerations in Distortion\n\n### Dynamic Range Compression\nDistortion often reduces the dynamic range of a signal, making the quieter parts louder and the louder parts quieter. This compression effect can impact the overall balance and perceived loudness.\n\n### Harmonic Content\nDifferent distortion types introduce distinct harmonic spectra. Understanding and controlling the harmonic content is crucial for achieving the desired tonal characteristics.\n\n### Artistic Expression\nDistortion is not merely a technical process; it's a tool for artistic expression. Musicians and producers use distortion intentionally to convey emotion, energy, and creativity in their music.\n\n### Context and Genre\nThe appropriateness of distortion depends on the musical context and genre. While heavy distortion may be suitable for rock or metal, subtle saturation might be more appropriate for jazz or acoustic music.\n\n-----------------------------------------------------------------------\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Faudio-soft-clip-distortion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdsherbert%2Faudio-soft-clip-distortion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdsherbert%2Faudio-soft-clip-distortion/lists"}