{"id":18763130,"url":"https://github.com/simre1/lambdasound","last_synced_at":"2025-04-13T04:32:26.648Z","repository":{"id":172223678,"uuid":"649013079","full_name":"Simre1/lambdasound","owner":"Simre1","description":"A Haskell libary for generating low-level sounds with high-level combinators.","archived":false,"fork":false,"pushed_at":"2024-10-10T14:48:46.000Z","size":193,"stargazers_count":15,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T21:38:27.167Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simre1.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-06-03T13:57:11.000Z","updated_at":"2024-04-28T12:59:37.000Z","dependencies_parsed_at":"2023-11-27T00:24:37.812Z","dependency_job_id":"e3a098cc-f9ca-4625-af58-c1a8c503ac19","html_url":"https://github.com/Simre1/lambdasound","commit_stats":null,"previous_names":["simre1/lambdasound"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Flambdasound","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Flambdasound/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Flambdasound/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Flambdasound/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simre1","download_url":"https://codeload.github.com/Simre1/lambdasound/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248664031,"owners_count":21141878,"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":[],"created_at":"2024-11-07T18:24:48.072Z","updated_at":"2025-04-13T04:32:26.394Z","avatar_url":"https://github.com/Simre1.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LambdaSound\n\nA Haskell libary for generating low-level sounds with high-level combinators.\n\nYou can create sounds as a list of floats and then manipulate them with \ncombinators like `parallel`, `sequentially` or `dropSound`.\n\n## Examples\n\n```haskell\n-- An infinite 440hz sinus curve\nsound440Hz :: Sound I Pulse\nsound440Hz = sineWave 440 \n\n-- Three infinite sounds in parallel\ntriad :: Sound I Pulse\ntriad = parallel $ fmap (asNote sineWave) [c4, e4, g4]\n\n-- Five sequential 1 second sounds \nascending :: Sound T Pulse\nascending = sequentially $\n  fmap (setDuration 1 . asNote sineWave) [c4,d4,e4,f4,g4]\n\n-- Cut apart sounds with takeSound and dropSound\nascendingPart :: Sound T Pulse\nascendingPart = takeSound 1 $ dropSound 1 ascending\n\n-- Add a quiet noise to a sound\nnoisyAscending :: Sound T Pulse\nnoisyAscending = parallel\n  [ setDuration (getDuration ascending) (reduce 3 (noise 42)),\n    ascending\n  ]\n\n-- Raise the frequency of a sound so it has a higher pitch\nascendingAnOctaveHigher :: Sound T Pulse\nascendingAnOctaveHigher = raise 8 ascending \n\n-- Reverse the samples in a sound\ndescending :: Sound T Pulse\ndescending = reverseSound ascending\n\n-- Change the tempo the parts of a sound are played at\nspeedupDuringSound :: Sound d Pulse -\u003e Sound d Pulse\nspeedupDuringSound = changeTempo $ \\progress -\u003e progress ** 1.2\n\n-- Play sound with a sample rate of 44100\nmain :: IO ()\nmain = do\n  let volume = 0.5\n      sampleRate = 44100\n  play sampleRate volume ascending\n```\n\nYou can also take a look at `example/Example1.hs` and `example/Example2.hs` for bigger examples and play them with:\n\n```haskell\ncabal run example1\ncabal run example2\n```\n\n## Feature Overview\n\n- Play sounds with RTAudio\n- Save sounds as WAV\n- Create raw audio samples by defining a vector of floats\n- Manipulate the duration of a sound\n- Combine sounds via `parallel`, `sequentially` or `zipSound`\n- Change volume\n- Modify the pitch\n- Create a sound and then map over its samples\n- Convolve sounds\n- IIR filters\n- Cut apart sounds with `takeSound` and `dropSound`\n- Scaling playing speed\n- Cache expensive to compute sounds in your XDG-cache directory\n- Loading wav files (with some caveats)\n- Embed IO into sounds\n\n## Building\n\n`lambdasound` can be built as usual with the `cabal` package manager. \n\n```\ngit clone https://github.com/Simre1/lambdasound\ncabal build lambdasound\n```\n\nYou can run the example with:\n\n```haskell\ncabal run example1\ncabal run example2\ncabal run example3\n```\n\n## Contributing\n\nFeel free to try out this library and add additional functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimre1%2Flambdasound","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimre1%2Flambdasound","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimre1%2Flambdasound/lists"}