{"id":13338110,"url":"https://github.com/kaxori/rtttl-player","last_synced_at":"2025-03-11T08:32:28.644Z","repository":{"id":236838970,"uuid":"793253112","full_name":"kaxori/rtttl-player","owner":"kaxori","description":"The player converts a music string in \"Ring Tone Text Transfer Language\" code into pitch and duration.","archived":false,"fork":false,"pushed_at":"2024-04-28T21:39:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-23T20:12:32.273Z","etag":null,"topics":["esp32","toit"],"latest_commit_sha":null,"homepage":"","language":"Toit","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/kaxori.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-04-28T20:48:00.000Z","updated_at":"2024-04-29T09:34:06.000Z","dependencies_parsed_at":"2024-04-28T22:01:56.434Z","dependency_job_id":null,"html_url":"https://github.com/kaxori/rtttl-player","commit_stats":null,"previous_names":["kaxori/rtttl-player"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaxori%2Frtttl-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaxori%2Frtttl-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaxori%2Frtttl-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaxori%2Frtttl-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaxori","download_url":"https://codeload.github.com/kaxori/rtttl-player/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243000947,"owners_count":20219777,"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":["esp32","toit"],"created_at":"2024-07-29T19:15:31.512Z","updated_at":"2025-03-11T08:32:28.332Z","avatar_url":"https://github.com/kaxori.png","language":"Toit","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RTTTL-PLAYER\nThe player converts a music string in \"Ring Tone Text Transfer Language\" code into pitch and duration.\n\nInspired by the idea of ​​reusing the piezo detectors contained in discarded smoke detectors, \nthe desire to play melodies arose. \n\nThe rtttl-player converts the RTTTL melody string into a Tone list. Regular expressions (=\u003e dartino_regexp pkg) is used to analyse the music string. \n\nA user defined tone player (lamdba function) is intented to control your own device.\n\n# Installation\n\n```bash\njag pkg install github.com/kaxori/rtttl-player\n```\n\n# Usage\n\n```toit\nimport rtttl-player show *\nimport gpio show Pin\nimport gpio.pwm show Pwm\n\nGPIO_BUZZER ::= 16\nBUZZER ::= Pin GPIO_BUZZER\n\nplay-host pitch duration:\n  print \"pitch: $(%5d pitch), duration: $duration ms\"\n\nplay-buzzer freq length:\n  if freq \u003e 0: // play tone\n    melody_pwm := Pwm --frequency=freq\n    melody_channel := melody_pwm.start BUZZER\n    melody_channel.set_duty_factor 0.5\n    sleep --ms=length\n    melody_pwm.close\n  else: // pause\n    sleep --ms=length\n\nmain:\n  SMOKE ::= \"smoke:o=5,d=4,b=130:c,d#,f.,c,d#,8f#,f,p,c,d#,f.,d#,c,2p,8p,c,d#,f.,c,d#,8f#,f,p,c,d#,f.,d#,c\"\n  rtttl := rtttl-player (:: | pitch duration | play-buzzer pitch duration )\n  rtttl.play SMOKE\n```\n\n# References\n\nWiki RTTTL: https://de.wikipedia.org/wiki/Ring_Tones_Text_Transfer_Language\n\nRTTTL Format Specifications: http://merwin.bespin.org/t4a/specs/nokia_rtttl.txt\n\nTo play RTTTL online: https://adamonsoon.github.io/rtttl-play/\n\nCollection of melodies: https://1j01.github.io/rtttl.js/\n\nToit regexp package: https://pkg.toit.io/package/github.com%2Ferikcorry%2Ftoit-dartino-regexp@v0.2.0\n\nOnline RegExp tester: https://regex101.com/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaxori%2Frtttl-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaxori%2Frtttl-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaxori%2Frtttl-player/lists"}