Skip to content

Commit

Permalink
Merge pull request #9 from arirusso/0.5.0
Browse files Browse the repository at this point in the history
0.5.0
  • Loading branch information
arirusso authored Feb 13, 2022
2 parents f451279 + 8af8161 commit 458c523
Show file tree
Hide file tree
Showing 22 changed files with 346 additions and 402 deletions.
14 changes: 5 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
source "https://rubygems.org"
source 'https://rubygems.org'

group :test do
gem "minitest", "~> 5.5", ">= 5.5.0"
gem "mocha", "~> 1.1", ">= 1.1.0"
gem "rake", "~> 10.4", ">= 10.4.2"
gem "shoulda-context", "~> 1.2", ">= 1.2.1"
end

gem "ffi", "~> 1.9", ">= 1.9.6"
gem 'ffi', '~> 1.15', '>= 1.15.5'
gem 'rake', '~> 13.0', '>= 13.0.6', groups: %i[development test]
gem 'rspec', '~> 3.11', '>= 3.11.0', groups: %i[test]
gem 'rubocop', '~> 1.25', '>= 1.25.1', groups: %i[development test]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2011-2017 Ari Russo
Copyright 2011-2022 Ari Russo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ Also thank you to [Jeremy Voorhis](http://github.com/jvoorhis) for some useful d

Apache 2.0, See the file LICENSE

Copyright (c) 2011-2017 [Ari Russo](http://github.com/arirusso)
Copyright (c) 2011-2022 [Ari Russo](http://github.com/arirusso)
17 changes: 9 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require "rake"
require "rake/testtask"
# frozen_string_literal: true

Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.verbose = true
end
begin
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task :default => [:test]
task default: :spec
rescue LoadError
# no rspec available
end
12 changes: 6 additions & 6 deletions examples/input.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
$:.unshift(File.join("..", "lib"))
# frozen_string_literal: true

require "coremidi"
$LOAD_PATH.unshift(File.join('..', 'lib'))

require 'coremidi'

# This program selects the first midi input and sends an inspection of the first 10 messages
# messages it receives to standard out
Expand All @@ -12,16 +14,14 @@
# or amidi -l from the command line

CoreMIDI::Source.all[0].open do |input|

puts "Using input: #{input.id}, #{input.name}"

puts "send some MIDI to your input now..."
puts 'send some MIDI to your input now...'

num_messages.times do
m = input.gets
puts(m)
end

puts "finished"

puts 'finished'
end
8 changes: 5 additions & 3 deletions examples/list_endpoints.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env ruby
$:.unshift(File.join("..", "lib"))
# frozen_string_literal: true

require "coremidi"
require "pp"
$LOAD_PATH.unshift(File.join('..', 'lib'))

require 'coremidi'
require 'pp'

# This will output a big list of Endpoint objects. Endpoint objects are what's used to input
# and output MIDI messages
Expand Down
20 changes: 8 additions & 12 deletions examples/output.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
$:.unshift(File.join("..", "lib"))
# frozen_string_literal: true

require "coremidi"
$LOAD_PATH.unshift(File.join('..', 'lib'))

require 'coremidi'

# This program selects the first midi output and sends some arpeggiated chords to it

Expand All @@ -13,17 +15,11 @@
# or amidi -l from the command line

CoreMIDI::Destination.first.open do |output|

(0..((octaves-1)*12)).step(12) do |oct|

(0..((octaves - 1) * 12)).step(12) do |oct|
notes.each do |note|

output.puts(0x90, note + oct, 100) # note on
sleep(duration) # wait
output.puts(0x80, note + oct, 100) # note off

output.puts(0x90, note + oct, 100) # NOTE: on
sleep(duration) # wait
output.puts(0x80, note + oct, 100) # NOTE: off
end

end

end
6 changes: 4 additions & 2 deletions examples/sysex_output.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
$:.unshift(File.join("..", "lib"))
# frozen_string_literal: true

require "coremidi"
$LOAD_PATH.unshift(File.join('..', 'lib'))

require 'coremidi'

# This example outputs a raw sysex message to the first Output endpoint
# there will not be any output to the console
Expand Down
24 changes: 13 additions & 11 deletions lib/coremidi.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
# frozen_string_literal: true

#
# ffi-coremidi
# Realtime MIDI IO with Ruby for OSX
#
# (c)2011-2017 Ari Russo
# (c)2011-2022 Ari Russo
# https://github.com/arirusso/ffi-coremidi
#

# Libs
require "ffi"
require "forwardable"
require 'ffi'
require 'forwardable'

# Modules
require "coremidi/api"
require "coremidi/endpoint"
require "coremidi/type_conversion"
require 'coremidi/api'
require 'coremidi/endpoint'
require 'coremidi/type_conversion'

# Classes
require "coremidi/entity"
require "coremidi/device"
require "coremidi/source"
require "coremidi/destination"
require 'coremidi/entity'
require 'coremidi/device'
require 'coremidi/source'
require 'coremidi/destination'

module CoreMIDI
VERSION = "0.4.1"
VERSION = '0.5.0'
end
Loading

0 comments on commit 458c523

Please sign in to comment.