Commit Graph

563 Commits (028c7382068e89f69e5247de45853ed128c64fe0)

Author SHA1 Message Date
Ben Niemann 77a239c781 Gracefully handle closed connections. 2019-02-04 00:31:14 +01:00
Ben Niemann 22550078e6 Allow pure proto requests.
No more pickle.
About 15% faster for small messages, but (surprisingly) slower for large messages...
2019-02-03 21:31:21 +01:00
Ben Niemann ce16b966f2 Do not log full messages by default. 2019-02-03 21:31:11 +01:00
Ben Niemann 129d7dab4c Suppress output in unittest mode and add missing dep. 2019-02-01 00:31:56 +01:00
Ben Niemann 51db281537 Add a basic performance test for IPCs.
So I can measure improvements as I change that stuff.
2019-02-01 00:12:04 +01:00
Ben Niemann 79b35d9689 Merge changes for the 'command cleanup' sprint.
- Use a common Create/Update/Delete convention for naming commands.
- Simplify the API of the Command class.
- Add factory functions for the remaining commands in
- Rename node related stuff:
  - 'pipeline graph node' -> 'node'
  - 'pipeline graph connection' -> 'node connection'
  - 'pipeline graph' -> 'graph'
2019-01-27 16:18:17 +01:00
Ben Niemann f4ce7f53d2 Rewrite MIDI input.
- A new "MIDI source" node, which can feed MIDI events from any ALSA device into the graph.
- All done rt safe in C++. The older Python implementation in noisicaa.devices has been removed.
- Still quite hacky:
  - It's built into the portaudio backend. There should probably be a separate "ALSA sequencer"
    backend for this, with the option to have an alternative "Jack MIDI" backend. But for that I
    have to figure out how to have separate backends for audio and MIDI and how that interacts
    for all possible combinations.
  - It just blindly connects to all readable MIDI ports, collecting all events. Filtering out
    the events for a specific port (e.g. a MIDI keyboard) happens in the "MIDI source" node.
    The engine should track, which ports are being used and only connect to those.

Squashed commit of the following:

commit c811be510347d1fd23abea081ba0a4d93e8cb6bf
Author: Ben Niemann <>
Date:   Mon Jan 14 03:36:18 2019 +0100

    Move ALSADeviceManager to a separate file.

commit 6e5d9a2c691fdf639f0173b9dd2ebfde7f58f4f4
Author: Ben Niemann <>
Date:   Mon Jan 14 03:25:29 2019 +0100

    Fix/improve tests.

commit 94b4fa253f8a4f8a84d13dd718dbaeac99fee5fe
Author: Ben Niemann <>
Date:   Sun Jan 13 13:57:07 2019 +0100

    Reanimate playback from the instrument library.

commit 17a288980fc361f190876763dbe4a6a6bbd0c2b3
Author: Ben Niemann <>
Date:   Sun Jan 13 12:57:54 2019 +0100

    Remove the now obsolete noisicaa.devices package.

commit aa2f9bbc1ae61295157f66948b276861dee00379
Author: Ben Niemann <>
Date:   Sun Jan 13 12:45:50 2019 +0100

    Strip the PianoWidget down to just the keys.

commit 1c87b29f7abb51defa28b33f902f8de85ae7eb55
Author: Ben Niemann <>
Date:   Sun Jan 13 12:24:57 2019 +0100

    Add piano to MIDI source node.

    - Make BasePipelineGraphNode.pipeline_node_id globally available.
    - Allow sending processor messages from the UI.
    - Pass the MIDI events to the rt thread via a FIFO queue.

commit f19114e966ab2d9261fd3a86b93d2ca88e9f3fba
Author: Ben Niemann <>
Date:   Sun Jan 13 11:29:43 2019 +0100

    Remove the System Out node again.

    And the related Backend::input().
    Not needed after all.

commit a839f259e3b8e338072be9c8b9fa58d8dc0d36a4
Author: Ben Niemann <>
Date:   Sun Jan 13 10:03:33 2019 +0100

    Wire up MIDI source to events from the backend.

    - Make the event buffer accessible via the block context.
    - Backend creates sequence of (uri, midi) tuples.
    - ProcessorMidiSource filters that list and emit list of midi events.

commit 347dc0168b00315eed233fdec40c8a9d6b5ffe41
Author: Ben Niemann <>
Date:   Sun Jan 13 09:21:36 2019 +0100

    Make the main ALSA sequences listen to all output ports again.

    Now also tracking new ports as they appear.

commit 86b6b7a59974c18c6078761fe1010456e5f26e43
Author: Ben Niemann <>
Date:   Sun Jan 13 09:20:52 2019 +0100

    Bug fix.

commit 776dbd4a946ecfa8e178cd7e3e108a4c3519f3cb
Author: Ben Niemann <>
Date:   Sun Jan 13 08:43:47 2019 +0100

    Editor tracks devices in a QAbstractItemModel.

    And MIDI Source node uses that for the port selector combobox.

commit a9c578e377948d187a0ee8ede90c29cc32b337a1
Author: Ben Niemann <>
Date:   Sun Jan 13 08:42:30 2019 +0100

    Also handle port changes somewhat gracefully.

commit f4cd8c7535b36e7c6b9323ff2861d72e376bac08
Author: Ben Niemann <>
Date:   Sun Jan 13 05:34:01 2019 +0100

    Also handle CC events.

commit 1329e51ff9747764a2bb5c6578f3490047cee135
Author: Ben Niemann <>
Date:   Sun Jan 13 04:30:45 2019 +0100

    Device manager that tracks ALSA sequencer clients.

    - Allow backends to post engine notifications.
    - PortAudioBackend runs a separate (non-rt) thread, with a sequencer client just for listening for
      client notifications.
    - Create a DeviceDescription proto for ALSA sequencer clients and post them as engine notifications.

commit 10c5b827de47479e6a8046c44cd32494693c762b
Author: Ben Niemann <>
Date:   Sun Jan 13 01:34:47 2019 +0100

    A MIDI source node, which doesn't really do anything yet.

commit e09a5c70e3b950f3c6e30b81c2e8b67d65a947b3
Author: Ben Niemann <>
Date:   Sat Jan 12 11:51:36 2019 +0100

    Use C string for Spec::get_buffer_idx() to avoid malloc in the audio thread.

commit 24cfffdf60a4ad888e65fe839165666ebef0f9f0
Author: Ben Niemann <>
Date:   Sat Jan 12 08:13:26 2019 +0100

    Add a "System In" node to the graph and wire it up to the MIDI events from the backend.

    Also rename "Audio Out" to "System Out", because that makes more sense, now that there is more than
    audio being passed around.

commit 77be27b0e487b0830d913bdcc54cf56ea35114cf
Author: Ben Niemann <>
Date:   Sat Jan 12 08:10:55 2019 +0100

    Add Backend::input() method to read incoming MIDI events.

    Also switch to an enum for the channel arg.

commit 5c4acefc476ace640d8a0ac40d6816ca48399207
Author: Ben Niemann <>
Date:   Sat Jan 12 08:08:20 2019 +0100

    PortAudioBackend also reads MIDI events into a buffer.

    Very prototypish implementation. It just scans for all available devices and connects to their
    outputs. Still need to think about how to deal with different devices.
2019-01-14 04:02:26 +01:00
Ben Niemann 9fd2fdeb7b Update licenses to 2019. 2019-01-12 01:20:46 +01:00
Ben Niemann 2a23e927b5 Upgraded mypy-protobuf.
It now knows about extension fields, so I could remove a bunch of 'type: ignore' pragmas.
2019-01-09 06:33:12 +01:00
Ben Niemann 21ec283822 Reorganize code to make creating new node types easier.
Adding new node types required adding bits and pieces in many places, which was tedious and failure
Now it's just cloning the directory of one of the existing nodes and adding a few lines to
'registries' (all in one directory).

- Reanimate custom csound node.
- All nodes can be muted.
2019-01-08 10:11:57 +01:00
Ben Niemann aa380e9c07 Custom UI for mixer nodes and an Instrument node to bring back sample playback.
And various internal changes and cleanups to support this.
2019-01-04 01:31:33 +01:00
Ben Niemann 45f67ea7f6 Make the audio thread (mostly) realtime safe.
- Purge all remaining Python from the critical path.
- Add a "realtime checker", and use it to remove most uses of malloc in the audio thread.
- Make logging from the audio thread realtime safe.
- Add a tool to profile the audio thread.
- Set realtime priority on the audio thread.
2018-12-27 00:34:14 +01:00
Ben Niemann 410b4ed952 Fix broken tests. 2018-12-23 18:38:51 +01:00
Ben Niemann 6a6259fa83 Fix broken test. 2018-12-23 17:47:19 +01:00
Ben Niemann 22c4e292d0 Unify the different messages, which are generated by the engine, into a single proto message. 2018-12-23 17:23:55 +01:00
Ben Niemann bc8cc6bf71 Upgrade mypy to V0.650
- fix a number of newly reported issues with PyQt5 stubs.
- add empty stub files for all 3rdparty libs without stubs.
- remove local copy of protobuf stubs, the version from the official typeshed is now good enough.
2018-12-21 23:46:36 +01:00
Ben Niemann 98328ca0fd Upgrade pylint to V2.2.2
It now understands type comments, so remove a bunch of disable=unused-import pragmas.
2018-12-21 19:12:26 +01:00
Ben Niemann 66d7f8c6af Change the primary metaphor to 'modular synth' instead of 'multitrack recorder'.
- tracks are now just special types of nodes in the pipeline graph.
- completely reimplemented the pipeline graph UI.
- greatly simplified the UI, got rid of all the docks.
- some functionality got lost along the way or hasn't been reimplemented yet.
2018-12-21 17:03:16 +01:00
Ben Niemann c2e36770c6 MockApp for UI tests just implements AbstractEditorApp. 2018-06-03 19:50:03 +02:00
Ben Niemann 42886ac2a9 EditorApp does not subclass QApplication.
Instead QApplication is created separately and EditorApp just holds a reference to it.
Merged BaseEditorApp and EditorApp into one class.
2018-06-03 16:51:41 +02:00
Ben Niemann 4c237f8ea6 Improve typing of ui_base.
Break cyclic import by defining some abstract base classes.
2018-06-03 16:09:00 +02:00
Ben Niemann 49cb41c646 Use typesafe callbacks.
Replace untyped CallbackRegistry by:
- explicitly declared Callback objects for each target.
- CallbackMap for maps of uniform callbacks.

Changed noisicaa.ui to use the same signature for callbacks.
Moved common code for synthetic attributes (e.g. project.duration) up into noisicaa.model.
2018-06-03 13:53:29 +02:00
Ben Niemann e60d6a11d0 Major refactoring of the project model.
- Move basic model code into noisicaa.model.
- Change internal property storage to protobufs.
- Commands also use protobufs.
- All serializations uses protobufs.
- Object are managed by a Pool object.
- Object references are stored as object IDs and dereferenced lazily.

- Everything is pylint clean.
- and most of noisicaa.ui are now mypy strict.
- Generate mypy stubs for generated protobuf code.
- Cleaned up some obsolete cruft.
- Some improvements to runtests.
2018-05-26 14:58:16 +02:00
Ben Niemann 1007c3968d Some more mypy strictness for
But I'm hitting some design issues, which make this exercise quite cumbersome. Some more refactoring
is needed to make the code structure work better with type annotations.
2018-04-16 09:22:29 +02:00
Ben Niemann 3d1316befa Make some modules mypy strict. 2018-04-15 19:30:20 +02:00
Ben Niemann 54b99a909d Make two noisicaa.ui modules pylint clean. 2018-04-15 19:29:42 +02:00
Ben Niemann 9cdd5e55f6 Test modules shouldn't be marked explicitly as 'mypy: loose'.
They're are always checked in loose mode.
2018-04-15 15:58:31 +02:00
Ben Niemann b4fc77d790 Make noisicaa.importers mypy clean (but still loose). 2018-04-15 15:43:46 +02:00
Ben Niemann 8d308487c9 Remove the broken PipelineGraphMonitor. 2018-04-15 15:38:05 +02:00
Ben Niemann 7c5d8fd969 Make the noisicaa.ui.track_items module mypy clean (but loose). 2018-04-15 15:34:57 +02:00
Ben Niemann f42ee88ef7 Make large parts of noisicaa.ui mypy clean, but still loose. 2018-04-15 14:22:48 +02:00
Ben Niemann b7748dfa2a Replace **self.context_args by context=self.context.
Equivalent, because context_args only contained one 'context' entry anyway.
And the old form confused mypy a bit.
2018-04-15 09:28:04 +02:00
Ben Niemann d4b21f1817 Make noisicaa.ui.dock_widget mypy clean (but still loose). 2018-04-15 09:12:50 +02:00
Ben Niemann 70f4ce1ccd Make all of mypy clean (but still mostly loose). 2018-04-15 08:48:42 +02:00
Ben Niemann 5422a360d5 Make and mypy and pylint clean. 2018-04-14 15:56:42 +02:00
Ben Niemann 13db3825d1 Add a debug console.
- Urwid ( based console UI.
- Simple process list and log viewer.
2018-04-14 12:48:04 +02:00
Ben Niemann 8a555abdd6 Now all of noisicaa.core is mypy strict. 2018-04-12 08:03:57 +02:00
Ben Niemann b6c1914368 More mypy strictness for noisicaa.core 2018-04-12 05:48:47 +02:00
Ben Niemann 5e67b1a11c Remove ObjectReferenceProperty.
Not used anymore, because it caused more problems than it solved.
2018-04-12 04:58:23 +02:00
Ben Niemann fcc8e0de75 Make more stuff in noisicaa.core mypy strict. 2018-04-12 02:37:32 +02:00
Ben Niemann 1a18c752a5 Make noisicaa.devices mypy and pylint clean.
I previously only fixed files, which were mypy clean, but not strict.
2018-04-10 13:12:28 +02:00
Ben Niemann fca33eddb0 Make noisicaa.lv2 mypy strict. 2018-04-10 12:10:03 +02:00
Ben Niemann 0140d99dd4 Make noisicaa.devices mypy strict. 2018-04-10 12:02:11 +02:00
Ben Niemann 9ecb6be39d Make all of noisicaa.instr mypy strict. 2018-04-10 11:35:10 +02:00
Ben Niemann 09fb0c4a06 Make all of noisicaa.node_db mypy strict. 2018-04-10 11:31:06 +02:00
Ben Niemann d473f8c0d9 Make all of noisicaa.audioproc mypy strict. 2018-04-10 11:30:44 +02:00
Ben Niemann 56b1dea44f Add stubs for bindings.ladspa and bindings.lilv 2018-04-10 11:26:54 +02:00
Ben Niemann 3372f1b529 Make the noisicaa.* toplevel modules mypy and pylint clean. 2018-04-09 20:51:30 +02:00
Ben Niemann f891abed9c Make the rest of noisicaa.audioproc mypy and pylint clean. 2018-04-09 08:40:34 +02:00
Ben Niemann 29e0b30523 Make noisicaa.audioproc.engine mypy clean.
Mostly by adding stubs for various cython modules.
2018-04-09 06:50:07 +02:00