Simple synthesizer for STM32F401RE/STMstation.

Dependencies:   FastPWM mbed-dsp

Embed: (wiki syntax)

« Back to documentation index

master Struct Reference

master Struct Reference

Stores data that is currently being played. More...

#include <STMstation_synth.h>


Detailed Description

Stores data that is currently being played.

So many members! A lot of these are just coefficients for waveform synthesis.

Parameters:
notes(LOADED FROM MELODY) Note frequency and timbre
durations(LOADED FROM MELODY) Duration (from 1/64th to 4 counts)
AR(LOADED FROM MELODY) Attack/Release (bits 7:4 - attack, 3:0 - release)
vol(LOADED FROM MELODY) Volume (0 - muted, 127 - 1x volume, 255 - 2x volume
indexNote currently being played
max(LOADED FROM MELODY) Max index of each channel
env(FOR SYNTHEESIS) Envelope value (between 0~1)
sineCoef(FOR SYNTHEESIS) Coefficient for sine wave synthesis
vSum(FOR SYNTHEESIS) Divider to prevent clipping
atkSlope(FOR SYNTHEESIS) Attack slope for envelope
relSlope(FOR SYNTHEESIS) Release slope for envelope
relOffset(FOR SYNTHEESIS) Release offset for envelope
volCoef(FOR SYNTHEESIS) Volume coefficient to control volume, prevent clipping
halfPeriod(FOR SYNTHEESIS) Half period for square, triangle functions
triSlope(FOR SYNTHEESIS) Triangle wave slope
noiseVal(FOR SYNTHEESIS) Value returned from random noise generation
triVal(FOR SYNTHEESIS) Value returned from triangle wave calculation
counterCurrent sample value
envAtkEnd(FOR SYNTHEESIS) Counter value at which attack ramp ends
envRelStart(FOR SYNTHEESIS) Counter value at which release ramp starts
val8-bit sample value (FOR SYNTHEESIS) What kind of waveform is playing? 0 - sine, 1 - sq, 2 - tri, 3 - noise (FOR SYNTHEESIS) What frequency is playing? 0 - rest, 1~freqLength frequencies in ascending order
bpm(LOADED FROM MELODY) Tempo, in 1/4th counts per minute
repeat(LOADED FROM MELODY) Channel repeat
endptr(LOADED FROM MELODY) Points to melody end value

Definition at line 59 of file STMstation_synth.h.