{"id":22636690,"url":"https://github.com/daroczig/singr","last_synced_at":"2025-08-26T22:33:22.220Z","repository":{"id":24779232,"uuid":"28192753","full_name":"daroczig/singR","owner":"daroczig","description":"helper functions to \"sing\" songs with R","archived":false,"fork":false,"pushed_at":"2016-03-18T00:04:28.000Z","size":433,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T06:59:34.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","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/daroczig.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}},"created_at":"2014-12-18T17:00:23.000Z","updated_at":"2021-09-16T16:31:27.000Z","dependencies_parsed_at":"2022-08-23T05:41:19.767Z","dependency_job_id":null,"html_url":"https://github.com/daroczig/singR","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daroczig%2FsingR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daroczig%2FsingR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daroczig%2FsingR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daroczig%2FsingR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daroczig","download_url":"https://codeload.github.com/daroczig/singR/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480421,"owners_count":21110939,"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-12-09T03:29:52.571Z","updated_at":"2025-04-11T21:21:18.182Z","avatar_url":"https://github.com/daroczig.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# singR: helper functions to \"sing\" songs with R\n\nInitially created for [Code Poetry Slam 2.0](http://stanford.edu/~mkagen/codepoetryslam/), where I plan to tribute to the *KC \u0026 The Sunshine Band* for [Give It Up](http://www.metrolyrics.com/give-it-up-lyrics-kc-and-the-sunshine-band.html). Yes, this is a fun project -- but I'm happy to merge serious pull requests :)\n\n## Installation\n\nThis will probably never end up on CRAN:\n\n```r\ndevtools::install_github('daroczig/singR')\n```\n\n## POC pseudo-R code\n\nThe minimal version:\n\n```r\nwhile (TRUE)\n    give_up(it)\n```\n\nThe refrain of the classic \"Give It Up\" song:\n\n```r\nrep(NA, 11)\ngive_up(what = it, who = Baby)\ngive_up(what = it)\ngive_up(what = it, who = Baby)\nrep(NA, 11)\ngive_up(what = it, who = Baby)\ngive_up(what = it)\ngive_up(what = it, who = Baby)\nverify(give_up(what = it, who = you), times = 2)\ngive_up(what = it)\n```\n\nSome parts of the above pseudo-R script actually works, e.g. the \"Na, na, na, na ...\" part:\n\n```r\n\u003e rep(NA, 11)\n [1] NA NA NA NA NA NA NA NA NA NA NA\n```\n\nAnd we can also implement e.g. a minimal `give_up` function easily:\n\n```r\ngive_up \u003c- function(what, who = '')\n\tsprintf('%s give %s up', who, what)\n```\n\n## Working R code\n\nAfter loading the `singR` package, the above psuedo-code should work:\n\n```r\n\u003e library(singR)\n\u003e rep(NA, 11)\n [1] NA NA NA NA NA NA NA NA NA NA NA\n\u003e give_up(what = it, who = Baby)\n[1] \"Baby give it up!\"\n\u003e give_up(what = it)\n[1] \"Give it up!\"\n\u003e give_up(what = it, who = Baby)\n[1] \"Baby give it up!\"\n\u003e rep(NA, 11)\n [1] NA NA NA NA NA NA NA NA NA NA NA\n\u003e give_up(what = it, who = Baby)\n[1] \"Baby give it up!\"\n\u003e give_up(what = it)\n[1] \"Give it up!\"\n\u003e give_up(what = it, who = Baby)\n[1] \"Baby give it up!\"\n\u003e verify(give_up(what = it, who = you), times = 2)\n[1] \"Can you give it up?\" \"Can you give it up?\"\n\u003e give_up(what = it)\n[1] \"Give it up!\"\n```\n\n## Let R sing the song!\n\nBuilding on the `koRpus` package, we can easily find all the syllables that can be written to the standard output in a timely manner:\n\n```r\nsing(\n    capture.output(\n        rep(NA, 11),\n        give_up(what = it, who = Baby),\n        give_up(what = it),\n        give_up(what = it, who = Baby),\n        rep(NA, 11),\n        give_up(what = it, who = Baby),\n        give_up(what = it),\n        give_up(what = it, who = Baby),\n        verify(give_up(what = it, who = you), times = 2),\n        give_up(what = it)\n    )\n)\n```\n\nResulting in:\n\n\u003cimg src=\"demo.gif\" width=\"400px\"/\u003e\n\n## bringing rythms to life with tap.along()\n\nUsing the following note figures, accompany your rythms with lyrics and hear a beeping sound giving you the rythm:\n\n- **w**  : whole note  \n- **wd** : whole note, dotted  \n- **h**  : half note  \n- **hd** : half note, dotted  \n- **q**  : quarter note  \n- **qd** : quarter note, dotted  \n- **e**  : eight note  \n- **ed** : eight note, dotted  \n- **t**  : triplet  \n- **s**  : sixteenth note  \n\n```r\nheyjude \u003c- list()\nheyjude$lyrics \u003c- c(rep(NA, 11), \"Hey\", \"Hey\",\"Jude\")\nheyjude$time.pattn \u003c- \"h, q, q, s, s, e, hd, s, s, e, h, s, ed, w\"\nheyjude$tempo \u003c- 60\nheyjude$repet \u003c- 8 # I hesitated between this and \"Inf\"\n\ndo.call(what = tap.along, args = heyjude)\n```\n\n```\nNA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  Hey  Hey  Jude \nNA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  Hey  Hey  Jude \nNA  NA  NA  NA  NA  NA  NA  NA  NA  NA  NA  Hey  Hey  Jude \n(ad infinitum)\n```\n\n## Future\n\nBut there's a lot more to do: my idea is to create a reference class for `it` with a function called `give` etc, which will end up in a beautiful, object-oriented R poetry! Or something else.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaroczig%2Fsingr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaroczig%2Fsingr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaroczig%2Fsingr/lists"}