# %infile and CMask

**URL:** <https://forum.csound.com/t/infile-and-cmask/174>\
**Category:** Blue\
**Created:** [February 28, 2021, 1:15pm UTC](https://forum.csound.com/t/infile-and-cmask/174 "2021-02-28T13:15:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjingboem](https://forum.csound.com/user_avatar/forum.csound.com/tjingboem/32/44_2.png) [@tjingboem](https://forum.csound.com/u/tjingboem)\
**Post date:** [February 28, 2021, 1:15pm UTC](https://forum.csound.com/t/infile-and-cmask/174/1 "2021-02-28T13:15:50Z")

</div>

Hi,  
i downloaded today the cmask version from [GitHub - kunstmusik/cmask: Cmask by Andre Bartetzki](https://github.com/kunstmusik/cmask)  
i built it and it did a fine job at that:  
menno@mennoASUSZ170 ~ $ cd /home/menno/bin/CMaskSteven/cmask-master/source  
menno@mennoASUSZ170 ~/bin/CMaskSteven/cmask-master/source $ make  
g++ -O -c cmask.cpp  
g++ -O -c event.cpp  
g++ -O -c field.cpp  
g++ -O -c fileio.cpp  
g++ -O -c gen.cpp  
g++ -O -c mask.cpp  
g++ -O -c parser.cpp  
parser.cpp: In member function ‘void scanner::calc(long int, paramliste&, long int)’:  
parser.cpp:1384:20: warning: ‘%ld’ directive writing between 1 and 19 bytes into a region of size 3 [-Wformat-overflow=]  
1384 | sprintf(pstr,"\tp%ld",i);  
| ^~~  
parser.cpp:1384:16: note: directive argument in the range [4, 9223372036854775807]  
1384 | sprintf(pstr,"\tp%ld",i);  
| ^ ~~~~~~~  
In file included from /usr/include/stdio.h:867,  
from /usr/include/c++/9/cstdio:42,  
from parser.cpp:3:  
/usr/include/x86\_64-linux-gnu/bits/stdio2.h:36:34: note: ‘\_\_builtin\_\_\_sprintf\_chk’ output between 4 and 22 bytes into a destination of size 5  
36 | return \_\_builtin\_\_\_sprintf\_chk (\_\_s, \_\_USE\_FORTIFY\_LEVEL - 1,  
| ~~^~~~~~~~  
37 | \_\_bos (\_\_s), \_\_fmt, \_\_va\_arg\_pack ());  
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
parser.cpp:1387:85: warning: ‘%s’ directive writing up to 1023 bytes into a region of size between 325 and 964 [-Wformat-overflow=]  
1387 | ------ begin of field %ld — seconds: %.2f - %.2f --------%s%s%s%s",NL,fn,p.beginn,p.ende,NL,dummy,NL,NL);  
| ^~ ~~~~~

In file included from /usr/include/stdio.h:867,  
from /usr/include/c++/9/cstdio:42,  
from parser.cpp:3:  
/usr/include/x86\_64-linux-gnu/bits/stdio2.h:36:34: note: ‘\_\_builtin\_\_\_sprintf\_chk’ output between 63 and 1725 bytes into a destination of size 1024  
36 | return \_\_builtin\_\_\_sprintf\_chk (\_\_s, \_\_USE\_FORTIFY\_LEVEL - 1,  
| ~~^~~~~~~~  
37 | \_\_bos (\_\_s), \_\_fmt, \_\_va\_arg\_pack ());  
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
g++ -O -c quant.cpp  
g++ -O -c items.cpp  
items.cpp: In member function ‘double itemlist::folder()’:  
items.cpp:116:2: warning: no return statement in function returning non-void [-Wreturn-type]  
116 | }  
| ^  
g++ -O -c tables.cpp  
g++ -O -c utils.cpp  
g++ -v -O -o cmask cmask.o event.o field.o fileio.o gen.o mask.o parser.o quant.o items.o tables.o utils.o -lm  
Using built-in specs.  
COLLECT\_GCC=g++  
COLLECT\_LTO\_WRAPPER=/usr/lib/gcc/x86\_64-linux-gnu/9/lto-wrapper  
OFFLOAD\_TARGET\_NAMES=nvptx-none:hsa  
OFFLOAD\_TARGET\_DEFAULT=1  
Target: x86\_64-linux-gnu  
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 9.3.0-17ubuntu1~20.04’ --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86\_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86\_64-linux-gnu --host=x86\_64-linux-gnu --target=x86\_64-linux-gnu  
Thread model: posix  
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)  
COMPILER\_PATH=/usr/lib/gcc/x86\_64-linux-gnu/9/:/usr/lib/gcc/x86\_64-linux-gnu/9/:/usr/lib/gcc/x86\_64-linux-gnu/:/usr/lib/gcc/x86\_64-linux-gnu/9/:/usr/lib/gcc/x86\_64-linux-gnu/  
LIBRARY\_PATH=/usr/lib/gcc/x86\_64-linux-gnu/9/:/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/x86\_64-linux-gnu/:/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/…/lib/:/lib/x86\_64-linux-gnu/:/lib/…/lib/:/usr/lib/x86\_64-linux-gnu/:/usr/lib/…/lib/:/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/:/lib/:/usr/lib/  
COLLECT\_GCC\_OPTIONS=’-v’ ‘-O’ ‘-o’ ‘cmask’ ‘-shared-libgcc’ ‘-mtune=generic’ ‘-march=x86-64’  
/usr/lib/gcc/x86\_64-linux-gnu/9/collect2 -plugin /usr/lib/gcc/x86\_64-linux-gnu/9/liblto\_plugin.so -plugin-opt=/usr/lib/gcc/x86\_64-linux-gnu/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccJewpWt.res -plugin-opt=-pass-through=-lgcc\_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc\_s -plugin-opt=-pass-through=-lgcc --build-id --eh-frame-hdr -m elf\_x86\_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmask /usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/x86\_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/x86\_64-linux-gnu/crti.o /usr/lib/gcc/x86\_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86\_64-linux-gnu/9 -L/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/x86\_64-linux-gnu -L/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/…/lib -L/lib/x86\_64-linux-gnu -L/lib/…/lib -L/usr/lib/x86\_64-linux-gnu -L/usr/lib/…/lib -L/usr/lib/gcc/x86\_64-linux-gnu/9/…/…/… cmask.o event.o field.o fileio.o gen.o mask.o parser.o quant.o items.o tables.o utils.o -lstdc++ -lm -lgcc\_s -lgcc -lc -lgcc\_s -lgcc /usr/lib/gcc/x86\_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86\_64-linux-gnu/9/…/…/…/x86\_64-linux-gnu/crtn.o  
COLLECT\_GCC\_OPTIONS=’-v’ ‘-O’ ‘-o’ ‘cmask’ ‘-shared-libgcc’ ‘-mtune=generic’ ‘-march=x86-64’  
menno@mennoASUSZ170 ~/bin/CMaskSteven/cmask-master/source $

When i run cmask from the terminal, it works:  
menno@mennoASUSZ170 ~/bin/CMaskSteven/cmask-master/source $ ./cmask SimpleTest  
-------- CMask 0.31 --------  
----- Modified Version -----  
-------- Feb 28 2021 -------

parameter file: SimpleTest  
Score file: SimpleTest.sco

===== Field: 1 ==================

Duration from 0 to 10

pfields: p1 p2 p3

10 events generated.

score file OK

* * *

The input file i used (SimpleTest) was super simple:

f 0 10

p1 const 1

p2 const 1

p3 const 1

Also, the testfiles included in this cmask version worked okay.  
Next thing i wanted to do is to run this cmask version from within Blue:

/home/menno/bin/CMaskSteven/cmask-master/source/cmask %infile %outfile

using the External Object.  
but got an empty window.  
Can it be that there is an issue with %infile?

---

<div class="post-metadata">

**Author:** ![stevenyi](https://forum.csound.com/user_avatar/forum.csound.com/stevenyi/32/4_2.png) [@stevenyi](https://forum.csound.com/u/stevenyi)\
**Post date:** [February 28, 2021, 4:27pm UTC](https://forum.csound.com/t/infile-and-cmask/174/2 "2021-02-28T16:27:35Z")

</div>

> [@tjingboem](#):
>
> /home/menno/bin/CMaskSteven/cmask-master/source/cmask %infile %outfile

I think it might be a simple problem to change from %infile %outfile to $infile $outfile?

---

<div class="post-metadata">

**Author:** ![tjingboem](https://forum.csound.com/user_avatar/forum.csound.com/tjingboem/32/44_2.png) [@tjingboem](https://forum.csound.com/u/tjingboem)\
**Post date:** [February 28, 2021, 6:03pm UTC](https://forum.csound.com/t/infile-and-cmask/174/3 "2021-02-28T18:03:00Z")

</div>

Could it be so simple? Yes, it is.  
My mistake- all works.
