Move noisicore back into the noisicaa tree.

looper
Ben Niemann 5 years ago
parent 1781244494
commit 73769815a4
  1. 1
      CMakeLists.txt
  2. 3
      NOTES.org
  3. 4
      bin/runtests.py
  4. 11
      noisicaa/audioproc/__init__.py
  5. 3
      noisicaa/audioproc/audioproc_process.py
  6. 6
      noisicaa/audioproc/node.py
  7. 5
      noisicaa/audioproc/nodes/track_event_source.py
  8. 18
      noisicaa/audioproc/ports.py
  9. 95
      noisicaa/audioproc/vm/CMakeLists.txt
  10. 28
      noisicaa/audioproc/vm/__init__.py
  11. 8
      noisicaa/audioproc/vm/audio_stream.cpp
  12. 4
      noisicaa/audioproc/vm/audio_stream.h
  13. 2
      noisicaa/audioproc/vm/audio_stream.pxd
  14. 0
      noisicaa/audioproc/vm/audio_stream.pyx
  15. 0
      noisicaa/audioproc/vm/audio_stream_test.py
  16. 8
      noisicaa/audioproc/vm/backend.cpp
  17. 6
      noisicaa/audioproc/vm/backend.h
  18. 2
      noisicaa/audioproc/vm/backend.pxd
  19. 0
      noisicaa/audioproc/vm/backend.pyx
  20. 8
      noisicaa/audioproc/vm/backend_ipc.cpp
  21. 12
      noisicaa/audioproc/vm/backend_ipc.h
  22. 0
      noisicaa/audioproc/vm/backend_ipc_test.pyx
  23. 8
      noisicaa/audioproc/vm/backend_null.cpp
  24. 8
      noisicaa/audioproc/vm/backend_null.h
  25. 6
      noisicaa/audioproc/vm/backend_portaudio.cpp
  26. 8
      noisicaa/audioproc/vm/backend_portaudio.h
  27. 0
      noisicaa/audioproc/vm/backend_test.pyx
  28. 6
      noisicaa/audioproc/vm/block_context.h
  29. 2
      noisicaa/audioproc/vm/block_context.pxd
  30. 0
      noisicaa/audioproc/vm/block_context.pyx
  31. 4
      noisicaa/audioproc/vm/block_data.capnp
  32. 4
      noisicaa/audioproc/vm/buffers.cpp
  33. 4
      noisicaa/audioproc/vm/buffers.h
  34. 2
      noisicaa/audioproc/vm/buffers.pxd
  35. 0
      noisicaa/audioproc/vm/buffers.pyx
  36. 0
      noisicaa/audioproc/vm/buffers_test.pyx
  37. 4
      noisicaa/audioproc/vm/compiler.py
  38. 4
      noisicaa/audioproc/vm/compiler_test.py
  39. 17
      noisicaa/audioproc/vm/engine.pyx
  40. 25
      noisicaa/audioproc/vm/engine_test.py
  41. 2
      noisicaa/audioproc/vm/host_data.cpp
  42. 8
      noisicaa/audioproc/vm/host_data.h
  43. 2
      noisicaa/audioproc/vm/host_data.pxd
  44. 0
      noisicaa/audioproc/vm/host_data.pyx
  45. 4
      noisicaa/audioproc/vm/host_system_csound.cpp
  46. 4
      noisicaa/audioproc/vm/host_system_csound.h
  47. 2
      noisicaa/audioproc/vm/host_system_lv2.cpp
  48. 4
      noisicaa/audioproc/vm/host_system_lv2.h
  49. 2
      noisicaa/audioproc/vm/misc.cpp
  50. 4
      noisicaa/audioproc/vm/misc.h
  51. 8
      noisicaa/audioproc/vm/opcodes.cpp
  52. 6
      noisicaa/audioproc/vm/opcodes.h
  53. 2
      noisicaa/audioproc/vm/opcodes.pxd
  54. 0
      noisicaa/audioproc/vm/opcodes_test.pyx
  55. 18
      noisicaa/audioproc/vm/processor.cpp
  56. 10
      noisicaa/audioproc/vm/processor.h
  57. 2
      noisicaa/audioproc/vm/processor.pxd
  58. 0
      noisicaa/audioproc/vm/processor.pyx
  59. 4
      noisicaa/audioproc/vm/processor_csound.cpp
  60. 6
      noisicaa/audioproc/vm/processor_csound.h
  61. 4
      noisicaa/audioproc/vm/processor_csound_base.cpp
  62. 8
      noisicaa/audioproc/vm/processor_csound_base.h
  63. 0
      noisicaa/audioproc/vm/processor_csound_test.pyx
  64. 8
      noisicaa/audioproc/vm/processor_custom_csound.cpp
  65. 6
      noisicaa/audioproc/vm/processor_custom_csound.h
  66. 6
      noisicaa/audioproc/vm/processor_fluidsynth.cpp
  67. 8
      noisicaa/audioproc/vm/processor_fluidsynth.h
  68. 0
      noisicaa/audioproc/vm/processor_fluidsynth_test.pyx
  69. 8
      noisicaa/audioproc/vm/processor_ipc.cpp
  70. 10
      noisicaa/audioproc/vm/processor_ipc.h
  71. 0
      noisicaa/audioproc/vm/processor_ipc_test.pyx
  72. 4
      noisicaa/audioproc/vm/processor_ladspa.cpp
  73. 8
      noisicaa/audioproc/vm/processor_ladspa.h
  74. 0
      noisicaa/audioproc/vm/processor_ladspa_test.pyx
  75. 6
      noisicaa/audioproc/vm/processor_lv2.cpp
  76. 8
      noisicaa/audioproc/vm/processor_lv2.h
  77. 0
      noisicaa/audioproc/vm/processor_lv2_test.pyx
  78. 4
      noisicaa/audioproc/vm/processor_null.cpp
  79. 8
      noisicaa/audioproc/vm/processor_null.h
  80. 6
      noisicaa/audioproc/vm/processor_sample_player.cpp
  81. 6
      noisicaa/audioproc/vm/processor_sample_player.h
  82. 0
      noisicaa/audioproc/vm/processor_sample_player_test.pyx
  83. 2
      noisicaa/audioproc/vm/processor_spec.cpp
  84. 4
      noisicaa/audioproc/vm/processor_spec.h
  85. 2
      noisicaa/audioproc/vm/processor_spec.pxd
  86. 0
      noisicaa/audioproc/vm/processor_spec.pyx
  87. 0
      noisicaa/audioproc/vm/processor_test.pyx
  88. 4
      noisicaa/audioproc/vm/spec.cpp
  89. 6
      noisicaa/audioproc/vm/spec.h
  90. 2
      noisicaa/audioproc/vm/spec.pxd
  91. 0
      noisicaa/audioproc/vm/spec.pyx
  92. 0
      noisicaa/audioproc/vm/spec_test.pyx
  93. 16
      noisicaa/audioproc/vm/vm.cpp
  94. 8
      noisicaa/audioproc/vm/vm.h
  95. 2
      noisicaa/audioproc/vm/vm.pxd
  96. 0
      noisicaa/audioproc/vm/vm_test.pyx
  97. 4
      noisicaa/core/logging.h
  98. 3
      noisicaa/music/base_track.py
  99. 3
      noisicaa/music/control_track.py
  100. 11
      noisicaa/music/player.py
  101. Some files were not shown because too many files have changed in this diff Show More

@ -69,7 +69,6 @@ macro(add_cpp_capnp src)
)
endmacro(add_cpp_capnp)
add_subdirectory(noisicore)
add_subdirectory(noisicaa)
add_subdirectory(noisidev)

@ -8,9 +8,6 @@
- thread local LogSink?
- capnp API is really awful. strongly consider rolling a custom format for FrameData
- are there any other places, where I care about zero-copy deserialization?
- rething directory structure
- rename noisicore/ to noisicaa/audioproc/audiocore
-> compile into libnoisicaa-audiocore
- clean use of NodeDescription types
- which types are actually needed?
- node parameters

@ -110,9 +110,7 @@ def main(argv):
cov.set_option("run:branch", True)
cov.start()
for dirpath, dirnames, filenames in itertools.chain(
os.walk(os.path.join(LIBDIR, 'noisicaa')),
os.walk(os.path.join(LIBDIR, 'noisicore'))):
for dirpath, dirnames, filenames in os.walk(os.path.join(LIBDIR, 'noisicaa')):
if '__pycache__' in dirnames:
dirnames.remove('__pycache__')

@ -9,3 +9,14 @@ from .mutations import (
SetPortProperty,
SetNodeParameter,
)
from .vm import (
Buffer,
BlockData,
AudioStream,
Spec,
Float,
FloatAudioBlock,
AtomData,
HostData,
BlockContext,
)

@ -9,7 +9,6 @@ import io
import posix_ipc
import noisicore
from noisicaa import core
from noisicaa.core import ipc
@ -119,7 +118,7 @@ class AudioProcProcessMixin(object):
if self.shm_name is not None:
self.shm = posix_ipc.SharedMemory(self.shm_name)
self.__host_data = noisicore.HostData()
self.__host_data = vm.HostData()
self.__host_data.setup()
self.__vm = vm.PipelineVM(

@ -4,10 +4,10 @@ import itertools
import logging
import uuid
import noisicore
from noisicaa import node_db
from .exceptions import Error
from . import vm
from . import ports
logger = logging.getLogger(__name__)
@ -170,10 +170,10 @@ class ProcessorNode(Node):
def setup(self):
super().setup()
spec = noisicore.ProcessorSpec()
spec = vm.ProcessorSpec()
spec.init(self.description)
self.__processor = noisicore.Processor(
self.__processor = vm.Processor(
self._host_data,
self.description.processor_name,
spec)

@ -3,13 +3,12 @@
import logging
import random
import noisicore
from noisicaa import core
from noisicaa import music
from noisicaa import node_db
from .. import ports
from .. import node
from .. import vm
logger = logging.getLogger(__name__)
@ -27,7 +26,7 @@ class TrackEventSource(node.BuiltinNode):
spec.append_opcode('FETCH_BUFFER', 'track:' + self.track_id, self.outputs['out'].buf_name)
spec.append_buffer(self.id + ':messages', noisicore.AtomData())
spec.append_buffer(self.id + ':messages', vm.AtomData())
spec.append_opcode(
'FETCH_MESSAGES',
core.build_labelset({core.MessageKey.trackId: self.track_id}).to_bytes(),

@ -2,7 +2,7 @@
import logging
import noisicore
from . import vm
from .exceptions import Error
logger = logging.getLogger(__name__)
@ -102,7 +102,7 @@ class AudioInputPort(InputPort):
raise Error("Can only connect to AudioOutputPort")
def get_buf_type(self):
return noisicore.FloatAudioBlock()
return vm.FloatAudioBlock()
class AudioOutputPort(OutputPort):
@ -147,7 +147,7 @@ class AudioOutputPort(OutputPort):
self.drywet = drywet
def get_buf_type(self):
return noisicore.FloatAudioBlock()
return vm.FloatAudioBlock()
class ARateControlInputPort(InputPort):
@ -157,12 +157,12 @@ class ARateControlInputPort(InputPort):
raise Error("Can only connect to ARateControlOutputPort")
def get_buf_type(self):
return noisicore.FloatAudioBlock()
return vm.FloatAudioBlock()
class ARateControlOutputPort(OutputPort):
def get_buf_type(self):
return noisicore.FloatAudioBlock()
return vm.FloatAudioBlock()
class KRateControlInputPort(InputPort):
@ -172,12 +172,12 @@ class KRateControlInputPort(InputPort):
raise Error("Can only connect to KRateControlOutputPort")
def get_buf_type(self):
return noisicore.Float()
return vm.Float()
class KRateControlOutputPort(OutputPort):
def get_buf_type(self):
return noisicore.Float()
return vm.Float()
class EventInputPort(InputPort):
@ -191,9 +191,9 @@ class EventInputPort(InputPort):
raise Error("Can only connect to EventOutputPort")
def get_buf_type(self):
return noisicore.AtomData()
return vm.AtomData()
class EventOutputPort(OutputPort):
def get_buf_type(self):
return noisicore.AtomData()
return vm.AtomData()

@ -1,4 +1,5 @@
add_python_package(
audio_stream_test.py
compiler.py
compiler_test.py
engine_perftest.py
@ -6,5 +7,97 @@ add_python_package(
graph.py
)
set(LIB_SRCS
audio_stream.cpp
backend.cpp
backend_ipc.cpp
backend_null.cpp
backend_portaudio.cpp
buffers.cpp
host_data.cpp
host_system_lv2.cpp
host_system_csound.cpp
misc.cpp
opcodes.cpp
processor_spec.cpp
processor.cpp
processor_null.cpp
processor_ladspa.cpp
processor_lv2.cpp
processor_csound_base.cpp
processor_csound.cpp
processor_custom_csound.cpp
processor_ipc.cpp
processor_fluidsynth.cpp
processor_sample_player.cpp
spec.cpp
vm.cpp
)
set(TEST_SRCS
backend_test.pyx
backend_ipc_test.pyx
buffers_test.pyx
opcodes_test.pyx
processor_test.pyx
processor_ladspa_test.pyx
processor_lv2_test.pyx
processor_csound_test.pyx
processor_ipc_test.pyx
processor_fluidsynth_test.pyx
processor_sample_player_test.pyx
spec_test.pyx
vm_test.pyx
)
add_cpp_capnp(block_data.capnp)
add_py_capnp(block_data.capnp)
add_library(noisicaa-audioproc-vm SHARED ${LIB_SRCS} block_data.capnp.c++)
target_compile_options(noisicaa-audioproc-vm PRIVATE -fPIC -std=c++11 -Wall -Werror -pedantic -DHAVE_PTHREAD_SPIN_LOCK)
target_link_libraries(noisicaa-audioproc-vm PRIVATE noisicaa-core)
target_link_libraries(noisicaa-audioproc-vm PRIVATE noisicaa-lv2)
target_link_libraries(noisicaa-audioproc-vm PRIVATE capnp)
target_link_libraries(noisicaa-audioproc-vm PRIVATE pthread)
target_link_libraries(noisicaa-audioproc-vm PRIVATE portaudio)
target_include_directories(noisicaa-audioproc-vm PUBLIC ${LIBLILV_INCLUDE_DIRS})
target_link_libraries(noisicaa-audioproc-vm PRIVATE ${LIBLILV_LIBRARIES})
target_include_directories(noisicaa-audioproc-vm PRIVATE ${LIBCSOUND_INCLUDE_DIRS})
target_link_libraries(noisicaa-audioproc-vm PRIVATE ${LIBCSOUND_LIBRARIES})
target_include_directories(noisicaa-audioproc-vm PRIVATE ${LIBFLUIDSYNTH_INCLUDE_DIRS})
target_link_libraries(noisicaa-audioproc-vm PRIVATE ${LIBFLUIDSYNTH_LIBRARIES})
add_cython_module(audio_stream CXX)
target_link_libraries(${audio_stream.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(spec CXX)
target_link_libraries(${spec.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(buffers CXX)
target_link_libraries(${buffers.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(processor CXX)
target_link_libraries(${processor.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(processor_spec CXX)
target_link_libraries(${processor_spec.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(host_data CXX)
target_link_libraries(${host_data.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(block_context CXX)
target_link_libraries(${block_context.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(backend CXX)
target_link_libraries(${backend.so} PRIVATE noisicaa-audioproc-vm)
add_cython_module(engine CXX)
target_link_libraries(${engine.so} PRIVATE noisicore)
target_link_libraries(${engine.so} PRIVATE noisicaa-audioproc-vm)
foreach(TEST_SRC ${TEST_SRCS})
string(REGEX REPLACE "\.pyx$" "" TEST_MOD ${TEST_SRC})
add_cython_module(${TEST_MOD} CXX)
target_link_libraries(${${TEST_MOD}.so} PRIVATE noisicaa-audioproc-vm)
target_include_directories(${${TEST_MOD}.so} PRIVATE ${LIBLILV_INCLUDE_DIRS})
target_link_libraries(${${TEST_MOD}.so} PRIVATE ${LIBLILV_LIBRARIES})
endforeach(TEST_SRC)

@ -1,2 +1,30 @@
from .engine import PipelineVM
from .compiler import compile_graph
from .audio_stream import (
AudioStream,
)
from .block_data_capnp import (
BlockData,
Buffer,
)
from .spec import (
PySpec as Spec
)
from .buffers import (
PyBufferType as BufferType,
PyFloat as Float,
PyFloatAudioBlock as FloatAudioBlock,
PyAtomData as AtomData,
)
from .host_data import (
PyHostData as HostData,
)
from .block_context import (
PyBlockContext as BlockContext,
)
from .processor import (
PyProcessor as Processor,
)
from .processor_spec import (
PyProcessorSpec as ProcessorSpec,
)

@ -7,8 +7,8 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "noisicore/audio_stream.h"
#include "noisicore/misc.h"
#include "noisicaa/audioproc/vm/audio_stream.h"
#include "noisicaa/audioproc/vm/misc.h"
namespace {
@ -156,7 +156,7 @@ Status AudioStreamBase::send_bytes(const char* data, size_t size) {
}
AudioStreamServer::AudioStreamServer(const string& address)
: AudioStreamBase("noisicore.audio_stream.server", address) {}
: AudioStreamBase("noisicaa.audioproc.vm.audio_stream.server", address) {}
Status AudioStreamServer::setup() {
_logger->info("Serving from %s", _address.c_str());
@ -217,7 +217,7 @@ void AudioStreamServer::cleanup() {
}
AudioStreamClient::AudioStreamClient(const string& address)
: AudioStreamBase("noisicore.audio_stream.client", address) {}
: AudioStreamBase("noisicaa.audioproc.vm.audio_stream.client", address) {}
Status AudioStreamClient::setup() {
_logger->info("Connecting to %s...", _address.c_str());

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_AUDIO_STREAM_H
#define _NOISICORE_AUDIO_STREAM_H
#ifndef _NOISICAA_AUDIOPROC_VM_AUDIO_STREAM_H
#define _NOISICAA_AUDIOPROC_VM_AUDIO_STREAM_H
#include <stdint.h>
#include "noisicaa/core/logging.h"

@ -2,7 +2,7 @@ from libcpp.string cimport string
from noisicaa.core.status cimport *
cdef extern from "noisicore/audio_stream.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/audio_stream.h" namespace "noisicaa" nogil:
cppclass AudioStreamBase:
Status setup()
void cleanup()

@ -1,7 +1,7 @@
#include "noisicore/backend.h"
#include "noisicore/backend_ipc.h"
#include "noisicore/backend_null.h"
#include "noisicore/backend_portaudio.h"
#include "noisicaa/audioproc/vm/backend.h"
#include "noisicaa/audioproc/vm/backend_ipc.h"
#include "noisicaa/audioproc/vm/backend_null.h"
#include "noisicaa/audioproc/vm/backend_portaudio.h"
namespace noisicaa {

@ -1,12 +1,12 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BACKEND_H
#define _NOISICORE_BACKEND_H
#ifndef _NOISICAA_AUDIOPROC_VM_BACKEND_H
#define _NOISICAA_AUDIOPROC_VM_BACKEND_H
#include <string>
#include "noisicaa/core/logging.h"
#include "noisicaa/core/status.h"
#include "noisicore/buffers.h"
#include "noisicaa/audioproc/vm/buffers.h"
namespace noisicaa {

@ -6,7 +6,7 @@ from .vm cimport *
from .buffers cimport *
from .block_context cimport *
cdef extern from "noisicore/backend.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/backend.h" namespace "noisicaa" nogil:
struct BackendSettings:
string ipc_address
uint32_t block_size

@ -1,9 +1,9 @@
#include <iostream>
#include "capnp/serialize.h"
#include "noisicaa/core/perf_stats.h"
#include "noisicore/backend_ipc.h"
#include "noisicore/audio_stream.h"
#include "noisicore/vm.h"
#include "noisicaa/audioproc/vm/backend_ipc.h"
#include "noisicaa/audioproc/vm/audio_stream.h"
#include "noisicaa/audioproc/vm/vm.h"
namespace noisicaa {
@ -27,7 +27,7 @@ private:
};
IPCBackend::IPCBackend(const BackendSettings& settings)
: Backend("noisicore.backend.ipc", settings),
: Backend("noisicaa.audioproc.vm.backend.ipc", settings),
_block_size(settings.block_size) {}
IPCBackend::~IPCBackend() {}

@ -1,15 +1,15 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BACKEND_IPC_H
#define _NOISICORE_BACKEND_IPC_H
#ifndef _NOISICAA_AUDIOPROC_VM_BACKEND_IPC_H
#define _NOISICAA_AUDIOPROC_VM_BACKEND_IPC_H
#include <memory>
#include <string>
#include "capnp/message.h"
#include "noisicore/audio_stream.h"
#include "noisicore/backend.h"
#include "noisicore/buffers.h"
#include "noisicore/block_data.capnp.h"
#include "noisicaa/audioproc/vm/audio_stream.h"
#include "noisicaa/audioproc/vm/backend.h"
#include "noisicaa/audioproc/vm/buffers.h"
#include "noisicaa/audioproc/vm/block_data.capnp.h"
namespace noisicaa {

@ -1,12 +1,12 @@
#include "noisicaa/core/perf_stats.h"
#include "noisicore/backend_null.h"
#include "noisicore/block_context.h"
#include "noisicore/vm.h"
#include "noisicaa/audioproc/vm/backend_null.h"
#include "noisicaa/audioproc/vm/block_context.h"
#include "noisicaa/audioproc/vm/vm.h"
namespace noisicaa {
NullBackend::NullBackend(const BackendSettings& settings)
: Backend("noisicore.backend.null", settings) {}
: Backend("noisicaa.audioproc.vm.backend.null", settings) {}
NullBackend::~NullBackend() {}
Status NullBackend::setup(VM* vm) {

@ -1,12 +1,12 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BACKEND_NULL_H
#define _NOISICORE_BACKEND_NULL_H
#ifndef _NOISICAA_AUDIOPROC_VM_BACKEND_NULL_H
#define _NOISICAA_AUDIOPROC_VM_BACKEND_NULL_H
#include <string.h>
#include "noisicaa/core/status.h"
#include "noisicore/backend.h"
#include "noisicore/buffers.h"
#include "noisicaa/audioproc/vm/backend.h"
#include "noisicaa/audioproc/vm/buffers.h"
namespace noisicaa {

@ -1,11 +1,11 @@
#include "noisicaa/core/perf_stats.h"
#include "noisicore/backend_portaudio.h"
#include "noisicore/vm.h"
#include "noisicaa/audioproc/vm/backend_portaudio.h"
#include "noisicaa/audioproc/vm/vm.h"
namespace noisicaa {
PortAudioBackend::PortAudioBackend(const BackendSettings& settings)
: Backend("noisicore.backend.portaudio", settings),
: Backend("noisicaa.audioproc.vm.backend.portaudio", settings),
_initialized(false),
_block_size(settings.block_size),
_stream(nullptr),

@ -1,13 +1,13 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BACKEND_PORTAUDIO_H
#define _NOISICORE_BACKEND_PORTAUDIO_H
#ifndef _NOISICAA_AUDIOPROC_VM_BACKEND_PORTAUDIO_H
#define _NOISICAA_AUDIOPROC_VM_BACKEND_PORTAUDIO_H
#include <string>
#include <stdint.h>
#include "portaudio.h"
#include "noisicore/backend.h"
#include "noisicore/buffers.h"
#include "noisicaa/audioproc/vm/backend.h"
#include "noisicaa/audioproc/vm/buffers.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BLOCK_CONTEXT_H
#define _NOISICORE_BLOCK_CONTEXT_H
#ifndef _NOISICAA_AUDIOPROC_VM_BLOCK_CONTEXT_H
#define _NOISICAA_AUDIOPROC_VM_BLOCK_CONTEXT_H
#include <map>
#include <memory>
@ -9,7 +9,7 @@
#include <vector>
#include <stdint.h>
#include "noisicaa/core/message.capnp.h"
#include "noisicore/buffers.h"
#include "noisicaa/audioproc/vm/buffers.h"
namespace noisicaa {

@ -3,7 +3,7 @@ from libcpp.memory cimport unique_ptr
from noisicaa.core.perf_stats cimport *
cdef extern from "noisicore/block_context.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/block_context.h" namespace "noisicaa" nogil:
struct BlockContext:
uint32_t block_size
uint32_t sample_pos

@ -4,8 +4,8 @@ using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("noisicaa::capnp");
# Absolute imports don't work reliably with Python.
using import "../noisicaa/core/message.capnp".Message;
using import "../noisicaa/core/perf_stats.capnp".PerfStats;
using import "../../core/message.capnp".Message;
using import "../../core/perf_stats.capnp".PerfStats;
struct Buffer {
id @0 :Text;

@ -2,8 +2,8 @@
#include <string.h>
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "noisicore/buffers.h"
#include "noisicore/host_data.h"
#include "noisicaa/audioproc/vm/buffers.h"
#include "noisicaa/audioproc/vm/host_data.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_BUFFERS_H
#define _NOISICORE_BUFFERS_H
#ifndef _NOISICAA_AUDIOPROC_VM_BUFFERS_H
#define _NOISICAA_AUDIOPROC_VM_BUFFERS_H
#include <memory>
#include <stdint.h>

@ -6,7 +6,7 @@ from noisicaa.core.status cimport *
from .host_data cimport *
cdef extern from "noisicore/buffers.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/buffers.h" namespace "noisicaa" nogil:
ctypedef uint8_t* BufferPtr
cppclass BufferType:

@ -4,7 +4,7 @@ import logging
import toposort
import noisicore
from noisicaa.audioproc import vm
logger = logging.getLogger(__name__)
@ -14,7 +14,7 @@ class Compiler(object):
self.__graph = graph
def build_spec(self):
spec = noisicore.Spec()
spec = vm.Spec()
sorted_nodes = toposort.toposort_flatten(
{node: set(node.parent_nodes) for node in self.__graph.nodes},

@ -3,7 +3,7 @@
import logging
import unittest
import noisicore
from noisicaa.audioproc import vm
from noisicaa import node_db
from .. import node
from . import compiler
@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
class CompilerTest(unittest.TestCase):
def setUp(self):
self.host_data = noisicore.HostData()
self.host_data = vm.HostData()
def _build_graph(self):
g = graph.PipelineGraph()

@ -14,19 +14,16 @@ import threading
import time
import cProfile
from noisicaa.core.status cimport *
from noisicore.vm cimport *
from noisicore.host_data cimport *
from noisicore.spec cimport *
from noisicore.block_context cimport *
from noisicore.buffers cimport *
from noisicore.backend cimport *
import noisicore
from noisicaa import core
from noisicaa import rwlock
from noisicaa import audioproc
from noisicaa.bindings import lv2
from noisicaa.core.status cimport *
from .vm cimport *
from .host_data cimport *
from .spec cimport *
from .block_context cimport *
from .buffers cimport *
from .backend cimport *
from .. import node
from . import graph
from . import compiler

@ -5,7 +5,6 @@ import struct
import threading
import unittest
import noisicore
from noisicaa import constants
from noisicaa import node_db
from noisicaa import audioproc
@ -53,7 +52,7 @@ logger = logging.getLogger(__name__)
class PipelineVMTest(unittest.TestCase):
def setUp(self):
self.host_data = noisicore.HostData()
self.host_data = audioproc.HostData()
self.host_data.setup()
def tearDown(self):
@ -62,7 +61,7 @@ class PipelineVMTest(unittest.TestCase):
# def test_get_buffer_bytes(self):
# vm = engine.PipelineVM()
# spec = noisicore.Spec()
# spec = vm.Spec()
# spec.buffers.append(buffers.FloatArray(4))
# vm.setup_spec(spec)
@ -82,7 +81,7 @@ class PipelineVMTest(unittest.TestCase):
# be.next_step()
# # run with a spec
# spec = noisicore.Spec()
# spec = vm.Spec()
# spec.buffers.append(buffers.Float())
# spec.opcodes.append(spec.OpCode('SET_FLOAT', buf_idx=0, value=12))
# vm.set_spec(spec)
@ -103,10 +102,10 @@ class PipelineVMTest(unittest.TestCase):
# vm.cleanup()
def test_run_vm(self):
spec = noisicore.Spec()
spec.append_buffer('buf1', noisicore.Float())
spec.append_buffer('buf2', noisicore.FloatAudioBlock())
spec.append_buffer('buf3', noisicore.FloatAudioBlock())
spec = audioproc.Spec()
spec.append_buffer('buf1', audioproc.Float())
spec.append_buffer('buf2', audioproc.FloatAudioBlock())
spec.append_buffer('buf3', audioproc.FloatAudioBlock())
spec.append_opcode('SET_FLOAT', 'buf1', 12.0)
spec.append_opcode('COPY', 'buf2', 'buf3')
spec.append_opcode('CLEAR', 'buf2')
@ -117,7 +116,7 @@ class PipelineVMTest(unittest.TestCase):
vm.set_backend('null', block_size=4)
vm.set_spec(spec)
ctxt = noisicore.BlockContext()
ctxt = audioproc.BlockContext()
ctxt.sample_pos = 0
ctxt.block_size = 4
vm.process_block(ctxt)
@ -294,9 +293,9 @@ class PipelineVMTest(unittest.TestCase):
vm.setup(start_thread=False)
vm.set_backend(constants.TEST_OPTS.PLAYBACK_BACKEND, block_size=4096)
spec = noisicore.Spec()
spec.append_buffer('buf1', noisicore.FloatAudioBlock())
spec.append_buffer('buf2', noisicore.FloatAudioBlock())
spec = audioproc.Spec()
spec.append_buffer('buf1', audioproc.FloatAudioBlock())
spec.append_buffer('buf2', audioproc.FloatAudioBlock())
spec.append_opcode('NOISE', 'buf1')
spec.append_opcode('MUL', 'buf1', 0.2)
spec.append_opcode('OUTPUT', 'buf1', 'left')
@ -305,7 +304,7 @@ class PipelineVMTest(unittest.TestCase):
spec.append_opcode('OUTPUT', 'buf2', 'right')
vm.set_spec(spec)
ctxt = noisicore.BlockContext()
ctxt = audioproc.BlockContext()
ctxt.sample_pos = 0
ctxt.block_size = 256

@ -1,5 +1,5 @@
#include <assert.h>
#include "noisicore/host_data.h"
#include "noisicaa/audioproc/vm/host_data.h"
namespace noisicaa {

@ -1,12 +1,12 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_HOST_DATA_H
#define _NOISICORE_HOST_DATA_H
#ifndef _NOISICAA_AUDIOPROC_VM_HOST_DATA_H
#define _NOISICAA_AUDIOPROC_VM_HOST_DATA_H
#include <memory>
#include "noisicaa/core/status.h"
#include "noisicore/host_system_lv2.h"
#include "noisicore/host_system_csound.h"
#include "noisicaa/audioproc/vm/host_system_lv2.h"
#include "noisicaa/audioproc/vm/host_system_csound.h"
namespace noisicaa {

@ -2,7 +2,7 @@ from libcpp.memory cimport unique_ptr
from noisicaa.core.status cimport *
cdef extern from "noisicore/host_data.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/host_data.h" namespace "noisicaa" nogil:
cppclass LV2SubSystem:
Status setup()
void cleanup()

@ -1,12 +1,12 @@
#include <assert.h>
#include <string.h>
#include "noisicaa/core/logging.h"
#include "noisicore/host_system_csound.h"
#include "noisicaa/audioproc/vm/host_system_csound.h"
namespace noisicaa {
CSoundSubSystem::CSoundSubSystem()
: _logger(LoggerRegistry::get_logger("noisicore.csound")) {}
: _logger(LoggerRegistry::get_logger("noisicaa.audioproc.vm.csound")) {}
CSoundSubSystem::~CSoundSubSystem() {
cleanup();

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_HOST_SYSTEM_CSOUND_H
#define _NOISICORE_HOST_SYSTEM_CSOUND_H
#ifndef _NOISICAA_AUDIOPROC_VM_HOST_SYSTEM_CSOUND_H
#define _NOISICAA_AUDIOPROC_VM_HOST_SYSTEM_CSOUND_H
#include <unordered_map>
#include "csound/csound.h"

@ -1,5 +1,5 @@
#include <assert.h>
#include "noisicore/host_system_lv2.h"
#include "noisicaa/audioproc/vm/host_system_lv2.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_HOST_SYSTEM_LV2_H
#define _NOISICORE_HOST_SYSTEM_LV2_H
#ifndef _NOISICAA_AUDIOPROC_VM_HOST_SYSTEM_LV2_H
#define _NOISICAA_AUDIOPROC_VM_HOST_SYSTEM_LV2_H
#include <unordered_map>
#include "lilv/lilv.h"

@ -1,7 +1,7 @@
#include <memory>
#include <stdio.h>
#include <stdarg.h>
#include "noisicore/misc.h"
#include "noisicaa/audioproc/vm/misc.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_MISC_H
#define _NOISICORE_MISC_H
#ifndef _NOISICAA_AUDIOPROC_VM_MISC_H
#define _NOISICAA_AUDIOPROC_VM_MISC_H
#include <string>

@ -2,10 +2,10 @@
#include "capnp/pretty-print.h"
#include "capnp/serialize.h"
#include "noisicaa/core/message.capnp.h"
#include "noisicore/opcodes.h"
#include "noisicore/host_data.h"
#include "noisicore/backend.h"
#include "noisicore/vm.h"
#include "noisicaa/audioproc/vm/opcodes.h"
#include "noisicaa/audioproc/vm/host_data.h"
#include "noisicaa/audioproc/vm/backend.h"
#include "noisicaa/audioproc/vm/vm.h"
namespace noisicaa {

@ -1,13 +1,13 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_OPCODES_H
#define _NOISICORE_OPCODES_H
#ifndef _NOISICAA_AUDIOPROC_VM_OPCODES_H
#define _NOISICAA_AUDIOPROC_VM_OPCODES_H
#include <string>
#include <vector>
#include <stdint.h>
#include "noisicaa/core/status.h"
#include "noisicore/block_context.h"
#include "noisicaa/audioproc/vm/block_context.h"
namespace noisicaa {

@ -4,7 +4,7 @@ from libc.stdint cimport int64_t
from .vm cimport *
cdef extern from "noisicore/opcodes.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/opcodes.h" namespace "noisicaa" nogil:
enum OpCode:
NOOP
END

@ -1,15 +1,15 @@
#include <random>
#include <time.h>
#include "noisicore/processor.h"
#include "noisicore/processor_null.h"
#include "noisicore/processor_ladspa.h"
#include "noisicore/processor_lv2.h"
#include "noisicore/processor_csound.h"
#include "noisicore/processor_custom_csound.h"
#include "noisicore/processor_sample_player.h"
#include "noisicore/processor_ipc.h"
#include "noisicore/processor_fluidsynth.h"
#include "noisicaa/audioproc/vm/processor.h"
#include "noisicaa/audioproc/vm/processor_null.h"
#include "noisicaa/audioproc/vm/processor_ladspa.h"
#include "noisicaa/audioproc/vm/processor_lv2.h"
#include "noisicaa/audioproc/vm/processor_csound.h"
#include "noisicaa/audioproc/vm/processor_custom_csound.h"
#include "noisicaa/audioproc/vm/processor_sample_player.h"
#include "noisicaa/audioproc/vm/processor_ipc.h"
#include "noisicaa/audioproc/vm/processor_fluidsynth.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_H
#define _NOISICORE_PROCESSOR_H
#ifndef _NOISICAA_AUDIOPROC_VM_PROCESSOR_H
#define _NOISICAA_AUDIOPROC_VM_PROCESSOR_H
#include <map>
#include <memory>
@ -9,9 +9,9 @@
#include <stdint.h>
#include "noisicaa/core/logging.h"
#include "noisicaa/core/status.h"
#include "noisicore/buffers.h"
#include "noisicore/block_context.h"
#include "noisicore/processor_spec.h"
#include "noisicaa/audioproc/vm/buffers.h"
#include "noisicaa/audioproc/vm/block_context.h"
#include "noisicaa/audioproc/vm/processor_spec.h"
namespace noisicaa {

@ -9,7 +9,7 @@ from .processor_spec cimport *
from .host_data cimport *
cdef extern from "noisicore/processor.h" namespace "noisicaa" nogil:
cdef extern from "noisicaa/audioproc/vm/processor.h" namespace "noisicaa" nogil:
cppclass Processor:
@staticmethod
StatusOr[Processor*] create(HostData* host_data, const string& name)

@ -1,9 +1,9 @@
#include "noisicore/processor_csound.h"
#include "noisicaa/audioproc/vm/processor_csound.h"
namespace noisicaa {
ProcessorCSound::ProcessorCSound(HostData *host_data)
: ProcessorCSoundBase("noisicore.processor.csound", host_data) {}
: ProcessorCSoundBase("noisicaa.audioproc.vm.processor.csound", host_data) {}
Status ProcessorCSound::setup(const ProcessorSpec* spec) {
Status status = ProcessorCSoundBase::setup(spec);

@ -1,10 +1,10 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_CSOUND_H
#define _NOISICORE_PROCESSOR_CSOUND_H
#ifndef _NOISICAA_AUDIOPROC_VM_PROCESSOR_CSOUND_H
#define _NOISICAA_AUDIOPROC_VM_PROCESSOR_CSOUND_H
#include "noisicaa/core/status.h"
#include "noisicore/processor_csound_base.h"
#include "noisicaa/audioproc/vm/processor_csound_base.h"
namespace noisicaa {

@ -2,8 +2,8 @@
#include <stdint.h>
#include <string.h>
#include "noisicaa/core/perf_stats.h"
#include "noisicore/host_data.h"
#include "noisicore/processor_csound.h"
#include "noisicaa/audioproc/vm/host_data.h"
#include "noisicaa/audioproc/vm/processor_csound.h"
namespace noisicaa {

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_CSOUND_BASE_H
#define _NOISICORE_PROCESSOR_CSOUND_BASE_H
#ifndef _NOISICAA_AUDIOPROC_VM_PROCESSOR_CSOUND_BASE_H
#define _NOISICAA_AUDIOPROC_VM_PROCESSOR_CSOUND_BASE_H
#include <atomic>
#include <string>
@ -11,8 +11,8 @@
#include "lv2/lv2plug.in/ns/ext/atom/forge.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "noisicaa/core/status.h"
#include "noisicore/buffers.h"
#include "noisicore/processor.h"
#include "noisicaa/audioproc/vm/buffers.h"
#include "noisicaa/audioproc/vm/processor.h"
namespace noisicaa {

@ -2,9 +2,9 @@
#include <ctype.h>
#include <stdint.h>
#include "noisicaa/core/status.h"
#include "noisicore/misc.h"
#include "noisicore/processor_custom_csound.h"
#include "noisicore/processor_spec.h"
#include "noisicaa/audioproc/vm/misc.h"
#include "noisicaa/audioproc/vm/processor_custom_csound.h"
#include "noisicaa/audioproc/vm/processor_spec.h"
namespace {
@ -31,7 +31,7 @@ string port_name_to_csound_label(const string &port_name) {
namespace noisicaa {
ProcessorCustomCSound::ProcessorCustomCSound(HostData *host_data)
: ProcessorCSoundBase("noisicore.processor.custom_csound", host_data) {}
: ProcessorCSoundBase("noisicaa.audioproc.vm.processor.custom_csound", host_data) {}
Status ProcessorCustomCSound::setup(const ProcessorSpec* spec) {
Status status = ProcessorCSoundBase::setup(spec);

@ -1,9 +1,9 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_CUSTOM_CSOUND_H
#define _NOISICORE_PROCESSOR_CUSTOM_CSOUND_H
#ifndef _NOISICAA_AUDIOPROC_VM_PROCESSOR_CUSTOM_CSOUND_H
#define _NOISICAA_AUDIOPROC_VM_PROCESSOR_CUSTOM_CSOUND_H
#include "noisicore/processor_csound_base.h"
#include "noisicaa/audioproc/vm/processor_csound_base.h"
namespace noisicaa {

@ -1,11 +1,11 @@
#include "noisicaa/core/perf_stats.h"
#include "noisicore/processor_fluidsynth.h"
#include "noisicore/host_data.h"
#include "noisicaa/audioproc/vm/processor_fluidsynth.h"
#include "noisicaa/audioproc/vm/host_data.h"
namespace noisicaa {
ProcessorFluidSynth::ProcessorFluidSynth(HostData* host_data)
: Processor("noisicore.processor.fluidsynth", host_data) {}
: Processor("noisicaa.audioproc.vm.processor.fluidsynth", host_data) {}
ProcessorFluidSynth::~ProcessorFluidSynth() {}

@ -1,7 +1,7 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_FLUIDSYNTH_H
#define _NOISICORE_PROCESSOR_FLUIDSYNTH_H
#ifndef _NOISICAA_AUDIOPROC_VM_PROCESSOR_FLUIDSYNTH_H
#define _NOISICAA_AUDIOPROC_VM_PROCESSOR_FLUIDSYNTH_H
#include <string>
#include <vector>
@ -9,8 +9,8 @@
#include "fluidsynth.h"
#include "lv2/lv2plug.in/ns/ext/urid/urid.h"
#include "noisicaa/core/status.h"
#include "noisicore/buffers.h"
#include "noisicore/processor.h"
#include "noisicaa/audioproc/vm/buffers.h"
#include "noisicaa/audioproc/vm/processor.h"
namespace noisicaa {

@ -5,14 +5,14 @@
#include "capnp/message.h"
#include "capnp/serialize.h"
#include "noisicaa/core/perf_stats.h"
#include "noisicore/host_data.h"
#include "noisicore/block_data.capnp.h"
#include "noisicore/processor_ipc.h"
#include "noisicaa/audioproc/vm/host_data.h"
#include "noisicaa/audioproc/vm/block_data.capnp.h"
#include "noisicaa/audioproc/vm/processor_ipc.h"
namespace noisicaa {
ProcessorIPC::ProcessorIPC(HostData* host_data)
: Processor("noisicore.processor.ipc", host_data) {}
: Processor("noisicaa.audioproc.vm.processor.ipc", host_data) {}
ProcessorIPC::~ProcessorIPC() {}

@ -1,15 +1,15 @@
// -*- mode: c++ -*-
#ifndef _NOISICORE_PROCESSOR_IPC_H
#define _NOISICORE_PROCESSOR_IPC_H