Csound Csound-dev Csound-tekno Search About

[Csnd] Csound in Unity on Android issues

Date2019-02-04 01:26
FromHector Centeno
Subject[Csnd] Csound in Unity on Android issues
Hello,

I've been trying to get Csound to work on Android inside of the Unity game engine. As you know Rory Walsh has been successful in getting it to work on Windows and Mac OS [ https://rorywalsh.github.io/CsoundUnity/ ] but he has also been unable to get it to work on Android. What makes it hard to debug is the fact that Unity or the system are not throwing any usable error messages. All I've been able to find is that the app crashes with an invalid memory error that happens at random points in the engine execution, a few seconds after instantiating Csound. I wonder if this just means that Csound is corrupting Unity's memory since the crash happens just by instantiating Csound without even trying to execute a CSD. I've also tried creating an AAR plugin library and instantiating Csound through Unity's Java bridge but that leads to the same results.

On the other hand, I've been successful at geting to Csound to run on Android inside of Unreal Engine, which is completely C++ based. I'm interested in getting Csound to work with Unity as it would be a great combination of tools to teach to my students. Unity is more popular in my university due to better support, extensive documentation and tutorials, and higher availability of plugins. So before I give up I wanted to reach out here to see if anyone could give me some pointers, particularly I wonder if Steven Yi might have some ideas to share.

Thanks!

Hector

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

Date2019-02-04 19:23
FromSteven Yi
SubjectRe: [Csnd] Csound in Unity on Android issues
Hi Hector,

I'm actually really interested to see Csound + Unity + Android work,
though I haven't looked into it.  It's *very* nice to hear it works
with Unreal. I'm using Unity now to teach and had it as a todo to look
into Csound with it for AR/VR.

Do you have a test Unity project you could send me a link to? I can
try it here and do some debugging.

Thanks!
Steven

On Sun, Feb 3, 2019 at 8:27 PM Hector Centeno  wrote:
>
> Hello,
>
> I've been trying to get Csound to work on Android inside of the Unity game engine. As you know Rory Walsh has been successful in getting it to work on Windows and Mac OS [ https://rorywalsh.github.io/CsoundUnity/ ] but he has also been unable to get it to work on Android. What makes it hard to debug is the fact that Unity or the system are not throwing any usable error messages. All I've been able to find is that the app crashes with an invalid memory error that happens at random points in the engine execution, a few seconds after instantiating Csound. I wonder if this just means that Csound is corrupting Unity's memory since the crash happens just by instantiating Csound without even trying to execute a CSD. I've also tried creating an AAR plugin library and instantiating Csound through Unity's Java bridge but that leads to the same results.
>
> On the other hand, I've been successful at geting to Csound to run on Android inside of Unreal Engine, which is completely C++ based. I'm interested in getting Csound to work with Unity as it would be a great combination of tools to teach to my students. Unity is more popular in my university due to better support, extensive documentation and tutorials, and higher availability of plugins. So before I give up I wanted to reach out here to see if anyone could give me some pointers, particularly I wonder if Steven Yi might have some ideas to share.
>
> Thanks!
>
> Hector
>
> 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

Date2019-07-02 17:28
Fromceberman <00000559a66aba27-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Csound in Unity on Android issues
I'm also about to dive into this, and wanted to see if anyone's been
successful in getting CsoundUnity to run on Android.   I'm interested in
deploying on Oculus Quest/Go which are both Android

I've downloaded csound6.12.0-Android, dated 10/24/2018 as referred to in the
FLOSS manual.   As I'm reading the documentation, I'm wondering a few things
that you might be able clarify:

1. Does anyone have this working already?
2. Is csound6.12.0-Android, the latest-and-greatest starting point to work
from? (Downloaded from csound.com)
3. Is there an opportunity to use the java API for CsoundUnity rather than
compiling the C language external...or are there functions missing in java
that would be needed?  
4. Any other advice on building and testing? 

Thanks very much in advance



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-07-02 17:42
FromHector Centeno
SubjectRe: [Csnd] Csound in Unity on Android issues
I've been successful at running Csound on both Unity and Unreal Engine on Android mobile devices, including lately the Oculus Quest (I'm currently developing a personal art project that uses all of these plus 2nd order ambisonics). Unfortunately I haven't had the time to polish the code so the plugins are in a decent state to be made public, although they work. The Unity implementation is based on Rory's CsoundUnity. If you contact me directly I can send you what I have.

Cheers,

Hector


On Tue, Jul 2, 2019 at 12:28 PM ceberman <00000559a66aba27-dmarc-request@listserv.heanet.ie> wrote:
I'm also about to dive into this, and wanted to see if anyone's been
successful in getting CsoundUnity to run on Android.   I'm interested in
deploying on Oculus Quest/Go which are both Android

I've downloaded csound6.12.0-Android, dated 10/24/2018 as referred to in the
FLOSS manual.   As I'm reading the documentation, I'm wondering a few things
that you might be able clarify:

1. Does anyone have this working already?
2. Is csound6.12.0-Android, the latest-and-greatest starting point to work
from? (Downloaded from csound.com)
3. Is there an opportunity to use the java API for CsoundUnity rather than
compiling the C language external...or are there functions missing in java
that would be needed? 
4. Any other advice on building and testing?

Thanks very much in advance



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-07-02 17:44
FromHector Centeno
SubjectRe: [Csnd] Csound in Unity on Android issues
... in case you can't see my email: info@hcenteno.net

On Tue, Jul 2, 2019 at 12:42 PM Hector Centeno <hcengar@gmail.com> wrote:
I've been successful at running Csound on both Unity and Unreal Engine on Android mobile devices, including lately the Oculus Quest (I'm currently developing a personal art project that uses all of these plus 2nd order ambisonics). Unfortunately I haven't had the time to polish the code so the plugins are in a decent state to be made public, although they work. The Unity implementation is based on Rory's CsoundUnity. If you contact me directly I can send you what I have.

Cheers,

Hector


On Tue, Jul 2, 2019 at 12:28 PM ceberman <00000559a66aba27-dmarc-request@listserv.heanet.ie> wrote:
I'm also about to dive into this, and wanted to see if anyone's been
successful in getting CsoundUnity to run on Android.   I'm interested in
deploying on Oculus Quest/Go which are both Android

I've downloaded csound6.12.0-Android, dated 10/24/2018 as referred to in the
FLOSS manual.   As I'm reading the documentation, I'm wondering a few things
that you might be able clarify:

1. Does anyone have this working already?
2. Is csound6.12.0-Android, the latest-and-greatest starting point to work
from? (Downloaded from csound.com)
3. Is there an opportunity to use the java API for CsoundUnity rather than
compiling the C language external...or are there functions missing in java
that would be needed? 
4. Any other advice on building and testing?

Thanks very much in advance



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-07-02 21:42
FromSigurd Saue
Subject[Csnd] Multiple Midi file playback

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd


Date2019-07-02 22:11
FromVictor Lazzarini
SubjectRe: [Csnd] Multiple Midi file playback
Not possible. Csound can only read one file each performance.

I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 21:42, Sigurd Saue <sigurd.saue@ntnu.no> wrote:

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd

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

Date2019-07-02 22:13
FromSigurd Saue
Subject[Csnd] SV: [Csnd] Multiple Midi file playback

​I thought so, but thanks for the verification!


Sigurd


Fra: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> på vegne av Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sendt: 2. juli 2019 23:11
Til: CSOUND@LISTSERV.HEANET.IE
Emne: Re: [Csnd] Multiple Midi file playback
 
Not possible. Csound can only read one file each performance.

I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 21:42, Sigurd Saue <sigurd.saue@ntnu.no> wrote:

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd

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

Date2019-07-02 23:06
FromRichard
SubjectRe: [Csnd] SV: [Csnd] Multiple Midi file playback

I am not so sure. Recently I discovered that it it is fairly simple to play a midi file with csound via the Python Mido library:

http://csound.1045644.n5.nabble.com/Csnd-Csound-play-a-midi-file-via-mido-tc5765853.html

So it requires some external Python programming...


Richard

On 02/07/2019 23:13, Sigurd Saue wrote:

​I thought so, but thanks for the verification!


Sigurd


Fra: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> på vegne av Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sendt: 2. juli 2019 23:11
Til: CSOUND@LISTSERV.HEANET.IE
Emne: Re: [Csnd] Multiple Midi file playback
 
Not possible. Csound can only read one file each performance.

I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 21:42, Sigurd Saue <sigurd.saue@ntnu.no> wrote:

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd

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

Date2019-07-02 23:10
FromGuillermo Senna
SubjectRe: [Csnd] SV: [Csnd] Multiple Midi file playback
Hi,

I haven't really tried this, but if by any chance you are on Linux, how
about launching an instance of aplaymidi with the the system_i opcode? I
think it could actually be automatically connected to Csound by using
the '-p' option.

Cheers.


On 2/7/19 18:13, Sigurd Saue wrote:
> ?I thought so, but thanks for the verification!
>
>
> Sigurd
>
> ________________________________
> Fra: A discussion list for users of Csound  på vegne av Victor Lazzarini 
> Sendt: 2. juli 2019 23:11
> Til: CSOUND@LISTSERV.HEANET.IE
> Emne: Re: [Csnd] Multiple Midi file playback
>
> Not possible. Csound can only read one file each performance.
>
> I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
> On 2 Jul 2019, at 21:42, Sigurd Saue > wrote:
>
>
> ?I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.
>
>
> My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!
>
>
> Sigurd
>
> 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
>

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

Date2019-07-02 23:11
FromVictor Lazzarini
SubjectRe: [Csnd] SV: [Csnd] Multiple Midi file playback
Ah, if you are using an external midi player, then of course it's possible.

Also you can load the midi files in separate tracks of a sequencer and then use Csound to play back.

That wasn't the question Sigurd asked though.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 23:07, Richard <zappfinger@gmail.com> wrote:

I am not so sure. Recently I discovered that it it is fairly simple to play a midi file with csound via the Python Mido library:

http://csound.1045644.n5.nabble.com/Csnd-Csound-play-a-midi-file-via-mido-tc5765853.html

So it requires some external Python programming...


Richard

On 02/07/2019 23:13, Sigurd Saue wrote:

​I thought so, but thanks for the verification!


Sigurd


Fra: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> på vegne av Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sendt: 2. juli 2019 23:11
Til: CSOUND@LISTSERV.HEANET.IE
Emne: Re: [Csnd] Multiple Midi file playback
 
Not possible. Csound can only read one file each performance.

I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 21:42, Sigurd Saue <sigurd.saue@ntnu.no> wrote:

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd

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
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

Date2019-07-02 23:32
FromSigurd Saue
Subject[Csnd] SV: [Csnd] SV: [Csnd] Multiple Midi file playback

Using system calls within CSound is absolutely an interesting option that I hadn't thought about. My main platform is Windows, unfortunately, and in general I would prefer to stay platform independent as far as possible.


I already have implemented an external application that communicates with CSound over OSC, and the shortest route for me is probably to extend that with MIDI file reading (I have code for that as well).


Sigurd






Fra: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> på vegne av Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sendt: 3. juli 2019 00:11
Til: CSOUND@LISTSERV.HEANET.IE
Emne: Re: [Csnd] SV: [Csnd] Multiple Midi file playback
 
Ah, if you are using an external midi player, then of course it's possible.

Also you can load the midi files in separate tracks of a sequencer and then use Csound to play back.

That wasn't the question Sigurd asked though.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 23:07, Richard <zappfinger@gmail.com> wrote:

I am not so sure. Recently I discovered that it it is fairly simple to play a midi file with csound via the Python Mido library:

http://csound.1045644.n5.nabble.com/Csnd-Csound-play-a-midi-file-via-mido-tc5765853.html

So it requires some external Python programming...


Richard

On 02/07/2019 23:13, Sigurd Saue wrote:

​I thought so, but thanks for the verification!


Sigurd


Fra: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> på vegne av Victor Lazzarini <Victor.Lazzarini@MU.IE>
Sendt: 2. juli 2019 23:11
Til: CSOUND@LISTSERV.HEANET.IE
Emne: Re: [Csnd] Multiple Midi file playback
 
Not possible. Csound can only read one file each performance.

I thought about allowing more, but it needs some major surgery for that (basically a redesign of midi file reading)

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 2 Jul 2019, at 21:42, Sigurd Saue <sigurd.saue@ntnu.no> wrote:

​I have a bunch of old MIDI files with accompanying samples, and I wonder if there is a simple way to play a number of them from within Csound instruments. I need to trigger those instruments at different times, hence I cannot use the command flag option for reading the MIDI file.


My guess is that it is not possible, and I have a solution using OSC from an external MIDI file reader. I just want to check if I have overlooked a Csound internal way of doing it. It would be handy!


Sigurd

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
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