roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
audio.h File Reference

Files for controlling audio speaker and MIDI files. More...

#include "VS1053_PatchTable.h"

Go to the source code of this file.

Functions

void audioInit (void)
 Initialize audio chip. More...
 
void audioNoteOn (uint8 instrument, uint8 key, uint8 velocity, uint32 duration)
 Plays given note for given time. This will schedule a note off message for the sound chip. More...
 
void audioNoteOff (uint8 instrument, uint8 key)
 Turns off given note. More...
 
void audioNoteOffAll (void)
 Turns off all notes. More...
 
void audioVolume (uint8 volume)
 Set the volume level. More...
 
void soundChipTest (uint8 test)
 Turns off sound. Sends audioMIDINoteOff data through SSI to soundchip. More...
 
void playMajorChord (uint8 instrument, uint8 baseNote, uint8 volume, uint32 duration)
 Plays a three note major chord. More...
 
void playMinorChord (uint8 instrument, uint8 baseNote, uint8 volume, uint32 duration)
 Plays a three note minor chord. More...
 

Detailed Description

Files for controlling audio speaker and MIDI files.

Since
Jul 6, 2011
Author
Sunny Kim

Function Documentation

void audioInit ( void  )

Initialize audio chip.

Returns
void
void audioNoteOff ( uint8  instrument,
uint8  key 
)

Turns off given note.

Parameters
instrumentInstrument to stop
keyNote to turn off
Returns
void
void audioNoteOffAll ( void  )

Turns off all notes.

Returns
void
void audioNoteOn ( uint8  instrument,
uint8  key,
uint8  velocity,
uint32  duration 
)

Plays given note for given time. This will schedule a note off message for the sound chip.

Parameters
instrumentInstrument to play
keyNote to play
velocitythe velocity (volume) to play. range is from 0-127
durationDuration of the note (ms)
void audioVolume ( uint8  volume)

Set the volume level.

Parameters
volumethe output level for left and right channels. 0 = total silence, 255 = max volume
Returns
void
void playMajorChord ( uint8  instrument,
uint8  baseNote,
uint8  volume,
uint32  duration 
)

Plays a three note major chord.

Parameters
instrument
baseNoteroot of the chord (played at baseNote + middleC)
volumethe output level for left and right channels. 0 = total silence, 255 = max volume
durationDuration of the note (ms)
Returns
void
void playMinorChord ( uint8  instrument,
uint8  baseNote,
uint8  volume,
uint32  duration 
)

Plays a three note minor chord.

Parameters
instrument
baseNoteroot of the chord (played at baseNote + middleC)
volumethe output level for left and right channels. 0 = total silence, 255 = max volume
durationDuration of the note (ms)
Returns
void
void soundChipTest ( uint8  test)

Turns off sound. Sends audioMIDINoteOff data through SSI to soundchip.

Parameters
test
Returns
void