honk-1.3.0.0: Cross-platform interface to the PC speaker.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.Honk

Contents

Description

Cross-platform interface to the PC speaker.

Here's an example:

simpleBeep = play [Note 1.0 440]

For more examples, see the readme.

Synopsis

Output

play :: [Note] -> IO () Source

Play multiple notes in order, one after the other.

playOne :: Note -> IO () Source

Play a single note.

Types

data Note Source

Represents a single note, with a duration in seconds and a frequency in hertz.

Constructors

Note 

Instances

Utility functions

freqToMidi :: Floating a => a -> a Source

Convert a frequency to a MIDI note value.

midiToFreq :: Floating a => a -> a Source

Convert a MIDI note value to a frequency.

loop :: Int -> [a] -> [a] Source

Repeat a sequence a specified number of times.