{"id":27553724,"url":"https://github.com/divitmittal/hs-faust","last_synced_at":"2025-07-28T06:05:30.713Z","repository":{"id":286855290,"uuid":"962776324","full_name":"DivitMittal/hs-faust","owner":"DivitMittal","description":"Haskell DSL wrapper for writing DSP files utilizing the Faust's Signal API \u0026 Compiler ","archived":false,"fork":false,"pushed_at":"2025-04-08T17:35:43.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T16:55:42.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivitMittal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-08T16:52:32.000Z","updated_at":"2025-04-08T17:35:47.000Z","dependencies_parsed_at":"2025-04-08T18:33:40.151Z","dependency_job_id":null,"html_url":"https://github.com/DivitMittal/hs-faust","commit_stats":null,"previous_names":["divitmittal/hs-faust"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DivitMittal/hs-faust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2Fhs-faust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2Fhs-faust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2Fhs-faust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2Fhs-faust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivitMittal","download_url":"https://codeload.github.com/DivitMittal/hs-faust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivitMittal%2Fhs-faust/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267470062,"owners_count":24092352,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-04-19T12:53:23.048Z","updated_at":"2025-07-28T06:05:30.643Z","avatar_url":"https://github.com/DivitMittal.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HS-Faust: Haskell Bindings for the Faust Signal API\n\n[![Nix Flake Check](https://github.com/DivitMittal/hs-faust/actions/workflows/flake-check.yaml/badge.svg)](https://github.com/DivitMittal/hs-faust/actions/workflows/flake-check.yaml)\n\n## Overview\n\n`hs-faust` provides Haskell DSL wrapper for the C Signal API of the [Faust](https://faust.grame.fr/). This allows one to define Faust signal processing graphs within Haskell and compile them using the Faust infrastructure.\n\nThis project explores using Haskell to construct DSP algorithms that can then be compiled by Faust into various targets (LLVM, C++, etc.).\n\n## Prerequisites\n\n*   **Nix:** The project uses [Nix Flakes](https://nixos.wiki/wiki/Flakes) for managing dependencies and providing a reproducible development environment.\n*   **Faust (`libfaust`):** The underlying Faust C library (`libfaust`) is required.\n\n## Current Status\n\n*   **What's Working:**\n    *   Bindings and wrappers for few core Faust Signal API functions (constructors, math, delays, UI, recursion).\n    *   Compiling simple Haskell-defined DSP graphs to an LLVM DSP Factory using `compileDsp`.\n    *   Basic example application (`app/Main.hs`) with a minimal DSP demonstrating compilation.\n    *   Reproducible development environment via Nix Flakes.\n*   **Known Issues:**\n    *   **Runtime Crashes (`SIGILL`):** Using the C++ source generation backend (`compileDspToCppSource`) or potentially more complex signal graphs can cause `SIGILL` crashes. This probably is occuring due to incompatibility between the linked `libfaust` library version \u0026 the runtime OS version.\n\n## Usage\n\nOnce inside the Nix development shell (`nix develop`), or after having necessary dependencies installed manually, one can:\n\n```bash\ncabal run hs-faust-example\n```\n\n### Example Code (`app/Main.hs`)\n\n```haskell\nimport           Foreign.Ptr (nullPtr)\nimport           HSFaust\nimport           System.IO   (putStrLn)\n\n-- Minimal DSP definition: A constant 0.5 signal\nminimalDsp :: IO [Signal]\nminimalDsp = do\n    putStrLn \"Creating signal: sigReal(0.5)\"\n    outSignal \u003c- sigReal 0.5\n    isSigNil \u003c- isNil outSignal\n    if isSigNil\n        then putStrLn \"No Signal\" \u003e\u003e return []\n        else return [outSignal]\n\nmain :: IO ()\nmain = do\n    let dspName = \"MinimalHaskellDSP\"\n    compileResult \u003c- compileDsp dspName minimalDsp\n\n    case compileResult of\n        Left errMsg -\u003e do\n            putStrLn $ \"Error: reported by Faust: \" ++ errMsg\n\n        Right factoryPtr -\u003e do\n            if factoryPtr == nullPtr then do\n                putStrLn \"Error: compileDsp returned a NULL factory pointer!\"\n            else do\n                putStrLn $ \"Obtained Factory Pointer: \" ++ show factoryPtr\n                deleteDspFactory factoryPtr\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivitmittal%2Fhs-faust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivitmittal%2Fhs-faust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivitmittal%2Fhs-faust/lists"}