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

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

/*
 *  WhiteNoise.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, StreamOut}
import de.sciss.fscape.{GE, UGen, UGenGraph, UGenIn, UGenInLike, UGenSource, stream}

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

final case class WhiteNoise(mul: GE = 1.0) extends UGenSource.SingleOut {
  protected def makeUGens(implicit b: UGenGraph.Builder): UGenInLike = unwrap(Vector(mul.expand))

  protected def makeUGen(args: Vec[UGenIn])(implicit b: UGenGraph.Builder): UGenInLike = {
    val noiseUGen = UGen.SingleOut(this, Vector.empty)
    val mulUGen   = args.head
    BinaryOp.Times.make(noiseUGen,mulUGen)
  }

  private[fscape] def makeStream(args: Vec[StreamIn])(implicit b: stream.Builder): StreamOut =
    stream.WhiteNoise()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy