Wave Table Synthesizer(Occilator only). I will make Envelope Generator and MML for play music.
Project: Synthesizer. It is using embed to Chip Tune Synthesizer for NXP LPC1768.
At First
Prepare an amplifier with volume wheel. The amplifier wire at pin1 to pin18(D/A converter) from IC Clip or Breedboard.
Play
Check out this project and deploy your mbed. And then push the reset key.
You hear a sound from amplifier.
Modify
First step, you can see main.cpp. This source file plays an occilator with "wait()". Modify frequency at
#define ADD 0x2000000
on the top of source.
Occilator select 7 waveforms.
- OCC_NONE,
- OCC_SQUARE,
- OCC_SINE,
- OCC_SAW,
- OCC_WT,
- OCC_NOISE,
- OCC_TRIANGLE,
WT means WaveTable Synthesizer.Use "setWave()" function at first.Wavetable will copy in instance.
Change there for waveform.
gOccilator[0]=Occilator::getInstance(OCC_SAW,INTERRUPT_TIME_US);
INTERRUPT_TIME_US depends sampling rate. Don't change.
Total volume of D/A converter is setting this place.
gOccilator[0]->setVolume(volume);
By the way, this sample output 0 to 1V(not3.3V) for deforming distortion.
ToDo
- Envelope generator and LFO(with delay)
- MML(Music Macro Language)
- Sample Song(I will make a Japanese Anime music,perhaps)
Project Goal Date
I will make for Comic Market 90(2016.Aug. in Tokyo).And these thing will be written in a Doujinshi.
Track.h@10:40bed7449a81, 2016-02-10 (annotated)
- Committer:
- 117Florian
- Date:
- Wed Feb 10 10:55:08 2016 +0000
- Revision:
- 10:40bed7449a81
- Parent:
- 3:32094530d55e
Adjust volume saw.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
117Florian | 3:32094530d55e | 1 | #ifndef _TRACK_H_INCL |
117Florian | 3:32094530d55e | 2 | #define _TRACK_H_INCL |
117Florian | 3:32094530d55e | 3 | |
117Florian | 3:32094530d55e | 4 | enum ENVELOPE_PHASE |
117Florian | 3:32094530d55e | 5 | { |
117Florian | 3:32094530d55e | 6 | ENV_ATTACK, |
117Florian | 3:32094530d55e | 7 | ENV_DECAY, |
117Florian | 3:32094530d55e | 8 | ENV_SUSTIN, |
117Florian | 3:32094530d55e | 9 | ENV_RELEASE |
117Florian | 3:32094530d55e | 10 | }; |
117Florian | 3:32094530d55e | 11 | |
117Florian | 3:32094530d55e | 12 | class Track |
117Florian | 3:32094530d55e | 13 | { |
117Florian | 3:32094530d55e | 14 | public: |
117Florian | 3:32094530d55e | 15 | |
117Florian | 3:32094530d55e | 16 | /** |
117Florian | 3:32094530d55e | 17 | * Now Envelope Level(max 0xffffffff upper 16bit is integer lower 16bit is decimal) |
117Florian | 3:32094530d55e | 18 | * |
117Florian | 3:32094530d55e | 19 | */ |
117Florian | 3:32094530d55e | 20 | long m_NowLevel; |
117Florian | 3:32094530d55e | 21 | ENVELOPE_PHASE m_Phase; |
117Florian | 3:32094530d55e | 22 | |
117Florian | 3:32094530d55e | 23 | long m_Attack_Speed; |
117Florian | 3:32094530d55e | 24 | long m_Decay_Speed; |
117Florian | 3:32094530d55e | 25 | long m_Decay_Level; |
117Florian | 3:32094530d55e | 26 | long m_Sustin_Speed; |
117Florian | 3:32094530d55e | 27 | long m_Release_Speed; |
117Florian | 3:32094530d55e | 28 | long m_Sustin_Speed; |
117Florian | 3:32094530d55e | 29 | long m_Release_Speed; |
117Florian | 3:32094530d55e | 30 | |
117Florian | 3:32094530d55e | 31 | long m_LFO_Delay; |
117Florian | 3:32094530d55e | 32 | long m_LFO_Speed; |
117Florian | 3:32094530d55e | 33 | long m_LFO_Level; |
117Florian | 3:32094530d55e | 34 | } |
117Florian | 3:32094530d55e | 35 | #endif |