csound 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/csound.rb +57 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a740b782dca09b5ce20793b492bb45fcc19267273d71fff31768dacfcb34c5a
|
4
|
+
data.tar.gz: 44f99b1b5f334b7fe054140801b4c800095190239ab45a12a7a64a90247dd8d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
|