{"id":13586969,"url":"https://github.com/alesgenova/pitch-detection","last_synced_at":"2025-04-04T23:08:54.441Z","repository":{"id":41260930,"uuid":"174886152","full_name":"alesgenova/pitch-detection","owner":"alesgenova","description":"A collection of algorithms to determine the pitch of a sound sample.","archived":false,"fork":false,"pushed_at":"2023-01-08T16:07:49.000Z","size":1003,"stargazers_count":212,"open_issues_count":9,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T12:13:27.985Z","etag":null,"topics":["audio-analysis","frequency","pitch-detection","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/alesgenova.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":"2019-03-10T21:58:24.000Z","updated_at":"2024-03-19T07:52:11.000Z","dependencies_parsed_at":"2023-02-08T06:30:50.293Z","dependency_job_id":null,"html_url":"https://github.com/alesgenova/pitch-detection","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/alesgenova%2Fpitch-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesgenova%2Fpitch-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesgenova%2Fpitch-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alesgenova%2Fpitch-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alesgenova","download_url":"https://codeload.github.com/alesgenova/pitch-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261609,"owners_count":20910108,"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-analysis","frequency","pitch-detection","rust"],"created_at":"2024-08-01T15:05:56.489Z","updated_at":"2025-04-04T23:08:54.420Z","avatar_url":"https://github.com/alesgenova.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"[![workflow status](https://github.com/alesgenova/pitch-detection/workflows/main/badge.svg?branch=master)](https://github.com/alesgenova/pitch-detection/actions?query=workflow%3Amain+branch%3Amaster)\n[![crates.io](https://img.shields.io/crates/v/pitch-detection.svg)](https://crates.io/crates/pitch-detection)\n\n# pitch_detection\n\n## Usage\n```rust\nuse pitch_detection::detector::mcleod::McLeodDetector;\nuse pitch_detection::detector::PitchDetector;\n\nfn main() {\n    const SAMPLE_RATE: usize = 44100;\n    const SIZE: usize = 1024;\n    const PADDING: usize = SIZE / 2;\n    const POWER_THRESHOLD: f64 = 5.0;\n    const CLARITY_THRESHOLD: f64 = 0.7;\n\n    // Signal coming from some source (microphone, generated, etc...)\n    let dt = 1.0 / SAMPLE_RATE as f64;\n    let freq = 300.0;\n    let signal: Vec\u003cf64\u003e = (0..SIZE)\n        .map(|x| (2.0 * std::f64::consts::PI * x as f64 * dt * freq).sin())\n        .collect();\n\n    let mut detector = McLeodDetector::new(SIZE, PADDING);\n\n    let pitch = detector\n        .get_pitch(\u0026signal, SAMPLE_RATE, POWER_THRESHOLD, CLARITY_THRESHOLD)\n        .unwrap();\n\n    println!(\"Frequency: {}, Clarity: {}\", pitch.frequency, pitch.clarity);\n}\n```\n## Live Demo\n[![Demo Page](https://raw.githubusercontent.com/alesgenova/pitch-detection-app/master/demo.png)](https://alesgenova.github.io/pitch-detection-app/)\n[Source](https://github.com/alesgenova/pitch-detection-app)\n\n## Documentation\nLaTeX formulas can be used in documentation. This is enabled by a method outlined in [rust-latex-doc-minimal-example](https://github.com/victe/rust-latex-doc-minimal-example). To build the docs, use\n```\ncargo doc --no-deps\n```\nThe `--no-deps` flag is needed because special headers are included to auto-process the math in the documentation. This\nheader is specified using a relative path and so an error is produced if `cargo` tries generate documentation for\ndependencies.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falesgenova%2Fpitch-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falesgenova%2Fpitch-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falesgenova%2Fpitch-detection/lists"}