{"id":21570406,"url":"https://github.com/arirusso/midi-message","last_synced_at":"2025-04-10T14:12:43.941Z","repository":{"id":56883662,"uuid":"1638314","full_name":"arirusso/midi-message","owner":"arirusso","description":"Ruby MIDI message objects","archived":false,"fork":false,"pushed_at":"2022-02-22T02:37:18.000Z","size":225,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-24T13:17:53.050Z","etag":null,"topics":["midi","midi-messages","music","parsing","ruby","sysex-messages"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arirusso.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":"2011-04-20T00:42:04.000Z","updated_at":"2020-07-19T03:18:42.000Z","dependencies_parsed_at":"2022-08-20T13:10:43.157Z","dependency_job_id":null,"html_url":"https://github.com/arirusso/midi-message","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/arirusso%2Fmidi-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fmidi-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fmidi-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fmidi-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arirusso","download_url":"https://codeload.github.com/arirusso/midi-message/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248232687,"owners_count":21069489,"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":["midi","midi-messages","music","parsing","ruby","sysex-messages"],"created_at":"2024-11-24T11:12:33.094Z","updated_at":"2025-04-10T14:12:43.920Z","avatar_url":"https://github.com/arirusso.png","language":"Ruby","readme":"# MIDI Message\n\n![midi](http://img208.imageshack.us/img208/5623/mks80small.jpg)\n\nRuby MIDI message objects\n\n## Features\n\n* Flexible API to accommodate various sources and destinations of MIDI data\n* Simple approach to System Exclusive data and devices\n* [YAML dictionary of MIDI constants](https://github.com/arirusso/midi-message/blob/master/lib/midi.yml)\n\n## Install\n\n`gem install midi-message`\n\nOr if you're using Bundler, add this to your Gemfile\n\n`gem \"midi-message\"`\n\n## Usage\n\n```ruby\nrequire \"midi-message\"\n```\n\n#### Basic Messages\n\nThere are a few ways to create a new MIDI message.  Here are some examples\n\n```ruby\nMIDIMessage::NoteOn.new(0, 64, 64)\n\nMIDIMessage::NoteOn[\"E4\"].new(0, 100)\n\nMIDIMessage.with(:channel =\u003e 0, :velocity =\u003e 100) { note_on(\"E4\") }\n```\n\nThose expressions all evaluate to the same object\n\n```ruby\n#\u003cMIDIMessage::NoteOn:0x9c1c240\n   @channel=0,\n   @data=[64, 64],\n   @name=\"E4\",\n   @note=64,\n   @status=[9, 0],\n   @velocity=64,\n   @verbose_name=\"Note On: E4\"\u003e\n```\n\n#### SysEx Messages\n\nAs with any kind of message, you can begin with raw data\n\n```ruby\nMIDIMessage::SystemExclusive.new(0xF0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x00, 0x7F, 0x00, 0x41, 0xF7)\n```\n\nOr in a more object oriented way\n\n```ruby  \nsynth = SystemExclusive::Node.new(0x41, :model_id =\u003e 0x42, :device_id =\u003e 0x10)\n\nSystemExclusive::Command.new([0x40, 0x7F, 0x00], 0x00, :node =\u003e synth)\n```\n\nA Node represents a device that you're sending a message to (eg. your Yamaha DX7 is a Node).  Sysex messages can either be a Command or Request\n\nYou can use the Node to instantiate a message\n\n```ruby  \nsynth.command([0x40, 0x7F, 0x00], 0x00)\n```\n\nOne way or another, you will wind up with a pair of objects like this\n\n```ruby\n#\u003cMIDIMessage::SystemExclusive::Command:0x9c1e57c\n   @address=[64, 0, 127],\n   @checksum=[65],\n   @data=[0],\n   @node=\n    #\u003cMIDIMessage::SystemExclusive::Node:0x9c1e5a4\n     @device_id=16,\n     @manufacturer_id=65,\n     @model_id=66\u003e\u003e\n```\n\n#### Parsing\n\nThe parse method will take any valid message data and return the object representation\n\n```ruby\nMIDIMessage.parse(0x90, 0x40, 0x40)\n\n  #\u003cMIDIMessage::NoteOn:0x9c1c240 ..\u003e\n\nMIDIMessage.parse(0xF0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x00, 0x7F, 0x00, 0x41, 0xF7)\n\n  #\u003cMIDIMessage::SystemExclusive::Command:0x9c1e57c ..\u003e\n```\n\nCheck out [nibbler](http://github.com/arirusso/nibbler) for more advanced parsing\n\n## Documentation\n\n* [rdoc](http://rubydoc.info/github/arirusso/midi-message)\n\n## Author\n\n* [Ari Russo](http://github.com/arirusso) \u003cari.russo at gmail.com\u003e\n\n## License\n\nApache 2.0, See the file LICENSE\n\nCopyright (c) 2011-2015 [Ari Russo](http://arirusso.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fmidi-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farirusso%2Fmidi-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fmidi-message/lists"}