Oscillator

eu.joaocosta.minart.audio.Oscillator
See theOscillator companion object
final case class Oscillator(generator: Double => AudioWave) extends Double => AudioWave

Oscillator used to create periodic waves.

Value parameters

generator

function used to generate a wave based on a frequency

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Double => AudioWave
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def apply(frequency: Double): AudioWave

Generates an AudioWave with a certain frequency

Generates an AudioWave with a certain frequency

Value parameters

frequency

audio wave frequency

Attributes

def generate(frequency: Double, amplitude: Double): AudioWave

Generates an AudioWave with a certain frequency and amplitude

Generates an AudioWave with a certain frequency and amplitude

Value parameters

ampitude

amplitude of the generated wave

frequency

audio wave frequency

Attributes

def generateClip(duration: Double, frequency: Double, amplitude: Double, roundDuration: Boolean): AudioClip

Generates a audio clip with a certain duration.

Generates a audio clip with a certain duration.

It also allows rounding the duration to the closest cycle, to smoothly merge results from oscilators.

Value parameters

amplitude

amplitude of the wave

duration

duration of the clip

frequncy

frequency to play

roundDuration

weather the duration should be rounded down to match a oscillator cycle

Attributes

def map(f: Double => Double): Oscillator

Maps the waves generated by this oscillator

Maps the waves generated by this oscillator

Value parameters

f

function that maps one amplitude to another

Attributes

Returns

a new oscillator that generates the transformed waves

Inherited methods

def andThen[A](g: AudioWave => A): T1 => A

Attributes

Inherited from:
Function1
def compose[A](g: A => Double): A => R

Attributes

Inherited from:
Function1

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1