All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.fscape.graph.Plot1D.scala Maven / Gradle / Ivy

/*
 *  Plot1D.scala
 *  (FScape)
 *
 *  Copyright (c) 2001-2016 Hanns Holger Rutz. All rights reserved.
 *
 *  This software is published under the GNU General Public License v2+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.fscape
package graph

import de.sciss.fscape.stream.StreamIn

import scala.collection.immutable.{IndexedSeq => Vec}

/** Debugging utility that plots 1D "windows" of the input data. */
final case class Plot1D(in: GE, size: GE, label: String = "plot") extends UGenSource.ZeroOut {
  protected def makeUGens(implicit b: UGenGraph.Builder): Unit =
    unwrap(Vector(in.expand, size.expand))

  protected def makeUGen(args: Vec[UGenIn])(implicit b: UGenGraph.Builder): Unit =
    UGen.ZeroOut(this, inputs = args, rest = label)

  private[fscape] def makeStream(args: Vec[StreamIn])(implicit b: stream.Builder): Unit = {
    val Vec(in, size) = args
    stream.Plot1D(in = in.toDouble, size = size.toInt, label = label)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy