{"id":24497037,"url":"https://github.com/yannxou/taptempobutton","last_synced_at":"2026-04-17T00:35:15.932Z","repository":{"id":65298171,"uuid":"587437693","full_name":"yannxou/TapTempoButton","owner":"yannxou","description":"SwiftUI View to easily add tap tempo functionality to music apps.","archived":false,"fork":false,"pushed_at":"2023-01-16T22:25:53.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T08:50:15.350Z","etag":null,"topics":["catalyst","ios","macos","macos-catalyst","music","music-library","swift","swift-package","swiftui","swiftui-controls","tvos","watchos","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/yannxou.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}},"created_at":"2023-01-10T18:48:41.000Z","updated_at":"2024-09-06T10:18:19.000Z","dependencies_parsed_at":"2023-02-10T06:45:16.136Z","dependency_job_id":null,"html_url":"https://github.com/yannxou/TapTempoButton","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannxou%2FTapTempoButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannxou%2FTapTempoButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannxou%2FTapTempoButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yannxou%2FTapTempoButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yannxou","download_url":"https://codeload.github.com/yannxou/TapTempoButton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690174,"owners_count":20331729,"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":["catalyst","ios","macos","macos-catalyst","music","music-library","swift","swift-package","swiftui","swiftui-controls","tvos","watchos","xcode"],"created_at":"2025-01-21T21:19:58.936Z","updated_at":"2026-04-17T00:35:13.849Z","avatar_url":"https://github.com/yannxou.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TapTempoButton\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyannxou%2FTapTempoButton%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/yannxou/TapTempoButton)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fyannxou%2FTapTempoButton%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/yannxou/TapTempoButton)\n\nA SwiftUI View that easily brings tap tempo functionality to music apps.\n\n## How it works\n\nThe `TapTempoButton` takes a content closure so it can be customized. The whole view will handle the tap events automatically and calculate the tempo average (in BPM) which is sent in the `onTempoChange` closure on each change.\n\nRather than processing the touch events like a standard Button (on touch up) the view handles them on touch down so the button behaviour is more natural in a musical context. \n\n![TapTempoButtonPreview](https://user-images.githubusercontent.com/5954961/211922448-172522bc-1a81-4b15-b7e7-606e54efdc59.gif)\n\n## Usage\n\nAdd the `TapTempoButton` to your View and customize it with the content closure.\n\n```swift\nTapTempoButton(onTempoChange: {\n    self.tempo = $0\n}) {\n    Text(\"Tap\")\n}\n```\n\nIt can also be customized like a regular SwiftUI Button:\n\n```swift\n.buttonBorderShape(.capsule)\n.buttonStyle(.bordered)\n```\n\nor\n\n```swift\n.buttonStyle(MyButtonStyle())\n```\n\n\n### Configuration\n\nThe following properties can be configured on initialization:\n\n* `tempoRange`: Defines the minimum and maximum tempo that can be detected.\n* `timeout`: Seconds of inactivity after which the ongoing detection will be restarted.\n* `minTaps`: Minimum number of taps required before sending values to the `onTempoChange` closure.\n* `roundDecimals`: Number of decimals to round the BPM to. Set to `0` for integer-only BPM (no decimals). Set to `nil` to disable rounding.\n\n## Installation\n\n1. From the File menu, select Add Packages...\n2. Enter package repository URL: https://github.com/yannxou/TapTempoButton\n3. Confirm the version and let Xcode resolve the package\n\n## Support\n\nThe idea for this library appeared while working on the app [Vetro: Visual Metronome](https://apps.apple.com/app/vetro-visual-metronome/id1637121079) for iOS/macOS. If you like it you can support us by buying any of [our apps](https://apps.apple.com/es/developer/natalia-artigas/id957299596).\n\n## License\n\nThis library is released under the MIT license. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannxou%2Ftaptempobutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyannxou%2Ftaptempobutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyannxou%2Ftaptempobutton/lists"}