• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

電子楽器CAmiDionのArduinoスケッチ(C++)です。回路図も置いてあります。


Commit MetaInfo

Revisão13f2c2577fb09ed88112d8bdba71fbcf28e847ab (tree)
Hora2016-04-23 13:39:42
AutorAkiyoshi Kamide <kamide@yk.r...>
CommiterAkiyoshi Kamide

Mensagem de Log

[BUGFIX] 波形を先頭から戻って最後に行こうとすると文字化けするバグの修正
音色テーブルのチューニング
CAmiDionConfig.hの誤記修正

Mudança Sumário

Diff

--- a/CAmiDion.ino
+++ b/CAmiDion.ino
@@ -1,6 +1,6 @@
11 //
22 // CAmiDion - Musical Chord Instrument
3-// ver.20160422
3+// ver.20160423
44 // by Akiyoshi Kamide (Twitter: @akiyoshi_kamide)
55 // http://kamide.b.osdn.me/camidion/
66 // http://osdn.jp/users/kamide/pf/CAmiDion/
@@ -109,9 +109,8 @@ class WaveSelecter {
109109 void changeWaveform(char offset) {
110110 if( ! offset ) return;
111111 MidiChannel *cp = PWMDACSynth::getChannel(current_midi_channel);
112- for( byte i = 0; i < NumberOf(wavetables); i++ ) {
113- if( (PROGMEM const byte *)pgm_read_word(wavetables + i) != cp->wavetable )
114- continue;
112+ for( char i = 0; i < NumberOf(wavetables); i++ ) {
113+ if( (PROGMEM const byte *)pgm_read_word(wavetables + i) != cp->wavetable ) continue;
115114 if ( (i += offset) < 0) i += NumberOf(wavetables);
116115 else if (i >= NumberOf(wavetables)) i -= NumberOf(wavetables);
117116 cp->wavetable = (PROGMEM const byte *)pgm_read_word(wavetables + i);
--- a/CAmiDionConfig.h
+++ b/CAmiDionConfig.h
@@ -50,7 +50,7 @@
5050 #define DRUM_VELOCITY 100
5151 // Drum
5252 #define DRUM_NOTE_NUMBER 36 // Bass Drum 1
53-#define DRUM_MIDI_CHANNEL 10;
53+#define DRUM_MIDI_CHANNEL 10
5454
5555 ////////////////////////////////////////////////////////
5656 // Automatic definition
--- a/instruments.ino
+++ b/instruments.ino
@@ -1,149 +1,166 @@
11
22 #if defined(OCTAVE_ANALOG_PIN)
3+// General MIDI instruments
34 PROGMEM const Instrument instruments[] = {
5+ // Piano
46 {sawtoothWavetable, {9, 0, 11, 4}},
57 {sawtoothWavetable, {9, 0, 11, 4}},
68 {sawtoothWavetable, {9, 0, 11, 4}},
79 {sawtoothWavetable, {9, 0, 11, 4}},
10+ {guitarWavetable, {9, 0, 11, 4}},
11+ {sawtoothWavetable, {9, 0, 10, 4}},
812 {sawtoothWavetable, {9, 0, 11, 4}},
9- {sawtoothWavetable, {9, 0, 11, 4}},
10- {sawtoothWavetable, {9, 0, 11, 4}},
11- {sawtoothWavetable, {9, 0, 11, 4}},
13+ {sawtoothWavetable, {8, 0, 10, 4}},
1214
15+ // Chromatic Percussion
16+ {sawtoothWavetable, {9, 0, 10, 4}},
1317 {sineWavetable, {9, 0, 11, 4}},
14- {sineWavetable, {9, 0, 11, 4}},
15- {sineWavetable, {9, 0, 9, 4}},
18+ {sineWavetable, {9, 0, 10, 3}},
1619 {sineWavetable, {9, 0, 11, 4}},
1720 {sineWavetable, {8, 0, 8, 4}},
1821 {sineWavetable, {7, 0, 7, 4}},
1922 {sawtoothWavetable, {9, 0, 11, 4}},
2023 {sawtoothWavetable, {9, 0, 9, 4}},
2124
25+ // Organ
2226 {guitarWavetable, {9, 255, 11, 4}},
2327 {sawtoothWavetable, {9, 255, 11, 4}},
2428 {guitarWavetable, {9, 255, 11, 4}},
25- {guitarWavetable, {9, 255, 11, 4}},
26- {guitarWavetable, {9, 255, 11, 4}},
27- {sawtoothWavetable, {9, 255, 11, 4}},
2829 {sawtoothWavetable, {9, 255, 11, 4}},
29- {sawtoothWavetable, {9, 255, 11, 9}},
30+ {sawtoothWavetable, {9, 255, 11, 6}},
31+ {sawtoothWavetable, {9, 255, 11, 8}},
32+ {sawtoothWavetable, {9, 255, 11, 6}},
33+ {sawtoothWavetable, {9, 255, 11, 6}},
3034
35+ // Guitar
3136 {guitarWavetable, {9, 0, 11, 4}},
3237 {sawtoothWavetable, {9, 0, 11, 4}},
3338 {guitarWavetable, {9, 0, 11, 4}},
3439 {sawtoothWavetable, {9, 0, 11, 4}},
35- {sawtoothWavetable, {9, 0, 11, 4}},
36- {randomWavetable, {9, 0, 10, 4}},
40+ {guitarWavetable, {9, 0, 11, 4}},
41+ {sawtoothWavetable, {9, 0, 10, 4}},
3742 {sawtoothWavetable, {9, 0, 11, 4}},
3843 {randomWavetable, {9, 8, 10, 4}},
3944
45+ // Bass
4046 {guitarWavetable, {9, 0, 11, 4}},
4147 {guitarWavetable, {9, 0, 11, 4}},
42- {guitarWavetable, {9, 0, 11, 4}},
43- {guitarWavetable, {9, 0, 11, 4}},
48+ {guitarWavetable, {9, 192, 9, 3}},
49+ {guitarWavetable, {9, 192, 9, 6}},
4450 {sawtoothWavetable, {9, 0, 11, 4}},
4551 {sawtoothWavetable, {9, 0, 11, 4}},
46- {sawtoothWavetable, {9, 8, 10, 4}},
47- {guitarWavetable, {9, 15, 11, 9}},
52+ {sawtoothWavetable, {9, 128, 10, 4}},
53+ {sawtoothWavetable, {9, 192, 11, 4}},
4854
49- {sawtoothWavetable, {9, 255, 11, 4}},
50- {sawtoothWavetable, {9, 255, 11, 4}},
51- {sawtoothWavetable, {9, 255, 11, 4}},
52- {sawtoothWavetable, {9, 255, 11, 4}},
53- {sawtoothWavetable, {9, 255, 11, 4}},
54- {sawtoothWavetable, {8, 255, 8, 4}},
55- {sineWavetable, {9, 0, 10, 4}},
56- {randomWavetable, {9, 0, 10, 4}},
55+ // Strings
56+ {sawtoothWavetable, {9, 255, 10, 6}},
57+ {sawtoothWavetable, {9, 255, 10, 6}},
58+ {sawtoothWavetable, {9, 255, 10, 6}},
59+ {sawtoothWavetable, {9, 255, 10, 6}},
60+ {guitarWavetable, {9, 255, 11, 6}},
61+ {sawtoothWavetable, {8, 0, 8, 4}},
62+ {sineWavetable, {9, 0, 11, 4}},
63+ {randomWavetable, {9, 0, 10, 3}},
5764
65+ // Ensemble
5866 {triangleWavetable, {9, 255, 11, 6}},
59- {triangleWavetable, {9, 255, 11, 11}},
6067 {triangleWavetable, {9, 255, 11, 9}},
68+ {triangleWavetable, {9, 255, 11, 6}},
6169 {triangleWavetable, {9, 255, 11, 7}},
62- {guitarWavetable, {9, 255, 11, 9}},
63- {sawtoothWavetable, {9, 255, 11, 9}},
64- {sineWavetable, {9, 255, 11, 9}},
65- {squareWavetable, {8, 0, 9, 3}},
66-
67- {sawtoothWavetable, {9, 255, 11, 4}},
68- {sawtoothWavetable, {9, 255, 11, 4}},
69- {sawtoothWavetable, {9, 255, 11, 4}},
70- {sawtoothWavetable, {9, 255, 11, 4}},
7170 {guitarWavetable, {9, 255, 11, 4}},
72- {sawtoothWavetable, {9, 255, 11, 4}},
73- {sawtoothWavetable, {9, 255, 11, 4}},
74- {guitarWavetable, {9, 255, 11, 4}},
75-
76- {guitarWavetable, {9, 255, 11, 4}},
77- {sawtoothWavetable, {9, 255, 11, 4}},
78- {sawtoothWavetable, {9, 255, 11, 4}},
79- {sawtoothWavetable, {9, 255, 11, 4}},
80- {sawtoothWavetable, {9, 255, 11, 4}},
81- {sawtoothWavetable, {9, 255, 11, 4}},
82- {sawtoothWavetable, {9, 255, 11, 4}},
83- {triangleWavetable, {9, 255, 11, 4}},
84-
85- {guitarWavetable, {9, 255, 11, 9}},
86- {guitarWavetable, {9, 255, 11, 9}},
87- {sineWavetable, {9, 255, 11, 9}},
88- {triangleWavetable, {9, 255, 11, 9}},
89- {randomWavetable, {9, 255, 11, 9}},
90- {triangleWavetable, {9, 255, 11, 9}},
91- {sineWavetable, {9, 255, 11, 9}},
92- {sineWavetable, {9, 255, 11, 8}},
71+ {sawtoothWavetable, {9, 128, 9, 4}},
72+ {sineWavetable, {9, 255, 11, 4}},
73+ {squareWavetable, {8, 0, 9, 3}},
9374
94- {squareWavetable, {9, 255, 11, 4}},
75+ // Brass
76+ {sawtoothWavetable, {9, 255, 11, 6}},
77+ {sawtoothWavetable, {9, 255, 11, 6}},
78+ {sawtoothWavetable, {9, 255, 11, 6}},
79+ {sawtoothWavetable, {9, 255, 11, 6}},
80+ {guitarWavetable, {9, 255, 11, 7}},
81+ {sawtoothWavetable, {9, 128, 9, 5}},
82+ {sawtoothWavetable, {9, 192, 9, 5}},
83+ {guitarWavetable, {9, 192, 10, 5}},
84+
85+ // Reed
86+ {guitarWavetable, {9, 255, 11, 6}},
87+ {sawtoothWavetable, {9, 255, 11, 6}},
88+ {sawtoothWavetable, {9, 255, 11, 6}},
89+ {sawtoothWavetable, {9, 255, 11, 6}},
90+ {sawtoothWavetable, {9, 255, 11, 6}},
9591 {sawtoothWavetable, {9, 255, 11, 4}},
96- {triangleWavetable, {9, 255, 11, 4}},
97- {triangleWavetable, {9, 128, 8, 4}},
98- {sawtoothWavetable, {9, 128, 8, 4}},
99- {sawtoothWavetable, {9, 128, 8, 4}},
100- {guitarWavetable, {9, 255, 11, 4}},
10192 {sawtoothWavetable, {9, 255, 11, 4}},
93+ {triangleWavetable, {9, 255, 11, 5}},
10294
95+ // Pipe
10396 {guitarWavetable, {9, 255, 11, 6}},
104- {guitarWavetable, {9, 255, 11, 11}},
105- {guitarWavetable, {4, 128, 8, 9}},
97+ {guitarWavetable, {9, 255, 11, 7}},
98+ {sineWavetable, {9, 255, 11, 6}},
99+ {triangleWavetable, {9, 255, 11, 7}},
100+ {randomWavetable, {9, 128, 10, 6}},
101+ {triangleWavetable, {9, 255, 11, 7}},
102+ {sineWavetable, {9, 255, 11, 7}},
103+ {sineWavetable, {9, 255, 11, 7}},
104+
105+ // Synth Lead
106+ {squareWavetable, {9, 255, 11, 3}},
107+ {sawtoothWavetable, {9, 255, 11, 3}},
108+ {triangleWavetable, {9, 255, 11, 5}},
109+ {triangleWavetable, {9, 128, 8, 6}},
110+ {sawtoothWavetable, {9, 192, 8, 5}},
111+ {sawtoothWavetable, {9, 192, 8, 5}},
112+ {guitarWavetable, {9, 192, 11, 5}},
113+ {sawtoothWavetable, {9, 255, 11, 3}},
114+
115+ // Synth Pad
116+ {guitarWavetable, {9, 255, 11, 5}},
117+ {guitarWavetable, {9, 255, 11, 9}},
118+ {guitarWavetable, {4, 192, 9, 4}},
106119 {guitarWavetable, {9, 255, 11, 6}},
107- {guitarWavetable, {9, 128, 8, 4}},
108- {sawtoothWavetable, {9, 255, 11, 11}},
120+ {guitarWavetable, {9, 192, 10, 8}},
121+ {sawtoothWavetable, {9, 255, 11, 10}},
122+ {guitarWavetable, {9, 255, 11, 8}},
109123 {sawtoothWavetable, {9, 255, 11, 10}},
110- {sawtoothWavetable, {9, 255, 11, 11}},
111124
112- {sawtoothWavetable, {9, 128, 8, 4}},
113- {sawtoothWavetable, {9, 255, 11, 11}},
114- {sawtoothWavetable, {9, 128, 8, 4}},
115- {guitarWavetable, {9, 128, 8, 4}},
116- {sawtoothWavetable, {9, 0, 11, 4}},
117- {sawtoothWavetable, {9, 255, 11, 11}},
125+ // Synth Effects
126+ {guitarWavetable, {9, 128, 9, 4}},
127+ {sawtoothWavetable, {9, 128, 10, 10}},
128+ {triangleWavetable, {9, 192, 8, 4}},
129+ {guitarWavetable, {9, 0, 11, 4}},
130+ {sawtoothWavetable, {10, 0, 11, 3}},
131+ {triangleWavetable, {9, 0, 11, 10}},
118132 {guitarWavetable, {9, 255, 11, 4}},
119- {sawtoothWavetable, {9, 0, 11, 4}},
133+ {sawtoothWavetable, {9, 255, 11, 6}},
120134
135+ // Ethnic
121136 {sawtoothWavetable, {9, 0, 11, 4}},
122137 {sawtoothWavetable, {9, 0, 11, 4}},
123- {sawtoothWavetable, {9, 0, 11, 4}},
138+ {sawtoothWavetable, {9, 0, 9, 4}},
124139 {sawtoothWavetable, {9, 0, 11, 4}},
125140 {sawtoothWavetable, {8, 0, 8, 4}},
126- {sawtoothWavetable, {9, 0, 11, 4}},
127- {sawtoothWavetable, {9, 0, 11, 4}},
128- {sawtoothWavetable, {9, 0, 11, 4}},
141+ {sawtoothWavetable, {9, 255, 11, 6}},
142+ {sawtoothWavetable, {9, 255, 11, 6}},
143+ {sawtoothWavetable, {9, 255, 11, 6}},
129144
130- {squareWavetable, {9, 0, 11, 4}},
145+ // Percussive
146+ {squareWavetable, {9, 64, 9, 4}},
131147 {sawtoothWavetable, {8, 0, 8, 4}},
132- {guitarWavetable, {9, 0, 11, 4}},
148+ {guitarWavetable, {9, 0, 11, 5}},
133149 {sineWavetable, {8, 0, 8, 4}},
134150 {randomWavetable, {8, 0, 8, 4}},
135- {sineWavetable, {8, 0, 8, 4}},
151+ {triangleWavetable, {8, 0, 8, 4}},
136152 {randomWavetable, {8, 0, 8, 4}},
137- {randomWavetable, {8, 255, 8, 14}},
153+ {randomWavetable, {8, 255, 7, 12}},
138154
155+ // Sound Effects
139156 {randomWavetable, {8, 0, 8, 4}},
140157 {randomWavetable, {8, 0, 8, 4}},
141- {randomWavetable, {10, 8, 10, 13}},
158+ {randomWavetable, {10, 64, 12, 12}},
142159 {sineWavetable, {9, 255, 11, 4}},
143- {sawtoothWavetable, {9, 255, 11, 4}},
144- {randomWavetable, {9, 255, 11, 13}},
145- {randomWavetable, {10, 128, 10, 13}},
146- {randomWavetable, {9, 0, 9, 3}},
160+ {randomWavetable, {9, 255, 11, 4}},
161+ {randomWavetable, {9, 255, 11, 12}},
162+ {randomWavetable, {10, 255, 10, 11}},
163+ {randomWavetable, {9, 0, 10, 3}},
147164 };
148165 #endif
149166