haskell-synthesizer-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Synthesizer.Structure

Synopsis

Documentation

newtype Channel Source #

Constructors

Channel 

Fields

Instances

Instances details
Eq Channel Source # 
Instance details

Defined in Synthesizer.Structure

Methods

(==) :: Channel -> Channel -> Bool #

(/=) :: Channel -> Channel -> Bool #

Show Channel Source # 
Instance details

Defined in Synthesizer.Structure

Semigroup Channel Source # 
Instance details

Defined in Synthesizer.Structure

Monoid Channel Source # 
Instance details

Defined in Synthesizer.Structure

data SoundEvent Source #

Constructors

SoundEvent 

Instances

Instances details
Eq SoundEvent Source #

Eq instance for SoundEvents. It should be noted that this isn't 100% sound, as if the needed samples for generating sounds are exactly the same but a sample after that is different, this will return equality even if it really isn't. However functionally these two events are the same, since at maximum that amount of samples will be used when generating the sound from them. So there is no practical difference in this context

Instance details

Defined in Synthesizer.Structure

Show SoundEvent Source # 
Instance details

Defined in Synthesizer.Structure

newtype SynSound Source #

Constructors

SynSound 

Fields

Instances

Instances details
Eq SynSound Source # 
Instance details

Defined in Synthesizer.Structure

Show SynSound Source # 
Instance details

Defined in Synthesizer.Structure

Semigroup SynSound Source # 
Instance details

Defined in Synthesizer.Structure

Monoid SynSound Source # 
Instance details

Defined in Synthesizer.Structure

addChannel :: SynSound -> Channel -> SynSound Source #

Adds a channel to a SynSound

addToNewChannel :: SynSound -> [SoundEvent] -> SynSound Source #

Adds SoundEvents to a new channel.

getAllEvents :: SynSound -> [SoundEvent] Source #

Gets all events currently in the synthesizer.

getAllEventsDuring :: SynSound -> (Time, Time) -> [SoundEvent] Source #

Gets all events that overlap with a time period of (startTime, endTime). | Passing an endTime that is before the startTime will result in no events being returned.

soundToSamples :: SynSound -> SamplingRate -> [Sample] Source #

Converts the sound structure to a list of samples with a certain sampling rate. The worst-case time complexity of the algorithm is O(n log n), where n is the amount of sound events.