midi-communications-macos 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -8
- data/README.md +11 -9
- data/Rakefile +3 -0
- data/lib/midi-communications-macos/api.rb +4 -4
- data/lib/midi-communications-macos.rb +1 -1
- data/midi-communications-macos.gemspec +11 -4
- metadata +63 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ced6ec8152e9e24a805d8ceff708fa9a18cf94adb03155569740e3324b8cb6f
|
4
|
+
data.tar.gz: 99e1fefe52df6117b865c120a3b0463a232d4aabe98f4373d4a5078d960ab802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8b42bbe039f2d092d793289655930d050863b8d35dd1e5f3f4aec000a52b6d3e0c444a7e8a0cdb5103f284b8fdb8c8456a2f69e393b04dde54e5d4c867cad82
|
7
|
+
data.tar.gz: ca248f1723a511940f76c63fb21e87b40d56cac73edf36adcce08847a748fb1493494adfaa238d5b8cd3edf9ad7ee91049d219f787b2c2f8f516395921e459dc
|
data/Gemfile
CHANGED
@@ -1,10 +1,3 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
4
|
-
gem 'minitest', '~> 5.14', '>= 5.14.4'
|
5
|
-
gem 'mocha', '~> 1.13', '>= 1.13.0'
|
6
|
-
gem 'rake', '~> 13.0', '>= 13.0.6'
|
7
|
-
gem 'shoulda-context', '~> 2.0', '>= 2.0.0'
|
8
|
-
end
|
9
|
-
|
10
|
-
gem 'ffi', '~> 1.15', '>= 1.15.4'
|
3
|
+
gemspec
|
data/README.md
CHANGED
@@ -25,6 +25,7 @@ This library is based on [Ari Russo's](http://github.com/arirusso) library [ffi-
|
|
25
25
|
* Generalized handling of different MIDI Message types (including SysEx)
|
26
26
|
* Timestamped input events
|
27
27
|
* Patch MIDI via software to other programs using IAC
|
28
|
+
* No events history and no buffers optimization
|
28
29
|
|
29
30
|
## Requirements
|
30
31
|
|
@@ -48,7 +49,7 @@ Otherwise
|
|
48
49
|
|
49
50
|
[MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos) is mostly a clone of [ffi-coremidi](https://github.com/arirusso/ffi-coremidi) with some modifications:
|
50
51
|
* Added locking behaviour when waiting midi events
|
51
|
-
* Removed process history information logging (to reduce CPU usage in some scenarios)
|
52
|
+
* Removed buffering and process history information logging (to reduce CPU usage in some scenarios)
|
52
53
|
* Improved MIDI devices name detection
|
53
54
|
* Source updated to Ruby 2.7 code conventions (method keyword parameters instead of options = {}, hash keys as 'key:' instead of ':key =>', etc.)
|
54
55
|
* Updated dependencies versions
|
@@ -76,15 +77,16 @@ that, **with some modifications**, I've been using in MusaDSL.
|
|
76
77
|
After thinking about the best approach to publish MusaDSL
|
77
78
|
I've decided to publish my own renamed version of the modified dependencies because:
|
78
79
|
|
80
|
+
* The original libraries have features
|
81
|
+
(buffering, very detailed logging and processing history information, not locking behaviour when waiting input midi messages)
|
82
|
+
that are not needed in MusaDSL and, in fact,
|
83
|
+
can degrade the performance on some use cases in MusaDSL.
|
84
|
+
* The requirements for **Musa DSL** users probably will evolve in time, so it will be easier to maintain an independent source code base.
|
79
85
|
* Some differences on the approach of the modifications vs the original library doesn't allow to merge the modifications on the original libraries.
|
80
86
|
* Then the renaming of the libraries is needed to avoid confusing existent users of the original libraries.
|
81
87
|
* Due to some of the interdependencies of Ari Russo libraries,
|
82
88
|
the modification and renaming on some of the low level libraries (ffi-coremidi, etc.)
|
83
89
|
forces to modify and rename unimidi library.
|
84
|
-
* The original libraries have features
|
85
|
-
(very detailed logging and processing history information, not locking behaviour when waiting input midi messages)
|
86
|
-
that are not needed in MusaDSL and, in fact,
|
87
|
-
can degrade the performance on some use case scenarios in MusaDSL.
|
88
90
|
|
89
91
|
All in all I have decided to publish a suite of libraries optimized for MusaDSL use case that also can be used by other people in their projects.
|
90
92
|
|
@@ -92,8 +94,8 @@ All in all I have decided to publish a suite of libraries optimized for MusaDSL
|
|
92
94
|
| --- | --- | --- | --- |
|
93
95
|
| MIDI Events representation | [MIDI Events](https://github.com/javier-sy/midi-events) | [MIDI Message](https://github.com/arirusso/midi-message) | removed parsing, small improvements |
|
94
96
|
| MIDI Data parsing | [MIDI Parser](https://github.com/javier-sy/midi-parser) | [Nibbler](https://github.com/arirusso/nibbler) | removed process history information, minor optimizations |
|
95
|
-
| MIDI communication with Instruments and Control Surfaces | [MIDI Communications](https://github.com/javier-sy/midi-communications) | [unimidi](https://github.com/arirusso/unimidi) | use of [MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos)
|
96
|
-
| Low level MIDI interface to MacOS | [MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos) | [ffi-coremidi](https://github.com/arirusso/ffi-coremidi) | removed process history information, locking behaviour when waiting midi events, improved midi devices name detection, minor optimizations |
|
97
|
+
| MIDI communication with Instruments and Control Surfaces | [MIDI Communications](https://github.com/javier-sy/midi-communications) | [unimidi](https://github.com/arirusso/unimidi) | use of [MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos, removed process history information, removed buffering, removed command line script)
|
98
|
+
| Low level MIDI interface to MacOS | [MIDI Communications MacOS Layer](https://github.com/javier-sy/midi-communications-macos) | [ffi-coremidi](https://github.com/arirusso/ffi-coremidi) | removed buffering and process history information, locking behaviour when waiting midi events, improved midi devices name detection, minor optimizations |
|
97
99
|
| Low level MIDI interface to Linux | **TO DO** | | |
|
98
100
|
| Low level MIDI interface to JRuby | **TO DO** | | |
|
99
101
|
| Low level MIDI interface to Windows | **TO DO** | | |
|
@@ -104,7 +106,7 @@ All in all I have decided to publish a suite of libraries optimized for MusaDSL
|
|
104
106
|
|
105
107
|
## Acknowledgements
|
106
108
|
|
107
|
-
Thanks to [Ari Russo](http://github.com/arirusso) for his ruby library [ffi-coremidi](https://github.com/arirusso/ffi-coremidi) licensed
|
109
|
+
Thanks to [Ari Russo](http://github.com/arirusso) for his ruby library [ffi-coremidi](https://github.com/arirusso/ffi-coremidi) licensed under Apache License 2.0.
|
108
110
|
|
109
111
|
As explained by **Ari Russo** regarding his library **ffi-coremidi**:
|
110
112
|
* **ffi-coremidi** began with some coremidi/ffi binding code for MIDI output by [Colin Harris](http://github.com/aberant) contained in [his fork of MIDIator](http://github.com/aberant/midiator) and a [blog post](http://aberant.tumblr.com/post/694878119/sending-midi-sysex-with-core-midi-and-ruby-ffi).
|
@@ -113,6 +115,6 @@ As explained by **Ari Russo** regarding his library **ffi-coremidi**:
|
|
113
115
|
|
114
116
|
### License
|
115
117
|
|
116
|
-
[MIDI
|
118
|
+
[MIDI Communicatios MacOS Layer](https://github.com/javier-sy/midi-communications-macos) Copyright (c) 2021 [Javier Sánchez Yeste](https://yeste.studio), licensed under LGPL 3.0 License
|
117
119
|
|
118
120
|
[ffi-coremidi](https://github.com/arirusso/ffi-coremidi) Copyright (c) 2011-2017 [Ari Russo](http://arirusso.com), licensed under Apache License 2.0 (see the file LICENSE.ffi-coremidi)
|
data/Rakefile
CHANGED
@@ -51,7 +51,7 @@ module MIDICommunicationsMacOS
|
|
51
51
|
|
52
52
|
# Pack the given data into a midi-communications-macos MIDI packet (used by Destination)
|
53
53
|
def self.get_midi_packet(data)
|
54
|
-
format =
|
54
|
+
format = 'C' * data.size
|
55
55
|
packed_data = data.pack(format)
|
56
56
|
char_size = FFI.type_size(:char) * data.size
|
57
57
|
bytes = FFI::MemoryPointer.new(char_size)
|
@@ -97,11 +97,11 @@ module MIDICommunicationsMacOS
|
|
97
97
|
packet_list = FFI::MemoryPointer.new(256)
|
98
98
|
packet_ptr = API.MIDIPacketListInit(packet_list)
|
99
99
|
time = HostTime.AudioGetCurrentHostTime
|
100
|
-
|
100
|
+
if X86_64
|
101
101
|
API.MIDIPacketListAdd(packet_list, 256, packet_ptr, time, size, bytes)
|
102
102
|
else
|
103
103
|
# Pass in two 32-bit 0s for the 64 bit time
|
104
|
-
|
104
|
+
API.MIDIPacketListAdd(packet_list, 256, packet_ptr, time >> 32, time & 0xFFFFFFFF, size, bytes)
|
105
105
|
end
|
106
106
|
packet_list
|
107
107
|
end
|
@@ -130,7 +130,7 @@ module MIDICommunicationsMacOS
|
|
130
130
|
bytes = FFI::MemoryPointer.new(length + 1)
|
131
131
|
|
132
132
|
if CF.CFStringGetCString(string, bytes, length + 1, :kCFStringEncodingUTF8)
|
133
|
-
bytes.read_string.force_encoding(
|
133
|
+
bytes.read_string.force_encoding('utf-8')
|
134
134
|
end
|
135
135
|
ensure
|
136
136
|
CF.CFRelease(string) unless string.nil? || string.null?
|
@@ -1,18 +1,17 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'midi-communications-macos'
|
3
|
-
s.version = '0.5.
|
4
|
-
s.date = '2021-11-
|
3
|
+
s.version = '0.5.1'
|
4
|
+
s.date = '2021-11-19'
|
5
5
|
s.summary = 'Realtime MIDI IO with Ruby for OSX'
|
6
6
|
s.description = 'Access the Apple Core MIDI framework API with Ruby.'
|
7
7
|
s.authors = ['Javier Sánchez Yeste']
|
8
8
|
s.email = ['javier.sy@gmail.com']
|
9
9
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
10
|
-
s.homepage = '
|
10
|
+
s.homepage = 'https://rubygems.org/gems/midi-communications-macos'
|
11
11
|
s.license = 'LGPL-3.0'
|
12
12
|
|
13
13
|
s.required_ruby_version = '~> 2.7'
|
14
14
|
|
15
|
-
s.add_runtime_dependency 'ffi', '~> 1.15', '>= 1.15.4'
|
16
15
|
|
17
16
|
# TODO
|
18
17
|
#s.metadata = {
|
@@ -21,4 +20,12 @@ Gem::Specification.new do |s|
|
|
21
20
|
# "documentation_uri" => "",
|
22
21
|
# "changelog_uri" => ""
|
23
22
|
#}
|
23
|
+
|
24
|
+
s.add_runtime_dependency 'ffi', '~> 1.15', '>= 1.15.4'
|
25
|
+
|
26
|
+
s.add_development_dependency 'minitest', '~> 5.14', '>= 5.14.4'
|
27
|
+
s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
|
28
|
+
s.add_development_dependency 'shoulda-context', '~> 2.0', '>= 2.0.0'
|
24
29
|
end
|
30
|
+
|
31
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: midi-communications-macos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Javier Sánchez Yeste
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -30,6 +30,66 @@ dependencies:
|
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.15.4
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: minitest
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.14'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 5.14.4
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.14'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 5.14.4
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: rake
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '13.0'
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 13.0.6
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '13.0'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 13.0.6
|
73
|
+
- !ruby/object:Gem::Dependency
|
74
|
+
name: shoulda-context
|
75
|
+
requirement: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '2.0'
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.0.0
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 2.0.0
|
33
93
|
description: Access the Apple Core MIDI framework API with Ruby.
|
34
94
|
email:
|
35
95
|
- javier.sy@gmail.com
|
@@ -58,7 +118,7 @@ files:
|
|
58
118
|
- lib/midi-communications-macos/source.rb
|
59
119
|
- lib/midi-communications-macos/type_conversion.rb
|
60
120
|
- midi-communications-macos.gemspec
|
61
|
-
homepage:
|
121
|
+
homepage: https://rubygems.org/gems/midi-communications-macos
|
62
122
|
licenses:
|
63
123
|
- LGPL-3.0
|
64
124
|
metadata: {}
|