Fork me on GitHub
#alda
<
2016-07-26
>
dave14:07:49

help wanted with this issue! https://github.com/alda-lang/alda/issues/243 could be fun, if you have experience with (or just like playing with) using core.async to schedule events and/or inter-process communication

etaylan14:07:44

as you can guess, it happens on windows too

dave14:07:19

that's good to know. my theory is that this is JVM related

dave14:07:28

like there is too much going on in a single alda server JVM

dave14:07:43

it's running an HTTP server and managing multiple score-performance contexts

dave14:07:02

each of which is doing audio stuff

etaylan14:07:46

but responses one? (i don't know much about how a JVM server work )

etaylan14:07:09

sorry about my english(still working on it), yes too much going on alda JVM, but JVM do not wait to end and stops before one?

dave14:07:34

i think i understand what you're asking

dave14:07:02

because it takes a long time for the JVM + clojure runtime to start, alda is set up to run in the background as a server

dave14:07:16

a single alda server should be able to handle playing multiple scores at once

dave14:07:34

and each score has a separate "audio context," including its own JVM MIDI Synthesizer instance, etc.

dave14:07:51

so all of this is running in the same JVM, the alda server process

etaylan14:07:37

everything sounds good but?

dave14:07:23

i think this issue with sound breaking up might be related to the single JVM being overloaded

dave14:07:49

i'm curious if it would help for the alda server to just be a server, and delegate playing audio to separate processes

etaylan15:07:18

what is the difference between alda server and "just server"

dave15:07:22

by "just a server," i mean it would just run the HTTP server that the alda command-line client interacts with

dave15:07:36

so it would just be listening for code to parse and play

dave15:07:57

but it would delegate the parsing and playing part to one of the "performer" processes

etaylan18:07:22

(2 hours later)I get it now. And I realize you said same thing before "a single alda server should be able to handle..."

etaylan18:07:16

when i started 2 different command line program at the same time(i start second process before first finished), second process waiting for first one, when first one finish, second starts, after several time, it breaks somehow

dave19:07:36

@etaylan: they were probably both trying to start on the same port (the default port is 27713)

dave19:07:51

you could try starting multiple servers on different ports

dave19:07:09

like alda -p 1234 up alda -p 2345 up etc.

dave19:07:38

i'd be curious to know if the sound breaks when playing scores on several different servers at the same time

dave19:07:49

that might confirm that running everything on a single server is the problem

etaylan19:07:42

I am going to try with different ports now

etaylan19:07:09

Changing port not making any difference, server still waits the other process

dave19:07:00

that's interesting

etaylan20:07:01

I wrote other outputs to the GitHub issue.

etaylan20:07:29

Actually I've seen this issue before but I was playing on Sublime Text and I didn't mention this is a bug or something important. If I play more, sometimes sound mysteriously slows down and I cannot change with tempo. I write here before, and it play correctly when I play command in REPL

dave20:07:14

i think overall, alda suffers from a handful of issues where memory isn't used in the most efficient way

dave20:07:37

i think if we implement the things i mentioned in the github issue, hopefully that should help

etaylan20:07:35

Memory issue is different this problem? Because anytime I play a sound, my JVM memory usage increasing all time, but not decrease, I have to close JVM by my hand to release that memory, I hope it helps

etaylan20:07:34

dave: I have another question. I want to make a web site to play commands on a web site, I know we do not have a output file but is this possible?

dave21:07:26

@etaylan: not currently. i've been wanting something like that for a while now, but haven't had the time to work on it

dave21:07:44

basically, we would need to port alda to javascript

dave21:07:46

the good news is that it won't take much effort -- clojure code is portable to something called clojurescript, which produces javascript

dave21:07:18

there is a proof of concept here https://github.com/alda-lang/web-demo -- it's very limited though, and the version of alda is from 10-11 months ago

etaylan21:07:35

Thank you this is helpful enough, now I can send this magic link to my friends.