Csound Csound-dev Csound-tekno Search About

How to read external files on android with csound?

Date2016-05-12 11:34
FromAnton Kholomiov
SubjectHow to read external files on android with csound?
I'd like to read soundfont or wave-file from my csound code on Android.
I place both resources  (csd-file and wav or sf2 file) in the raw folder.
But the problem is that I can not reference the sample from the
csound code since the android changes the file name. 

Is there some workaround for this? 

I can read/parse the path in the Java code and send it with message
if I'm going to read the audio samples. But with sf2 I have to declare
the path in the init instr (at the header). So is it possible to get the 
filename for a soundfont?

Anton
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-05-12 11:45
FromAnton Kholomiov
SubjectRe: How to read external files on android with csound?
Maybe it's possible to preprocess the file. To parse the external source Uri the substitute 
the string in the right place after reading the csound file. But maybe there is a better solution..


2016-05-12 13:34 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
I'd like to read soundfont or wave-file from my csound code on Android.
I place both resources  (csd-file and wav or sf2 file) in the raw folder.
But the problem is that I can not reference the sample from the
csound code since the android changes the file name. 

Is there some workaround for this? 

I can read/parse the path in the Java code and send it with message
if I'm going to read the audio samples. But with sf2 I have to declare
the path in the init instr (at the header). So is it possible to get the 
filename for a soundfont?

Anton

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-05-12 14:59
FromJohn
SubjectRe: How to read external files on android with csound?

I read wav files on android without problems.  In what way is the name changed?

On 12 May 2016, at 11:35, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
I'd like to read soundfont or wave-file from my csound code on Android.
I place both resources  (csd-file and wav or sf2 file) in the raw folder.
But the problem is that I can not reference the sample from the
csound code since the android changes the file name. 

Is there some workaround for this? 

I can read/parse the path in the Java code and send it with message
if I'm going to read the audio samples. But with sf2 I have to declare
the path in the init instr (at the header). So is it possible to get the 
filename for a soundfont?

Anton
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-05-12 15:14
FromAnton Kholomiov
SubjectRe: How to read external files on android with csound?
I'm trying to load soundfont file with sfload.
But it says

 sfload: cannot open SoundFont file "synth1.sf2" (error No such file or directory)

I place the synth1.sf2 with csd in the android directory res/raw

2016-05-12 16:59 GMT+03:00 John <jpff@codemist.co.uk>:

I read wav files on android without problems.  In what way is the name changed?

On 12 May 2016, at 11:35, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
I'd like to read soundfont or wave-file from my csound code on Android.
I place both resources  (csd-file and wav or sf2 file) in the raw folder.
But the problem is that I can not reference the sample from the
csound code since the android changes the file name. 

Is there some workaround for this? 

I can read/parse the path in the Java code and send it with message
if I'm going to read the audio samples. But with sf2 I have to declare
the path in the init instr (at the header). So is it possible to get the 
filename for a soundfont?

Anton
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2016-05-13 10:26
FromJacques Leplat
SubjectRe: How to read external files on android with csound?
You’ll have to extract the soundfont resource file as a stream and write it out as a file, byte by byte. Then use that path in your csd.

It was mentioned a couple of years ago in this forum.

All the best,

Jacques


On 12 May 2016, at 15:14, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:

I'm trying to load soundfont file with sfload.
But it says

 sfload: cannot open SoundFont file "synth1.sf2" (error No such file or directory)

I place the synth1.sf2 with csd in the android directory res/raw

2016-05-12 16:59 GMT+03:00 John <jpff@codemist.co.uk>:

I read wav files on android without problems.  In what way is the name changed?

On 12 May 2016, at 11:35, Anton Kholomiov <anton.kholomiov@GMAIL.COM> wrote:
I'd like to read soundfont or wave-file from my csound code on Android.
I place both resources  (csd-file and wav or sf2 file) in the raw folder.
But the problem is that I can not reference the sample from the
csound code since the android changes the file name. 

Is there some workaround for this? 

I can read/parse the path in the Java code and send it with message
if I'm going to read the audio samples. But with sf2 I have to declare
the path in the init instr (at the header). So is it possible to get the 
filename for a soundfont?

Anton
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here