csound 0.0.1 → 0.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/csound.rb +57 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cd3db57e71fd3b7107a000a912ddd99ba78e7e3482006c918695f64abbd4e35
4
- data.tar.gz: 1bb04c780a3ec13ba28fab32ed859071cda82005fe9f9344ebb5f8bc1ce213f9
3
+ metadata.gz: 8a740b782dca09b5ce20793b492bb45fcc19267273d71fff31768dacfcb34c5a
4
+ data.tar.gz: 44f99b1b5f334b7fe054140801b4c800095190239ab45a12a7a64a90247dd8d2
5
5
  SHA512:
6
- metadata.gz: 2acac62033bae48d8579878f8e63c4642176d58a6ff04d0410fef4b63c54836ed3cd4c858f70d3fc2882d75b07a6afec923b5a938199c543f1db9d24a515052f
7
- data.tar.gz: 9e82db9fe81413c6f570b73ae8943bd55dc163f049620c09d3734d550cd8e88e8201359ca49005685270b0ee6765be67e1566357778a753505933282ae991413
6
+ metadata.gz: 0b228bf632fc3710d0b442814f077d9772eb43562758e8d2443c5023e9e84ef1556cd4a22db6b0c887dc7377b629e20de7932d94fb7ca6547fd58f51420ce2f0
7
+ data.tar.gz: b37553b3a4d4a280ae916c478445172d4d22ea545b295f950bcdfe5c1fb0c5f739e09a29ade0b408eb098924db3dde098997c3ea65682cc5d6a3881f9b1a02a8
data/lib/csound.rb CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
1
  require "bundler/inline"
4
2
 
5
3
  gemfile do
@@ -7,11 +5,47 @@ gemfile do
7
5
  gem "ffi", require: true
8
6
  end
9
7
 
8
+ module ControlChannelType
9
+ CSOUND_CONTROL_CHANNEL = 1
10
+ CSOUND_AUDIO_CHANNEL = 2
11
+ CSOUND_STRING_CHANNEL = 3
12
+ CSOUND_PVS_CHANNEL = 4
13
+ CSOUND_VAR_CHANNEL = 5
14
+
15
+ CSOUND_CHANNEL_TYPE_MASK = 15
16
+ CSOUND_INPUT_CHANNEL = 16
17
+ CSOUND_OUTPUT_CHANNEL = 32
18
+ end
19
+
20
+ module ControlChannelBehavior
21
+ CSOUND_CONTROL_CHANNEL_NO_HINTS = 0
22
+ CSOUND_CONTROL_CHANNEL_INT = 1
23
+ CSOUND_CONTROL_CHANNEL_LIN = 2
24
+ CSOUND_CONTROL_CHANNEL_EXP = 3
25
+ end
26
+
27
+ class ControlChannelHints_t < FFI::Struct
28
+ layout :behav, :int, #controlChannelBehavior
29
+ :dflt, :double,
30
+ :min, :double,
31
+ :max, :double,
32
+ :x, :int,
33
+ :y, :int,
34
+ :width, :int,
35
+ :height, :int,
36
+ :attributes, :pointer # char *
37
+ end
38
+
39
+ class ControlChannelInfo_t < FFI::Struct
40
+ layout :name, :string, # char *
41
+ :type, :int,
42
+ :hints, ControlChannelHints_t
43
+ end
44
+
10
45
  module CsoundModule
11
46
  extend FFI::Library
12
47
  ffi_lib '/usr/local/lib/libcsound64.so'
13
48
 
14
-
15
49
  attach_function :csoundCreate,[:pointer],:pointer
16
50
  attach_function :csoundInitialize,[:int],:int
17
51
  attach_function :csoundDestroy,[:pointer],:void
@@ -134,6 +168,14 @@ module CsoundModule
134
168
  attach_function :csoundOpenLibrary,[:pointer,:string],:int
135
169
  attach_function :csoundCloseLibrary,[:pointer],:int
136
170
 
171
+ #Handwritten
172
+ attach_function :csoundSetControlChannel,[:pointer,:string,:double],:void
173
+
174
+ attach_function :csoundGetFirstMessage,[:pointer],:string
175
+
176
+ #Missing
177
+ #csoundSetMessageCallback
178
+ #csoundSetMessageStringCallback
137
179
  end
138
180
 
139
181
  class Csound
@@ -387,7 +429,7 @@ class Csound
387
429
  end
388
430
 
389
431
  def SetMessageLevel(messageLevel)
390
- return CsoundModule.csoundSetMessageLevel(messageLevel)
432
+ CsoundModule.csoundSetMessageLevel(messageLevel)
391
433
  end
392
434
 
393
435
  def CreateMessageBuffer(toStdOut)
@@ -399,7 +441,7 @@ class Csound
399
441
  end
400
442
 
401
443
  def PopFirstMessage()
402
- return CsoundModule.csoundPopFirstMessage(@csound)
444
+ CsoundModule.csoundPopFirstMessage(@csound)
403
445
  end
404
446
 
405
447
  def GetMessageCnt()
@@ -411,7 +453,7 @@ class Csound
411
453
  end
412
454
 
413
455
  def ListChannels(lst)
414
- return CsoundModule.csoundListChannels(lst)
456
+ return CsoundModule.csoundListChannels(@csound,lst)
415
457
  end
416
458
 
417
459
  def DeleteChannelList(lst)
@@ -618,6 +660,15 @@ class Csound
618
660
  return CsoundModule.csoundCloseLibrary(library)
619
661
  end
620
662
 
663
+ #Handwritten
664
+
665
+ def SetControlChannel(channel_name, value)
666
+ CsoundModule.csoundSetControlChannel(@csound, channel_name, value)
667
+ end
668
+
669
+ def GetFirstMessage()
670
+ return CsoundModule.csoundGetFirstMessage(@csound)
671
+ end
621
672
  end
622
673
 
623
674
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csound
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johann Philippe