midiator 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ # midiator Changelog
2
+
3
+ ### 0.3.3 / 2010-11-13
4
+
5
+ * convert build system to hoe
6
+ * convert tests to rspec2
7
+
8
+ ### 0.3.2 / 2009-04-02
9
+
10
+ * minor doc bug fix
11
+
12
+ ### 0.3.1 / 2009-04-02
13
+
14
+ * Added DLSSynth example (Giles Bowkett)
15
+ * Interface#play supports playing multiple notes at once (David Brady)
16
+ * Added cygwin support (Adam Murray)
17
+
18
+ ### 0.3.0 / 2008-11-23
19
+
20
+ * Added method to show allow drivers to give the user instructions
21
+ * Added Control Change (CC) messages (Jeremy Voorhis)
22
+ * Cleaned up CoreMIDI driver (Jeremy Voorhis)
23
+ * Added software synth driver on OSX (Adam Murray & Jeremy Voorhis)
24
+
25
+ ### 0.2.0 / 2008-10-29
26
+
27
+ * Cleaned up MIDI note shortcuts (Xavier Shay)
28
+ * Fixed platform detection with Platform gem (Giles Bowkett)
29
+
30
+ ### 0.1.1 / 2008-10-19
31
+
32
+ * Fix bug in the CoreMIDI driver
33
+
34
+ ### 0.1.0 / 2008-10-19
35
+
36
+ * First release!
37
+
38
+ ### 0.0.1 / 2008-07-04
39
+
40
+ * Project Created
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2008, Ben Bleything <ben@bleything.net>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included
14
+ in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2006, 2007 Topher Cyll
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included
14
+ in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,32 @@
1
+ CHANGELOG.md
2
+ LICENSE
3
+ LICENSE.prp
4
+ Manifest.txt
5
+ README.md
6
+ Rakefile
7
+ examples/a_little_end_music.rb
8
+ examples/amen_break.rb
9
+ examples/chords.rb
10
+ examples/chromatic_scale.rb
11
+ examples/drum_chords.rb
12
+ examples/metronome.rb
13
+ examples/synth.rb
14
+ examples/twinkle.rb
15
+ lib/midiator.rb
16
+ lib/midiator/driver.rb
17
+ lib/midiator/driver_registry.rb
18
+ lib/midiator/drivers/alsa.rb
19
+ lib/midiator/drivers/core_midi.rb
20
+ lib/midiator/drivers/dls_synth.rb
21
+ lib/midiator/drivers/mmj.rb
22
+ lib/midiator/drivers/winmm.rb
23
+ lib/midiator/drums.rb
24
+ lib/midiator/exceptions.rb
25
+ lib/midiator/interface.rb
26
+ lib/midiator/notes.rb
27
+ lib/midiator/timer.rb
28
+ lib/string_extensions.rb
29
+ spec/driver_registry_spec.rb
30
+ spec/driver_spec.rb
31
+ spec/interface_spec.rb
32
+ spec/string_extensions_spec.rb
@@ -0,0 +1,53 @@
1
+ # MIDIator
2
+
3
+ * http://github.com/bleything/midiator
4
+
5
+ ## DESCRIPTION:
6
+
7
+ A nice Ruby interface to your system's MIDI services.
8
+
9
+ MIDIator was inspired by Topher Cyll's fantastic Practical Ruby Projects
10
+ book. In it, Topher describes how to interact with the MIDI providers
11
+ in OSX, Linux, and Windows. As I was reading the book, I noticed some
12
+ things I would do differently, which got me thinking that maybe it
13
+ would be valuable to package up my modifications to the book's code and
14
+ release it as a gem.
15
+
16
+ ## FEATURES:
17
+
18
+ * Cross-platform system for MIDI output
19
+ * Built-in softsynth (OS X only, so far)
20
+
21
+ ## INSTALL:
22
+
23
+ $ [sudo] gem install midiator
24
+
25
+ ## AUTHORS:
26
+
27
+ * Ben Bleything -- ben@bleything.net
28
+ * Topher Cyll -- http://www.cyll.org
29
+
30
+ ## CREDITS:
31
+
32
+ Huge, huge credit goes to Topher Cyll, without whom I would have had
33
+ to figure all of this crap out for myself. Apress also deserves some
34
+ credit; they released all the source in their book under the MIT
35
+ license. That's a big deal and you should buy their books.
36
+
37
+ Props also go to the folks who have contributed patches. In
38
+ alphabetical order:
39
+
40
+ * Giles Bowkett -- gilesb@gmail.com
41
+ * Ruben Medellin -- http://github.com/chubas
42
+ * Adam Murray -- adam@compusition.com
43
+ * Xavier Shay -- http://rhnh.net
44
+ * Jeremy Voorhis -- jvoorhis@gmail.com
45
+
46
+ ## LICENSE:
47
+
48
+ Distributed under the terms of the MIT license. See the LICENSE file
49
+ for complete text and details.
50
+
51
+ Portions of the code are excerpted from Topher Cyll's Practical Ruby
52
+ Projects. That code is also released under the MIT license. See the
53
+ LICENSE.prp file for complete text and details.
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'hoe'
3
+
4
+ Hoe.spec 'midiator' do
5
+ developer 'Ben Bleything', 'ben@bleything.net'
6
+
7
+ ### Use markdown for changelog and readme
8
+ self.history_file = 'CHANGELOG.md'
9
+ self.readme_file = 'README.md'
10
+
11
+ ### Depend on Platform
12
+ self.extra_deps << [ 'Platform', '>= 0.4.0' ]
13
+
14
+ ### Test with rspec
15
+ self.extra_dev_deps << [ 'rspec', '>= 2.1.0' ]
16
+ self.testlib = :rspec
17
+
18
+ end
@@ -0,0 +1,944 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'midiator'
5
+
6
+ midi = MIDIator::Interface.new
7
+ midi.use :dls_synth
8
+
9
+ include MIDIator::Notes
10
+
11
+ scale = [ C4, Cs4, D4, Eb4, E4, F4, Fs4, G4, Gs4, A4, Bb4, B4,
12
+ C5, Cs5, D5, Eb5, E5, F5, Fs5, G5, Gs5, A5, Bb5, B5 ]
13
+
14
+ DATA.each_line do |line|
15
+ num_spaces = line.match( /^(\s+)/ )[1].size rescue 0
16
+ midi.play scale[ num_spaces / 2 ]
17
+ end
18
+
19
+ __END__
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
149
+ end
150
+ end
151
+ end
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
163
+ end
164
+ end
165
+ end
166
+ end
167
+ end
168
+ end
169
+ end
170
+ end
171
+ end
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end
180
+ end
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
187
+ end
188
+ end
189
+ end
190
+ end
191
+ end
192
+ end
193
+ end
194
+ end
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
200
+ end
201
+ end
202
+ end
203
+ end
204
+ end
205
+ end
206
+ end
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
216
+ end
217
+ end
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end
223
+ end
224
+ end
225
+ end
226
+ end
227
+ end
228
+ end
229
+ end
230
+ end
231
+ end
232
+ end
233
+ end
234
+ end
235
+ end
236
+ end
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end
242
+ end
243
+ end
244
+ end
245
+ end
246
+ end
247
+ end
248
+ end
249
+ end
250
+ end
251
+ end
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end
260
+ end
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
269
+ end
270
+ end
271
+ end
272
+ end
273
+ end
274
+ end
275
+ end
276
+ end
277
+ end
278
+ end
279
+ end
280
+ end
281
+ end
282
+ end
283
+ end
284
+ end
285
+ end
286
+ end
287
+ end
288
+ end
289
+ end
290
+ end
291
+ end
292
+ end
293
+ end
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
299
+ end
300
+ end
301
+ end
302
+ end
303
+ end
304
+ end
305
+ end
306
+ end
307
+ end
308
+ end
309
+ end
310
+ end
311
+ end
312
+ end
313
+ end
314
+ end
315
+ end
316
+ end
317
+ end
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
323
+ end
324
+ end
325
+ end
326
+ end
327
+ end
328
+ end
329
+ end
330
+ end
331
+ end
332
+ end
333
+ end
334
+ end
335
+ end
336
+ end
337
+ end
338
+ end
339
+ end
340
+ end
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
348
+ end
349
+ end
350
+ end
351
+ end
352
+ end
353
+ end
354
+ end
355
+ end
356
+ end
357
+ end
358
+ end
359
+ end
360
+ end
361
+ end
362
+ end
363
+ end
364
+ end
365
+ end
366
+ end
367
+ end
368
+ end
369
+ end
370
+ end
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+ end
377
+ end
378
+ end
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
385
+ end
386
+ end
387
+ end
388
+ end
389
+ end
390
+ end
391
+ end
392
+ end
393
+ end
394
+ end
395
+ end
396
+ end
397
+ end
398
+ end
399
+ end
400
+ end
401
+ end
402
+ end
403
+ end
404
+ end
405
+ end
406
+ end
407
+ end
408
+ end
409
+ end
410
+ end
411
+ end
412
+ end
413
+ end
414
+ end
415
+ end
416
+ end
417
+ end
418
+ end
419
+ end
420
+ end
421
+ end
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
436
+ end
437
+ end
438
+ end
439
+ end
440
+ end
441
+ end
442
+ end
443
+ end
444
+ end
445
+ end
446
+ end
447
+ end
448
+ end
449
+ end
450
+ end
451
+ end
452
+ end
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
460
+ end
461
+ end
462
+ end
463
+ end
464
+ end
465
+ end
466
+ end
467
+ end
468
+ end
469
+ end
470
+ end
471
+ end
472
+ end
473
+ end
474
+ end
475
+ end
476
+ end
477
+ end
478
+ end
479
+ end
480
+ end
481
+ end
482
+ end
483
+ end
484
+ end
485
+ end
486
+ end
487
+ end
488
+ end
489
+ end
490
+ end
491
+ end
492
+ end
493
+ end
494
+ end
495
+ end
496
+ end
497
+ end
498
+ end
499
+ end
500
+ end
501
+ end
502
+ end
503
+ end
504
+ end
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end
511
+ end
512
+ end
513
+ end
514
+ end
515
+ end
516
+ end
517
+ end
518
+ end
519
+ end
520
+ end
521
+ end
522
+ end
523
+ end
524
+ end
525
+ end
526
+ end
527
+ end
528
+ end
529
+ end
530
+ end
531
+ end
532
+ end
533
+ end
534
+ end
535
+ end
536
+ end
537
+ end
538
+ end
539
+ end
540
+ end
541
+ end
542
+ end
543
+ end
544
+ end
545
+ end
546
+ end
547
+ end
548
+ end
549
+ end
550
+ end
551
+ end
552
+ end
553
+ end
554
+ end
555
+ end
556
+ end
557
+ end
558
+ end
559
+ end
560
+ end
561
+ end
562
+ end
563
+ end
564
+ end
565
+ end
566
+ end
567
+ end
568
+ end
569
+ end
570
+ end
571
+ end
572
+ end
573
+ end
574
+ end
575
+ end
576
+ end
577
+ end
578
+ end
579
+ end
580
+ end
581
+ end
582
+ end
583
+ end
584
+ end
585
+ end
586
+ end
587
+ end
588
+ end
589
+ end
590
+ end
591
+ end
592
+ end
593
+ end
594
+ end
595
+ end
596
+ end
597
+ end
598
+ end
599
+ end
600
+ end
601
+ end
602
+ end
603
+ end
604
+ end
605
+ end
606
+ end
607
+ end
608
+ end
609
+ end
610
+ end
611
+ end
612
+ end
613
+ end
614
+ end
615
+ end
616
+ end
617
+ end
618
+ end
619
+ end
620
+ end
621
+ end
622
+ end
623
+ end
624
+ end
625
+ end
626
+ end
627
+ end
628
+ end
629
+ end
630
+ end
631
+ end
632
+ end
633
+ end
634
+ end
635
+ end
636
+ end
637
+ end
638
+ end
639
+ end
640
+ end
641
+ end
642
+ end
643
+ end
644
+ end
645
+ end
646
+ end
647
+ end
648
+ end
649
+ end
650
+ end
651
+ end
652
+ end
653
+ end
654
+ end
655
+ end
656
+ end
657
+ end
658
+ end
659
+ end
660
+ end
661
+ end
662
+ end
663
+ end
664
+ end
665
+ end
666
+ end
667
+ end
668
+ end
669
+ end
670
+ end
671
+ end
672
+ end
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end
681
+ end
682
+ end
683
+ end
684
+ end
685
+ end
686
+ end
687
+ end
688
+ end
689
+ end
690
+ end
691
+ end
692
+ end
693
+ end
694
+ end
695
+ end
696
+ end
697
+ end
698
+ end
699
+ end
700
+ end
701
+ end
702
+ end
703
+ end
704
+ end
705
+ end
706
+ end
707
+ end
708
+ end
709
+ end
710
+ end
711
+ end
712
+ end
713
+ end
714
+ end
715
+ end
716
+ end
717
+ end
718
+ end
719
+ end
720
+ end
721
+ end
722
+ end
723
+ end
724
+ end
725
+ end
726
+ end
727
+ end
728
+ end
729
+ end
730
+ end
731
+ end
732
+ end
733
+ end
734
+ end
735
+ end
736
+ end
737
+ end
738
+ end
739
+ end
740
+ end
741
+ end
742
+ end
743
+ end
744
+ end
745
+ end
746
+ end
747
+ end
748
+ end
749
+ end
750
+ end
751
+ end
752
+ end
753
+ end
754
+ end
755
+ end
756
+ end
757
+ end
758
+ end
759
+ end
760
+ end
761
+ end
762
+ end
763
+ end
764
+ end
765
+ end
766
+ end
767
+ end
768
+ end
769
+ end
770
+ end
771
+ end
772
+ end
773
+ end
774
+ end
775
+ end
776
+ end
777
+ end
778
+ end
779
+ end
780
+ end
781
+ end
782
+ end
783
+ end
784
+ end
785
+ end
786
+ end
787
+ end
788
+ end
789
+ end
790
+ end
791
+ end
792
+ end
793
+ end
794
+ end
795
+ end
796
+ end
797
+ end
798
+ end
799
+ end
800
+ end
801
+ end
802
+ end
803
+ end
804
+ end
805
+ end
806
+ end
807
+ end
808
+ end
809
+ end
810
+ end
811
+ end
812
+ end
813
+ end
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end
819
+ end
820
+ end
821
+ end
822
+ end
823
+ end
824
+ end
825
+ end
826
+ end
827
+ end
828
+ end
829
+ end
830
+ end
831
+ end
832
+ end
833
+ end
834
+ end
835
+ end
836
+ end
837
+ end
838
+ end
839
+ end
840
+ end
841
+ end
842
+ end
843
+ end
844
+ end
845
+ end
846
+ end
847
+ end
848
+ end
849
+ end
850
+ end
851
+ end
852
+ end
853
+ end
854
+ end
855
+ end
856
+ end
857
+ end
858
+ end
859
+ end
860
+ end
861
+ end
862
+ end
863
+ end
864
+ end
865
+ end
866
+ end
867
+ end
868
+ end
869
+ end
870
+ end
871
+ end
872
+ end
873
+ end
874
+ end
875
+ end
876
+ end
877
+ end
878
+ end
879
+ end
880
+ end
881
+ end
882
+ end
883
+ end
884
+ end
885
+ end
886
+ end
887
+ end
888
+ end
889
+ end
890
+ end
891
+ end
892
+ end
893
+ end
894
+ end
895
+ end
896
+ end
897
+ end
898
+ end
899
+ end
900
+ end
901
+ end
902
+ end
903
+ end
904
+ end
905
+ end
906
+ end
907
+ end
908
+ end
909
+ end
910
+ end
911
+ end
912
+ end
913
+ end
914
+ end
915
+ end
916
+ end
917
+ end
918
+ end
919
+ end
920
+ end
921
+ end
922
+ end
923
+ end
924
+ end
925
+ end
926
+ end
927
+ end
928
+ end
929
+ end
930
+ end
931
+ end
932
+ end
933
+ end
934
+ end
935
+ end
936
+ end
937
+ end
938
+ end
939
+ end
940
+ end
941
+ end
942
+ end
943
+ end
944
+ end