-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilecheckModule.binstr
108 lines (100 loc) · 3.88 KB
/
FilecheckModule.binstr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<instrument type='blue.orchestra.BlueSynthBuilder' editEnabled='true'>
<name>FilecheckModule</name>
<comment>
DESCRIPTION:
The FilecheckModule imports a File, in this case a soundfile. It checks for the most common formats.
- if it turns out not to be the right format, jumps to LABEL nosound:
No sound but also no error is produced.</comment>
<globalOrc/>
<globalSco/>
<instrumentText>;0 inputs, 2 output control signals
;;===============================File checker===================================
Suf StrSuf <file>, 1
iok1 strcmp "wav", Suf ; specify wanted file extensions
iok2 strcmp "flac", Suf
iok3 strcmp "ogg", Suf
iok4 strcmp "mp3", Suf
iok5 strcmp "aif", Suf
iok6 strcmp "aiff", Suf
if (iok1 == 0) || (iok2 == 0) ||(iok1 == 0) || (iok3 == 0) ||(iok4 == 0) || (iok5 == 0) ||(iok6 == 0) then
else
prints "\nnot an audiofile!\n" ; not the suffix from the list
goto nosound ; jump to label
endif
;asig diskin2 <file>, 1
; place after blueMixerOut asig1 [, asig2...]
nosound: ; label
</instrumentText>
<alwaysOnInstrumentText></alwaysOnInstrumentText>
<graphicInterface editEnabled='false'>
<gridSettings>
<width>10</width>
<height>10</height>
<gridStyle>DOT</gridStyle>
<snapGridEnabled>true</snapGridEnabled>
</gridSettings>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
<objectName></objectName>
<x>0</x>
<y>0</y>
<groupName>Group</groupName>
<backgroundColor>0x00000033</backgroundColor>
<borderColor>0x000000ff</borderColor>
<labelTextColor>0xffffffff</labelTextColor>
<titleEnabled>true</titleEnabled>
<width>20</width>
<height>20</height>
<font>
<name>Roboto</name>
<size>12.0</size>
<style>0</style>
</font>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBFileSelector'>
<objectName>file</objectName>
<x>86</x>
<y>20</y>
<comment>import sample to use</comment>
<fileName>/media/menno/datae/EigenWerk/samples3/accKlankM/accKlankM01.wav</fileName>
<textFieldWidth>500</textFieldWidth>
<stringChannelEnabled>true</stringChannelEnabled>
</bsbObject>
<bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
<objectName></objectName>
<x>10</x>
<y>21</y>
<label>sample</label>
<font>
<name>Roboto</name>
<size>20.0</size>
<style>0</style>
</font>
</bsbObject>
</bsbObject>
</graphicInterface>
<parameterList/>
<presetGroup name='Presets'/>
<opcodeList>
<udo>
<opcodeName>StrSuf</opcodeName>
<outTypes>S</outTypes>
<inTypes>So</inTypes>
<codeBody> ;returns the suffix of a filename or path, optional in lower case
Spath,ilow xin
ipos strrindex Spath, "."
Suf strsub Spath, ipos+1
if ilow != 0 then
Suf strlower Suf
endif
xout Suf
</codeBody>
<comments>/****************************************************************************
Suf StrSuf Spath [,ilow]
Returns the suffix of a filename or path, optional in lower case
Returns the suffix (extension) of a filename or a full path, optional in lower case.
written by joachim heintz
Spath - full pathname (or filename) as string
ilow - return ensuring lower case (1) or return as in Spath (0 = default)
****************************************************************************/</comments>
</udo>
</opcodeList>
</instrument>