{"id":16711759,"url":"https://github.com/bburdette/chordpredictor","last_synced_at":"2025-09-18T23:47:29.929Z","repository":{"id":35518134,"uuid":"39788548","full_name":"bburdette/ChordPredictor","owner":"bburdette","description":"Analyse and generate chord sequences","archived":false,"fork":false,"pushed_at":"2015-08-05T21:20:16.000Z","size":65168,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T17:24:11.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/bburdette.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":"2015-07-27T17:37:35.000Z","updated_at":"2021-01-01T03:45:10.000Z","dependencies_parsed_at":"2022-09-08T17:41:23.028Z","dependency_job_id":null,"html_url":"https://github.com/bburdette/ChordPredictor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bburdette/ChordPredictor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bburdette%2FChordPredictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bburdette%2FChordPredictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bburdette%2FChordPredictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bburdette%2FChordPredictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bburdette","download_url":"https://codeload.github.com/bburdette/ChordPredictor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bburdette%2FChordPredictor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262432283,"owners_count":23310216,"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-10-12T20:26:21.859Z","updated_at":"2025-09-18T23:47:24.872Z","avatar_url":"https://github.com/bburdette.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChordPredictor\nAnalyse and generate chord sequences\n\nChordPredictor is a set of software tools to generate randomized midi files containing chord sequences.\n\nmidi2csv is a haskell program that converts midi files to CSV format, while 'canonicalizing' chords.  It only processes groups of 3 or more simultaneous notes. \n\nthe scala/figaro component reads in the CSV files and builds probability tables for duration, chord type, and root note.  It uses these to generate randomized midi files.\n\ncsv2midi is a python program that reads in the csv files from scala and creates midi files for playback.  \n\n### Building midi2csv:\n\n- first install haskell and cabal, the haskell build tool.  If your cabal is new enough, hopefully the following will work:\n\n```\n\u003e cd midi2csv\n\u003e cabal sandbox init  (optional step, but recommended)\n\u003e cabal install\n```\n\nThe executable will end up in midi2csv/.cabal_sandbox/bin/midi2csv.  If you don't use the sandbox, then it will go in ~/.cabal/bin.  \n\n### Using midi2csv\n\nYou can use midi2csv with no parameters to get the syntax.  Essentially you just pass it the filename of the file you want to convert, and the filename of the output file.  For example:\n\n```\n\u003e midi2csv vexation.mid vexation.csv\n```\n### Using the scala component\n\nIn order to run the model as is, you only need to change the names in \nthe src/main/scala/fileNames.scala file.  Direct them as follows:\n\n - melodyMatrixFileName= the file in which you will store the note transitions\n - testFileDirectory= the directory in which the training csv files are held.\n - newSongFileName= the name of the file in which you will store the new song\n - chordMatrixFileName= the file in which you store the chord transitions\n - timeMatrixFileName= the name of the file in which you will store the time transitions.\n \nChange the length of the song in figModel if you want (variable is numIterations) it is currently at 100.\n\nThen run musicProcessing.figModel as your main file.  That is it.\n\n### Using csv2midi\n\ncsv2midi is a Python 2 program that converts output CSV file to playable midis.\nIt requires the Python package Midi (which requires packages alsalib and 'swig'). To install:\n\n```\n\u003e sudo apt-get install swig alsalib python-dev          // if I remember correctly...\n\u003e git clone https://github.com/vishnubob/python-midi\n\u003e cd python-midi\n\u003e python setup.py install\n\u003e pip install midi\n```\n\nOn nixos:\n\n```\n\u003e git clone https://github.com/vishnubob/python-midi     \n\u003e cd chordpredictor/csv2midi\n\u003e nix-shell                             // make python and other libs available\n\u003e virtualenv .                          // create a virtualenv in csv2midi\n\u003e source bin/activate                   // activate the virtualenv\n\u003e cd ../../python-midi    \n\u003e python setup.py install               // install python-midi into our csv2midi virtualenv\n\u003e cd ../chordpredictor/csv2midi         // cd back, ready to go hopefully\n```\n\nTo run csv2midi, run csv2midi.py through the Python 2 interpreter:\n\n```\n\u003e python csv2midi \u003cinput CSV file\u003e \u003coutput MIDI file\u003e\n```\n\nExample:\n\n```\n\u003e python csv2midi free_bird.csv free_bird.mid\n```\nThen use the midi player of your choice to listen to free_bird.mid!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbburdette%2Fchordpredictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbburdette%2Fchordpredictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbburdette%2Fchordpredictor/lists"}