Class IntJreOut

java.lang.Object
eu.bandm.sig.adlib2.lib.IntJreOut
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
IntJreOut_sgnPCM_16bit_BigEndian

public abstract class IntJreOut extends Object implements AutoCloseable
Output driver from the single-signal-pull sig world into the block-push java runtime system. The subclasses of this class realize different output encodings. (based on /sig/sub/organ/src/main/java/eu/bandm/sig/organ/Player.java and /sig/src/eu/bandm/sig/adlib/DataLineSink.java
  • Field Details

    • os_interfacing_delay

      protected int os_interfacing_delay
      Delay in msec between the attempts to write to the os interface output buffer, in msec. This is a configuration value which can be overrridden on-the-fly when subclassing, e.g. by new IntJreOut(..){{os_interfacing_delay = 2;}}.
      The value of 1 is appropriate for e.g. 40_100 Hz sampling rate, stereo out, and min latency of 235. This value has been found by experiments and depends highly on context and operating system.
    • channels

      protected final int channels
    • bytesPerFrame

      protected final int bytesPerFrame
      "Frames" used in this class exclusively for "sample times channels".
    • bufferSize

      protected final int bufferSize
    • cooked

      protected final int[][] cooked
    • raw

      protected final byte[] raw
  • Constructor Details

    • IntJreOut

      protected IntJreOut(int minLatency, int maxLatency, int threadPriority, IntBufferedProducer sources)
      Only constructor. The subclasses of this class realize different output encodings. The instances are subsequently open(javax.sound.sampled.SourceDataLine, int)ed with an argument of type SourceDataLine which realizes the (multi channel) "physical" output, and one particular sampling rate. The combination of all these format parameters must be checked in advance for feasibility---the negotiation and planning level is not contained in this code, because it can imply very different heuristics, interactions, configuration mechanisms, etc.
      Parameters:
      minLatency - in samples
      maxLatency - in samples
      sources - multi-channel bufferd producer. Its channels will be assigned to the output channels in this particular sequential order. (The encoding bytes of the single samples of multiple output channels simply follow each other in the written output block. Remarkably, this is totally undocumented in the JRE API doc.)
  • Method Details