Kernel: Python 3 (Ubuntu Linux)
Using Abjad and Lilypond in CoCalc
In a CoCalc terminal, run
Then, as this worksheet shows, displaying music works!
What does not work so far is playing music. This is because abjad.play relies on timidity. Feature request for abjad.play: allow to specify a player, such as a javascript player.
For example, by allowing abjad.play(staff, player='midijs')
or similar.
In [1]:
In [6]:
In [7]:
In [8]:
Note("c'4")
In [9]:
In [10]:
[8, 10, 11, 22, 3, 19, 22, -4, 20, -7]
In [11]:
In [12]:
In [13]:
In [14]:
---------------------------------------------------------------------------
CalledProcessError Traceback (most recent call last)
<ipython-input-14-86a9b915fe20> in <module>()
----> 1 abjad.play(staff)
~/.local/lib/python3.6/site-packages/abjadext/ipython/Play.py in __call__(self, argument)
24 if not hasattr(argument, '__illustrate__'):
25 raise TypeError('Cannot play {!r}'.format(type(argument)))
---> 26 has_vorbis = self._check_for_vorbis()
27 with tempfile.TemporaryDirectory() as temporary_directory:
28 temporary_directory = pathlib.Path(temporary_directory)
~/.local/lib/python3.6/site-packages/abjadext/ipython/Play.py in _check_for_vorbis(self)
48 def _check_for_vorbis(self):
49 has_vorbis = False
---> 50 output = subprocess.check_output('timidity --help', shell=True)
51 output = output.decode('utf-8')
52 for line in output.splitlines():
/usr/lib/python3.6/subprocess.py in check_output(timeout, *popenargs, **kwargs)
334
335 return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
--> 336 **kwargs).stdout
337
338
/usr/lib/python3.6/subprocess.py in run(input, timeout, check, *popenargs, **kwargs)
416 if check and retcode:
417 raise CalledProcessError(retcode, process.args,
--> 418 output=stdout, stderr=stderr)
419 return CompletedProcess(process.args, retcode, stdout, stderr)
420
CalledProcessError: Command 'timidity --help' returned non-zero exit status 127.
In [0]: