aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common_features.mk21
-rw-r--r--docs/_summary.md1
-rw-r--r--docs/audio_driver.md221
-rw-r--r--docs/config_options.md12
-rw-r--r--docs/feature_audio.md143
-rw-r--r--keyboards/1upkeyboards/sweet16/v2/proton_c/config.h4
-rw-r--r--keyboards/atomic/keymaps/pvc/config.h2
-rw-r--r--keyboards/boston_meetup/2019/config.h5
-rw-r--r--keyboards/c39/keymaps/kuchosauronad0/config.h9
-rw-r--r--keyboards/ckeys/obelus/config.h2
-rwxr-xr-xkeyboards/ckeys/thedora/config.h3
-rw-r--r--keyboards/clueboard/2x1800/2018/config.h4
-rw-r--r--keyboards/clueboard/2x1800/2019/config.h4
-rw-r--r--keyboards/clueboard/66/rev4/config.h4
-rw-r--r--keyboards/clueboard/66_hotswap/gen1/config.h4
-rw-r--r--keyboards/clueboard/66_hotswap/prototype/config.h2
-rw-r--r--keyboards/clueboard/california/config.h4
-rw-r--r--keyboards/clueboard/card/config.h2
-rw-r--r--keyboards/crkbd/keymaps/gotham/config.h2
-rw-r--r--keyboards/ergodash/mini/config.h2
-rw-r--r--keyboards/ergodash/rev1/config.h2
-rw-r--r--keyboards/evyd13/plain60/keymaps/audio/config.h2
-rw-r--r--keyboards/flehrad/bigswitch/keymaps/wanleg/config.h2
-rw-r--r--keyboards/hadron/ver3/config.h6
-rw-r--r--keyboards/handwired/aranck/config.h2
-rw-r--r--keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h2
-rw-r--r--keyboards/handwired/heisenberg/config.h2
-rw-r--r--keyboards/handwired/ibm122m/config.h6
-rw-r--r--keyboards/handwired/xealous/config.h3
-rw-r--r--keyboards/helix/pico/config.h2
-rw-r--r--keyboards/hp69/config.h5
-rw-r--r--keyboards/jones/v03/config.h4
-rw-r--r--keyboards/jones/v03_1/config.h4
-rw-r--r--keyboards/keebio/iris/keymaps/blucky/config.h4
-rw-r--r--keyboards/keebio/iris/keymaps/broswen/config.h2
-rw-r--r--keyboards/keebio/iris/keymaps/drashna/config.h2
-rw-r--r--keyboards/keebio/iris/keymaps/mtdjr/config.h2
-rw-r--r--keyboards/keebio/iris/keymaps/pvinis/config.h2
-rw-r--r--keyboards/keebio/levinson/keymaps/issmirnov/config.h2
-rw-r--r--keyboards/keebio/quefrency/keymaps/drashna_ms/config.h2
-rw-r--r--keyboards/keebio/viterbi/keymaps/drashna/config.h2
-rwxr-xr-xkeyboards/keysofkings/twokey/config.h30
-rw-r--r--keyboards/knops/mini/keymaps/mverteuil/config.h4
-rw-r--r--keyboards/launchpad/keymaps/drashna/config.h2
-rw-r--r--keyboards/lets_split/sockets/config.h2
-rw-r--r--keyboards/lfkeyboards/lfk78/config.h2
-rw-r--r--keyboards/lfkeyboards/lfk87/config.h2
-rw-r--r--keyboards/lfkeyboards/mini1800/config.h2
-rw-r--r--keyboards/lfkeyboards/smk65/revb/config.h3
-rw-r--r--keyboards/meira/featherble/config.h2
-rw-r--r--keyboards/meira/keymaps/grahampheath/config.h2
-rw-r--r--keyboards/mitosis/keymaps/datagrok/config.h2
-rw-r--r--keyboards/mitosis/keymaps/mjt/config.h2
-rw-r--r--keyboards/moonlander/config.h4
-rw-r--r--keyboards/mschwingen/modelm/config.h2
-rw-r--r--keyboards/nack/config.h14
-rw-r--r--keyboards/nightly_boards/n40_o/config.h4
-rw-r--r--keyboards/nightly_boards/n87/config.h2
-rw-r--r--keyboards/nightly_boards/octopad/config.h2
-rw-r--r--keyboards/orthodox/keymaps/drashna/config.h2
-rw-r--r--keyboards/planck/config.h2
-rw-r--r--keyboards/planck/ez/config.h5
-rw-r--r--keyboards/planck/keymaps/dodger/config.h2
-rw-r--r--keyboards/planck/keymaps/synth_sample/config.h56
-rw-r--r--keyboards/planck/keymaps/synth_sample/keymap.c296
-rw-r--r--keyboards/planck/keymaps/synth_sample/rules.mk2
-rw-r--r--keyboards/planck/keymaps/synth_sample/sample.h3797
-rw-r--r--keyboards/planck/keymaps/synth_wavetable/config.h56
-rw-r--r--keyboards/planck/keymaps/synth_wavetable/keymap.c320
-rw-r--r--keyboards/planck/keymaps/synth_wavetable/rules.mk2
-rw-r--r--keyboards/planck/keymaps/synth_wavetable/wavetable.h2197
-rw-r--r--keyboards/planck/light/config.h4
-rw-r--r--keyboards/planck/rev6/config.h6
-rw-r--r--keyboards/preonic/config.h2
-rw-r--r--keyboards/preonic/rev3/config.h6
-rw-r--r--keyboards/scarletbandana/config.h2
-rw-r--r--keyboards/silverbullet44/config.h2
-rw-r--r--keyboards/splitkb/zima/config.h2
-rw-r--r--keyboards/subatomic/config.h2
-rwxr-xr-xkeyboards/tetris/config.h2
-rw-r--r--keyboards/vitamins_included/rev1/config.h2
-rw-r--r--keyboards/vitamins_included/rev2/config.h2
-rw-r--r--keyboards/wilba_tech/wt60_xt/config.h2
-rw-r--r--keyboards/yoichiro/lunakey_mini/config.h2
-rw-r--r--layouts/community/numpad_5x6/bjohnson/config.h2
-rw-r--r--layouts/community/numpad_5x6/drashna/config.h1
-rw-r--r--layouts/community/ortho_4x12/bakingpy/config.h2
-rw-r--r--layouts/community/ortho_5x12/drashna/config.h2
-rw-r--r--layouts/community/ortho_5x14/yet-another-developer/config.h2
-rw-r--r--layouts/community/split_3x6_3/drashna/config.h2
-rw-r--r--quantum/audio/audio.c539
-rw-r--r--quantum/audio/audio.h281
-rw-r--r--quantum/audio/audio_avr.c812
-rw-r--r--quantum/audio/audio_chibios.c721
-rw-r--r--quantum/audio/audio_pwm.c606
-rw-r--r--quantum/audio/driver_avr_pwm.h17
-rw-r--r--quantum/audio/driver_avr_pwm_hardware.c322
-rw-r--r--quantum/audio/driver_chibios_dac.h126
-rw-r--r--quantum/audio/driver_chibios_dac_additive.c335
-rw-r--r--quantum/audio/driver_chibios_dac_basic.c245
-rw-r--r--quantum/audio/driver_chibios_pwm.h40
-rw-r--r--quantum/audio/driver_chibios_pwm_hardware.c144
-rw-r--r--quantum/audio/driver_chibios_pwm_software.c164
-rw-r--r--quantum/audio/musical_notes.h77
-rw-r--r--quantum/audio/voices.c170
-rw-r--r--quantum/audio/voices.h21
-rw-r--r--quantum/audio/wave.h36
-rw-r--r--quantum/backlight/backlight_avr.c4
-rw-r--r--requirements-dev.txt1
-rw-r--r--users/yanfali/config.h2
-rwxr-xr-xutil/audio_generate_dac_lut.py67
-rwxr-xr-xutil/sample_parser.py39
-rwxr-xr-xutil/wavetable_parser.py40
113 files changed, 9731 insertions, 2456 deletions
diff --git a/common_features.mk b/common_features.mk
index 8338ce408..6463efb8b 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -42,12 +42,31 @@ ifeq ($(strip $(COMMAND_ENABLE)), yes)
42 OPT_DEFS += -DCOMMAND_ENABLE 42 OPT_DEFS += -DCOMMAND_ENABLE
43endif 43endif
44 44
45AUDIO_ENABLE ?= no
45ifeq ($(strip $(AUDIO_ENABLE)), yes) 46ifeq ($(strip $(AUDIO_ENABLE)), yes)
47 ifeq ($(PLATFORM),CHIBIOS)
48 AUDIO_DRIVER ?= dac_basic
49 ifeq ($(strip $(AUDIO_DRIVER)), dac_basic)
50 OPT_DEFS += -DAUDIO_DRIVER_DAC
51 else ifeq ($(strip $(AUDIO_DRIVER)), dac_additive)
52 OPT_DEFS += -DAUDIO_DRIVER_DAC
53 ## stm32f2 and above have a usable DAC unit, f1 do not, and need to use pwm instead
54 else ifeq ($(strip $(AUDIO_DRIVER)), pwm_software)
55 OPT_DEFS += -DAUDIO_DRIVER_PWM
56 else ifeq ($(strip $(AUDIO_DRIVER)), pwm_hardware)
57 OPT_DEFS += -DAUDIO_DRIVER_PWM
58 endif
59 else
60 # fallback for all other platforms is pwm
61 AUDIO_DRIVER ?= pwm_hardware
62 OPT_DEFS += -DAUDIO_DRIVER_PWM
63 endif
46 OPT_DEFS += -DAUDIO_ENABLE 64 OPT_DEFS += -DAUDIO_ENABLE
47 MUSIC_ENABLE = yes 65 MUSIC_ENABLE = yes
48 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c 66 SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
49 SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c 67 SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
50 SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c 68 SRC += $(QUANTUM_DIR)/audio/audio.c ## common audio code, hardware agnostic
69 SRC += $(QUANTUM_DIR)/audio/driver_$(PLATFORM_KEY)_$(strip $(AUDIO_DRIVER)).c
51 SRC += $(QUANTUM_DIR)/audio/voices.c 70 SRC += $(QUANTUM_DIR)/audio/voices.c
52 SRC += $(QUANTUM_DIR)/audio/luts.c 71 SRC += $(QUANTUM_DIR)/audio/luts.c
53endif 72endif
diff --git a/docs/_summary.md b/docs/_summary.md
index 526caf926..acbfcfaed 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -133,6 +133,7 @@
133 * [Compatible Microcontrollers](compatible_microcontrollers.md) 133 * [Compatible Microcontrollers](compatible_microcontrollers.md)
134 * [Drivers](hardware_drivers.md) 134 * [Drivers](hardware_drivers.md)
135 * [ADC Driver](adc_driver.md) 135 * [ADC Driver](adc_driver.md)
136 * [Audio Driver](audio_driver.md)
136 * [I2C Driver](i2c_driver.md) 137 * [I2C Driver](i2c_driver.md)
137 * [SPI Driver](spi_driver.md) 138 * [SPI Driver](spi_driver.md)
138 * [WS2812 Driver](ws2812_driver.md) 139 * [WS2812 Driver](ws2812_driver.md)
diff --git a/docs/audio_driver.md b/docs/audio_driver.md
new file mode 100644
index 000000000..7cd5a98d9
--- /dev/null
+++ b/docs/audio_driver.md
@@ -0,0 +1,221 @@
1# Audio Driver :id=audio-driver
2
3The [Audio feature](feature_audio.md) breaks the hardware specifics out into separate, exchangeable driver units, with a common interface to the audio-"core" - which itself handles playing songs and notes while tracking their progress in an internal state, initializing/starting/stopping the driver as needed.
4
5Not all MCUs support every available driver, either the platform-support is not there (yet?) or the MCU simply does not have the required hardware peripheral.
6
7
8## AVR :id=avr
9
10Boards built around an Atmega32U4 can use two sets of PWM capable pins, each driving a separate speaker.
11The possible configurations are:
12
13| | Timer3 | Timer1 |
14|--------------|-------------|--------------|
15| one speaker | C4,C5 or C6 | |
16| one speaker | | B4, B5 or B7 |
17| two speakers | C4,C5 or C6 | B4, B5 or B7 |
18
19Currently there is only one/default driver for AVR based boards, which is automatically configured to:
20
21```make
22AUDIO_DRIVER = pwm_hardware
23```
24
25
26## ARM :id=arm
27
28For Arm based boards, QMK depends on ChibiOS - hence any MCU supported by the later is likely usable, as long as certain hardware peripherals are available.
29
30Supported wiring configurations, with their ChibiOS/MCU peripheral requirement are listed below;
31piezo speakers are marked with :one: for the first/primary and :two: for the secondary.
32
33 | driver | GPTD6<br>Tim6 | GPTD7<br>Tim7 | GPTD8<br>Tim8 | PWMD1<sup>1</sup><br>Tim1_Ch1 |
34 |--------------|------------------------------------------|------------------------|---------------|-------------------------------|
35 | dac_basic | A4+DACD1 = :one: | A5+DACD2 = :one: | state | |
36 | | A4+DACD1 = :one: + Gnd | A5+DACD2 = :two: + Gnd | state | |
37 | | A4+DACD1 = :two: + Gnd | A5+DACD2 = :one: + Gnd | state | |
38 | | A4+DACD1 = :one: + Gnd | | state | |
39 | | | A5+DACD2 = :one: + Gnd | state | |
40 | dac_additive | A4+DACD1 = :one: + Gnd | | | |
41 | | A5+DACD2 = :one: + Gnd | | | |
42 | | A4+DACD1 + A5+DACD2 = :one: <sup>2</sup> | | | |
43 | pwm_software | state-update | | | any = :one: |
44 | pwm hardware | state-update | | | A8 = :one: <sup>3</sup> |
45
46
47<sup>1</sup>: the routing and alternate functions for PWM differ sometimes between STM32 MCUs, if in doubt consult the data-sheet
48<sup>2</sup>: one piezo connected to A4 and A5, with AUDIO_PIN_ALT_AS_NEGATIVE set
49<sup>3</sup>: TIM1_CH1 = A8 on STM32F103C8, other combinations are possible, see Data-sheet. configured with: AUDIO_PWM_DRIVER and AUDIO_PWM_CHANNEL
50
51
52
53### DAC basic :id=dac-basic
54
55The default driver for ARM boards, in absence of an overriding configuration.
56This driver needs one Timer per enabled/used DAC channel, to trigger conversion; and a third timer to trigger state updates with the audio-core.
57
58Additionally, in the board config, you'll want to make changes to enable the DACs, GPT for Timers 6, 7 and 8:
59
60``` c
61//halconf.h:
62#define HAL_USE_DAC TRUE
63#define HAL_USE_GPT TRUE
64#include_next <halconf.h>
65```
66
67``` c
68// mcuconf.h:
69#include_next <mcuconf.h>
70#undef STM32_DAC_USE_DAC1_CH1
71#define STM32_DAC_USE_DAC1_CH1 TRUE
72#undef STM32_DAC_USE_DAC1_CH2
73#define STM32_DAC_USE_DAC1_CH2 TRUE
74#undef STM32_GPT_USE_TIM6
75#define STM32_GPT_USE_TIM6 TRUE
76#undef STM32_GPT_USE_TIM7
77#define STM32_GPT_USE_TIM7 TRUE
78#undef STM32_GPT_USE_TIM8
79#define STM32_GPT_USE_TIM8 TRUE
80```
81
82?> Note: DAC1 (A4) uses TIM6, DAC2 (A5) uses TIM7, and the audio state timer uses TIM8 (configurable).
83
84You can also change the timer used for the overall audio state by defining the driver. For instance:
85
86```c
87#define AUDIO_STATE_TIMER GPTD9
88```
89
90### DAC additive :id=dac-additive
91
92only needs one timer (GPTD6, Tim6) to trigger the DAC unit to do a conversion; the audio state updates are in turn triggered during the DAC callback.
93
94Additionally, in the board config, you'll want to make changes to enable the DACs, GPT for Timer 6:
95
96``` c
97//halconf.h:
98#define HAL_USE_DAC TRUE
99#define HAL_USE_GPT TRUE
100#include_next <halconf.h>
101```
102
103``` c
104// mcuconf.h:
105#include_next <mcuconf.h>
106#undef STM32_DAC_USE_DAC1_CH1
107#define STM32_DAC_USE_DAC1_CH1 TRUE
108#undef STM32_DAC_USE_DAC1_CH2
109#define STM32_DAC_USE_DAC1_CH2 TRUE
110#undef STM32_GPT_USE_TIM6
111#define STM32_GPT_USE_TIM6 TRUE
112```
113
114### DAC Config
115
116| Define | Defaults | Description --------------------------------------------------------------------------------------------- |
117| `AUDIO_DAC_SAMPLE_MAX` | `4095U` | Highest value allowed. Lower value means lower volume. And 4095U is the upper limit, since this is limited to a 12 bit value. Only effects non-pregenerated samples. |
118| `AUDIO_DAC_OFF_VALUE` | `AUDIO_DAC_SAMPLE_MAX / 2` | The value of the DAC when notplaying anything. Some setups may require a high (`AUDIO_DAC_SAMPLE_MAX`) or low (`0`) value here. |
119| `AUDIO_MAX_SIMULTANEOUS_TONES` | __see next table__ | The number of tones that can be played simultaneously. A value that is too high may freeze the controller or glitch out when too many tones are being played. |
120| `AUDIO_DAC_SAMPLE_RATE` | __see next table__ | Effective bit rate of the DAC (in hertz), higher limits simultaneous tones, and lower sacrifices quality. |
121
122There are a number of predefined quality settings that you can use, with "sane minimum" being the default. You can use custom values by simply defining the sample rate and number of simultaneous tones, instead of using one of the listed presets.
123
124| Define | Sample Rate | Simultaneous tones |
125| `AUDIO_DAC_QUALITY_VERY_LOW` | `11025U` | `8` |
126| `AUDIO_DAC_QUALITY_LOW` | `22040U` | `4` |
127| `AUDIO_DAC_QUALITY_HIGH` | `44100U` | `2` |
128| `AUDIO_DAC_QUALITY_VERY_HIGH` | `88200U` | `1` |
129| `AUDIO_DAC_QUALITY_SANE_MINIMUM` | `16384U` | `8` |
130
131
132```c
133 /* zero crossing (or approach, whereas zero == DAC_OFF_VALUE, which can be configured to anything from 0 to DAC_SAMPLE_MAX)
134 * ============================*=*========================== AUDIO_DAC_SAMPLE_MAX
135 * * *
136 * * *
137 * ---------------------------------------------------------
138 * * * } AUDIO_DAC_SAMPLE_MAX/100
139 * --------------------------------------------------------- AUDIO_DAC_OFF_VALUE
140 * * * } AUDIO_DAC_SAMPLE_MAX/100
141 * ---------------------------------------------------------
142 * *
143 * * *
144 * * *
145 * =====*=*================================================= 0x0
146 */
147```
148
149
150### PWM hardware :id=pwm-hardware
151
152This driver uses the ChibiOS-PWM system to produce a square-wave on specific output pins that are connected to the PWM hardware.
153The hardware directly toggles the pin via its alternate function. See your MCU's data-sheet for which pin can be driven by what timer - looking for TIMx_CHy and the corresponding alternate function.
154
155A configuration example for the STM32F103C8 would be:
156``` c
157//halconf.h:
158#define HAL_USE_PWM TRUE
159#define HAL_USE_PAL TRUE
160#define HAL_USE_GPT TRUE
161#include_next <halconf.h>
162```
163
164``` c
165// mcuconf.h:
166#include_next <mcuconf.h>
167#undef STM32_PWM_USE_TIM1
168#define STM32_PWM_USE_TIM1 TRUE
169#undef STM32_GPT_USE_TIM4
170#define STM32_GPT_USE_TIM4 TRUE
171```
172
173If we now target pin A8, looking through the data-sheet of the STM32F103C8, for the timers and alternate functions
174- TIM1_CH1 = PA8 <- alternate0
175- TIM1_CH2 = PA9
176- TIM1_CH3 = PA10
177- TIM1_CH4 = PA11
178
179with all this information, the configuration would contain these lines:
180``` c
181//config.h:
182#define AUDIO_PIN A8
183#define AUDIO_PWM_DRIVER PWMD1
184#define AUDIO_PWM_CHANNEL 1
185#define AUDIO_STATE_TIMER GPTD4
186```
187
188ChibiOS uses GPIOv1 for the F103, which only knows of one alternate function.
189On 'larger' STM32s, GPIOv2 or GPIOv3 are used; with them it is also necessary to configure `AUDIO_PWM_PAL_MODE` to the correct alternate function for the selected pin, timer and timer-channel.
190
191
192### PWM software :id=pwm-software
193
194This driver uses the PWM callbacks from PWMD1 with TIM1_CH1 to toggle the selected AUDIO_PIN in software.
195During the same callback, with AUDIO_PIN_ALT_AS_NEGATIVE set, the AUDIO_PIN_ALT is toggled inversely to AUDIO_PIN. This is useful for setups that drive a piezo from two pins (instead of one and Gnd).
196
197You can also change the timer used for software PWM by defining the driver. For instance:
198
199```c
200#define AUDIO_STATE_TIMER GPTD8
201```
202
203
204### Testing Notes :id=testing-notes
205
206While not an exhaustive list, the following table provides the scenarios that have been partially validated:
207
208| | DAC basic | DAC additive | PWM hardware | PWM software |
209|--------------------------|--------------------|--------------------|--------------------|--------------------|
210| Atmega32U4 | :o: | :o: | :heavy_check_mark: | :o: |
211| STM32F103C8 (bluepill) | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: |
212| STM32F303CCT6 (proton-c) | :heavy_check_mark: | :heavy_check_mark: | ? | :heavy_check_mark: |
213| STM32F405VG | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
214| L0xx | :x: (no Tim8) | ? | ? | ? |
215
216
217:heavy_check_mark: : works and was tested
218:o: : does not apply
219:x: : not supported by MCU
220
221*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*
diff --git a/docs/config_options.md b/docs/config_options.md
index 9a64b9b3d..aeaaf47aa 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -67,16 +67,22 @@ This is a C header file that is one of the first things included, and will persi
67 * turns on the alternate audio voices (to cycle through) 67 * turns on the alternate audio voices (to cycle through)
68* `#define C4_AUDIO` 68* `#define C4_AUDIO`
69 * enables audio on pin C4 69 * enables audio on pin C4
70 * Deprecated. Use `#define AUDIO_PIN C4`
70* `#define C5_AUDIO` 71* `#define C5_AUDIO`
71 * enables audio on pin C5 72 * enables audio on pin C5
73 * Deprecated. Use `#define AUDIO_PIN C5`
72* `#define C6_AUDIO` 74* `#define C6_AUDIO`
73 * enables audio on pin C6 75 * enables audio on pin C6
76 * Deprecated. Use `#define AUDIO_PIN C6`
74* `#define B5_AUDIO` 77* `#define B5_AUDIO`
75 * enables audio on pin B5 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) 78 * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
79 * Deprecated. Use `#define AUDIO_PIN B5`, or use `#define AUDIO_PIN_ALT B5` if a `C` pin is enabled with `AUDIO_PIN`
76* `#define B6_AUDIO` 80* `#define B6_AUDIO`
77 * enables audio on pin B6 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) 81 * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
82 * Deprecated. Use `#define AUDIO_PIN B6`, or use `#define AUDIO_PIN_ALT B6` if a `C` pin is enabled with `AUDIO_PIN`
78* `#define B7_AUDIO` 83* `#define B7_AUDIO`
79 * enables audio on pin B7 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO) 84 * enables audio on pin B5 (duophony is enabled if one of B pins is enabled along with one of C pins)
85 * Deprecated. Use `#define AUDIO_PIN B7`, or use `#define AUDIO_PIN_ALT B7` if a `C` pin is enabled with `AUDIO_PIN`
80* `#define BACKLIGHT_PIN B7` 86* `#define BACKLIGHT_PIN B7`
81 * pin of the backlight 87 * pin of the backlight
82* `#define BACKLIGHT_LEVELS 3` 88* `#define BACKLIGHT_LEVELS 3`
diff --git a/docs/feature_audio.md b/docs/feature_audio.md
index 68ba4477a..9e7ba75f5 100644
--- a/docs/feature_audio.md
+++ b/docs/feature_audio.md
@@ -1,21 +1,117 @@
1# Audio 1# Audio
2 2
3Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any AVR keyboard that allows access to certain PWM-capable pins, you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes. 3Your keyboard can make sounds! If you've got a spare pin you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
4 4
5Up to two simultaneous audio voices are supported, one driven by timer 1 and another driven by timer 3. The following pins can be defined as audio outputs in config.h: 5To activate this feature, add `AUDIO_ENABLE = yes` to your `rules.mk`.
6 6
7Timer 1: 7## AVR based boards
8`#define B5_AUDIO` 8On Atmega32U4 based boards, up to two simultaneous tones can be rendered.
9`#define B6_AUDIO` 9With one speaker connected to a PWM capable pin on PORTC driven by timer 3 and the other on one of the PWM pins on PORTB driven by timer 1.
10`#define B7_AUDIO`
11 10
12Timer 3: 11The following pins can be configured as audio outputs in `config.h` - for one speaker set eiter one out of:
13`#define C4_AUDIO`
14`#define C5_AUDIO`
15`#define C6_AUDIO`
16 12
17If you add `AUDIO_ENABLE = yes` to your `rules.mk`, there's a couple different sounds that will automatically be enabled without any other configuration: 13* `#define AUDIO_PIN C4`
14* `#define AUDIO_PIN C5`
15* `#define AUDIO_PIN C6`
16* `#define AUDIO_PIN B5`
17* `#define AUDIO_PIN B6`
18* `#define AUDIO_PIN B7`
18 19
20and *optionally*, for a second speaker, one of:
21* `#define AUDIO_PIN_ALT B5`
22* `#define AUDIO_PIN_ALT B6`
23* `#define AUDIO_PIN_ALT B7`
24
25### Wiring
26per speaker is - for example with a piezo buzzer - the black lead to Ground, and the red lead connected to the selected AUDIO_PIN for the primary; and similarly with AUDIO_PIN_ALT for the secondary.
27
28
29## ARM based boards
30for more technical details, see the notes on [Audio driver](audio_driver.md).
31
32<!-- because I'm not sure where to fit this in: https://waveeditonline.com/ -->
33### DAC (basic)
34Most STM32 MCUs have DAC peripherals, with a notable exception of the STM32F1xx series. Generally, the DAC peripheral drives pins A4 or A5. To enable DAC-based audio output on STM32 devices, add `AUDIO_DRIVER = dac_basic` to `rules.mk` and set in `config.h` either:
35
36`#define AUDIO_PIN A4` or `#define AUDIO_PIN A5`
37
38the other DAC channel can optionally be used with a secondary speaker, just set:
39
40`#define AUDIO_PIN_ALT A4` or `#define AUDIO_PIN_ALT A5`
41
42Do note though that the dac_basic driver is only capable of reproducing one tone per speaker/channel at a time, for more tones simultaneously, try the dac_additive driver.
43
44#### Wiring:
45for two piezos, for example configured as `AUDIO_PIN A4` and `AUDIO_PIN_ALT A5` would be: red lead to A4 and black to Ground, and similarly with the second one: A5 = red, and Ground = black
46
47another alternative is to drive *one* piezo with both DAC pins - for an extra "push".
48wiring red to A4 and black to A5 (or the other way round) and add `#define AUDIO_PIN_ALT_AS_NEGATIVE` to `config.h`
49
50##### Proton-C Example:
51The Proton-C comes (optionally) with one 'builtin' piezo, which is wired to A4+A5.
52For this board `config.h` would include these defines:
53
54```c
55#define AUDIO_PIN A5
56#define AUDIO_PIN_ALT A4
57#define AUDIO_PIN_ALT_AS_NEGATIVE
58```
59
60### DAC (additive)
61Another option, besides dac_basic (which produces sound through a square-wave), is to use the DAC to do additive wave synthesis.
62With a number of predefined wave-forms or by providing your own implementation to generate samples on the fly.
63To use this feature set `AUDIO_DRIVER = dac_additive` in your `rules.mk`, and select in `config.h` EITHER `#define AUDIO_PIN A4` or `#define AUDIO_PIN A5`.
64
65The used waveform *defaults* to sine, but others can be selected by adding one of the following defines to `config.h`:
66
67* `#define AUDIO_DAC_SAMPLE_WAVEFORM_SINE`
68* `#define AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE`
69* `#define AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID`
70* `#define AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE`
71
72Should you rather choose to generate and use your own sample-table with the DAC unit, implement `uint16_t dac_value_generate(void)` with your keyboard - for an example implementation see keyboards/planck/keymaps/synth_sample or keyboards/planck/keymaps/synth_wavetable
73
74
75### PWM (software)
76if the DAC pins are unavailable (or the MCU has no usable DAC at all, like STM32F1xx); PWM can be an alternative.
77Note that there is currently only one speaker/pin supported.
78
79set in `rules.mk`:
80
81`AUDIO_DRIVER = pwm_software` and in `config.h`:
82`#define AUDIO_PIN C13` (can be any pin) to have the selected pin output a pwm signal, generated from a timer callback which toggles the pin in software.
83
84#### Wiring
85the usual piezo wiring: red goes to the selected AUDIO_PIN, black goes to ground.
86
87OR if you can chose to drive one piezo with two pins, for example `#define AUDIO_PIN B1`, `#define AUDIO_PIN_ALT B2` in `config.h`, with `#define AUDIO_PIN_ALT_AS_NEGATIVE` - then the red lead could go to B1, the black to B2.
88
89### PWM (hardware)
90STM32F1xx have to fall back to using PWM, but can do so in hardware; but again on currently only one speaker/pin.
91
92`AUDIO_DRIVER = pwm_hardware` in `rules.mk`, and in `config.h`:
93`#define AUDIO_PIN A8`
94`#define AUDIO_PWM_DRIVER PWMD1`
95`#define AUDIO_PWM_CHANNEL 1`
96(as well as `#define AUDIO_PWM_PAL_MODE 42` if you are on STM32F2 or larger)
97which will use Timer 1 to directly drive pin PA8 through the PWM hardware (TIM1_CH1 = PA8).
98Should you want to use the pwm-hardware on another pin and timer - be ready to dig into the STM32 data-sheet to pick the right TIMx_CHy and pin-alternate function.
99
100
101## Tone Multiplexing
102Since most drivers can only render one tone per speaker at a time (with the one exception: arm dac-additive) there also exists a "workaround-feature" that does time-slicing/multiplexing - which does what the name implies: cycle through a set of active tones (e.g. when playing chords in Music Mode) at a given rate, and put one tone at a time out through the one/few speakers that are available.
103
104To enable this feature, and configure a starting-rate, add the following defines to `config.h`:
105```c
106#define AUDIO_ENABLE_TONE_MULTIPLEXING
107#define AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT 10
108```
109
110The audio core offers interface functions to get/set/change the tone multiplexing rate from within `keymap.c`.
111
112
113## Songs
114There's a couple of different sounds that will automatically be enabled without any other configuration:
19``` 115```
20STARTUP_SONG // plays when the keyboard starts up (audio.c) 116STARTUP_SONG // plays when the keyboard starts up (audio.c)
21GOODBYE_SONG // plays when you press the RESET key (quantum.c) 117GOODBYE_SONG // plays when you press the RESET key (quantum.c)
@@ -67,15 +163,34 @@ The available keycodes for audio are:
67* `AU_OFF` - Turn Audio Feature off 163* `AU_OFF` - Turn Audio Feature off
68* `AU_TOG` - Toggle Audio Feature state 164* `AU_TOG` - Toggle Audio Feature state
69 165
70!> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely. 166!> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely.
167
168## Tempo
169the 'speed' at which SONGs are played is dictated by the set Tempo, which is measured in beats-per-minute. Note lenghts are defined relative to that.
170The initial/default tempo is set to 120 bpm, but can be configured by setting `TEMPO_DEFAULT` in `config.c`.
171There is also a set of functions to modify the tempo from within the user/keymap code:
172```c
173void audio_set_tempo(uint8_t tempo);
174void audio_increase_tempo(uint8_t tempo_change);
175void audio_decrease_tempo(uint8_t tempo_change);
176```
71 177
72## ARM Audio Volume 178## ARM Audio Volume
73 179
74For ARM devices, you can adjust the DAC sample values. If your board is too loud for you or your coworkers, you can set the max using `DAC_SAMPLE_MAX` in your `config.h`: 180For ARM devices, you can adjust the DAC sample values. If your board is too loud for you or your coworkers, you can set the max using `AUDIO_DAC_SAMPLE_MAX` in your `config.h`:
75 181
76```c 182```c
77#define DAC_SAMPLE_MAX 65535U 183#define AUDIO_DAC_SAMPLE_MAX 4095U
78``` 184```
185the DAC usually runs in 12Bit mode, hence a volume of 100% = 4095U
186
187Note: this only adjusts the volume aka 'works' if you stick to WAVEFORM_SQUARE, since its samples are generated on the fly - any other waveform uses a hardcoded/precomputed sample-buffer.
188
189## Voices
190Aka "audio effects", different ones can be enabled by setting in `config.h` these defines:
191`#define AUDIO_VOICES` to enable the feature, and `#define AUDIO_VOICE_DEFAULT something` to select a specific effect
192for details see quantum/audio/voices.h and .c
193
79 194
80## Music Mode 195## Music Mode
81 196
diff --git a/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h b/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
index 30abf28ee..286af1857 100644
--- a/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
+++ b/keyboards/1upkeyboards/sweet16/v2/proton_c/config.h
@@ -18,3 +18,7 @@
18#define ENCODERS_PAD_A { A2 } 18#define ENCODERS_PAD_A { A2 }
19#define ENCODERS_PAD_B { A1 } 19#define ENCODERS_PAD_B { A1 }
20#define ENCODER_RESOLUTION 4 20#define ENCODER_RESOLUTION 4
21
22#define AUDIO_PIN A5
23#define AUDIO_PIN_ALT A4
24#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/atomic/keymaps/pvc/config.h b/keyboards/atomic/keymaps/pvc/config.h
index 3803a2ccd..01fa0f431 100644
--- a/keyboards/atomic/keymaps/pvc/config.h
+++ b/keyboards/atomic/keymaps/pvc/config.h
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
31#define BACKLIGHT_PIN B7 31#define BACKLIGHT_PIN B7
32#define BACKLIGHT_BREATHING 32#define BACKLIGHT_BREATHING
33 33
34#define C6_AUDIO 34#define AUDIO_PIN C6
35 35
36/* COL2ROW or ROW2COL */ 36/* COL2ROW or ROW2COL */
37#define DIODE_DIRECTION COL2ROW 37#define DIODE_DIRECTION COL2ROW
diff --git a/keyboards/boston_meetup/2019/config.h b/keyboards/boston_meetup/2019/config.h
index 3f2a0dd5d..d9fd93da6 100644
--- a/keyboards/boston_meetup/2019/config.h
+++ b/keyboards/boston_meetup/2019/config.h
@@ -31,7 +31,10 @@
31 31
32//Audio 32//Audio
33#undef AUDIO_VOICES 33#undef AUDIO_VOICES
34#undef C6_AUDIO 34#undef AUDIO_PIN
35#define AUDIO_PIN A5
36#define AUDIO_PIN_ALT A4
37#define AUDIO_PIN_ALT_AS_NEGATIVE
35 38
36#ifdef AUDIO_ENABLE 39#ifdef AUDIO_ENABLE
37 #define STARTUP_SONG SONG(ONE_UP_SOUND) 40 #define STARTUP_SONG SONG(ONE_UP_SOUND)
diff --git a/keyboards/c39/keymaps/kuchosauronad0/config.h b/keyboards/c39/keymaps/kuchosauronad0/config.h
index cf0726e2b..d67935a9f 100644
--- a/keyboards/c39/keymaps/kuchosauronad0/config.h
+++ b/keyboards/c39/keymaps/kuchosauronad0/config.h
@@ -32,12 +32,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32# define RGB_DI_PIN D0 32# define RGB_DI_PIN D0
33# define RGBLED_NUM 4 33# define RGBLED_NUM 4
34#endif // !RGBLIGHT_ENABLE 34#endif // !RGBLIGHT_ENABLE
35
36/*
37#ifdef AUDIO_ENABLE
38# Timer 1: #define B5_AUDIO #define B6_AUDIO #define B7_AUDIO
39# Timer 3: #define C4_AUDIO #define C5_AUDIO #define C6_AUDIO
40//TODO: only D0 and D1 available
41#endif // !AUDIO_ENABLE
42*/
43
diff --git a/keyboards/ckeys/obelus/config.h b/keyboards/ckeys/obelus/config.h
index eaf4811ba..25bc1db03 100644
--- a/keyboards/ckeys/obelus/config.h
+++ b/keyboards/ckeys/obelus/config.h
@@ -154,7 +154,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
154 154
155#ifdef AUDIO_ENABLE 155#ifdef AUDIO_ENABLE
156 #define AUDIO_VOICES 156 #define AUDIO_VOICES
157 #define C6_AUDIO 157 #define AUDIO_PIN C6
158 #define STARTUP_SONG SONG(STARTUP_SOUND) 158 #define STARTUP_SONG SONG(STARTUP_SOUND)
159#endif 159#endif
160 160
diff --git a/keyboards/ckeys/thedora/config.h b/keyboards/ckeys/thedora/config.h
index 349e33748..c7557aa62 100755
--- a/keyboards/ckeys/thedora/config.h
+++ b/keyboards/ckeys/thedora/config.h
@@ -157,6 +157,9 @@
157// NOTE: Must change polyphony_rate to a number higher than 0 in voices.c 157// NOTE: Must change polyphony_rate to a number higher than 0 in voices.c
158#define AUDIO_VOICES 158#define AUDIO_VOICES
159#define PITCH_STANDARD_A 880.0f 159#define PITCH_STANDARD_A 880.0f
160#define AUDIO_PIN A5
161#define AUDIO_PIN_ALT A4
162#define AUDIO_PIN_ALT_AS_NEGATIVE
160 163
161// Mouse keys 164// Mouse keys
162#define MOUSEKEY_DELAY 0 165#define MOUSEKEY_DELAY 0
diff --git a/keyboards/clueboard/2x1800/2018/config.h b/keyboards/clueboard/2x1800/2018/config.h
index 40486379e..9d5b9b514 100644
--- a/keyboards/clueboard/2x1800/2018/config.h
+++ b/keyboards/clueboard/2x1800/2018/config.h
@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20#include "config_common.h" 20#include "config_common.h"
21 21
22/* audio support */ 22/* audio support */
23#define B7_AUDIO 23#define AUDIO_PIN_ALT B7
24#define C4_AUDIO 24#define AUDIO_PIN C4
25#define AUDIO_CLICKY 25#define AUDIO_CLICKY
26 26
27/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ 27/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
diff --git a/keyboards/clueboard/2x1800/2019/config.h b/keyboards/clueboard/2x1800/2019/config.h
index 595dc6108..162d41a2e 100644
--- a/keyboards/clueboard/2x1800/2019/config.h
+++ b/keyboards/clueboard/2x1800/2019/config.h
@@ -27,8 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27#define ENCODER_RESOLUTION 4 27#define ENCODER_RESOLUTION 4
28 28
29/* audio support */ 29/* audio support */
30#define B7_AUDIO 30#define AUDIO_PIN_ALT B7
31#define C4_AUDIO 31#define AUDIO_PIN C4
32#define AUDIO_CLICKY 32#define AUDIO_CLICKY
33 33
34/* 34/*
diff --git a/keyboards/clueboard/66/rev4/config.h b/keyboards/clueboard/66/rev4/config.h
index c745b5a11..2c11cf1ec 100644
--- a/keyboards/clueboard/66/rev4/config.h
+++ b/keyboards/clueboard/66/rev4/config.h
@@ -22,3 +22,7 @@
22#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 // The led to start at 22#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 // The led to start at
23#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel 23#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel
24#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up 24#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up
25
26#define AUDIO_PIN A5
27#define AUDIO_PIN_ALT A4
28#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h
index 1ddcfacf4..1471af63d 100644
--- a/keyboards/clueboard/66_hotswap/gen1/config.h
+++ b/keyboards/clueboard/66_hotswap/gen1/config.h
@@ -108,3 +108,7 @@
108 108
109#define LED_DRIVER_COUNT 1 109#define LED_DRIVER_COUNT 1
110#define LED_DRIVER_LED_COUNT 71 110#define LED_DRIVER_LED_COUNT 71
111
112#define AUDIO_PIN A5
113#define AUDIO_PIN_ALT A4
114#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/clueboard/66_hotswap/prototype/config.h b/keyboards/clueboard/66_hotswap/prototype/config.h
index 5c22b927a..a1ab703c3 100644
--- a/keyboards/clueboard/66_hotswap/prototype/config.h
+++ b/keyboards/clueboard/66_hotswap/prototype/config.h
@@ -3,7 +3,7 @@
3 3
4/* Speaker configuration 4/* Speaker configuration
5 */ 5 */
6#define B7_AUDIO 6#define AUDIO_PIN B7
7#define NO_MUSIC_MODE 7#define NO_MUSIC_MODE
8#define AUDIO_CLICKY 8#define AUDIO_CLICKY
9 9
diff --git a/keyboards/clueboard/california/config.h b/keyboards/clueboard/california/config.h
index b8c5759db..017f1ddf6 100644
--- a/keyboards/clueboard/california/config.h
+++ b/keyboards/clueboard/california/config.h
@@ -1,3 +1,7 @@
1#pragma once 1#pragma once
2 2
3#include "config_common.h" 3#include "config_common.h"
4
5#define AUDIO_PIN A5
6#define AUDIO_PIN_ALT A4
7#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/clueboard/card/config.h b/keyboards/clueboard/card/config.h
index 67ddb5e25..a115f5d6c 100644
--- a/keyboards/clueboard/card/config.h
+++ b/keyboards/clueboard/card/config.h
@@ -23,4 +23,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23#define BACKLIGHT_LEVELS 6 23#define BACKLIGHT_LEVELS 6
24 24
25// Enable audio 25// Enable audio
26#define C6_AUDIO 26#define AUDIO_PIN C6
diff --git a/keyboards/crkbd/keymaps/gotham/config.h b/keyboards/crkbd/keymaps/gotham/config.h
index ed08203aa..dd58a0fe0 100644
--- a/keyboards/crkbd/keymaps/gotham/config.h
+++ b/keyboards/crkbd/keymaps/gotham/config.h
@@ -15,7 +15,7 @@
15#define NO_ACTION_ONESHOT 15#define NO_ACTION_ONESHOT
16 16
17#ifdef AUDIO_ENABLE 17#ifdef AUDIO_ENABLE
18# define B5_AUDIO 18# define AUDIO_PIN B5
19# define NO_MUSIC_MODE 19# define NO_MUSIC_MODE
20# define AUDIO_CLICKY 20# define AUDIO_CLICKY
21#endif 21#endif
diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h
index 5e16c7854..b936e0f54 100644
--- a/keyboards/ergodash/mini/config.h
+++ b/keyboards/ergodash/mini/config.h
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
45/* define if matrix has ghost */ 45/* define if matrix has ghost */
46//#define MATRIX_HAS_GHOST 46//#define MATRIX_HAS_GHOST
47 47
48#define C6_AUDIO 48#define AUDIO_PIN C6
49 49
50/* number of backlight levels */ 50/* number of backlight levels */
51#ifdef BACKLIGHT_ENABLE 51#ifdef BACKLIGHT_ENABLE
diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h
index 6e25194e4..07282cdad 100644
--- a/keyboards/ergodash/rev1/config.h
+++ b/keyboards/ergodash/rev1/config.h
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
45/* define if matrix has ghost */ 45/* define if matrix has ghost */
46//#define MATRIX_HAS_GHOST 46//#define MATRIX_HAS_GHOST
47 47
48#define C6_AUDIO 48#define AUDIO_PIN C6
49 49
50/* number of backlight levels */ 50/* number of backlight levels */
51#ifdef BACKLIGHT_ENABLE 51#ifdef BACKLIGHT_ENABLE
diff --git a/keyboards/evyd13/plain60/keymaps/audio/config.h b/keyboards/evyd13/plain60/keymaps/audio/config.h
index 9a43b7fbe..50309173b 100644
--- a/keyboards/evyd13/plain60/keymaps/audio/config.h
+++ b/keyboards/evyd13/plain60/keymaps/audio/config.h
@@ -1,3 +1,3 @@
1#pragma once 1#pragma once
2 2
3#define B7_AUDIO 3#define AUDIO_PIN B7
diff --git a/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h b/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
index 54abb9a6c..bb638ce59 100644
--- a/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
+++ b/keyboards/flehrad/bigswitch/keymaps/wanleg/config.h
@@ -39,4 +39,4 @@
39#define QMK_LED B0 39#define QMK_LED B0
40 40
41// set audio pin 41// set audio pin
42#define C6_AUDIO 42#define AUDIO_PIN C6
diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h
index f76ca4060..8c04575ee 100644
--- a/keyboards/hadron/ver3/config.h
+++ b/keyboards/hadron/ver3/config.h
@@ -50,7 +50,11 @@
50 50
51//Audio 51//Audio
52#undef AUDIO_VOICES 52#undef AUDIO_VOICES
53#undef C6_AUDIO 53#undef AUDIO_PIN
54#define AUDIO_PIN A5
55#define AUDIO_PIN_ALT A4
56#define AUDIO_PIN_ALT_AS_NEGATIVE
57
54 58
55#ifdef AUDIO_ENABLE 59#ifdef AUDIO_ENABLE
56 #define STARTUP_SONG SONG(PLANCK_SOUND) 60 #define STARTUP_SONG SONG(PLANCK_SOUND)
diff --git a/keyboards/handwired/aranck/config.h b/keyboards/handwired/aranck/config.h
index 5356feb1e..7d0ab25fe 100644
--- a/keyboards/handwired/aranck/config.h
+++ b/keyboards/handwired/aranck/config.h
@@ -101,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
101/** 101/**
102 * Aranck-specific definitions 102 * Aranck-specific definitions
103 */ 103 */
104#define B5_AUDIO 104#define AUDIO_PIN B5
105/** 105/**
106 * Aranck-specific definitions END 106 * Aranck-specific definitions END
107 */ 107 */
diff --git a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
index 6d89314a2..d18f08e40 100644
--- a/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
+++ b/keyboards/handwired/dactyl_manuform/5x6_right_trackball/config.h
@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
61#define BOOTMAGIC_LITE_ROW_RIGHT 6 61#define BOOTMAGIC_LITE_ROW_RIGHT 6
62#define BOOTMAGIC_LITE_COLUMN_RIGHT 5 62#define BOOTMAGIC_LITE_COLUMN_RIGHT 5
63 63
64#define C6_AUDIO 64#define AUDIO_PIN C6
65 65
66#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095 66#define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 4095
67#define DYNAMIC_KEYMAP_LAYER_COUNT 16 67#define DYNAMIC_KEYMAP_LAYER_COUNT 16
diff --git a/keyboards/handwired/heisenberg/config.h b/keyboards/handwired/heisenberg/config.h
index 9fe2ec879..ba35f24ac 100644
--- a/keyboards/handwired/heisenberg/config.h
+++ b/keyboards/handwired/heisenberg/config.h
@@ -101,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
101/** 101/**
102 * Heisenberg-specific definitions 102 * Heisenberg-specific definitions
103 */ 103 */
104#define B5_AUDIO 104#define AUDIO_PIN B5
105/** 105/**
106 * Heisenberg-specific definitions END 106 * Heisenberg-specific definitions END
107 */ 107 */
diff --git a/keyboards/handwired/ibm122m/config.h b/keyboards/handwired/ibm122m/config.h
index e0e95d6d3..bd1fdc97d 100644
--- a/keyboards/handwired/ibm122m/config.h
+++ b/keyboards/handwired/ibm122m/config.h
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24#define PRODUCT_ID 0x0000 24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001 25#define DEVICE_VER 0x0001
26#define MANUFACTURER IBM 26#define MANUFACTURER IBM
27#define PRODUCT IBM Model M 122 key 27#define PRODUCT IBM Model M 122 key
28 28
29/* key matrix size */ 29/* key matrix size */
30#define MATRIX_ROWS 8 30#define MATRIX_ROWS 8
@@ -102,8 +102,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
102 * 102 *
103 */ 103 */
104 104
105#define B6_AUDIO 105#define AUDIO_PIN_ALT B6
106#define C6_AUDIO 106#define AUDIO_PIN C6
107 107
108/* control how magic key switches layers */ 108/* control how magic key switches layers */
109//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true 109//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h
index 251e85d4c..5c1469b1f 100644
--- a/keyboards/handwired/xealous/config.h
+++ b/keyboards/handwired/xealous/config.h
@@ -34,10 +34,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
34 34
35 35
36#ifdef AUDIO_ENABLE 36#ifdef AUDIO_ENABLE
37 #define C6_AUDIO 37 #define AUDIO_PIN C6
38 #define STARTUP_SONG SONG(STARTUP_SOUND) 38 #define STARTUP_SONG SONG(STARTUP_SOUND)
39 #define NO_MUSIC_MODE 39 #define NO_MUSIC_MODE
40 #define TONE_QWERTY SONG(Q__NOTE(_E4)); 40 #define TONE_QWERTY SONG(Q__NOTE(_E4));
41 #define TONE_NUMPAD SONG(Q__NOTE(_D4)); 41 #define TONE_NUMPAD SONG(Q__NOTE(_D4));
42#endif 42#endif
43
diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h
index 3938db30e..b01fd3a00 100644
--- a/keyboards/helix/pico/config.h
+++ b/keyboards/helix/pico/config.h
@@ -77,7 +77,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
77 77
78/* Audio */ 78/* Audio */
79#ifdef AUDIO_ENABLE 79#ifdef AUDIO_ENABLE
80 #define B5_AUDIO 80 #define AUDIO_PIN B5
81#endif 81#endif
82 82
83/* ws2812 RGB LED */ 83/* ws2812 RGB LED */
diff --git a/keyboards/hp69/config.h b/keyboards/hp69/config.h
index ca0a9eb47..06dd57145 100644
--- a/keyboards/hp69/config.h
+++ b/keyboards/hp69/config.h
@@ -48,5 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
48#define RGBLED_NUM 20 48#define RGBLED_NUM 20
49#define RGBLIGHT_ANIMATIONS 49#define RGBLIGHT_ANIMATIONS
50 50
51#define A4_AUDIO 51#define AUDIO_PIN A5
52#define A5_AUDIO \ No newline at end of file 52#define AUDIO_PIN_ALT A4
53#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/jones/v03/config.h b/keyboards/jones/v03/config.h
index 3683a43dd..0ff82e8d3 100644
--- a/keyboards/jones/v03/config.h
+++ b/keyboards/jones/v03/config.h
@@ -57,8 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
57 57
58/* Audio */ 58/* Audio */
59#ifdef AUDIO_ENABLE 59#ifdef AUDIO_ENABLE
60 #define C6_AUDIO 60 #define AUDIO_PIN C6
61 #define B6_AUDIO // 2nd pin for simultaneous audio. 61 #define AUDIO_PIN_ALT B6 // 2nd pin for simultaneous audio.
62 #define AUDIO_CLICKY 62 #define AUDIO_CLICKY
63#endif 63#endif
64 64
diff --git a/keyboards/jones/v03_1/config.h b/keyboards/jones/v03_1/config.h
index a064e5639..c1d6a577f 100644
--- a/keyboards/jones/v03_1/config.h
+++ b/keyboards/jones/v03_1/config.h
@@ -57,8 +57,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
57 57
58/* Audio */ 58/* Audio */
59#ifdef AUDIO_ENABLE 59#ifdef AUDIO_ENABLE
60 #define C6_AUDIO 60 #define AUDIO_PIN C6
61 #define B7_AUDIO // 2nd pin for simultaneous audio. 61 #define AUDIO_PIN_ALT B7 // 2nd pin for simultaneous audio.
62 #define AUDIO_CLICKY 62 #define AUDIO_CLICKY
63#endif 63#endif
64 64
diff --git a/keyboards/keebio/iris/keymaps/blucky/config.h b/keyboards/keebio/iris/keymaps/blucky/config.h
index 213445dd3..f187addbd 100644
--- a/keyboards/keebio/iris/keymaps/blucky/config.h
+++ b/keyboards/keebio/iris/keymaps/blucky/config.h
@@ -1,5 +1,5 @@
1/* 1/*
2Copyright 2019 Brian Luckenbill 2Copyright 2019 Brian Luckenbill
3 3
4This program is free software: you can redistribute it and/or modify 4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by 5it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18#pragma once 18#pragma once
19 19
20#define C6_AUDIO 20#define AUDIO_PIN C6
21 21
22#undef RGBLED_NUM 22#undef RGBLED_NUM
23#define RGBLED_NUM 12 23#define RGBLED_NUM 12
diff --git a/keyboards/keebio/iris/keymaps/broswen/config.h b/keyboards/keebio/iris/keymaps/broswen/config.h
index 19c47780d..fcfbfe8cf 100644
--- a/keyboards/keebio/iris/keymaps/broswen/config.h
+++ b/keyboards/keebio/iris/keymaps/broswen/config.h
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
32#define RGBLIGHT_HUE_STEP 5 32#define RGBLIGHT_HUE_STEP 5
33#define RGBLIGHT_SAT_STEP 8 33#define RGBLIGHT_SAT_STEP 8
34#define RGBLIGHT_VAL_STEP 8 34#define RGBLIGHT_VAL_STEP 8
35#define C6_AUDIO 35#define AUDIO_PIN C6
36 36
37#define NO_MUSIC_MODE 37#define NO_MUSIC_MODE
38 38
diff --git a/keyboards/keebio/iris/keymaps/drashna/config.h b/keyboards/keebio/iris/keymaps/drashna/config.h
index 63f87b7c4..f68166c98 100644
--- a/keyboards/keebio/iris/keymaps/drashna/config.h
+++ b/keyboards/keebio/iris/keymaps/drashna/config.h
@@ -43,7 +43,7 @@
43#endif // RGBLIGHT_ENABLE 43#endif // RGBLIGHT_ENABLE
44 44
45#ifdef AUDIO_ENABLE 45#ifdef AUDIO_ENABLE
46# define C6_AUDIO 46# define AUDIO_PIN C6
47# ifdef RGBLIGHT_ENABLE 47# ifdef RGBLIGHT_ENABLE
48# ifndef __arm__ 48# ifndef __arm__
49# define NO_MUSIC_MODE 49# define NO_MUSIC_MODE
diff --git a/keyboards/keebio/iris/keymaps/mtdjr/config.h b/keyboards/keebio/iris/keymaps/mtdjr/config.h
index 93dc4c211..9adb6d627 100644
--- a/keyboards/keebio/iris/keymaps/mtdjr/config.h
+++ b/keyboards/keebio/iris/keymaps/mtdjr/config.h
@@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
34 34
35// #define AUDIO_CLICKY 35// #define AUDIO_CLICKY
36// #define AUDIO_CLICKY_ON 36// #define AUDIO_CLICKY_ON
37// #define C6_AUDIO 37// #define AUDIO_PIN C6
38// #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.1f 38// #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.1f
39// #define AUDIO_CLICKY_FREQ_MAX 100.0f 39// #define AUDIO_CLICKY_FREQ_MAX 100.0f
40 40
diff --git a/keyboards/keebio/iris/keymaps/pvinis/config.h b/keyboards/keebio/iris/keymaps/pvinis/config.h
index 9574f2a83..c2870eba0 100644
--- a/keyboards/keebio/iris/keymaps/pvinis/config.h
+++ b/keyboards/keebio/iris/keymaps/pvinis/config.h
@@ -16,7 +16,7 @@
16 16
17// Choose pin to use for audio. C6 is the one iris uses. 17// Choose pin to use for audio. C6 is the one iris uses.
18#ifdef AUDIO_ENABLE 18#ifdef AUDIO_ENABLE
19# define C6_AUDIO 19# define AUDIO_PIN C6
20# define STARTUP_SONG SONG(NO_SOUND) // No startup song. 20# define STARTUP_SONG SONG(NO_SOUND) // No startup song.
21#endif 21#endif
22 22
diff --git a/keyboards/keebio/levinson/keymaps/issmirnov/config.h b/keyboards/keebio/levinson/keymaps/issmirnov/config.h
index 89c2f5ebe..2f0fbaf33 100644
--- a/keyboards/keebio/levinson/keymaps/issmirnov/config.h
+++ b/keyboards/keebio/levinson/keymaps/issmirnov/config.h
@@ -29,6 +29,6 @@
29 29
30#ifdef AUDIO_ENABLE 30#ifdef AUDIO_ENABLE
31 #define QMK_SPEAKER C6 31 #define QMK_SPEAKER C6
32 #define C6_AUDIO 32 #define AUDIO_PIN C6
33 #define NO_MUSIC_MODE // Save 2000 bytes 33 #define NO_MUSIC_MODE // Save 2000 bytes
34#endif 34#endif
diff --git a/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
index 089c8cf79..80a3cb877 100644
--- a/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
+++ b/keyboards/keebio/quefrency/keymaps/drashna_ms/config.h
@@ -35,6 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
35#endif 35#endif
36 36
37#ifdef AUDIO_ENABLE 37#ifdef AUDIO_ENABLE
38 #define B7_AUDIO 38 #define AUDIO_PIN B7
39 #define AUDIO_CLICKY 39 #define AUDIO_CLICKY
40#endif 40#endif
diff --git a/keyboards/keebio/viterbi/keymaps/drashna/config.h b/keyboards/keebio/viterbi/keymaps/drashna/config.h
index 5d7ffa8a1..2decb3b3e 100644
--- a/keyboards/keebio/viterbi/keymaps/drashna/config.h
+++ b/keyboards/keebio/viterbi/keymaps/drashna/config.h
@@ -34,7 +34,7 @@
34#define PRODUCT Drashnas Viterbi Macro Pad 34#define PRODUCT Drashnas Viterbi Macro Pad
35 35
36#ifdef AUDIO_ENABLE 36#ifdef AUDIO_ENABLE
37# define C6_AUDIO 37# define AUDIO_PIN C6
38# define NO_MUSIC_MODE 38# define NO_MUSIC_MODE
39#endif 39#endif
40 40
diff --git a/keyboards/keysofkings/twokey/config.h b/keyboards/keysofkings/twokey/config.h
index d7f4c3cf0..9b77fa73e 100755
--- a/keyboards/keysofkings/twokey/config.h
+++ b/keyboards/keysofkings/twokey/config.h
@@ -1,18 +1,18 @@
1 /* Copyright 2020 Keys of Kings 1 /* Copyright 2020 Keys of Kings
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or 5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version. 6 * (at your option) any later version.
7 * 7 *
8 * This program is distributed in the hope that it will be useful, 8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details. 11 * GNU General Public License for more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License 13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#pragma once 17#pragma once
18 18
@@ -59,7 +59,7 @@
59#define RGBLIGHT_HUE_STEP 4 59#define RGBLIGHT_HUE_STEP 4
60#define RGBLIGHT_SAT_STEP 4 60#define RGBLIGHT_SAT_STEP 4
61#define RGBLIGHT_VAL_STEP 4 61#define RGBLIGHT_VAL_STEP 4
62#define B6_AUDIO 62#define AUDIO_PIN B6
63#define AUDIO_CLICKY 63#define AUDIO_CLICKY
64#endif 64#endif
65 65
diff --git a/keyboards/knops/mini/keymaps/mverteuil/config.h b/keyboards/knops/mini/keymaps/mverteuil/config.h
index f72145c5a..584296cfa 100644
--- a/keyboards/knops/mini/keymaps/mverteuil/config.h
+++ b/keyboards/knops/mini/keymaps/mverteuil/config.h
@@ -18,8 +18,8 @@
18 18
19#if defined(AUDIO_ENABLE) 19#if defined(AUDIO_ENABLE)
20 #define AUDIO_CLICKY 20 #define AUDIO_CLICKY
21 #define B5_AUDIO 21 #define AUDIO_PIN_ALT B5
22 #define C6_AUDIO 22 #define AUDIO_PIN C6
23 #define STARTUP_SONG SONG(ZELDA_PUZZLE) 23 #define STARTUP_SONG SONG(ZELDA_PUZZLE)
24 #define GOODBYE_SONG SONG(COIN_SOUND) 24 #define GOODBYE_SONG SONG(COIN_SOUND)
25#endif 25#endif
diff --git a/keyboards/launchpad/keymaps/drashna/config.h b/keyboards/launchpad/keymaps/drashna/config.h
index 212b1da80..b14becc25 100644
--- a/keyboards/launchpad/keymaps/drashna/config.h
+++ b/keyboards/launchpad/keymaps/drashna/config.h
@@ -27,5 +27,5 @@
27#define RGBLIGHT_VAL_STEP 17 27#define RGBLIGHT_VAL_STEP 17
28 28
29#define DRIVER_LED_TOTAL RGBLED_NUM 29#define DRIVER_LED_TOTAL RGBLED_NUM
30#define B7_AUDIO 30#define AUDIO_PIN B7
31#define AUDIO_CLICKY 31#define AUDIO_CLICKY
diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h
index 4315ce24f..67fa4b4cc 100644
--- a/keyboards/lets_split/sockets/config.h
+++ b/keyboards/lets_split/sockets/config.h
@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
61 61
62/* Audio settings */ 62/* Audio settings */
63#ifdef AUDIO_ENABLE 63#ifdef AUDIO_ENABLE
64 #define C6_AUDIO // Define this to enable the buzzer 64 #define AUDIO_PIN C6 // Define this to enable the buzzer
65#endif 65#endif
66 66
67/* 67/*
diff --git a/keyboards/lfkeyboards/lfk78/config.h b/keyboards/lfkeyboards/lfk78/config.h
index 5a855b07c..2b0b01d86 100644
--- a/keyboards/lfkeyboards/lfk78/config.h
+++ b/keyboards/lfkeyboards/lfk78/config.h
@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
39 39
40#define TAPPING_TERM 200 40#define TAPPING_TERM 200
41 41
42#define C6_AUDIO 42#define AUDIO_PIN C6
43#define AUDIO_VOICES 43#define AUDIO_VOICES
44 44
45#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile 45#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile
diff --git a/keyboards/lfkeyboards/lfk87/config.h b/keyboards/lfkeyboards/lfk87/config.h
index 118c135aa..c03059092 100644
--- a/keyboards/lfkeyboards/lfk87/config.h
+++ b/keyboards/lfkeyboards/lfk87/config.h
@@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
50#endif 50#endif
51 51
52#define AUDIO_VOICES 52#define AUDIO_VOICES
53#define C6_AUDIO 53#define AUDIO_PIN C6
54 54
55#define BACKLIGHT_LEVELS 10 55#define BACKLIGHT_LEVELS 10
56#define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255} 56#define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255}
diff --git a/keyboards/lfkeyboards/mini1800/config.h b/keyboards/lfkeyboards/mini1800/config.h
index a6cd675dd..b8c0f2b67 100644
--- a/keyboards/lfkeyboards/mini1800/config.h
+++ b/keyboards/lfkeyboards/mini1800/config.h
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37 #define RGBLED_NUM 26 // Number of LEDs 37 #define RGBLED_NUM 26 // Number of LEDs
38 38
39#define AUDIO_VOICES 39#define AUDIO_VOICES
40#define C6_AUDIO 40#define AUDIO_PIN C6
41 41
42#define BACKLIGHT_LEVELS 10 42#define BACKLIGHT_LEVELS 10
43#define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255} 43#define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255}
diff --git a/keyboards/lfkeyboards/smk65/revb/config.h b/keyboards/lfkeyboards/smk65/revb/config.h
index 0d4fe40f3..924a04fd9 100644
--- a/keyboards/lfkeyboards/smk65/revb/config.h
+++ b/keyboards/lfkeyboards/smk65/revb/config.h
@@ -43,8 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
43//RevB only: 43//RevB only:
44 44
45#define AUDIO_VOICES 45#define AUDIO_VOICES
46#define C6_AUDIO 46#define AUDIO_PIN C6
47// #define B5_AUDIO
48 47
49#define BACKLIGHT_LEVELS 8 48#define BACKLIGHT_LEVELS 8
50#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255} 49#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255}
diff --git a/keyboards/meira/featherble/config.h b/keyboards/meira/featherble/config.h
index c6c63556d..e8db87acb 100644
--- a/keyboards/meira/featherble/config.h
+++ b/keyboards/meira/featherble/config.h
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37#define UNUSED_PINS 37#define UNUSED_PINS
38 38
39#define QMK_SPEAKER B5 39#define QMK_SPEAKER B5
40#define B5_AUDIO 40#define AUDIO_PIN B5
41#define AUDIO_VOICES 41#define AUDIO_VOICES
42 42
43// #define BACKLIGHT_PIN B7 43// #define BACKLIGHT_PIN B7
diff --git a/keyboards/meira/keymaps/grahampheath/config.h b/keyboards/meira/keymaps/grahampheath/config.h
index fcc5e4f13..604f37846 100644
--- a/keyboards/meira/keymaps/grahampheath/config.h
+++ b/keyboards/meira/keymaps/grahampheath/config.h
@@ -21,7 +21,7 @@
21 21
22// place overrides here 22// place overrides here
23#define MUSIC_MASK (keycode != KC_NO) 23#define MUSIC_MASK (keycode != KC_NO)
24#define C6_AUDIO 24#define AUDIO_PIN C6
25#ifdef AUDIO_ENABLE 25#ifdef AUDIO_ENABLE
26 #define STARTUP_SONG SONG(PLANCK_SOUND) 26 #define STARTUP_SONG SONG(PLANCK_SOUND)
27 // #define STARTUP_SONG SONG(NO_SOUND) 27 // #define STARTUP_SONG SONG(NO_SOUND)
diff --git a/keyboards/mitosis/keymaps/datagrok/config.h b/keyboards/mitosis/keymaps/datagrok/config.h
index 0e82b628b..5f37d27e6 100644
--- a/keyboards/mitosis/keymaps/datagrok/config.h
+++ b/keyboards/mitosis/keymaps/datagrok/config.h
@@ -36,7 +36,7 @@
36 } 36 }
37#define AUDIO_VOICES 37#define AUDIO_VOICES
38#define AUDIO_CLICKY 38#define AUDIO_CLICKY
39#define C6_AUDIO 39#define AUDIO_PIN C6
40#endif 40#endif
41 41
42#endif 42#endif
diff --git a/keyboards/mitosis/keymaps/mjt/config.h b/keyboards/mitosis/keymaps/mjt/config.h
index 71adc5a2d..830cbc9e0 100644
--- a/keyboards/mitosis/keymaps/mjt/config.h
+++ b/keyboards/mitosis/keymaps/mjt/config.h
@@ -15,7 +15,7 @@
15#endif 15#endif
16 16
17#define AUDIO_VOICES 17#define AUDIO_VOICES
18#define C6_AUDIO 18#define AUDIO_PIN C6
19 19
20// fix iPhone power adapter issue 20// fix iPhone power adapter issue
21#define USB_MAX_POWER_CONSUMPTION 50 21#define USB_MAX_POWER_CONSUMPTION 50
diff --git a/keyboards/moonlander/config.h b/keyboards/moonlander/config.h
index d1c685280..c88feea3d 100644
--- a/keyboards/moonlander/config.h
+++ b/keyboards/moonlander/config.h
@@ -101,3 +101,7 @@
101# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 16383 101# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 16383
102# define DYNAMIC_KEYMAP_LAYER_COUNT 32 102# define DYNAMIC_KEYMAP_LAYER_COUNT 32
103#endif 103#endif
104
105#define AUDIO_PIN A5
106#define AUDIO_PIN_ALT A4
107#define AUDIO_PIN_ALT_AS_NEGATIVE
diff --git a/keyboards/mschwingen/modelm/config.h b/keyboards/mschwingen/modelm/config.h
index 07881cd21..2b42bb38e 100644
--- a/keyboards/mschwingen/modelm/config.h
+++ b/keyboards/mschwingen/modelm/config.h
@@ -87,5 +87,5 @@
87#define RGBLED_NUM 3 87#define RGBLED_NUM 3
88 88
89// disabled, needs PCB patch. 89// disabled, needs PCB patch.
90//#define C6_AUDIO 90//#define AUDIO_PIN C6
91//#define NO_MUSIC_MODE 91//#define NO_MUSIC_MODE
diff --git a/keyboards/nack/config.h b/keyboards/nack/config.h
index 9f0880e38..e442a1333 100644
--- a/keyboards/nack/config.h
+++ b/keyboards/nack/config.h
@@ -13,7 +13,7 @@ GNU General Public License for more details.
13 13
14You should have received a copy of the GNU General Public License 14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#pragma once 18#pragma once
19#include "config_common.h" 19#include "config_common.h"
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
27#define MATRIX_ROWS 4 27#define MATRIX_ROWS 4
28#define MATRIX_COLS 13 28#define MATRIX_COLS 13
29 29
30#define MATRIX_ROW_PINS { A0, A1, A2, A3 } 30#define MATRIX_ROW_PINS { A0, A1, A2, A3 }
31#define MATRIX_COL_PINS { A6, A7, A8, A9, A10, B0, B1, B2, B6, B7, C13, C14, C15 } 31#define MATRIX_COL_PINS { A6, A7, A8, A9, A10, B0, B1, B2, B6, B7, C13, C14, C15 }
32 32
33#define DIODE_DIRECTION ROW2COL 33#define DIODE_DIRECTION ROW2COL
@@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
40 #define RGB_DI_PIN B5 40 #define RGB_DI_PIN B5
41 #define RGBLED_NUM 52 41 #define RGBLED_NUM 52
42 #define DRIVER_LED_TOTAL RGBLED_NUM 42 #define DRIVER_LED_TOTAL RGBLED_NUM
43 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 128 // Max brightness of LEDs 43 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 128 // Max brightness of LEDs
44 #define RGB_MATRIX_STARTUP_VAL 64 44 #define RGB_MATRIX_STARTUP_VAL 64
45 #define RGB_MATRIX_HUE_STEP 10 45 #define RGB_MATRIX_HUE_STEP 10
46 #define RGB_MATRIX_SAT_STEP 10 46 #define RGB_MATRIX_SAT_STEP 10
@@ -49,11 +49,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
49 49
50#ifdef AUDIO_ENABLE 50#ifdef AUDIO_ENABLE
51 #define STARTUP_SONG SONG(NO_SOUND) 51 #define STARTUP_SONG SONG(NO_SOUND)
52 #define AUDIO_PIN A4 // Pin of the left speaker 52 #define AUDIO_PIN A5
53 #define AUDIO_PIN_ALT A5 // Pin of the right speaker 53 #define AUDIO_PIN_ALT A4
54 /* 54 #define AUDIO_PIN_ALT_AS_NEGATIVE
55 /*
55 * Basically, change this section once pull request 6165 has been merged 56 * Basically, change this section once pull request 6165 has been merged
56 * https://github.com/qmk/qmk_firmware/pull/6165 57 * https://github.com/qmk/qmk_firmware/pull/6165
57 */ 58 */
58#endif 59#endif
59
diff --git a/keyboards/nightly_boards/n40_o/config.h b/keyboards/nightly_boards/n40_o/config.h
index e0bcdbe01..a5257cc49 100644
--- a/keyboards/nightly_boards/n40_o/config.h
+++ b/keyboards/nightly_boards/n40_o/config.h
@@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66 66
67/* Audio */ 67/* Audio */
68 68
69#define B7_AUDIO 69#define AUDIO_PIN B7
70 70
71#define AUDIO_CLICKY 71#define AUDIO_CLICKY
72 72
@@ -80,5 +80,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
80#define LOCKING_SUPPORT_ENABLE 80#define LOCKING_SUPPORT_ENABLE
81/* Locking resynchronize hack */ 81/* Locking resynchronize hack */
82#define LOCKING_RESYNC_ENABLE 82#define LOCKING_RESYNC_ENABLE
83
84
diff --git a/keyboards/nightly_boards/n87/config.h b/keyboards/nightly_boards/n87/config.h
index 890276c30..0315119d8 100644
--- a/keyboards/nightly_boards/n87/config.h
+++ b/keyboards/nightly_boards/n87/config.h
@@ -84,7 +84,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
84// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 84// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
85#endif 85#endif
86 86
87#define B7_AUDIO 87#define AUDIO_PIN B7
88 88
89#define AUDIO_CLICKY 89#define AUDIO_CLICKY
90 90
diff --git a/keyboards/nightly_boards/octopad/config.h b/keyboards/nightly_boards/octopad/config.h
index 1477ce93e..ee417644d 100644
--- a/keyboards/nightly_boards/octopad/config.h
+++ b/keyboards/nightly_boards/octopad/config.h
@@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
66 66
67/* Audio */ 67/* Audio */
68 68
69#define B5_AUDIO 69#define AUDIO_PIN B5
70 70
71#define AUDIO_CLICKY 71#define AUDIO_CLICKY
72#define NO_MUSIC_MODE 72#define NO_MUSIC_MODE
diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h
index 585c91640..e3a89bce6 100644
--- a/keyboards/orthodox/keymaps/drashna/config.h
+++ b/keyboards/orthodox/keymaps/drashna/config.h
@@ -50,7 +50,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
50#endif // RGBLIGHT_ENABLE 50#endif // RGBLIGHT_ENABLE
51 51
52#ifdef AUDIO_ENABLE 52#ifdef AUDIO_ENABLE
53# define C6_AUDIO 53# define AUDIO_PIN C6
54# ifdef RGBLIGHT_ENABLE 54# ifdef RGBLIGHT_ENABLE
55# define NO_MUSIC_MODE 55# define NO_MUSIC_MODE
56# endif 56# endif
diff --git a/keyboards/planck/config.h b/keyboards/planck/config.h
index c8cbd7494..f7dce7020 100644
--- a/keyboards/planck/config.h
+++ b/keyboards/planck/config.h
@@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41#define QMK_SPEAKER C6 41#define QMK_SPEAKER C6
42 42
43#define AUDIO_VOICES 43#define AUDIO_VOICES
44#define C6_AUDIO 44#define AUDIO_PIN C6
45 45
46#define BACKLIGHT_PIN B7 46#define BACKLIGHT_PIN B7
47 47
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h
index ecab5d5dc..7f8876496 100644
--- a/keyboards/planck/ez/config.h
+++ b/keyboards/planck/ez/config.h
@@ -56,7 +56,10 @@
56 56
57#define MUSIC_MAP 57#define MUSIC_MAP
58#undef AUDIO_VOICES 58#undef AUDIO_VOICES
59#undef C6_AUDIO 59#undef AUDIO_PIN
60#define AUDIO_PIN A5
61#define AUDIO_PIN_ALT A4
62#define AUDIO_PIN_ALT_AS_NEGATIVE
60 63
61/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 64/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
62// #define DEBOUNCE 6 65// #define DEBOUNCE 6
diff --git a/keyboards/planck/keymaps/dodger/config.h b/keyboards/planck/keymaps/dodger/config.h
index 2f94edb01..38af37bc0 100644
--- a/keyboards/planck/keymaps/dodger/config.h
+++ b/keyboards/planck/keymaps/dodger/config.h
@@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41#define QMK_SPEAKER C6 41#define QMK_SPEAKER C6
42 42
43#define AUDIO_VOICES 43#define AUDIO_VOICES
44#define C6_AUDIO 44#define AUDIO_PIN C6
45 45
46#define BACKLIGHT_PIN B7 46#define BACKLIGHT_PIN B7
47 47
diff --git a/keyboards/planck/keymaps/synth_sample/config.h b/keyboards/planck/keymaps/synth_sample/config.h
new file mode 100644
index 000000000..930b26b00
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_sample/config.h
@@ -0,0 +1,56 @@
1/*
2Copyright 2020 Jack Humbert
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#ifdef AUDIO_ENABLE
21 #define AUDIO_PIN A5
22 #define STARTUP_SONG SONG(PLANCK_SOUND)
23 // #define STARTUP_SONG SONG(NO_SOUND)
24
25 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
26 SONG(COLEMAK_SOUND), \
27 SONG(DVORAK_SOUND) \
28 }
29#endif
30
31/*
32 * MIDI options
33 */
34
35/* Prevent use of disabled MIDI features in the keymap */
36//#define MIDI_ENABLE_STRICT 1
37
38/* enable basic MIDI features:
39 - MIDI notes can be sent when in Music mode is on
40*/
41
42#define MIDI_BASIC
43
44/* enable advanced MIDI features:
45 - MIDI notes can be added to the keymap
46 - Octave shift and transpose
47 - Virtual sustain, portamento, and modulation wheel
48 - etc.
49*/
50//#define MIDI_ADVANCED
51
52/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
53//#define MIDI_TONE_KEYCODE_OCTAVES 2
54
55// Most tactile encoders have detents every 4 stages
56#define ENCODER_RESOLUTION 4
diff --git a/keyboards/planck/keymaps/synth_sample/keymap.c b/keyboards/planck/keymaps/synth_sample/keymap.c
new file mode 100644
index 000000000..87a7479ce
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_sample/keymap.c
@@ -0,0 +1,296 @@
1/* Copyright 2019 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18
19enum planck_layers {
20 _QWERTY,
21 _COLEMAK,
22 _DVORAK,
23 _LOWER,
24 _RAISE,
25 _PLOVER,
26 _ADJUST
27};
28
29enum planck_keycodes {
30 QWERTY = SAFE_RANGE,
31 COLEMAK,
32 DVORAK,
33 PLOVER,
34 BACKLIT,
35 EXT_PLV
36};
37
38#define LOWER MO(_LOWER)
39#define RAISE MO(_RAISE)
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43/* Qwerty
44 * ,-----------------------------------------------------------------------------------.
45 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
48 * |------+------+------+------+------+------|------+------+------+------+------+------|
49 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
50 * |------+------+------+------+------+------+------+------+------+------+------+------|
51 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
52 * `-----------------------------------------------------------------------------------'
53 */
54[_QWERTY] = LAYOUT_planck_grid(
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
56 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
58 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
59),
60
61/* Colemak
62 * ,-----------------------------------------------------------------------------------.
63 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
64 * |------+------+------+------+------+-------------+------+------+------+------+------|
65 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
66 * |------+------+------+------+------+------|------+------+------+------+------+------|
67 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
70 * `-----------------------------------------------------------------------------------'
71 */
72[_COLEMAK] = LAYOUT_planck_grid(
73 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
74 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
75 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
76 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
77),
78
79/* Dvorak
80 * ,-----------------------------------------------------------------------------------.
81 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_DVORAK] = LAYOUT_planck_grid(
91 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
92 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
93 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
94 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
95),
96
97/* Lower
98 * ,-----------------------------------------------------------------------------------.
99 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
100 * |------+------+------+------+------+-------------+------+------+------+------+------|
101 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
102 * |------+------+------+------+------+------|------+------+------+------+------+------|
103 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | | Next | Vol- | Vol+ | Play |
106 * `-----------------------------------------------------------------------------------'
107 */
108[_LOWER] = LAYOUT_planck_grid(
109 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
110 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
111 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
112 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
113),
114
115/* Raise
116 * ,-----------------------------------------------------------------------------------.
117 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
118 * |------+------+------+------+------+-------------+------+------+------+------+------|
119 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
120 * |------+------+------+------+------+------|------+------+------+------+------+------|
121 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
122 * |------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | | | | | Next | Vol- | Vol+ | Play |
124 * `-----------------------------------------------------------------------------------'
125 */
126[_RAISE] = LAYOUT_planck_grid(
127 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
128 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
129 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
130 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
131),
132
133/* Plover layer (http://opensteno.org)
134 * ,-----------------------------------------------------------------------------------.
135 * | # | # | # | # | # | # | # | # | # | # | # | # |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | S | T | P | H | * | * | F | P | L | T | D |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * | | S | K | W | R | * | * | R | B | G | S | Z |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | Exit | | | A | O | | E | U | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144[_PLOVER] = LAYOUT_planck_grid(
145 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
146 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
147 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
148 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
149),
150
151/* Adjust (Lower + Raise)
152 * ,-----------------------------------------------------------------------------------.
153 * | | Reset| | | | | | | | | | Del |
154 * |------+------+------+------+------+-------------+------+------+------+------+------|
155 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
156 * |------+------+------+------+------+------|------+------+------+------+------+------|
157 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
158 * |------+------+------+------+------+------+------+------+------+------+------+------|
159 * | | | | | | | | | | | |
160 * `-----------------------------------------------------------------------------------'
161 */
162[_ADJUST] = LAYOUT_planck_grid(
163 _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
164 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
165 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
166 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
167)
168
169};
170
171#ifdef AUDIO_ENABLE
172 float plover_song[][2] = SONG(PLOVER_SOUND);
173 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
174#endif
175
176uint32_t layer_state_set_user(uint32_t state) {
177 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
178}
179
180bool process_record_user(uint16_t keycode, keyrecord_t *record) {
181 switch (keycode) {
182 case QWERTY:
183 if (record->event.pressed) {
184 print("mode just switched to qwerty and this is a huge string\n");
185 set_single_persistent_default_layer(_QWERTY);
186 }
187 return false;
188 break;
189 case COLEMAK:
190 if (record->event.pressed) {
191 set_single_persistent_default_layer(_COLEMAK);
192 }
193 return false;
194 break;
195 case DVORAK:
196 if (record->event.pressed) {
197 set_single_persistent_default_layer(_DVORAK);
198 }
199 return false;
200 break;
201 case BACKLIT:
202 if (record->event.pressed) {
203 register_code(KC_RSFT);
204 #ifdef BACKLIGHT_ENABLE
205 backlight_step();
206 #endif
207 #ifdef KEYBOARD_planck_rev5
208 PORTE &= ~(1<<6);
209 #endif
210 } else {
211 unregister_code(KC_RSFT);
212 #ifdef KEYBOARD_planck_rev5
213 PORTE |= (1<<6);
214 #endif
215 }
216 return false;
217 break;
218 case PLOVER:
219 if (record->event.pressed) {
220 #ifdef AUDIO_ENABLE
221 stop_all_notes();
222 PLAY_SONG(plover_song);
223 #endif
224 layer_off(_RAISE);
225 layer_off(_LOWER);
226 layer_off(_ADJUST);
227 layer_on(_PLOVER);
228 if (!eeconfig_is_enabled()) {
229 eeconfig_init();
230 }
231 keymap_config.raw = eeconfig_read_keymap();
232 keymap_config.nkro = 1;
233 eeconfig_update_keymap(keymap_config.raw);
234 }
235 return false;
236 break;
237 case EXT_PLV:
238 if (record->event.pressed) {
239 #ifdef AUDIO_ENABLE
240 PLAY_SONG(plover_gb_song);
241 #endif
242 layer_off(_PLOVER);
243 }
244 return false;
245 break;
246 }
247 return true;
248}
249
250void encoder_update(bool clockwise) {
251 if (clockwise) {
252 #ifdef MOUSEKEY_ENABLE
253 register_code(KC_MS_WH_DOWN);
254 unregister_code(KC_MS_WH_DOWN);
255 #else
256 register_code(KC_PGDN);
257 unregister_code(KC_PGDN);
258 #endif
259 } else {
260 #ifdef MOUSEKEY_ENABLE
261 register_code(KC_MS_WH_UP);
262 unregister_code(KC_MS_WH_UP);
263 #else
264 register_code(KC_PGUP);
265 unregister_code(KC_PGUP);
266 #endif
267 }
268}
269
270void matrix_scan_user(void) {
271
272}
273
274bool music_mask_user(uint16_t keycode) {
275 switch (keycode) {
276 case RAISE:
277 case LOWER:
278 return false;
279 default:
280 return true;
281 }
282}
283
284#include "sample.h"
285
286uint32_t dac_sample_custom_counter = 0;
287
288uint16_t dac_value_generate(void) {
289 if (is_playing_note()) {
290 uint16_t sample = dac_sample_custom[dac_sample_custom_counter];
291 dac_sample_custom_counter = (dac_sample_custom_counter + 1) % AUDIO_DAC_SAMPLE_CUSTOM_LENGTH;
292 return sample;
293 } else {
294 return AUDIO_DAC_OFF_VALUE;
295 }
296}
diff --git a/keyboards/planck/keymaps/synth_sample/rules.mk b/keyboards/planck/keymaps/synth_sample/rules.mk
new file mode 100644
index 000000000..ebfcda221
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_sample/rules.mk
@@ -0,0 +1,2 @@
1AUDIO_ENABLE = yes
2AUDIO_DRIVER = dac_additive
diff --git a/keyboards/planck/keymaps/synth_sample/sample.h b/keyboards/planck/keymaps/synth_sample/sample.h
new file mode 100644
index 000000000..71c1b87e7
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_sample/sample.h
@@ -0,0 +1,3797 @@
1/*
2Copyright 2020 Jack Humbert
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#define AUDIO_DAC_SAMPLE_CUSTOM_LENGTH 30208
19
20static const dacsample_t dac_sample_custom[30208] = {
21 2041, 2039, 2039, 2037, 2035, 2037, 2037, 2037,
22 2038, 2037, 2037, 2040, 2039, 2038, 2036, 2035,
23 2036, 2036, 2036, 2034, 2034, 2034, 2032, 2032,
24 2033, 2034, 2032, 2030, 2029, 2031, 2030, 2029,
25 2029, 2030, 2029, 2030, 2030, 2031, 2028, 2028,
26 2028, 2027, 2025, 2026, 2027, 2026, 2025, 2026,
27 2026, 2025, 2023, 2022, 2023, 2021, 2021, 2023,
28 2020, 2023, 2023, 2022, 2022, 2021, 2021, 2020,
29 2022, 2020, 2017, 2016, 2015, 2018, 2017, 2015,
30 2013, 2012, 2015, 2013, 2011, 2012, 2011, 2011,
31 2010, 2008, 2008, 2010, 2010, 2006, 2006, 2006,
32 2004, 2005, 2006, 2006, 2005, 2002, 2005, 2003,
33 2003, 2004, 2002, 2001, 2003, 2003, 2002, 2003,
34 2003, 2000, 2000, 2000, 1998, 1997, 1998, 1999,
35 1997, 1995, 1995, 1996, 1996, 1992, 1995, 1995,
36 1994, 1994, 1995, 1997, 1996, 1996, 1997, 1997,
37 1997, 1996, 1996, 1995, 1997, 1997, 1996, 1998,
38 1995, 1996, 1996, 1996, 1996, 1994, 1990, 1991,
39 1992, 1991, 1994, 1992, 1993, 1995, 1994, 1995,
40 1992, 1991, 1991, 1992, 1993, 1992, 1992, 1993,
41 1993, 1992, 1990, 1989, 1991, 1992, 1991, 1991,
42 1990, 1990, 1992, 1992, 1991, 1992, 1992, 1994,
43 1992, 1992, 1992, 1993, 1993, 1994, 1995, 1993,
44 1991, 1992, 1990, 1989, 1990, 1988, 1988, 1987,
45 1989, 1989, 1985, 1986, 1987, 1985, 1986, 1986,
46 1987, 1988, 1988, 1989, 1989, 1988, 1988, 1990,
47 1991, 1991, 1990, 1991, 1992, 1994, 1994, 1995,
48 1994, 1995, 1997, 1995, 1995, 1995, 1997, 1997,
49 1997, 1996, 1999, 2000, 1997, 1998, 1999, 2002,
50 2001, 2001, 2001, 2002, 2000, 1998, 2000, 2004,
51 2002, 2001, 2003, 2005, 2004, 2004, 2002, 2004,
52 2004, 2001, 2000, 2001, 2003, 2005, 2005, 2005,
53 2005, 2006, 2010, 2010, 2009, 2007, 2006, 2008,
54 2006, 2007, 2007, 2005, 2005, 2005, 2007, 2005,
55 2006, 2007, 2009, 2010, 2008, 2007, 2006, 2006,
56 2005, 2005, 2005, 2004, 2005, 2004, 2004, 2003,
57 2007, 2006, 2006, 2004, 2005, 2006, 2007, 2007,
58 2006, 2010, 2007, 2008, 2009, 2012, 2012, 2010,
59 2011, 2010, 2014, 2012, 2013, 2013, 2014, 2014,
60 2013, 2012, 2012, 2012, 2010, 2013, 2012, 2010,
61 2011, 2011, 2012, 2012, 2013, 2013, 2015, 2016,
62 2015, 2015, 2015, 2015, 2015, 2014, 2012, 2014,
63 2016, 2017, 2016, 2015, 2018, 2019, 2017, 2017,
64 2017, 2017, 2016, 2016, 2017, 2017, 2018, 2021,
65 2020, 2019, 2019, 2022, 2022, 2024, 2024, 2023,
66 2023, 2023, 2024, 2025, 2026, 2025, 2024, 2025,
67 2025, 2026, 2026, 2023, 2023, 2023, 2023, 2023,
68 2023, 2024, 2024, 2025, 2024, 2022, 2022, 2021,
69 2021, 2022, 2022, 2024, 2023, 2023, 2023, 2021,
70 2023, 2023, 2024, 2024, 2025, 2024, 2026, 2027,
71 2025, 2026, 2028, 2026, 2027, 2027, 2025, 2024,
72 2027, 2028, 2027, 2028, 2027, 2027, 2028, 2028,
73 2030, 2029, 2032, 2031, 2030, 2029, 2028, 2030,
74 2027, 2028, 2028, 2028, 2026, 2027, 2028, 2027,
75 2029, 2032, 2030, 2030, 2032, 2033, 2030, 2030,
76 2032, 2030, 2030, 2030, 2032, 2032, 2033, 2031,
77 2034, 2032, 2029, 2028, 2028, 2030, 2028, 2029,
78 2030, 2028, 2029, 2029, 2029, 2030, 2032, 2033,
79 2031, 2036, 2034, 2032, 2032, 2031, 2032, 2031,
80 2032, 2033, 2035, 2033, 2032, 2034, 2035, 2036,
81 2037, 2038, 2039, 2038, 2038, 2038, 2040, 2040,
82 2041, 2041, 2041, 2043, 2041, 2041, 2043, 2043,
83 2041, 2040, 2042, 2042, 2042, 2044, 2044, 2041,
84 2042, 2043, 2042, 2044, 2043, 2044, 2044, 2045,
85 2045, 2044, 2045, 2044, 2045, 2043, 2042, 2043,
86 2043, 2043, 2043, 2044, 2044, 2044, 2045, 2044,
87 2044, 2043, 2042, 2045, 2046, 2045, 2046, 2048,
88 2048, 2046, 2046, 2046, 2049, 2048, 2050, 2049,
89 2049, 2050, 2053, 2051, 2049, 2050, 2047, 2050,
90 2048, 2052, 2050, 2051, 2053, 2051, 2051, 2048,
91 2051, 2050, 2049, 2051, 2052, 2051, 2050, 2051,
92 2050, 2050, 2051, 2050, 2048, 2049, 2049, 2048,
93 2050, 2050, 2050, 2049, 2048, 2048, 2048, 2048,
94 2049, 2049, 2049, 2050, 2051, 2050, 2053, 2051,
95 2051, 2053, 2052, 2052, 2052, 2051, 2053, 2055,
96 2056, 2056, 2055, 2056, 2056, 2056, 2059, 2058,
97 2055, 2057, 2059, 2057, 2056, 2056, 2056, 2057,
98 2059, 2060, 2060, 2059, 2059, 2059, 2059, 2061,
99 2059, 2059, 2060, 2061, 2059, 2057, 2058, 2060,
100 2060, 2061, 2060, 2061, 2062, 2063, 2062, 2060,
101 2062, 2060, 2061, 2061, 2060, 2060, 2061, 2062,
102 2062, 2062, 2061, 2059, 2062, 2063, 2062, 2063,
103 2063, 2063, 2063, 2063, 2063, 2063, 2065, 2063,
104 2063, 2065, 2065, 2066, 2065, 2067, 2067, 2066,
105 2065, 2065, 2065, 2066, 2066, 2063, 2064, 2062,
106 2063, 2062, 2062, 2061, 2062, 2063, 2062, 2061,
107 2061, 2062, 2058, 2059, 2061, 2062, 2062, 2062,
108 2062, 2064, 2063, 2063, 2062, 2061, 2061, 2063,
109 2060, 2059, 2059, 2058, 2059, 2059, 2059, 2062,
110 2063, 2063, 2062, 2061, 2061, 2061, 2061, 2062,
111 2060, 2058, 2059, 2060, 2060, 2059, 2059, 2057,
112 2059, 2059, 2056, 2057, 2056, 2057, 2056, 2056,
113 2056, 2057, 2057, 2057, 2055, 2055, 2055, 2053,
114 2054, 2054, 2054, 2054, 2052, 2051, 2054, 2055,
115 2055, 2053, 2055, 2054, 2055, 2055, 2053, 2053,
116 2054, 2052, 2051, 2053, 2051, 2052, 2052, 2054,
117 2054, 2053, 2051, 2051, 2053, 2052, 2051, 2050,
118 2049, 2049, 2048, 2049, 2049, 2047, 2046, 2047,
119 2047, 2047, 2046, 2048, 2046, 2046, 2046, 2044,
120 2043, 2044, 2045, 2046, 2043, 2044, 2043, 2046,
121 2044, 2044, 2043, 2043, 2042, 2039, 2037, 2039,
122 2038, 2039, 2039, 2038, 2038, 2038, 2039, 2036,
123 2034, 2034, 2033, 2035, 2034, 2032, 2031, 2034,
124 2035, 2033, 2034, 2032, 2032, 2033, 2031, 2031,
125 2031, 2032, 2032, 2032, 2030, 2030, 2029, 2029,
126 2029, 2025, 2024, 2024, 2024, 2025, 2025, 2028,
127 2028, 2025, 2024, 2026, 2025, 2022, 2023, 2021,
128 2018, 2019, 2020, 2020, 2020, 2021, 2021, 2018,
129 2017, 2019, 2017, 2016, 2018, 2019, 2018, 2016,
130 2017, 2016, 2014, 2017, 2017, 2017, 2016, 2014,
131 2012, 2011, 2011, 2011, 2011, 2012, 2011, 2009,
132 2011, 2011, 2011, 2012, 2009, 2009, 2010, 2011,
133 2011, 2011, 2008, 2008, 2010, 2009, 2009, 2008,
134 2007, 2010, 2009, 2011, 2012, 2011, 2012, 2012,
135 2010, 2010, 2011, 2009, 2010, 2010, 2010, 2012,
136 2011, 2011, 2011, 2010, 2010, 2009, 2012, 2008,
137 2009, 2010, 2010, 2008, 2008, 2009, 2007, 2007,
138 2007, 2007, 2009, 2008, 2006, 2006, 2010, 2011,
139 2011, 2009, 2010, 2007, 2008, 2007, 2009, 2011,
140 2009, 2009, 2008, 2009, 2009, 2009, 2007, 2010,
141 2008, 2009, 2013, 2011, 2011, 2009, 2010, 2009,
142 2007, 2007, 2008, 2008, 2009, 2010, 2008, 2009,
143 2009, 2010, 2010, 2010, 2009, 2007, 2008, 2007,
144 2011, 2012, 2010, 2009, 2009, 2010, 2008, 2010,
145 2011, 2010, 2010, 2012, 2011, 2010, 2013, 2014,
146 2013, 2014, 2016, 2015, 2016, 2017, 2016, 2020,
147 2022, 2022, 2020, 2022, 2023, 2024, 2023, 2022,
148 2021, 2020, 2023, 2022, 2023, 2022, 2023, 2024,
149 2022, 2021, 2021, 2021, 2021, 2021, 2021, 2023,
150 2024, 2024, 2022, 2022, 2023, 2026, 2027, 2024,
151 2025, 2029, 2027, 2029, 2030, 2029, 2029, 2028,
152 2029, 2029, 2028, 2031, 2031, 2029, 2027, 2026,
153 2026, 2028, 2025, 2025, 2021, 2022, 2025, 2025,
154 2028, 2026, 2025, 2025, 2023, 2024, 2024, 2027,
155 2027, 2029, 2028, 2025, 2027, 2029, 2031, 2028,
156 2026, 2028, 2028, 2028, 2028, 2030, 2026, 2028,
157 2029, 2029, 2030, 2030, 2030, 2032, 2032, 2032,
158 2031, 2030, 2031, 2031, 2033, 2035, 2033, 2032,
159 2031, 2032, 2032, 2032, 2032, 2031, 2030, 2030,
160 2028, 2030, 2029, 2027, 2029, 2028, 2027, 2029,
161 2032, 2031, 2031, 2032, 2030, 2029, 2032, 2033,
162 2032, 2027, 2026, 2029, 2030, 2031, 2033, 2033,
163 2033, 2035, 2035, 2034, 2035, 2034, 2035, 2036,
164 2037, 2035, 2035, 2034, 2034, 2034, 2037, 2036,
165 2035, 2033, 2033, 2034, 2033, 2035, 2035, 2036,
166 2038, 2037, 2035, 2038, 2038, 2033, 2033, 2035,
167 2036, 2036, 2038, 2037, 2037, 2038, 2038, 2039,
168 2039, 2038, 2038, 2040, 2041, 2040, 2042, 2042,
169 2042, 2043, 2042, 2040, 2041, 2040, 2041, 2043,
170 2040, 2042, 2042, 2041, 2044, 2045, 2043, 2043,
171 2045, 2045, 2047, 2045, 2044, 2046, 2045, 2048,
172 2049, 2050, 2050, 2050, 2050, 2048, 2050, 2051,
173 2050, 2050, 2052, 2053, 2053, 2055, 2054, 2053,
174 2055, 2053, 2053, 2052, 2050, 2052, 2052, 2053,
175 2053, 2054, 2053, 2055, 2056, 2055, 2053, 2053,
176 2054, 2054, 2056, 2054, 2054, 2056, 2054, 2053,
177 2054, 2057, 2055, 2054, 2056, 2057, 2056, 2058,
178 2057, 2058, 2059, 2057, 2058, 2057, 2057, 2055,
179 2056, 2056, 2055, 2059, 2057, 2055, 2052, 2050,
180 2053, 2054, 2052, 2053, 2055, 2056, 2055, 2054,
181 2055, 2055, 2053, 2053, 2053, 2054, 2055, 2055,
182 2055, 2052, 2054, 2056, 2057, 2059, 2058, 2055,
183 2056, 2057, 2056, 2056, 2056, 2057, 2057, 2056,
184 2057, 2056, 2057, 2055, 2056, 2057, 2057, 2058,
185 2057, 2055, 2055, 2056, 2057, 2056, 2056, 2056,
186 2057, 2057, 2058, 2058, 2058, 2059, 2057, 2056,
187 2057, 2055, 2053, 2055, 2056, 2056, 2056, 2057,
188 2059, 2058, 2058, 2058, 2057, 2060, 2058, 2058,
189 2058, 2059, 2059, 2060, 2061, 2060, 2058, 2059,
190 2060, 2060, 2058, 2058, 2059, 2058, 2056, 2058,
191 2059, 2059, 2058, 2058, 2057, 2059, 2060, 2058,
192 2058, 2058, 2057, 2059, 2058, 2056, 2061, 2061,
193 2060, 2059, 2061, 2062, 2062, 2062, 2059, 2061,
194 2059, 2058, 2060, 2061, 2058, 2058, 2058, 2059,
195 2059, 2057, 2060, 2058, 2058, 2057, 2055, 2054,
196 2056, 2056, 2059, 2056, 2056, 2059, 2059, 2057,
197 2055, 2052, 2051, 2052, 2052, 2052, 2053, 2051,
198 2052, 2052, 2051, 2050, 2048, 2049, 2050, 2052,
199 2050, 2052, 2051, 2052, 2053, 2052, 2050, 2050,
200 2052, 2051, 2051, 2053, 2052, 2051, 2053, 2055,
201 2055, 2054, 2053, 2054, 2051, 2052, 2052, 2053,
202 2053, 2052, 2052, 2053, 2053, 2049, 2048, 2051,
203 2048, 2048, 2049, 2050, 2051, 2049, 2047, 2047,
204 2049, 2050, 2051, 2049, 2048, 2045, 2045, 2046,
205 2046, 2046, 2045, 2046, 2045, 2043, 2044, 2043,
206 2043, 2043, 2044, 2042, 2042, 2042, 2044, 2046,
207 2044, 2039, 2040, 2039, 2038, 2040, 2040, 2040,
208 2040, 2039, 2039, 2039, 2037, 2036, 2036, 2037,
209 2037, 2034, 2036, 2035, 2034, 2033, 2033, 2031,
210 2029, 2027, 2029, 2028, 2028, 2029, 2030, 2029,
211 2027, 2027, 2026, 2028, 2028, 2026, 2026, 2024,
212 2025, 2028, 2027, 2025, 2026, 2027, 2023, 2018,
213 2017, 2021, 2020, 2019, 2018, 2016, 2014, 2013,
214 2011, 2010, 2007, 2010, 2009, 2006, 2008, 2008,
215 2004, 2005, 2006, 2009, 2009, 2010, 2009, 2007,
216 2007, 2008, 2007, 2006, 2008, 2009, 2008, 2008,
217 2006, 2007, 2009, 2008, 2007, 2007, 2008, 2007,
218 2007, 2009, 2008, 2007, 2008, 2009, 2007, 2006,
219 2005, 2004, 2007, 2006, 2006, 2004, 2004, 2003,
220 2001, 2001, 2002, 2004, 2003, 2003, 2001, 2001,
221 2002, 1998, 2000, 1999, 2000, 2001, 2001, 1999,
222 2000, 1999, 1998, 1998, 2001, 2000, 1998, 1997,
223 1996, 1995, 1994, 1994, 1995, 1995, 1993, 1996,
224 1996, 1994, 1992, 1992, 1993, 1991, 1990, 1989,
225 1991, 1987, 1988, 1989, 1989, 1989, 1992, 1990,
226 1992, 1993, 1992, 1993, 1992, 1990, 1989, 1991,
227 1990, 1990, 1988, 1989, 1991, 1991, 1992, 1991,
228 1994, 1993, 1991, 1991, 1991, 1991, 1989, 1990,
229 1990, 1991, 1989, 1991, 1990, 1991, 1989, 1988,
230 1988, 1987, 1987, 1990, 1990, 1988, 1988, 1988,
231 1988, 1987, 1987, 1984, 1986, 1985, 1986, 1988,
232 1988, 1987, 1987, 1988, 1987, 1988, 1989, 1988,
233 1989, 1991, 1990, 1988, 1990, 1989, 1987, 1987,
234 1987, 1985, 1986, 1987, 1988, 1985, 1987, 1985,
235 1986, 1988, 1988, 1988, 1988, 1987, 1988, 1988,
236 1988, 1988, 1989, 1987, 1988, 1989, 1989, 1991,
237 1990, 1992, 1990, 1990, 1991, 1991, 1993, 1994,
238 1994, 1996, 1993, 1995, 1995, 1998, 1997, 1996,
239 1997, 1997, 1998, 1998, 1997, 1999, 1999, 2000,
240 2001, 2003, 2004, 2004, 2006, 2005, 2003, 2008,
241 2006, 2005, 2005, 2005, 2008, 2009, 2011, 2011,
242 2009, 2008, 2010, 2010, 2012, 2013, 2014, 2015,
243 2015, 2014, 2015, 2015, 2013, 2013, 2013, 2013,
244 2014, 2015, 2018, 2018, 2016, 2016, 2018, 2019,
245 2017, 2015, 2017, 2016, 2016, 2016, 2015, 2017,
246 2018, 2018, 2017, 2016, 2018, 2017, 2019, 2018,
247 2016, 2015, 2014, 2014, 2016, 2018, 2018, 2015,
248 2016, 2016, 2017, 2017, 2016, 2015, 2015, 2015,
249 2015, 2018, 2016, 2017, 2016, 2014, 2016, 2017,
250 2020, 2019, 2018, 2018, 2016, 2017, 2019, 2017,
251 2017, 2013, 2015, 2016, 2015, 2015, 2016, 2016,
252 2017, 2015, 2013, 2016, 2016, 2017, 2018, 2017,
253 2016, 2017, 2016, 2016, 2017, 2019, 2019, 2021,
254 2020, 2018, 2019, 2019, 2019, 2018, 2018, 2018,
255 2020, 2021, 2022, 2023, 2019, 2018, 2022, 2022,
256 2022, 2022, 2023, 2024, 2021, 2022, 2023, 2024,
257 2024, 2024, 2025, 2027, 2028, 2029, 2030, 2028,
258 2029, 2027, 2028, 2026, 2029, 2028, 2029, 2030,
259 2029, 2031, 2029, 2030, 2029, 2028, 2028, 2030,
260 2029, 2029, 2031, 2029, 2029, 2030, 2029, 2030,
261 2030, 2029, 2027, 2026, 2025, 2024, 2024, 2023,
262 2024, 2024, 2024, 2023, 2024, 2024, 2025, 2029,
263 2027, 2025, 2027, 2029, 2029, 2033, 2034, 2035,
264 2034, 2036, 2038, 2035, 2035, 2036, 2037, 2038,
265 2036, 2038, 2038, 2037, 2038, 2039, 2039, 2033,
266 2031, 2031, 2030, 2030, 2029, 2031, 2031, 2031,
267 2031, 2032, 2034, 2034, 2037, 2038, 2038, 2039,
268 2038, 2037, 2040, 2039, 2041, 2040, 2039, 2039,
269 2038, 2041, 2038, 2035, 2037, 2037, 2037, 2035,
270 2033, 2036, 2037, 2037, 2037, 2036, 2036, 2037,
271 2035, 2036, 2038, 2039, 2040, 2039, 2039, 2038,
272 2039, 2041, 2042, 2042, 2044, 2042, 2042, 2041,
273 2041, 2040, 2041, 2041, 2040, 2041, 2041, 2042,
274 2042, 2039, 2041, 2040, 2040, 2038, 2030, 2025,
275 2024, 2015, 1982, 1933, 1910, 1911, 1896, 1878,
276 1888, 1889, 1882, 1894, 1915, 1938, 1950, 1959,
277 1977, 1987, 1989, 2008, 2032, 2054, 2074, 2093,
278 2112, 2129, 2145, 2158, 2166, 2164, 2146, 2135,
279 2129, 2105, 2079, 2064, 2040, 2017, 1999, 1987,
280 1980, 1972, 1963, 1962, 1963, 1965, 1968, 1974,
281 1982, 1991, 2001, 2014, 2031, 2043, 2058, 2074,
282 2089, 2102, 2120, 2136, 2134, 2127, 2123, 2121,
283 2116, 2102, 2092, 2087, 2073, 2048, 2032, 2017,
284 1998, 1986, 1973, 1960, 1956, 1949, 1945, 1951,
285 1957, 1960, 1964, 1976, 1985, 1994, 2014, 2031,
286 2039, 2059, 2079, 2089, 2104, 2113, 2117, 2118,
287 2114, 2115, 2117, 2112, 2108, 2106, 2085, 2057,
288 2049, 2039, 2026, 2019, 2006, 1988, 1975, 1961,
289 1958, 1961, 1957, 1956, 1962, 1965, 1966, 1975,
290 1988, 1997, 2008, 2012, 2018, 2029, 2036, 2047,
291 2059, 2063, 2061, 2057, 2059, 2065, 2062, 2053,
292 2048, 2042, 2029, 2024, 2023, 2023, 2023, 2020,
293 2015, 2015, 2020, 2021, 2028, 2040, 2042, 2043,
294 2049, 2053, 2053, 2058, 2066, 2068, 2061, 2071,
295 2089, 2081, 2072, 2088, 2089, 2074, 2061, 2052,
296 2049, 2041, 2027, 2014, 2011, 2007, 2010, 2025,
297 2026, 2000, 1982, 1984, 1991, 1993, 1992, 1998,
298 1997, 2001, 2015, 2038, 2052, 2052, 2057, 2068,
299 2070, 2067, 2071, 2084, 2092, 2087, 2079, 2086,
300 2089, 2076, 2091, 2106, 2076, 2063, 2079, 2070,
301 2058, 2064, 2060, 2040, 2022, 2035, 2043, 2023,
302 2024, 2042, 2037, 2022, 2026, 2044, 2030, 2014,
303 2025, 2029, 2023, 2034, 2043, 2048, 2051, 2031,
304 2030, 2043, 2037, 2039, 2046, 2041, 2033, 2026,
305 2038, 2050, 2044, 2050, 2056, 2047, 2041, 2035,
306 2036, 2044, 2035, 2028, 2033, 2028, 2029, 2031,
307 2038, 2048, 2027, 2017, 2036, 2036, 2033, 2036,
308 2039, 2039, 2031, 2034, 2049, 2050, 2045, 2033,
309 2032, 2037, 2022, 2021, 2036, 2032, 2031, 2028,
310 2032, 2038, 2028, 2028, 2036, 2025, 2017, 2013,
311 2017, 2021, 2014, 2018, 2027, 2020, 2021, 2038,
312 2042, 2032, 2021, 2026, 2036, 2026, 2014, 2021,
313 2023, 2009, 2001, 2003, 2002, 1998, 1986, 1985,
314 1992, 1981, 1979, 2006, 2013, 2003, 2013, 2026,
315 2027, 2029, 2047, 2064, 2055, 2040, 2052, 2069,
316 2069, 2063, 2053, 2052, 2046, 2028, 2007, 1999,
317 1993, 1985, 1981, 1977, 1976, 1971, 1976, 1986,
318 1977, 1973, 1984, 1996, 2006, 2018, 2029, 2038,
319 2045, 2052, 2073, 2092, 2105, 2115, 2106, 2063,
320 2025, 2028, 2033, 1998, 1963, 1962, 1957, 1928,
321 1932, 1964, 1977, 1980, 1979, 1996, 2011, 2003,
322 2001, 2012, 2028, 2039, 2041, 2060, 2086, 2091,
323 2093, 2112, 2108, 2078, 2072, 2073, 2047, 2018,
324 1989, 1972, 1968, 1939, 1916, 1928, 1925, 1906,
325 1904, 1923, 1950, 1953, 1945, 1974, 2006, 2012,
326 2042, 2095, 2105, 2098, 2110, 2108, 2097, 2111,
327 2111, 2067, 2035, 2022, 1989, 1970, 1956, 1929,
328 1915, 1889, 1861, 1867, 1873, 1875, 1893, 1898,
329 1916, 1937, 1945, 1985, 2034, 2062, 2080, 2101,
330 2113, 2117, 2142, 2178, 2174, 2152, 2142, 2126,
331 2110, 2077, 2040, 2046, 2017, 1943, 1932, 1944,
332 1911, 1882, 1892, 1928, 1922, 1899, 1949, 1987,
333 1968, 1974, 2010, 2042, 2041, 2024, 2063, 2094,
334 2082, 2105, 2114, 2114, 2123, 2111, 2131, 2121,
335 2064, 2060, 2046, 2015, 2001, 1965, 1958, 1953,
336 1938, 1957, 1955, 1979, 2008, 1983, 2027, 2079,
337 2038, 2052, 2115, 2120, 2093, 2092, 2122, 2126,
338 2103, 2103, 2109, 2106, 2073, 2025, 2035, 2018,
339 1956, 1950, 1939, 1887, 1861, 1850, 1851, 1873,
340 1863, 1870, 1912, 1936, 1960, 1994, 2022, 2060,
341 2082, 2081, 2114, 2142, 2132, 2146, 2165, 2166,
342 2156, 2137, 2143, 2144, 2100, 2076, 2083, 2051,
343 2018, 2004, 1984, 1971, 1946, 1935, 1955, 1962,
344 1973, 1991, 1990, 2012, 2041, 2054, 2094, 2122,
345 2104, 2120, 2135, 2114, 2136, 2152, 2137, 2137,
346 2123, 2128, 2127, 2082, 2083, 2077, 2017, 1986,
347 1969, 1938, 1910, 1894, 1901, 1896, 1905, 1928,
348 1921, 1958, 2016, 2007, 2012, 2046, 2031, 2038,
349 2079, 2074, 2074, 2093, 2091, 2102, 2131, 2117,
350 2102, 2109, 2101, 2084, 2076, 2073, 2058, 2032,
351 2016, 2006, 2004, 2009, 1990, 1981, 2006, 1996,
352 1982, 2010, 2035, 2023, 2021, 2040, 2045, 2035,
353 2033, 2065, 2079, 2050, 2047, 2074, 2093, 2116,
354 2124, 2123, 2129, 2117, 2126, 2145, 2157, 2161,
355 2115, 2056, 2011, 1943, 1899, 1882, 1861, 1837,
356 1795, 1781, 1812, 1825, 1842, 1895, 1920, 1929,
357 1948, 1966, 1998, 2039, 2072, 2100, 2139, 2179,
358 2230, 2299, 2359, 2371, 2355, 2347, 2345, 2314,
359 2274, 2244, 2183, 2096, 2018, 1968, 1954, 1911,
360 1860, 1868, 1870, 1850, 1854, 1874, 1916, 1951,
361 1948, 1976, 2058, 2103, 2106, 2166, 2246, 2250,
362 2237, 2292, 2361, 2357, 2314, 2333, 2334, 2254,
363 2225, 2223, 2161, 2099, 2047, 2009, 2004, 1971,
364 1936, 1926, 1887, 1852, 1883, 1911, 1896, 1942,
365 1999, 1955, 1965, 2055, 2063, 2096, 2166, 2165,
366 2156, 2152, 2153, 2179, 2174, 2160, 2142, 2090,
367 2086, 2085, 2045, 2052, 2047, 2003, 1985, 1996,
368 2024, 2019, 2009, 2035, 2003, 1957, 1988, 2028,
369 2047, 2039, 2015, 2029, 2040, 2024, 2046, 2086,
370 2086, 2049, 2036, 2066, 2056, 2031, 2046, 2058,
371 2024, 2008, 2029, 2032, 2023, 2038, 2043, 2026,
372 2034, 2052, 2059, 2071, 2082, 2069, 2042, 2059,
373 2091, 2079, 2065, 2085, 2086, 2066, 2100, 2140,
374 2106, 2090, 2131, 2120, 2080, 2087, 2088, 2031,
375 1987, 1986, 1965, 1930, 1928, 1957, 1972, 1962,
376 1969, 2023, 2075, 2066, 2085, 2149, 2139, 2113,
377 2166, 2204, 2159, 2145, 2185, 2183, 2164, 2192,
378 2207, 2198, 2220, 2226, 2194, 2186, 2185, 2160,
379 2127, 2116, 2092, 2018, 1990, 2024, 2011, 1975,
380 2015, 2069, 2056, 2051, 2112, 2149, 2131, 2136,
381 2165, 2167, 2147, 2143, 2161, 2183, 2178, 2173,
382 2217, 2237, 2217, 2227, 2217, 2182, 2153, 2107,
383 2080, 2073, 2026, 1969, 1939, 1909, 1879, 1869,
384 1888, 1899, 1891, 1904, 1935, 1966, 1995, 2030,
385 2069, 2105, 2107, 2085, 2107, 2134, 2109, 2104,
386 2149, 2159, 2133, 2156, 2196, 2187, 2184, 2200,
387 2191, 2162, 2140, 2110, 2059, 1991, 1940, 1916,
388 1882, 1870, 1864, 1831, 1829, 1866, 1889, 1900,
389 1928, 1948, 1934, 1917, 1941, 1954, 1934, 1942,
390 1953, 1937, 1957, 1998, 2036, 2076, 2104, 2124,
391 2126, 2111, 2113, 2116, 2079, 2029, 1992, 1945,
392 1883, 1881, 1918, 1894, 1878, 1928, 1936, 1936,
393 1997, 2025, 2012, 2037, 2053, 2045, 2058, 2068,
394 2078, 2105, 2120, 2110, 2107, 2116, 2123, 2133,
395 2150, 2145, 2135, 2139, 2111, 2106, 2141, 2125,
396 2099, 2107, 2100, 2097, 2109, 2113, 2126, 2133,
397 2135, 2158, 2179, 2177, 2167, 2177, 2189, 2156,
398 2127, 2146, 2115, 2068, 2098, 2095, 2055, 2055,
399 2064, 2077, 2086, 2096, 2135, 2152, 2148, 2171,
400 2176, 2162, 2172, 2168, 2159, 2144, 2126, 2121,
401 2095, 2097, 2110, 2083, 2090, 2108, 2094, 2086,
402 2083, 2064, 2042, 2027, 2022, 2000, 1986, 1994,
403 1989, 1997, 2002, 2004, 2048, 2075, 2066, 2096,
404 2114, 2096, 2102, 2113, 2081, 2049, 2051, 2061,
405 2039, 2025, 2034, 2017, 2016, 2032, 2055, 2065,
406 2063, 2080, 2084, 2063, 2042, 2053, 2030, 1987,
407 2002, 1986, 1928, 1937, 1953, 1924, 1937, 1982,
408 1985, 1973, 1983, 1989, 1971, 1963, 1975, 1953,
409 1915, 1900, 1906, 1928, 1934, 1936, 1935, 1944,
410 1964, 1966, 1954, 1945, 1926, 1895, 1876, 1856,
411 1826, 1814, 1808, 1791, 1785, 1797, 1802, 1819,
412 1840, 1849, 1875, 1900, 1890, 1886, 1908, 1923,
413 1913, 1891, 1897, 1915, 1902, 1902, 1923, 1935,
414 1960, 1988, 2021, 2066, 2093, 2121, 2153, 2175,
415 2204, 2227, 2229, 2241, 2257, 2266, 2270, 2291,
416 2314, 2318, 2338, 2362, 2337, 2306, 2310, 2309,
417 2272, 2231, 2194, 2176, 2193, 2173, 2148, 2166,
418 2180, 2188, 2212, 2244, 2271, 2300, 2316, 2313,
419 2346, 2371, 2353, 2356, 2371, 2361, 2340, 2332,
420 2340, 2330, 2322, 2329, 2336, 2339, 2331, 2337,
421 2354, 2328, 2297, 2297, 2276, 2254, 2251, 2251,
422 2267, 2287, 2299, 2312, 2353, 2396, 2393, 2380,
423 2388, 2374, 2323, 2274, 2243, 2211, 2164, 2120,
424 2103, 2099, 2073, 2055, 2068, 2065, 2049, 2043,
425 2037, 2025, 2017, 2011, 2000, 1995, 1992, 1977,
426 1967, 1979, 1977, 1955, 1948, 1951, 1946, 1923,
427 1905, 1895, 1864, 1815, 1765, 1733, 1683, 1627,
428 1593, 1563, 1542, 1544, 1551, 1563, 1590, 1613,
429 1631, 1654, 1676, 1692, 1698, 1703, 1716, 1731,
430 1743, 1767, 1789, 1802, 1817, 1839, 1859, 1863,
431 1856, 1843, 1827, 1801, 1774, 1754, 1727, 1695,
432 1677, 1654, 1635, 1635, 1625, 1610, 1618, 1634,
433 1634, 1643, 1665, 1681, 1689, 1711, 1726, 1742,
434 1774, 1815, 1880, 1951, 2022, 2119, 2197, 2263,
435 2363, 2462, 2534, 2609, 2666, 2684, 2710, 2746,
436 2766, 2776, 2767, 2757, 2763, 2765, 2770, 2760,
437 2731, 2718, 2701, 2673, 2666, 2653, 2622, 2604,
438 2616, 2632, 2630, 2655, 2718, 2777, 2832, 2873,
439 2915, 2982, 3039, 3059, 3076, 3083, 3031, 2947,
440 2886, 2790, 2659, 2541, 2422, 2298, 2187, 2089,
441 2012, 1960, 1912, 1862, 1820, 1812, 1835, 1854,
442 1884, 1926, 1963, 1992, 2034, 2093, 2133, 2162,
443 2205, 2232, 2233, 2245, 2258, 2252, 2247, 2228,
444 2184, 2136, 2088, 2040, 1994, 1963, 1932, 1898,
445 1889, 1908, 1931, 1964, 2010, 2050, 2083, 2116,
446 2151, 2177, 2197, 2209, 2200, 2178, 2150, 2115,
447 2066, 2015, 1957, 1883, 1804, 1730, 1654, 1568,
448 1487, 1408, 1326, 1253, 1202, 1167, 1145, 1151,
449 1180, 1227, 1295, 1377, 1462, 1555, 1648, 1727,
450 1796, 1855, 1892, 1913, 1929, 1931, 1916, 1892,
451 1856, 1820, 1784, 1738, 1689, 1637, 1584, 1541,
452 1504, 1470, 1443, 1431, 1421, 1422, 1454, 1496,
453 1546, 1619, 1694, 1765, 1857, 1957, 2043, 2126,
454 2187, 2228, 2280, 2307, 2307, 2322, 2309, 2280,
455 2262, 2240, 2227, 2237, 2241, 2254, 2279, 2311,
456 2352, 2392, 2436, 2473, 2505, 2567, 2638, 2668,
457 2697, 2757, 2812, 2856, 2902, 2928, 2945, 2967,
458 2985, 2986, 2985, 2982, 2970, 2957, 2932, 2917,
459 2937, 2958, 2961, 2977, 3007, 3023, 3065, 3135,
460 3154, 3137, 3091, 2996, 2881, 2762, 2607, 2430,
461 2270, 2102, 1967, 1888, 1827, 1784, 1774, 1771,
462 1771, 1779, 1790, 1792, 1788, 1781, 1776, 1780,
463 1798, 1843, 1889, 1941, 2014, 2092, 2170, 2242,
464 2299, 2344, 2381, 2408, 2411, 2392, 2350, 2297,
465 2244, 2188, 2151, 2119, 2096, 2080, 2086, 2108,
466 2139, 2178, 2208, 2221, 2219, 2211, 2187, 2143,
467 2087, 2017, 1940, 1863, 1792, 1733, 1681, 1631,
468 1583, 1530, 1478, 1435, 1393, 1353, 1316, 1282,
469 1257, 1246, 1248, 1269, 1308, 1345, 1390, 1452,
470 1515, 1573, 1631, 1676, 1708, 1738, 1755, 1752,
471 1740, 1718, 1678, 1636, 1597, 1560, 1527, 1500,
472 1476, 1460, 1463, 1478, 1487, 1506, 1540, 1576,
473 1612, 1668, 1726, 1786, 1863, 1927, 1999, 2116,
474 2199, 2257, 2356, 2424, 2455, 2493, 2514, 2529,
475 2536, 2529, 2516, 2496, 2487, 2480, 2468, 2461,
476 2452, 2449, 2466, 2501, 2527, 2557, 2594, 2636,
477 2682, 2733, 2769, 2807, 2872, 2910, 2921, 2966,
478 3030, 3088, 3147, 3185, 3218, 3259, 3314, 3374,
479 3388, 3375, 3362, 3368, 3375, 3366, 3338, 3227,
480 3059, 2936, 2802, 2623, 2447, 2265, 2083, 1951,
481 1873, 1837, 1819, 1812, 1806, 1806, 1824, 1841,
482 1851, 1853, 1825, 1786, 1762, 1759, 1778, 1799,
483 1811, 1841, 1898, 1971, 2050, 2110, 2151, 2179,
484 2195, 2203, 2203, 2192, 2176, 2146, 2138, 2149,
485 2172, 2204, 2235, 2273, 2315, 2363, 2418, 2466,
486 2496, 2505, 2495, 2469, 2439, 2397, 2321, 2217,
487 2109, 2007, 1915, 1837, 1772, 1708, 1649, 1602,
488 1566, 1526, 1470, 1398, 1324, 1250, 1186, 1129,
489 1086, 1072, 1075, 1104, 1155, 1226, 1311, 1390,
490 1462, 1520, 1560, 1586, 1597, 1584, 1562, 1537,
491 1500, 1471, 1448, 1423, 1402, 1392, 1403, 1417,
492 1436, 1462, 1497, 1531, 1571, 1613, 1654, 1693,
493 1722, 1758, 1814, 1873, 1932, 1999, 2068, 2129,
494 2200, 2288, 2360, 2394, 2415, 2415, 2392, 2377,
495 2356, 2314, 2263, 2220, 2206, 2218, 2251, 2294,
496 2337, 2363, 2393, 2438, 2495, 2547, 2566, 2559,
497 2562, 2588, 2624, 2666, 2709, 2732, 2741, 2785,
498 2857, 2907, 2948, 2987, 3028, 3078, 3140, 3206,
499 3255, 3286, 3297, 3318, 3359, 3381, 3376, 3373,
500 3353, 3261, 3141, 3049, 2919, 2735, 2553, 2360,
501 2188, 2078, 2000, 1936, 1890, 1861, 1845, 1848,
502 1861, 1863, 1847, 1832, 1817, 1805, 1799, 1786,
503 1774, 1775, 1787, 1792, 1805, 1849, 1912, 1961,
504 1996, 2042, 2087, 2111, 2118, 2115, 2101, 2083,
505 2073, 2081, 2105, 2128, 2151, 2186, 2238, 2297,
506 2350, 2399, 2441, 2474, 2487, 2480, 2458, 2418,
507 2344, 2245, 2137, 2031, 1931, 1843, 1758, 1680,
508 1623, 1574, 1514, 1466, 1423, 1358, 1288, 1243,
509 1198, 1146, 1111, 1103, 1113, 1150, 1195, 1244,
510 1311, 1383, 1443, 1495, 1540, 1567, 1569, 1559,
511 1540, 1517, 1485, 1447, 1408, 1367, 1337, 1320,
512 1311, 1321, 1340, 1356, 1389, 1459, 1526, 1582,
513 1659, 1739, 1799, 1864, 1928, 1978, 2035, 2088,
514 2126, 2179, 2241, 2284, 2325, 2368, 2389, 2399,
515 2414, 2406, 2385, 2367, 2333, 2295, 2294, 2309,
516 2314, 2334, 2371, 2399, 2441, 2502, 2553, 2596,
517 2635, 2651, 2679, 2731, 2789, 2823, 2844, 2861,
518 2884, 2921, 2960, 3004, 3027, 3029, 3057, 3111,
519 3181, 3251, 3291, 3320, 3363, 3407, 3433, 3458,
520 3475, 3419, 3287, 3161, 3060, 2925, 2788, 2641,
521 2459, 2316, 2249, 2211, 2185, 2170, 2134, 2079,
522 2044, 2037, 2017, 1964, 1880, 1795, 1725, 1681,
523 1658, 1653, 1655, 1661, 1694, 1754, 1843, 1947,
524 2015, 2054, 2081, 2102, 2127, 2137, 2118, 2081,
525 2049, 2039, 2058, 2094, 2124, 2144, 2165, 2204,
526 2265, 2332, 2388, 2414, 2420, 2416, 2411, 2405,
527 2381, 2315, 2216, 2133, 2069, 2004, 1955, 1909,
528 1847, 1795, 1757, 1709, 1660, 1607, 1516, 1410,
529 1330, 1252, 1168, 1113, 1080, 1063, 1082, 1126,
530 1180, 1255, 1338, 1398, 1449, 1496, 1523, 1519,
531 1495, 1465, 1438, 1404, 1357, 1317, 1292, 1272,
532 1262, 1270, 1293, 1314, 1343, 1394, 1447, 1498,
533 1554, 1607, 1645, 1702, 1762, 1800, 1846, 1912,
534 1975, 2039, 2110, 2189, 2264, 2336, 2396, 2435,
535 2467, 2473, 2457, 2433, 2402, 2364, 2333, 2317,
536 2315, 2329, 2356, 2391, 2441, 2503, 2557, 2593,
537 2632, 2678, 2718, 2738, 2745, 2762, 2784, 2803,
538 2835, 2876, 2895, 2927, 2997, 3046, 3098, 3186,
539 3242, 3273, 3344, 3410, 3434, 3453, 3465, 3456,
540 3444, 3411, 3316, 3201, 3100, 2979, 2842, 2716,
541 2594, 2480, 2382, 2314, 2287, 2267, 2228, 2179,
542 2143, 2119, 2086, 2047, 2013, 1979, 1939, 1893,
543 1847, 1832, 1837, 1824, 1802, 1801, 1828, 1864,
544 1900, 1931, 1955, 1974, 1982, 1989, 1997, 2002,
545 1990, 1983, 2001, 2040, 2081, 2108, 2145, 2201,
546 2261, 2317, 2368, 2413, 2445, 2458, 2460, 2458,
547 2449, 2422, 2357, 2270, 2201, 2148, 2088, 2020,
548 1948, 1869, 1802, 1737, 1670, 1617, 1554, 1464,
549 1386, 1338, 1296, 1250, 1212, 1189, 1191, 1213,
550 1236, 1271, 1320, 1364, 1392, 1423, 1454, 1468,
551 1455, 1429, 1400, 1373, 1340, 1305, 1263, 1234,
552 1211, 1192, 1197, 1219, 1242, 1268, 1303, 1353,
553 1421, 1491, 1555, 1618, 1679, 1757, 1830, 1879,
554 1944, 2019, 2070, 2119, 2181, 2235, 2279, 2319,
555 2346, 2361, 2380, 2383, 2365, 2357, 2355, 2347,
556 2335, 2344, 2368, 2396, 2431, 2472, 2520, 2574,
557 2619, 2666, 2725, 2772, 2805, 2838, 2875, 2914,
558 2949, 2979, 3001, 3024, 3055, 3082, 3106, 3134,
559 3177, 3221, 3258, 3312, 3367, 3408, 3456, 3495,
560 3502, 3481, 3419, 3321, 3218, 3105, 2971, 2827,
561 2692, 2583, 2498, 2440, 2404, 2379, 2350, 2316,
562 2286, 2255, 2220, 2176, 2115, 2057, 1997, 1929,
563 1867, 1819, 1781, 1752, 1726, 1714, 1726, 1754,
564 1793, 1837, 1879, 1922, 1953, 1968, 1976, 1982,
565 1979, 1967, 1966, 1976, 1985, 1999, 2030, 2074,
566 2130, 2188, 2247, 2309, 2355, 2385, 2403, 2412,
567 2403, 2378, 2338, 2284, 2218, 2152, 2109, 2076,
568 2025, 1959, 1898, 1840, 1775, 1715, 1658, 1580,
569 1500, 1425, 1356, 1307, 1269, 1221, 1177, 1165,
570 1162, 1160, 1184, 1220, 1250, 1276, 1309, 1337,
571 1359, 1372, 1375, 1364, 1345, 1319, 1288, 1252,
572 1217, 1188, 1163, 1152, 1157, 1178, 1204, 1244,
573 1288, 1344, 1407, 1466, 1524, 1589, 1649, 1710,
574 1771, 1834, 1901, 1960, 2014, 2073, 2125, 2176,
575 2223, 2261, 2295, 2329, 2348, 2362, 2376, 2384,
576 2391, 2403, 2417, 2418, 2421, 2439, 2465, 2501,
577 2540, 2581, 2624, 2676, 2722, 2765, 2824, 2870,
578 2891, 2916, 2943, 2961, 2993, 3028, 3063, 3097,
579 3136, 3183, 3238, 3300, 3345, 3372, 3400, 3428,
580 3440, 3420, 3379, 3313, 3222, 3138, 3059, 2955,
581 2843, 2738, 2634, 2561, 2514, 2465, 2418, 2379,
582 2338, 2299, 2283, 2268, 2230, 2181, 2127, 2056,
583 1974, 1906, 1857, 1802, 1741, 1704, 1690, 1699,
584 1727, 1761, 1793, 1825, 1850, 1868, 1881, 1891,
585 1887, 1875, 1873, 1881, 1885, 1895, 1920, 1950,
586 1988, 2035, 2085, 2133, 2175, 2214, 2248, 2264,
587 2275, 2286, 2280, 2258, 2233, 2198, 2148, 2109,
588 2083, 2027, 1964, 1908, 1840, 1773, 1732, 1686,
589 1620, 1566, 1512, 1443, 1392, 1359, 1301, 1247,
590 1218, 1187, 1163, 1171, 1189, 1205, 1224, 1252,
591 1279, 1300, 1323, 1338, 1335, 1319, 1303, 1288,
592 1265, 1238, 1213, 1189, 1181, 1186, 1187, 1195,
593 1223, 1250, 1283, 1334, 1388, 1436, 1500, 1563,
594 1619, 1679, 1740, 1802, 1859, 1914, 1962, 2008,
595 2057, 2107, 2156, 2209, 2258, 2293, 2321, 2359,
596 2388, 2407, 2427, 2442, 2446, 2445, 2452, 2471,
597 2494, 2516, 2543, 2579, 2620, 2666, 2717, 2769,
598 2816, 2854, 2889, 2933, 2971, 3001, 3042, 3079,
599 3106, 3147, 3185, 3217, 3254, 3285, 3299, 3323,
600 3344, 3334, 3313, 3300, 3253, 3184, 3133, 3067,
601 2976, 2893, 2808, 2725, 2666, 2615, 2555, 2509,
602 2470, 2425, 2393, 2374, 2345, 2315, 2282, 2231,
603 2180, 2124, 2060, 2004, 1955, 1900, 1851, 1821,
604 1799, 1792, 1804, 1815, 1827, 1841, 1848, 1860,
605 1876, 1881, 1882, 1888, 1893, 1893, 1898, 1914,
606 1932, 1951, 1980, 2011, 2047, 2082, 2116, 2147,
607 2170, 2184, 2199, 2208, 2201, 2187, 2157, 2122,
608 2101, 2066, 2014, 1960, 1903, 1839, 1794, 1760,
609 1711, 1669, 1632, 1587, 1555, 1537, 1503, 1467,
610 1444, 1412, 1372, 1358, 1353, 1341, 1344, 1350,
611 1354, 1363, 1384, 1393, 1401, 1402, 1397, 1393,
612 1383, 1358, 1334, 1310, 1288, 1273, 1266, 1266,
613 1268, 1275, 1299, 1334, 1370, 1415, 1467, 1515,
614 1564, 1620, 1676, 1722, 1775, 1825, 1861, 1903,
615 1945, 1981, 2024, 2073, 2109, 2143, 2190, 2241,
616 2276, 2320, 2372, 2402, 2426, 2457, 2481, 2498,
617 2521, 2544, 2563, 2584, 2603, 2629, 2662, 2696,
618 2729, 2758, 2785, 2808, 2839, 2876, 2907, 2936,
619 2972, 3010, 3045, 3083, 3121, 3150, 3175, 3200,
620 3217, 3234, 3245, 3238, 3220, 3201, 3178, 3145,
621 3107, 3061, 3001, 2936, 2877, 2827, 2774, 2718,
622 2665, 2610, 2561, 2522, 2484, 2447, 2410, 2366,
623 2317, 2266, 2210, 2155, 2110, 2059, 2010, 1968,
624 1935, 1910, 1905, 1903, 1896, 1898, 1906, 1903,
625 1903, 1912, 1912, 1910, 1919, 1926, 1926, 1927,
626 1937, 1948, 1952, 1965, 1980, 1986, 2000, 2015,
627 2021, 2031, 2046, 2058, 2061, 2059, 2048, 2036,
628 2025, 2005, 1976, 1943, 1905, 1860, 1823, 1798,
629 1772, 1745, 1719, 1685, 1659, 1644, 1621, 1597,
630 1580, 1550, 1511, 1484, 1466, 1451, 1450, 1453,
631 1443, 1434, 1441, 1454, 1460, 1458, 1453, 1445,
632 1434, 1423, 1406, 1386, 1371, 1360, 1343, 1334,
633 1335, 1333, 1336, 1350, 1370, 1394, 1429, 1471,
634 1509, 1546, 1585, 1641, 1696, 1740, 1781, 1824,
635 1865, 1905, 1950, 1988, 2018, 2056, 2093, 2130,
636 2176, 2220, 2252, 2289, 2337, 2370, 2389, 2427,
637 2464, 2479, 2504, 2542, 2566, 2591, 2627, 2654,
638 2677, 2712, 2753, 2788, 2812, 2841, 2886, 2932,
639 2976, 3012, 3042, 3078, 3118, 3143, 3160, 3180,
640 3197, 3204, 3206, 3206, 3202, 3195, 3183, 3166,
641 3140, 3105, 3074, 3045, 3003, 2952, 2903, 2859,
642 2823, 2780, 2725, 2682, 2646, 2608, 2573, 2532,
643 2486, 2443, 2399, 2342, 2287, 2244, 2199, 2152,
644 2109, 2065, 2033, 2022, 2002, 1975, 1960, 1952,
645 1938, 1935, 1934, 1928, 1921, 1922, 1924, 1924,
646 1933, 1944, 1947, 1958, 1973, 1981, 1985, 1992,
647 2002, 2004, 2004, 2013, 2020, 2019, 2009, 1999,
648 1993, 1984, 1969, 1945, 1904, 1864, 1831, 1797,
649 1768, 1741, 1709, 1678, 1655, 1641, 1628, 1613,
650 1605, 1595, 1572, 1557, 1554, 1547, 1537, 1535,
651 1531, 1522, 1520, 1525, 1520, 1512, 1509, 1497,
652 1480, 1465, 1446, 1427, 1406, 1392, 1378, 1364,
653 1360, 1354, 1347, 1355, 1374, 1390, 1413, 1439,
654 1471, 1510, 1558, 1606, 1657, 1707, 1748, 1791,
655 1834, 1869, 1906, 1940, 1965, 1998, 2029, 2063,
656 2099, 2138, 2175, 2211, 2250, 2283, 2310, 2340,
657 2370, 2396, 2422, 2455, 2477, 2504, 2533, 2565,
658 2596, 2632, 2667, 2695, 2730, 2768, 2806, 2845,
659 2889, 2920, 2951, 2991, 3035, 3069, 3094, 3113,
660 3129, 3141, 3149, 3150, 3145, 3139, 3127, 3111,
661 3102, 3091, 3065, 3039, 3017, 2982, 2948, 2918,
662 2886, 2846, 2807, 2770, 2729, 2696, 2669, 2632,
663 2587, 2544, 2495, 2441, 2389, 2344, 2289, 2232,
664 2189, 2143, 2101, 2072, 2048, 2023, 2002, 1987,
665 1970, 1954, 1949, 1935, 1922, 1923, 1914, 1906,
666 1911, 1919, 1927, 1936, 1946, 1950, 1955, 1959,
667 1959, 1950, 1942, 1930, 1922, 1916, 1905, 1889,
668 1879, 1871, 1854, 1836, 1807, 1772, 1738, 1707,
669 1679, 1653, 1632, 1608, 1582, 1569, 1559, 1542,
670 1534, 1531, 1515, 1497, 1492, 1487, 1482, 1485,
671 1487, 1481, 1478, 1482, 1484, 1479, 1473, 1458,
672 1437, 1416, 1395, 1372, 1348, 1332, 1317, 1303,
673 1295, 1293, 1294, 1301, 1313, 1328, 1347, 1367,
674 1390, 1421, 1458, 1496, 1534, 1576, 1621, 1660,
675 1696, 1734, 1765, 1797, 1829, 1853, 1877, 1910,
676 1939, 1970, 2010, 2049, 2077, 2111, 2144, 2166,
677 2196, 2231, 2253, 2281, 2309, 2331, 2361, 2403,
678 2436, 2469, 2507, 2536, 2567, 2600, 2636, 2673,
679 2707, 2743, 2776, 2812, 2856, 2893, 2921, 2950,
680 2976, 2994, 3003, 3010, 3014, 3014, 3015, 3013,
681 3005, 2999, 2989, 2978, 2966, 2953, 2939, 2915,
682 2891, 2861, 2835, 2809, 2781, 2758, 2734, 2705,
683 2666, 2628, 2588, 2532, 2478, 2426, 2371, 2312,
684 2257, 2206, 2159, 2124, 2094, 2064, 2034, 2016,
685 1990, 1973, 1967, 1947, 1929, 1921, 1907, 1890,
686 1888, 1892, 1893, 1897, 1902, 1908, 1907, 1908,
687 1906, 1893, 1879, 1864, 1849, 1830, 1814, 1803,
688 1789, 1775, 1765, 1748, 1722, 1693, 1662, 1629,
689 1597, 1568, 1539, 1512, 1496, 1481, 1467, 1458,
690 1452, 1437, 1425, 1412, 1399, 1390, 1389, 1391,
691 1394, 1392, 1394, 1404, 1406, 1410, 1411, 1403,
692 1383, 1364, 1345, 1318, 1294, 1276, 1257, 1238,
693 1231, 1226, 1222, 1227, 1234, 1240, 1255, 1274,
694 1291, 1314, 1346, 1384, 1420, 1460, 1504, 1544,
695 1583, 1622, 1651, 1679, 1707, 1733, 1750, 1773,
696 1802, 1829, 1857, 1892, 1927, 1955, 1985, 2014,
697 2040, 2061, 2090, 2114, 2132, 2160, 2194, 2226,
698 2265, 2306, 2346, 2383, 2419, 2459, 2497, 2534,
699 2571, 2603, 2633, 2671, 2709, 2742, 2778, 2811,
700 2836, 2864, 2886, 2902, 2915, 2925, 2924, 2932,
701 2938, 2943, 2943, 2944, 2945, 2942, 2941, 2935,
702 2923, 2914, 2897, 2878, 2861, 2840, 2818, 2800,
703 2779, 2755, 2726, 2693, 2651, 2602, 2556, 2504,
704 2453, 2399, 2341, 2291, 2243, 2208, 2172, 2138,
705 2111, 2082, 2053, 2035, 2022, 2002, 1987, 1977,
706 1958, 1944, 1939, 1934, 1931, 1932, 1934, 1930,
707 1928, 1925, 1916, 1898, 1883, 1861, 1839, 1824,
708 1810, 1800, 1787, 1775, 1762, 1741, 1714, 1682,
709 1650, 1616, 1578, 1545, 1514, 1482, 1464, 1449,
710 1430, 1420, 1414, 1396, 1380, 1373, 1367, 1355,
711 1352, 1349, 1345, 1346, 1352, 1360, 1362, 1365,
712 1366, 1355, 1341, 1332, 1317, 1294, 1277, 1255,
713 1233, 1221, 1215, 1209, 1208, 1212, 1212, 1219,
714 1233, 1250, 1270, 1293, 1319, 1353, 1388, 1425,
715 1469, 1515, 1552, 1580, 1612, 1636, 1655, 1678,
716 1698, 1712, 1734, 1769, 1789, 1813, 1848, 1878,
717 1901, 1929, 1952, 1969, 1991, 2013, 2035, 2059,
718 2092, 2123, 2156, 2192, 2233, 2275, 2314, 2360,
719 2404, 2440, 2479, 2518, 2555, 2595, 2632, 2669,
720 2705, 2739, 2766, 2794, 2818, 2836, 2861, 2881,
721 2889, 2901, 2915, 2929, 2946, 2966, 2973, 2975,
722 2988, 2990, 2982, 2985, 2976, 2953, 2937, 2926,
723 2910, 2889, 2876, 2858, 2831, 2800, 2767, 2722,
724 2670, 2624, 2575, 2517, 2462, 2414, 2361, 2314,
725 2276, 2243, 2208, 2180, 2156, 2125, 2099, 2085,
726 2068, 2051, 2041, 2029, 2015, 2008, 2007, 2011,
727 2013, 2010, 2007, 1996, 1985, 1972, 1958, 1933,
728 1908, 1892, 1873, 1855, 1845, 1836, 1821, 1807,
729 1790, 1762, 1733, 1706, 1674, 1638, 1604, 1576,
730 1547, 1521, 1503, 1483, 1462, 1449, 1431, 1410,
731 1396, 1383, 1366, 1360, 1355, 1346, 1343, 1343,
732 1343, 1343, 1342, 1340, 1334, 1323, 1311, 1297,
733 1283, 1268, 1251, 1236, 1220, 1209, 1204, 1200,
734 1201, 1202, 1208, 1215, 1227, 1244, 1262, 1287,
735 1318, 1352, 1385, 1424, 1459, 1490, 1522, 1554,
736 1578, 1598, 1620, 1637, 1656, 1680, 1711, 1740,
737 1764, 1797, 1826, 1854, 1884, 1916, 1945, 1967,
738 1994, 2019, 2044, 2074, 2108, 2145, 2178, 2217,
739 2253, 2294, 2334, 2374, 2419, 2463, 2506, 2552,
740 2594, 2640, 2681, 2717, 2756, 2793, 2820, 2849,
741 2878, 2903, 2924, 2948, 2968, 2982, 3009, 3030,
742 3045, 3064, 3082, 3095, 3100, 3105, 3103, 3093,
743 3089, 3073, 3057, 3045, 3028, 3009, 2985, 2956,
744 2922, 2881, 2833, 2776, 2716, 2661, 2599, 2537,
745 2483, 2428, 2378, 2336, 2295, 2260, 2229, 2206,
746 2178, 2153, 2136, 2116, 2102, 2092, 2084, 2069,
747 2061, 2058, 2057, 2055, 2056, 2054, 2046, 2036,
748 2025, 2008, 1990, 1969, 1946, 1923, 1903, 1888,
749 1873, 1860, 1852, 1833, 1811, 1788, 1760, 1735,
750 1711, 1686, 1662, 1634, 1608, 1593, 1569, 1541,
751 1518, 1491, 1454, 1426, 1406, 1382, 1369, 1364,
752 1347, 1326, 1324, 1318, 1307, 1298, 1290, 1277,
753 1261, 1252, 1242, 1229, 1219, 1211, 1195, 1178,
754 1171, 1163, 1149, 1145, 1145, 1137, 1139, 1149,
755 1159, 1173, 1191, 1215, 1239, 1265, 1293, 1321,
756 1353, 1382, 1414, 1446, 1469, 1497, 1524, 1551,
757 1583, 1614, 1642, 1665, 1697, 1727, 1753, 1787,
758 1818, 1840, 1868, 1896, 1921, 1948, 1980, 2009,
759 2040, 2077, 2113, 2149, 2187, 2226, 2267, 2309,
760 2357, 2405, 2452, 2501, 2549, 2596, 2644, 2685,
761 2722, 2759, 2797, 2831, 2863, 2900, 2934, 2958,
762 2993, 3021, 3042, 3068, 3094, 3116, 3134, 3152,
763 3165, 3173, 3181, 3180, 3173, 3164, 3154, 3139,
764 3123, 3103, 3075, 3049, 3014, 2979, 2933, 2869,
765 2798, 2732, 2669, 2597, 2532, 2466, 2396, 2341,
766 2299, 2259, 2228, 2201, 2176, 2148, 2125, 2107,
767 2094, 2082, 2076, 2066, 2044, 2034, 2033, 2031,
768 2033, 2038, 2032, 2023, 2020, 2010, 1995, 1976,
769 1956, 1932, 1907, 1887, 1870, 1854, 1843, 1834,
770 1811, 1788, 1770, 1748, 1728, 1712, 1700, 1684,
771 1667, 1652, 1636, 1615, 1592, 1569, 1534, 1489,
772 1447, 1408, 1380, 1354, 1328, 1301, 1280, 1260,
773 1242, 1231, 1219, 1201, 1179, 1159, 1137, 1121,
774 1108, 1095, 1087, 1077, 1069, 1064, 1058, 1055,
775 1057, 1054, 1051, 1059, 1064, 1070, 1081, 1096,
776 1113, 1134, 1158, 1179, 1200, 1218, 1240, 1267,
777 1293, 1322, 1349, 1373, 1409, 1452, 1491, 1529,
778 1570, 1605, 1632, 1663, 1693, 1718, 1749, 1780,
779 1799, 1822, 1858, 1896, 1928, 1963, 2001, 2033,
780 2066, 2107, 2141, 2177, 2223, 2264, 2301, 2351,
781 2400, 2449, 2498, 2546, 2593, 2636, 2683, 2730,
782 2769, 2810, 2858, 2901, 2939, 2986, 3032, 3065,
783 3101, 3137, 3164, 3193, 3219, 3236, 3257, 3273,
784 3275, 3276, 3281, 3273, 3258, 3247, 3225, 3201,
785 3173, 3143, 3108, 3061, 3009, 2947, 2872, 2788,
786 2704, 2627, 2545, 2457, 2380, 2310, 2243, 2191,
787 2156, 2123, 2094, 2072, 2046, 2025, 2014, 2002,
788 1984, 1972, 1967, 1955, 1950, 1958, 1961, 1965,
789 1970, 1975, 1972, 1964, 1960, 1943, 1920, 1898,
790 1872, 1844, 1816, 1799, 1781, 1767, 1757, 1748,
791 1733, 1716, 1706, 1700, 1701, 1704, 1706, 1710,
792 1710, 1702, 1692, 1675, 1648, 1616, 1578, 1536,
793 1492, 1453, 1411, 1382, 1356, 1321, 1289, 1266,
794 1241, 1208, 1179, 1152, 1115, 1085, 1062, 1038,
795 1020, 1006, 997, 994, 988, 987, 986, 993,
796 998, 1002, 1012, 1021, 1036, 1049, 1060, 1076,
797 1091, 1109, 1128, 1149, 1166, 1179, 1193, 1215,
798 1245, 1276, 1307, 1339, 1374, 1413, 1456, 1500,
799 1540, 1574, 1602, 1635, 1670, 1709, 1747, 1783,
800 1820, 1860, 1899, 1941, 1988, 2035, 2076, 2112,
801 2146, 2181, 2215, 2252, 2287, 2320, 2360, 2401,
802 2450, 2498, 2546, 2597, 2649, 2697, 2747, 2800,
803 2851, 2901, 2953, 3010, 3057, 3100, 3144, 3182,
804 3221, 3265, 3301, 3327, 3359, 3385, 3406, 3427,
805 3442, 3454, 3457, 3447, 3431, 3412, 3385, 3351,
806 3320, 3284, 3234, 3187, 3136, 3076, 3012, 2935,
807 2845, 2749, 2654, 2562, 2465, 2374, 2289, 2216,
808 2153, 2100, 2059, 2020, 1990, 1968, 1946, 1926,
809 1911, 1899, 1891, 1889, 1887, 1887, 1894, 1902,
810 1915, 1926, 1932, 1937, 1932, 1922, 1911, 1893,
811 1876, 1861, 1845, 1827, 1808, 1794, 1784, 1779,
812 1776, 1762, 1745, 1734, 1725, 1730, 1743, 1757,
813 1771, 1783, 1787, 1790, 1792, 1781, 1756, 1720,
814 1674, 1624, 1580, 1541, 1498, 1459, 1422, 1384,
815 1352, 1326, 1281, 1230, 1189, 1144, 1086, 1040,
816 1005, 966, 939, 923, 915, 908, 911, 917,
817 919, 922, 931, 944, 948, 952, 961, 972,
818 981, 1004, 1031, 1046, 1060, 1074, 1088, 1104,
819 1126, 1151, 1174, 1203, 1239, 1279, 1322, 1376,
820 1421, 1457, 1494, 1528, 1559, 1586, 1625, 1665,
821 1702, 1747, 1794, 1851, 1909, 1968, 2021, 2064,
822 2103, 2136, 2169, 2198, 2223, 2252, 2281, 2316,
823 2356, 2398, 2446, 2496, 2543, 2593, 2645, 2697,
824 2748, 2803, 2862, 2919, 2979, 3036, 3090, 3140,
825 3185, 3221, 3251, 3278, 3300, 3323, 3348, 3375,
826 3398, 3422, 3441, 3464, 3489, 3504, 3505, 3499,
827 3489, 3467, 3440, 3414, 3375, 3335, 3309, 3270,
828 3221, 3180, 3122, 3038, 2947, 2844, 2737, 2623,
829 2503, 2388, 2277, 2176, 2098, 2039, 1989, 1943,
830 1901, 1864, 1828, 1809, 1791, 1762, 1748, 1749,
831 1745, 1753, 1780, 1804, 1828, 1854, 1876, 1889,
832 1902, 1911, 1910, 1896, 1888, 1889, 1886, 1879,
833 1876, 1875, 1866, 1859, 1857, 1841, 1817, 1795,
834 1771, 1753, 1754, 1763, 1769, 1785, 1813, 1843,
835 1868, 1885, 1883, 1853, 1819, 1786, 1750, 1709,
836 1667, 1624, 1580, 1548, 1525, 1496, 1462, 1419,
837 1361, 1298, 1228, 1154, 1083, 1016, 951, 889,
838 843, 808, 789, 778, 772, 776, 785, 797,
839 812, 830, 841, 858, 880, 893, 912, 938,
840 960, 985, 1021, 1052, 1081, 1115, 1145, 1182,
841 1227, 1268, 1313, 1356, 1390, 1424, 1460, 1487,
842 1507, 1530, 1547, 1561, 1586, 1620, 1659, 1709,
843 1764, 1823, 1885, 1945, 1994, 2039, 2079, 2113,
844 2138, 2162, 2190, 2211, 2237, 2270, 2316, 2368,
845 2419, 2473, 2530, 2584, 2638, 2705, 2766, 2821,
846 2877, 2941, 2995, 3046, 3103, 3157, 3202, 3240,
847 3280, 3322, 3364, 3401, 3433, 3476, 3516, 3548,
848 3588, 3630, 3656, 3656, 3652, 3650, 3629, 3599,
849 3563, 3524, 3479, 3434, 3398, 3367, 3334, 3294,
850 3252, 3205, 3128, 3029, 2911, 2771, 2633, 2492,
851 2352, 2209, 2076, 1972, 1887, 1824, 1787, 1752,
852 1719, 1689, 1660, 1634, 1620, 1605, 1591, 1586,
853 1588, 1592, 1610, 1642, 1675, 1703, 1733, 1762,
854 1787, 1819, 1843, 1856, 1865, 1872, 1877, 1878,
855 1867, 1854, 1840, 1821, 1804, 1786, 1765, 1743,
856 1726, 1723, 1741, 1769, 1793, 1828, 1861, 1902,
857 1944, 1976, 1994, 2000, 1988, 1959, 1929, 1908,
858 1883, 1843, 1800, 1754, 1711, 1658, 1596, 1535,
859 1455, 1354, 1259, 1171, 1075, 977, 877, 780,
860 701, 638, 580, 545, 531, 516, 513, 548,
861 590, 623, 669, 724, 767, 808, 859, 898,
862 925, 951, 978, 1007, 1033, 1070, 1111, 1141,
863 1169, 1209, 1251, 1287, 1318, 1342, 1356, 1376,
864 1397, 1415, 1431, 1450, 1475, 1504, 1544, 1595,
865 1645, 1687, 1739, 1799, 1853, 1903, 1953, 1994,
866 2023, 2052, 2082, 2102, 2123, 2147, 2168, 2184,
867 2213, 2256, 2294, 2331, 2382, 2434, 2480, 2536,
868 2592, 2645, 2699, 2760, 2820, 2878, 2951, 3015,
869 3072, 3132, 3193, 3263, 3327, 3380, 3423, 3474,
870 3526, 3562, 3598, 3642, 3672, 3691, 3711, 3728,
871 3735, 3723, 3700, 3678, 3657, 3608, 3548, 3499,
872 3457, 3382, 3313, 3273, 3208, 3142, 3075, 2959,
873 2817, 2667, 2519, 2370, 2221, 2069, 1919, 1806,
874 1717, 1645, 1604, 1570, 1528, 1489, 1456, 1427,
875 1402, 1369, 1344, 1348, 1363, 1373, 1404, 1457,
876 1507, 1553, 1606, 1660, 1709, 1755, 1788, 1814,
877 1831, 1842, 1851, 1841, 1823, 1812, 1799, 1787,
878 1788, 1790, 1774, 1756, 1750, 1751, 1765, 1798,
879 1819, 1836, 1865, 1907, 1947, 1986, 2017, 2027,
880 2025, 2025, 2033, 2050, 2070, 2073, 2068, 2054,
881 2022, 1971, 1907, 1814, 1695, 1575, 1452, 1322,
882 1207, 1104, 999, 907, 833, 756, 684, 625,
883 552, 482, 446, 421, 396, 394, 417, 445,
884 486, 556, 636, 709, 784, 863, 927, 986,
885 1044, 1096, 1138, 1182, 1228, 1277, 1328, 1379,
886 1423, 1452, 1474, 1484, 1485, 1486, 1495, 1510,
887 1525, 1544, 1574, 1609, 1638, 1671, 1709, 1738,
888 1758, 1777, 1800, 1826, 1856, 1892, 1932, 1975,
889 2014, 2050, 2083, 2116, 2140, 2148, 2151, 2157,
890 2161, 2170, 2187, 2210, 2240, 2284, 2344, 2409,
891 2477, 2550, 2624, 2702, 2778, 2854, 2938, 3026,
892 3115, 3202, 3281, 3353, 3429, 3507, 3561, 3601,
893 3650, 3683, 3706, 3747, 3797, 3830, 3873, 3924,
894 3949, 3972, 3978, 3955, 3922, 3887, 3821, 3732,
895 3655, 3579, 3479, 3401, 3352, 3285, 3209, 3141,
896 3040, 2876, 2688, 2517, 2355, 2168, 1979, 1819,
897 1679, 1564, 1495, 1459, 1424, 1386, 1344, 1301,
898 1274, 1256, 1223, 1201, 1210, 1236, 1261, 1312,
899 1384, 1449, 1511, 1577, 1641, 1695, 1750, 1801,
900 1834, 1853, 1880, 1912, 1919, 1911, 1910, 1906,
901 1897, 1903, 1903, 1884, 1856, 1834, 1824, 1842,
902 1887, 1927, 1954, 1992, 2046, 2096, 2142, 2177,
903 2194, 2185, 2167, 2166, 2186, 2213, 2246, 2277,
904 2306, 2334, 2333, 2288, 2207, 2101, 1966, 1800,
905 1634, 1475, 1312, 1164, 1042, 941, 857, 784,
906 716, 654, 599, 541, 481, 435, 405, 384,
907 379, 399, 446, 520, 616, 713, 806, 898,
908 986, 1072, 1150, 1217, 1280, 1331, 1368, 1404,
909 1442, 1478, 1507, 1520, 1518, 1506, 1489, 1474,
910 1482, 1505, 1526, 1549, 1577, 1614, 1655, 1687,
911 1707, 1719, 1719, 1711, 1715, 1727, 1744, 1767,
912 1803, 1848, 1899, 1953, 1994, 2024, 2043, 2045,
913 2035, 2020, 2002, 1986, 1975, 1971, 1987, 2018,
914 2059, 2111, 2166, 2228, 2299, 2377, 2464, 2553,
915 2637, 2724, 2814, 2914, 3028, 3140, 3240, 3332,
916 3412, 3474, 3542, 3616, 3671, 3720, 3764, 3805,
917 3855, 3908, 3953, 3986, 4025, 4042, 4044, 4048,
918 4038, 3998, 3961, 3927, 3885, 3828, 3774, 3712,
919 3639, 3573, 3491, 3406, 3320, 3221, 3102, 2943,
920 2742, 2530, 2346, 2173, 1982, 1799, 1648, 1520,
921 1422, 1366, 1330, 1297, 1248, 1199, 1170, 1160,
922 1130, 1098, 1100, 1128, 1156, 1198, 1264, 1342,
923 1427, 1518, 1601, 1680, 1763, 1838, 1889, 1930,
924 1965, 1996, 2010, 2003, 1990, 1980, 1974, 1977,
925 1988, 1997, 1998, 1992, 1984, 2002, 2047, 2085,
926 2102, 2124, 2152, 2181, 2216, 2246, 2262, 2268,
927 2263, 2275, 2302, 2335, 2376, 2413, 2447, 2483,
928 2511, 2513, 2494, 2446, 2364, 2246, 2118, 1985,
929 1833, 1679, 1530, 1383, 1250, 1135, 1038, 947,
930 858, 776, 700, 640, 579, 518, 464, 420,
931 396, 395, 421, 465, 520, 577, 648, 746,
932 848, 938, 1029, 1115, 1188, 1256, 1322, 1372,
933 1413, 1441, 1448, 1443, 1450, 1461, 1469, 1480,
934 1500, 1528, 1562, 1606, 1649, 1675, 1692, 1699,
935 1687, 1682, 1680, 1671, 1665, 1675, 1693, 1724,
936 1764, 1809, 1853, 1888, 1915, 1933, 1945, 1947,
937 1929, 1901, 1866, 1838, 1823, 1814, 1817, 1829,
938 1846, 1875, 1915, 1969, 2030, 2093, 2161, 2232,
939 2308, 2389, 2471, 2554, 2644, 2731, 2823, 2918,
940 3032, 3147, 3228, 3317, 3411, 3490, 3582, 3674,
941 3736, 3781, 3821, 3846, 3882, 3932, 3947, 3947,
942 3976, 4000, 4013, 4047, 4080, 4083, 4083, 4079,
943 4052, 4025, 3978, 3903, 3825, 3745, 3646, 3543,
944 3457, 3355, 3229, 3081, 2872, 2637, 2440, 2233,
945 2004, 1804, 1624, 1462, 1332, 1234, 1156, 1091,
946 1036, 971, 913, 884, 848, 800, 797, 850,
947 917, 990, 1081, 1192, 1306, 1426, 1536, 1625,
948 1715, 1785, 1832, 1867, 1904, 1953, 1978, 1982,
949 1993, 2014, 2031, 2047, 2067, 2072, 2064, 2041,
950 2013, 2008, 2027, 2043, 2045, 2054, 2088, 2131,
951 2168, 2198, 2230, 2248, 2259, 2287, 2329, 2375,
952 2421, 2470, 2517, 2569, 2613, 2619, 2593, 2547,
953 2484, 2404, 2326, 2256, 2172, 2065, 1941, 1812,
954 1679, 1549, 1416, 1271, 1127, 994, 860, 747,
955 663, 577, 491, 424, 376, 356, 342, 336,
956 334, 347, 378, 429, 509, 594, 677, 766,
957 867, 969, 1064, 1145, 1220, 1288, 1342, 1389,
958 1428, 1461, 1481, 1503, 1528, 1554, 1589, 1622,
959 1627, 1615, 1602, 1584, 1577, 1569, 1559, 1560,
960 1566, 1571, 1585, 1614, 1640, 1660, 1670, 1685,
961 1706, 1720, 1723, 1727, 1731, 1736, 1740, 1743,
962 1747, 1745, 1731, 1709, 1690, 1678, 1671, 1667,
963 1676, 1700, 1740, 1787, 1841, 1903, 1965, 2033,
964 2109, 2189, 2267, 2352, 2441, 2527, 2626, 2743,
965 2857, 2965, 3071, 3173, 3259, 3334, 3404, 3461,
966 3530, 3603, 3653, 3704, 3752, 3795, 3834, 3883,
967 3935, 3970, 4002, 4038, 4052, 4058, 4075, 4095,
968 4094, 4084, 4076, 4046, 4017, 3989, 3933, 3855,
969 3773, 3674, 3558, 3452, 3351, 3209, 3023, 2797,
970 2555, 2342, 2122, 1878, 1665, 1482, 1308, 1166,
971 1067, 979, 909, 855, 779, 731, 714, 658,
972 615, 635, 679, 744, 832, 920, 1027, 1152,
973 1272, 1387, 1507, 1618, 1709, 1767, 1810, 1867,
974 1929, 1956, 1961, 1974, 1984, 1992, 2018, 2034,
975 2038, 2044, 2024, 2000, 2018, 2051, 2063, 2059,
976 2067, 2090, 2128, 2158, 2185, 2209, 2224, 2237,
977 2277, 2334, 2395, 2452, 2504, 2562, 2627, 2677,
978 2694, 2677, 2632, 2570, 2504, 2446, 2397, 2332,
979 2259, 2182, 2109, 2034, 1951, 1852, 1732, 1593,
980 1437, 1291, 1167, 1047, 926, 810, 706, 632,
981 577, 522, 487, 465, 427, 397, 412, 435,
982 454, 488, 532, 593, 675, 760, 828, 903,
983 980, 1041, 1108, 1181, 1249, 1306, 1354, 1402,
984 1465, 1533, 1578, 1605, 1614, 1611, 1609, 1603,
985 1592, 1592, 1597, 1588, 1594, 1620, 1651, 1686,
986 1702, 1700, 1696, 1700, 1695, 1694, 1695, 1690,
987 1693, 1699, 1717, 1743, 1753, 1754, 1754, 1751,
988 1742, 1731, 1719, 1702, 1688, 1687, 1693, 1706,
989 1723, 1741, 1767, 1803, 1851, 1905, 1964, 2034,
990 2106, 2183, 2272, 2373, 2471, 2564, 2660, 2756,
991 2847, 2947, 3037, 3120, 3209, 3289, 3362, 3432,
992 3508, 3576, 3621, 3668, 3712, 3749, 3784, 3803,
993 3821, 3862, 3892, 3900, 3928, 3973, 3988, 4005,
994 4037, 4047, 4036, 4022, 3988, 3946, 3912, 3858,
995 3784, 3710, 3633, 3546, 3446, 3344, 3221, 3046,
996 2803, 2566, 2353, 2113, 1878, 1678, 1481, 1308,
997 1191, 1088, 989, 921, 837, 727, 653, 596,
998 519, 479, 498, 538, 606, 699, 799, 919,
999 1049, 1174, 1286, 1387, 1485, 1579, 1642, 1695,
1000 1788, 1878, 1921, 1960, 2014, 2042, 2065, 2100,
1001 2117, 2128, 2133, 2116, 2104, 2123, 2160, 2166,
1002 2160, 2179, 2208, 2224, 2237, 2255, 2260, 2261,
1003 2285, 2325, 2381, 2455, 2530, 2598, 2674, 2751,
1004 2806, 2823, 2811, 2779, 2726, 2681, 2652, 2618,
1005 2569, 2519, 2465, 2408, 2352, 2286, 2196, 2075,
1006 1944, 1798, 1652, 1527, 1395, 1256, 1133, 1024,
1007 935, 856, 784, 704, 619, 550, 509, 485,
1008 458, 435, 419, 429, 462, 503, 547, 591,
1009 633, 673, 727, 792, 851, 912, 984, 1059,
1010 1136, 1222, 1305, 1377, 1427, 1460, 1488, 1512,
1011 1532, 1549, 1570, 1601, 1635, 1683, 1734, 1790,
1012 1841, 1867, 1888, 1905, 1912, 1910, 1904, 1894,
1013 1890, 1904, 1926, 1936, 1943, 1950, 1957, 1959,
1014 1952, 1930, 1901, 1864, 1822, 1795, 1773, 1754,
1015 1730, 1700, 1677, 1663, 1646, 1629, 1627, 1634,
1016 1652, 1687, 1739, 1801, 1868, 1938, 2004, 2077,
1017 2152, 2223, 2290, 2356, 2436, 2523, 2615, 2721,
1018 2831, 2939, 3034, 3118, 3199, 3263, 3307, 3338,
1019 3360, 3385, 3412, 3443, 3484, 3532, 3590, 3636,
1020 3678, 3741, 3795, 3823, 3843, 3860, 3869, 3883,
1021 3905, 3922, 3931, 3949, 3961, 3967, 3971, 3950,
1022 3917, 3867, 3796, 3725, 3641, 3527, 3364, 3145,
1023 2925, 2727, 2501, 2257, 2038, 1833, 1624, 1458,
1024 1332, 1208, 1102, 997, 875, 772, 695, 608,
1025 539, 519, 519, 538, 589, 658, 758, 881,
1026 1002, 1121, 1249, 1370, 1484, 1576, 1646, 1729,
1027 1821, 1872, 1910, 1966, 2011, 2047, 2093, 2135,
1028 2168, 2194, 2196, 2185, 2192, 2210, 2209, 2187,
1029 2176, 2179, 2183, 2183, 2191, 2198, 2198, 2214,
1030 2249, 2296, 2358, 2432, 2503, 2580, 2662, 2731,
1031 2778, 2798, 2799, 2781, 2760, 2744, 2719, 2690,
1032 2660, 2627, 2593, 2566, 2531, 2471, 2388, 2293,
1033 2188, 2074, 1965, 1850, 1725, 1591, 1448, 1321,
1034 1214, 1114, 1024, 945, 875, 819, 781, 749,
1035 711, 677, 640, 606, 595, 587, 579, 581,
1036 595, 622, 669, 735, 803, 875, 950, 1028,
1037 1106, 1177, 1229, 1266, 1295, 1321, 1350, 1381,
1038 1407, 1440, 1481, 1528, 1587, 1654, 1716, 1771,
1039 1812, 1836, 1853, 1871, 1877, 1876, 1877, 1878,
1040 1887, 1903, 1917, 1932, 1943, 1947, 1954, 1959,
1041 1961, 1953, 1935, 1911, 1883, 1851, 1812, 1763,
1042 1708, 1651, 1605, 1568, 1536, 1512, 1488, 1474,
1043 1470, 1482, 1502, 1527, 1554, 1580, 1608, 1649,
1044 1698, 1750, 1808, 1878, 1960, 2048, 2149, 2257,
1045 2358, 2448, 2534, 2620, 2711, 2796, 2863, 2917,
1046 2964, 3004, 3034, 3064, 3108, 3140, 3164, 3205,
1047 3250, 3293, 3327, 3355, 3386, 3423, 3462, 3484,
1048 3508, 3534, 3552, 3569, 3604, 3639, 3672, 3707,
1049 3737, 3772, 3803, 3829, 3844, 3850, 3840, 3814,
1050 3772, 3714, 3647, 3559, 3425, 3233, 3027, 2851,
1051 2657, 2445, 2257, 2089, 1918, 1770, 1645, 1522,
1052 1414, 1300, 1158, 1036, 939, 826, 725, 680,
1053 664, 668, 707, 755, 830, 935, 1031, 1122,
1054 1213, 1296, 1373, 1440, 1486, 1558, 1641, 1689,
1055 1732, 1791, 1842, 1889, 1940, 1977, 2013, 2045,
1056 2051, 2040, 2045, 2053, 2046, 2029, 2016, 2016,
1057 2020, 2012, 2010, 2013, 2013, 2034, 2069, 2111,
1058 2173, 2244, 2312, 2387, 2472, 2545, 2598, 2627,
1059 2643, 2655, 2658, 2667, 2675, 2678, 2686, 2699,
1060 2704, 2707, 2705, 2682, 2629, 2562, 2483, 2394,
1061 2306, 2212, 2115, 2022, 1933, 1845, 1755, 1661,
1062 1569, 1481, 1391, 1305, 1234, 1166, 1093, 1024,
1063 968, 922, 897, 866, 837, 821, 809, 795,
1064 792, 812, 829, 848, 872, 913, 966, 1020,
1065 1062, 1098, 1135, 1167, 1191, 1217, 1244, 1277,
1066 1316, 1357, 1410, 1472, 1532, 1583, 1633, 1677,
1067 1716, 1747, 1761, 1770, 1783, 1802, 1821, 1844,
1068 1872, 1897, 1918, 1929, 1934, 1937, 1934, 1922,
1069 1908, 1891, 1875, 1863, 1849, 1833, 1815, 1797,
1070 1774, 1753, 1730, 1706, 1679, 1652, 1636, 1622,
1071 1616, 1617, 1624, 1633, 1648, 1671, 1695, 1721,
1072 1752, 1794, 1843, 1894, 1958, 2022, 2084, 2144,
1073 2203, 2264, 2320, 2372, 2412, 2457, 2501, 2538,
1074 2577, 2616, 2651, 2683, 2711, 2736, 2764, 2789,
1075 2798, 2808, 2817, 2824, 2838, 2858, 2873, 2897,
1076 2921, 2939, 2971, 3004, 3030, 3054, 3079, 3104,
1077 3131, 3168, 3202, 3242, 3282, 3308, 3342, 3376,
1078 3408, 3432, 3444, 3445, 3442, 3428, 3404, 3378,
1079 3344, 3295, 3219, 3110, 2992, 2886, 2763, 2622,
1080 2498, 2377, 2254, 2155, 2056, 1960, 1891, 1803,
1081 1704, 1622, 1549, 1471, 1411, 1370, 1342, 1334,
1082 1331, 1342, 1378, 1427, 1475, 1521, 1557, 1594,
1083 1638, 1671, 1699, 1738, 1774, 1794, 1821, 1855,
1084 1876, 1905, 1924, 1930, 1937, 1943, 1935, 1919,
1085 1905, 1898, 1885, 1871, 1865, 1867, 1867, 1863,
1086 1862, 1859, 1865, 1878, 1891, 1909, 1942, 1989,
1087 2040, 2100, 2166, 2229, 2279, 2325, 2362, 2394,
1088 2427, 2458, 2478, 2496, 2523, 2549, 2567, 2590,
1089 2601, 2602, 2588, 2564, 2529, 2490, 2444, 2390,
1090 2334, 2279, 2227, 2174, 2121, 2068, 2014, 1954,
1091 1887, 1820, 1760, 1701, 1638, 1580, 1524, 1479,
1092 1444, 1415, 1391, 1372, 1355, 1338, 1322, 1314,
1093 1304, 1293, 1293, 1302, 1311, 1328, 1351, 1377,
1094 1413, 1450, 1478, 1506, 1535, 1567, 1604, 1641,
1095 1678, 1714, 1746, 1777, 1808, 1834, 1856, 1867,
1096 1870, 1869, 1870, 1866, 1856, 1852, 1852, 1853,
1097 1858, 1861, 1865, 1868, 1872, 1880, 1883, 1885,
1098 1885, 1886, 1887, 1888, 1891, 1895, 1895, 1888,
1099 1885, 1881, 1872, 1860, 1841, 1834, 1823, 1813,
1100 1809, 1804, 1803, 1804, 1810, 1817, 1825, 1836,
1101 1847, 1857, 1870, 1888, 1904, 1919, 1937, 1960,
1102 1983, 2004, 2026, 2045, 2066, 2084, 2098, 2115,
1103 2132, 2150, 2169, 2185, 2206, 2227, 2243, 2257,
1104 2271, 2285, 2295, 2302, 2309, 2316, 2323, 2333,
1105 2347, 2361, 2379, 2395, 2410, 2421, 2436, 2449,
1106 2465, 2480, 2491, 2500, 2513, 2525, 2538, 2557,
1107 2577, 2595, 2613, 2632, 2651, 2674, 2691, 2710,
1108 2727, 2745, 2758, 2769, 2785, 2800, 2810, 2816,
1109 2826, 2832, 2828, 2823, 2817, 2805, 2797, 2779,
1110 2750, 2716, 2684, 2650, 2609, 2569, 2528, 2485,
1111 2447, 2408, 2377, 2351, 2323, 2301, 2281, 2267,
1112 2257, 2247, 2241, 2243, 2247, 2247, 2253, 2259,
1113 2270, 2289, 2301, 2308, 2320, 2331, 2341, 2346,
1114 2348, 2350, 2347, 2338, 2330, 2321, 2311, 2302,
1115 2290, 2271, 2256, 2239, 2211, 2183, 2161, 2140,
1116 2115, 2087, 2064, 2047, 2029, 2015, 2001, 1988,
1117 1980, 1971, 1959, 1954, 1955, 1956, 1962, 1970,
1118 1978, 1987, 1995, 1998, 2001, 2003, 2000, 1997,
1119 1989, 1984, 1980, 1973, 1967, 1963, 1958, 1947,
1120 1939, 1929, 1917, 1905, 1893, 1880, 1869, 1860,
1121 1850, 1841, 1833, 1827, 1820, 1820, 1821, 1822,
1122 1824, 1824, 1822, 1824, 1830, 1831, 1837, 1849,
1123 1857, 1864, 1874, 1880, 1884, 1894, 1902, 1901,
1124 1900, 1900, 1903, 1909, 1910, 1909, 1901, 1895,
1125 1891, 1884, 1875, 1867, 1854, 1839, 1829, 1821,
1126 1811, 1803, 1791, 1779, 1774, 1764, 1751, 1735,
1127 1724, 1714, 1703, 1693, 1684, 1676, 1669, 1663,
1128 1659, 1656, 1655, 1653, 1650, 1650, 1651, 1652,
1129 1652, 1652, 1654, 1656, 1661, 1670, 1677, 1681,
1130 1690, 1700, 1711, 1719, 1729, 1742, 1750, 1761,
1131 1771, 1782, 1793, 1803, 1815, 1826, 1836, 1849,
1132 1861, 1874, 1884, 1894, 1910, 1921, 1934, 1947,
1133 1960, 1969, 1980, 1995, 2005, 2014, 2022, 2029,
1134 2035, 2040, 2048, 2054, 2059, 2066, 2074, 2082,
1135 2088, 2091, 2096, 2102, 2100, 2101, 2104, 2107,
1136 2113, 2121, 2131, 2136, 2140, 2145, 2148, 2151,
1137 2156, 2162, 2165, 2170, 2175, 2179, 2184, 2191,
1138 2198, 2206, 2219, 2229, 2240, 2252, 2268, 2282,
1139 2295, 2310, 2328, 2346, 2364, 2383, 2402, 2420,
1140 2439, 2456, 2472, 2489, 2503, 2516, 2530, 2545,
1141 2561, 2575, 2587, 2595, 2602, 2610, 2615, 2620,
1142 2620, 2619, 2615, 2612, 2609, 2600, 2594, 2583,
1143 2571, 2559, 2545, 2531, 2513, 2496, 2477, 2465,
1144 2451, 2438, 2426, 2409, 2395, 2385, 2369, 2354,
1145 2344, 2332, 2321, 2310, 2299, 2293, 2289, 2284,
1146 2277, 2265, 2256, 2249, 2234, 2223, 2215, 2201,
1147 2189, 2180, 2169, 2158, 2148, 2136, 2120, 2105,
1148 2091, 2073, 2053, 2034, 2016, 1998, 1982, 1968,
1149 1959, 1946, 1936, 1929, 1919, 1914, 1909, 1902,
1150 1899, 1894, 1892, 1890, 1891, 1894, 1895, 1897,
1151 1895, 1895, 1892, 1892, 1888, 1882, 1877, 1872,
1152 1869, 1862, 1859, 1858, 1854, 1849, 1843, 1837,
1153 1828, 1821, 1813, 1801, 1788, 1781, 1772, 1763,
1154 1752, 1745, 1735, 1724, 1713, 1704, 1693, 1685,
1155 1677, 1671, 1667, 1667, 1668, 1668, 1670, 1674,
1156 1678, 1680, 1681, 1683, 1686, 1688, 1689, 1694,
1157 1696, 1694, 1694, 1700, 1704, 1707, 1711, 1717,
1158 1721, 1730, 1736, 1741, 1746, 1753, 1760, 1765,
1159 1775, 1782, 1786, 1793, 1798, 1803, 1811, 1815,
1160 1822, 1830, 1836, 1844, 1852, 1857, 1864, 1870,
1161 1873, 1878, 1883, 1885, 1888, 1893, 1894, 1900,
1162 1905, 1908, 1912, 1916, 1921, 1925, 1927, 1931,
1163 1936, 1935, 1940, 1945, 1945, 1946, 1952, 1955,
1164 1958, 1963, 1965, 1967, 1970, 1969, 1969, 1974,
1165 1974, 1973, 1974, 1975, 1977, 1979, 1983, 1984,
1166 1989, 1996, 2002, 2002, 2007, 2016, 2021, 2022,
1167 2029, 2038, 2039, 2041, 2049, 2051, 2054, 2058,
1168 2063, 2065, 2072, 2079, 2084, 2091, 2100, 2109,
1169 2114, 2122, 2128, 2135, 2142, 2153, 2162, 2167,
1170 2179, 2191, 2195, 2204, 2215, 2222, 2233, 2244,
1171 2253, 2259, 2267, 2275, 2281, 2289, 2297, 2302,
1172 2301, 2308, 2316, 2316, 2321, 2324, 2324, 2329,
1173 2334, 2335, 2337, 2339, 2339, 2341, 2342, 2344,
1174 2344, 2345, 2346, 2349, 2348, 2349, 2350, 2351,
1175 2350, 2351, 2352, 2350, 2350, 2351, 2347, 2346,
1176 2346, 2346, 2340, 2339, 2340, 2341, 2337, 2335,
1177 2335, 2329, 2327, 2324, 2322, 2318, 2318, 2315,
1178 2311, 2309, 2305, 2303, 2300, 2303, 2301, 2295,
1179 2292, 2290, 2286, 2282, 2277, 2272, 2267, 2256,
1180 2248, 2242, 2231, 2220, 2207, 2196, 2185, 2176,
1181 2166, 2153, 2144, 2132, 2121, 2111, 2100, 2087,
1182 2074, 2060, 2051, 2042, 2030, 2025, 2015, 2005,
1183 1998, 1993, 1985, 1978, 1969, 1960, 1954, 1947,
1184 1940, 1932, 1928, 1921, 1915, 1912, 1904, 1899,
1185 1892, 1889, 1887, 1879, 1873, 1866, 1860, 1852,
1186 1848, 1842, 1837, 1835, 1833, 1832, 1828, 1827,
1187 1826, 1825, 1825, 1824, 1823, 1827, 1829, 1830,
1188 1833, 1835, 1839, 1841, 1843, 1842, 1846, 1848,
1189 1851, 1853, 1857, 1863, 1866, 1870, 1871, 1875,
1190 1877, 1879, 1880, 1881, 1882, 1882, 1883, 1882,
1191 1884, 1885, 1886, 1886, 1889, 1890, 1890, 1893,
1192 1893, 1891, 1891, 1893, 1892, 1894, 1896, 1897,
1193 1900, 1904, 1908, 1913, 1913, 1914, 1919, 1919,
1194 1923, 1929, 1932, 1937, 1940, 1945, 1949, 1953,
1195 1955, 1958, 1962, 1967, 1973, 1976, 1977, 1982,
1196 1986, 1989, 1993, 1999, 2001, 2007, 2009, 2012,
1197 2018, 2022, 2025, 2033, 2040, 2045, 2051, 2059,
1198 2064, 2073, 2081, 2082, 2092, 2098, 2105, 2111,
1199 2116, 2121, 2128, 2133, 2136, 2139, 2142, 2146,
1200 2152, 2156, 2158, 2161, 2167, 2165, 2169, 2173,
1201 2174, 2179, 2175, 2176, 2179, 2181, 2184, 2185,
1202 2186, 2188, 2191, 2189, 2190, 2190, 2191, 2193,
1203 2197, 2197, 2196, 2199, 2199, 2199, 2201, 2203,
1204 2205, 2208, 2210, 2212, 2214, 2216, 2219, 2222,
1205 2222, 2227, 2229, 2229, 2233, 2234, 2236, 2238,
1206 2240, 2242, 2244, 2248, 2249, 2251, 2250, 2250,
1207 2251, 2248, 2248, 2247, 2248, 2250, 2250, 2248,
1208 2247, 2247, 2247, 2247, 2248, 2250, 2252, 2253,
1209 2253, 2254, 2256, 2258, 2257, 2257, 2256, 2259,
1210 2258, 2257, 2257, 2256, 2253, 2256, 2258, 2254,
1211 2251, 2247, 2245, 2243, 2240, 2236, 2231, 2227,
1212 2224, 2221, 2217, 2215, 2214, 2210, 2206, 2202,
1213 2200, 2199, 2193, 2190, 2186, 2182, 2180, 2175,
1214 2171, 2168, 2162, 2157, 2152, 2148, 2144, 2139,
1215 2131, 2125, 2118, 2113, 2109, 2104, 2099, 2095,
1216 2090, 2087, 2082, 2076, 2070, 2068, 2065, 2056,
1217 2052, 2051, 2048, 2048, 2043, 2041, 2037, 2034,
1218 2030, 2026, 2023, 2021, 2020, 2017, 2014, 2011,
1219 2009, 2005, 2004, 2003, 2002, 2001, 2000, 1995,
1220 1993, 1992, 1987, 1984, 1984, 1979, 1976, 1972,
1221 1967, 1966, 1962, 1960, 1957, 1956, 1956, 1955,
1222 1953, 1951, 1949, 1946, 1944, 1942, 1938, 1936,
1223 1937, 1934, 1932, 1932, 1930, 1928, 1929, 1926,
1224 1925, 1925, 1923, 1923, 1922, 1919, 1922, 1920,
1225 1920, 1921, 1919, 1924, 1926, 1928, 1929, 1929,
1226 1934, 1936, 1936, 1937, 1937, 1939, 1939, 1943,
1227 1944, 1947, 1948, 1950, 1952, 1955, 1959, 1959,
1228 1963, 1964, 1967, 1970, 1972, 1975, 1978, 1981,
1229 1985, 1985, 1991, 1994, 1997, 2002, 2007, 2013,
1230 2016, 2022, 2025, 2028, 2031, 2032, 2033, 2035,
1231 2040, 2043, 2046, 2049, 2053, 2052, 2052, 2051,
1232 2050, 2052, 2054, 2053, 2053, 2058, 2062, 2063,
1233 2064, 2066, 2068, 2066, 2069, 2070, 2071, 2073,
1234 2074, 2074, 2076, 2076, 2076, 2078, 2077, 2079,
1235 2078, 2079, 2079, 2078, 2078, 2077, 2074, 2074,
1236 2073, 2074, 2070, 2068, 2070, 2069, 2067, 2067,
1237 2064, 2064, 2066, 2065, 2065, 2064, 2063, 2066,
1238 2066, 2066, 2064, 2065, 2067, 2065, 2067, 2068,
1239 2067, 2067, 2068, 2068, 2068, 2068, 2069, 2069,
1240 2071, 2071, 2072, 2075, 2076, 2076, 2076, 2076,
1241 2076, 2077, 2078, 2080, 2082, 2084, 2087, 2089,
1242 2090, 2091, 2091, 2093, 2091, 2093, 2097, 2097,
1243 2098, 2100, 2102, 2102, 2105, 2104, 2103, 2103,
1244 2105, 2105, 2111, 2112, 2109, 2111, 2111, 2110,
1245 2108, 2108, 2109, 2110, 2112, 2110, 2106, 2106,
1246 2106, 2106, 2101, 2102, 2103, 2101, 2098, 2098,
1247 2098, 2096, 2092, 2092, 2088, 2089, 2085, 2082,
1248 2081, 2077, 2074, 2069, 2068, 2062, 2058, 2057,
1249 2054, 2051, 2048, 2046, 2042, 2041, 2037, 2037,
1250 2031, 2026, 2026, 2021, 2018, 2015, 2011, 2006,
1251 2000, 1999, 1994, 1991, 1986, 1983, 1984, 1982,
1252 1980, 1978, 1978, 1977, 1976, 1975, 1973, 1974,
1253 1974, 1974, 1974, 1974, 1977, 1978, 1977, 1976,
1254 1976, 1977, 1976, 1978, 1981, 1982, 1980, 1983,
1255 1984, 1985, 1986, 1985, 1982, 1983, 1983, 1984,
1256 1984, 1987, 1984, 1983, 1984, 1980, 1979, 1984,
1257 1981, 1980, 1983, 1985, 1984, 1984, 1982, 1982,
1258 1987, 1987, 1986, 1992, 1989, 1989, 1998, 2001,
1259 2000, 2002, 2003, 2003, 2004, 2005, 2007, 2009,
1260 2010, 2010, 2013, 2013, 2014, 2014, 2016, 2021,
1261 2018, 2019, 2022, 2026, 2029, 2028, 2029, 2029,
1262 2033, 2034, 2032, 2035, 2035, 2035, 2038, 2039,
1263 2041, 2044, 2047, 2046, 2047, 2052, 2054, 2058,
1264 2059, 2058, 2060, 2063, 2065, 2068, 2067, 2069,
1265 2068, 2067, 2071, 2073, 2073, 2073, 2075, 2073,
1266 2071, 2069, 2072, 2072, 2072, 2073, 2072, 2067,
1267 2063, 2068, 2069, 2068, 2067, 2066, 2066, 2064,
1268 2065, 2064, 2063, 2061, 2061, 2059, 2061, 2061,
1269 2059, 2058, 2059, 2056, 2051, 2052, 2051, 2047,
1270 2045, 2042, 2039, 2041, 2041, 2036, 2035, 2032,
1271 2031, 2032, 2031, 2028, 2028, 2026, 2026, 2023,
1272 2022, 2021, 2022, 2022, 2020, 2019, 2016, 2018,
1273 2017, 2016, 2015, 2013, 2016, 2019, 2019, 2021,
1274 2023, 2024, 2025, 2027, 2029, 2030, 2033, 2032,
1275 2035, 2041, 2042, 2043, 2046, 2050, 2051, 2053,
1276 2057, 2056, 2058, 2055, 2056, 2056, 2054, 2051,
1277 2051, 2051, 2046, 2045, 2047, 2046, 2046, 2047,
1278 2046, 2043, 2044, 2041, 2041, 2040, 2040, 2041,
1279 2040, 2041, 2038, 2036, 2035, 2036, 2037, 2037,
1280 2034, 2035, 2033, 2030, 2030, 2029, 2029, 2028,
1281 2027, 2028, 2028, 2026, 2025, 2025, 2028, 2028,
1282 2030, 2031, 2031, 2033, 2038, 2039, 2040, 2042,
1283 2044, 2048, 2050, 2050, 2055, 2059, 2064, 2065,
1284 2068, 2071, 2074, 2076, 2076, 2080, 2086, 2085,
1285 2086, 2091, 2090, 2092, 2096, 2096, 2097, 2100,
1286 2103, 2105, 2103, 2104, 2104, 2106, 2107, 2106,
1287 2107, 2108, 2107, 2108, 2109, 2107, 2107, 2109,
1288 2107, 2108, 2105, 2103, 2102, 2101, 2101, 2101,
1289 2101, 2100, 2102, 2099, 2100, 2103, 2100, 2098,
1290 2095, 2096, 2091, 2088, 2087, 2087, 2086, 2084,
1291 2084, 2081, 2082, 2081, 2077, 2075, 2073, 2071,
1292 2069, 2067, 2067, 2067, 2066, 2065, 2068, 2068,
1293 2066, 2066, 2064, 2063, 2063, 2060, 2058, 2058,
1294 2057, 2057, 2057, 2055, 2051, 2048, 2049, 2047,
1295 2046, 2045, 2042, 2042, 2042, 2040, 2040, 2039,
1296 2038, 2034, 2032, 2032, 2032, 2031, 2029, 2029,
1297 2028, 2028, 2028, 2026, 2024, 2025, 2026, 2023,
1298 2024, 2024, 2023, 2023, 2020, 2021, 2020, 2021,
1299 2023, 2024, 2024, 2026, 2026, 2026, 2026, 2030,
1300 2028, 2030, 2032, 2034, 2032, 2032, 2032, 2034,
1301 2038, 2039, 2039, 2037, 2036, 2041, 2043, 2043,
1302 2044, 2046, 2050, 2052, 2046, 2045, 2048, 2051,
1303 2049, 2049, 2047, 2047, 2046, 2042, 2041, 2043,
1304 2040, 2040, 2045, 2045, 2043, 2043, 2038, 2040,
1305 2037, 2030, 2027, 2031, 2038, 2034, 2038, 2039,
1306 2033, 2032, 2032, 2028, 2029, 2035, 2037, 2038,
1307 2038, 2038, 2044, 2047, 2042, 2039, 2043, 2042,
1308 2044, 2048, 2048, 2051, 2051, 2056, 2058, 2058,
1309 2055, 2055, 2055, 2060, 2066, 2067, 2070, 2072,
1310 2074, 2069, 2069, 2070, 2070, 2074, 2076, 2074,
1311 2074, 2077, 2079, 2080, 2080, 2081, 2078, 2082,
1312 2084, 2084, 2086, 2086, 2087, 2081, 2087, 2090,
1313 2088, 2089, 2090, 2087, 2087, 2087, 2086, 2090,
1314 2094, 2090, 2088, 2093, 2093, 2091, 2090, 2089,
1315 2087, 2088, 2089, 2092, 2095, 2092, 2086, 2085,
1316 2085, 2085, 2088, 2087, 2084, 2078, 2075, 2078,
1317 2079, 2073, 2065, 2063, 2066, 2066, 2065, 2067,
1318 2063, 2056, 2060, 2062, 2060, 2059, 2062, 2057,
1319 2056, 2055, 2056, 2059, 2058, 2059, 2052, 2052,
1320 2054, 2054, 2057, 2055, 2053, 2055, 2056, 2054,
1321 2048, 2044, 2043, 2041, 2037, 2033, 2031, 2033,
1322 2035, 2035, 2030, 2025, 2024, 2025, 2028, 2024,
1323 2021, 2023, 2020, 2016, 2020, 2020, 2012, 2009,
1324 2015, 2019, 2021, 2019, 2015, 2018, 2017, 2012,
1325 2011, 2017, 2015, 2012, 2011, 2010, 2011, 2017,
1326 2018, 2014, 2013, 2015, 2011, 2006, 2006, 2005,
1327 2005, 2006, 2001, 2002, 2009, 2009, 2010, 2013,
1328 2017, 2021, 2019, 2020, 2024, 2025, 2028, 2029,
1329 2028, 2032, 2034, 2037, 2040, 2038, 2036, 2036,
1330 2040, 2039, 2034, 2034, 2033, 2027, 2030, 2033,
1331 2030, 2030, 2032, 2030, 2028, 2029, 2027, 2023,
1332 2022, 2022, 2017, 2018, 2021, 2020, 2017, 2014,
1333 2017, 2017, 2015, 2020, 2021, 2018, 2019, 2020,
1334 2021, 2019, 2017, 2017, 2018, 2021, 2021, 2021,
1335 2024, 2029, 2031, 2035, 2035, 2035, 2036, 2035,
1336 2038, 2043, 2047, 2048, 2046, 2043, 2045, 2047,
1337 2046, 2047, 2047, 2048, 2051, 2052, 2052, 2052,
1338 2052, 2051, 2052, 2050, 2045, 2047, 2050, 2048,
1339 2049, 2048, 2046, 2050, 2051, 2051, 2052, 2052,
1340 2055, 2056, 2056, 2055, 2060, 2061, 2057, 2061,
1341 2064, 2064, 2061, 2061, 2060, 2064, 2064, 2065,
1342 2068, 2067, 2066, 2066, 2067, 2069, 2070, 2068,
1343 2069, 2069, 2069, 2073, 2074, 2074, 2075, 2078,
1344 2082, 2081, 2079, 2084, 2088, 2086, 2085, 2088,
1345 2091, 2092, 2096, 2100, 2107, 2109, 2110, 2110,
1346 2113, 2112, 2110, 2114, 2116, 2116, 2116, 2115,
1347 2114, 2112, 2109, 2110, 2111, 2112, 2112, 2109,
1348 2108, 2108, 2111, 2113, 2113, 2111, 2109, 2107,
1349 2107, 2106, 2106, 2106, 2106, 2104, 2100, 2105,
1350 2105, 2101, 2104, 2104, 2104, 2103, 2098, 2096,
1351 2100, 2102, 2098, 2098, 2097, 2094, 2094, 2091,
1352 2089, 2090, 2091, 2091, 2087, 2086, 2086, 2086,
1353 2087, 2088, 2085, 2082, 2079, 2078, 2079, 2077,
1354 2079, 2077, 2078, 2078, 2077, 2078, 2083, 2083,
1355 2082, 2082, 2085, 2086, 2092, 2095, 2092, 2092,
1356 2096, 2096, 2100, 2102, 2103, 2106, 2108, 2106,
1357 2104, 2106, 2108, 2109, 2108, 2108, 2106, 2106,
1358 2103, 2103, 2105, 2103, 2102, 2099, 2098, 2101,
1359 2101, 2103, 2104, 2107, 2106, 2105, 2106, 2108,
1360 2108, 2107, 2107, 2106, 2109, 2111, 2108, 2107,
1361 2107, 2108, 2104, 2105, 2104, 2102, 2101, 2103,
1362 2107, 2103, 2101, 2099, 2096, 2097, 2098, 2098,
1363 2098, 2098, 2098, 2100, 2099, 2098, 2099, 2098,
1364 2098, 2100, 2102, 2099, 2098, 2096, 2095, 2097,
1365 2094, 2095, 2092, 2086, 2081, 2079, 2070, 2063,
1366 2053, 2046, 1902, 1613, 1570, 1719, 1812, 1882,
1367 1946, 1964, 1959, 1931, 1918, 1942, 1980, 2003,
1368 2025, 2040, 2049, 2063, 2059, 2053, 2062, 2086,
1369 2102, 2119, 2114, 2081, 2034, 2009, 2013, 2033,
1370 2068, 2109, 2134, 2126, 2096, 2053, 2007, 1980,
1371 1980, 2016, 2063, 2086, 2092, 2088, 2082, 2065,
1372 2051, 2037, 2030, 2040, 2056, 2065, 2048, 2026,
1373 2014, 2015, 2032, 2054, 2075, 2080, 2069, 2054,
1374 2031, 2011, 1994, 1982, 1987, 2005, 2030, 2055,
1375 2064, 2037, 1997, 1967, 1965, 1984, 2004, 2011,
1376 2007, 2002, 1993, 1985, 1985, 1984, 1985, 1988,
1377 1994, 1991, 1979, 1960, 1946, 1938, 1931, 1937,
1378 1952, 1972, 1984, 1979, 1953, 1927, 1909, 1894,
1379 1897, 1914, 1932, 1939, 1932, 1920, 1914, 1907,
1380 1913, 1933, 1944, 1937, 1933, 1935, 1925, 1916,
1381 1909, 1909, 1918, 1936, 1954, 1958, 1953, 1941,
1382 1927, 1914, 1908, 1925, 1941, 1949, 1955, 1954,
1383 1950, 1946, 1940, 1929, 1926, 1929, 1937, 1945,
1384 1950, 1942, 1932, 1925, 1928, 1940, 1947, 1950,
1385 1951, 1947, 1937, 1924, 1922, 1928, 1931, 1939,
1386 1947, 1950, 1948, 1941, 1938, 1932, 1927, 1924,
1387 1926, 1929, 1929, 1931, 1928, 1915, 1909, 1906,
1388 1909, 1914, 1919, 1921, 1919, 1912, 1903, 1897,
1389 1899, 1901, 1906, 1909, 1901, 1896, 1897, 1896,
1390 1893, 1887, 1880, 1884, 1884, 1878, 1878, 1881,
1391 1875, 1866, 1863, 1854, 1852, 1860, 1865, 1861,
1392 1853, 1859, 1865, 1865, 1858, 1859, 1858, 1853,
1393 1852, 1849, 1848, 1846, 1845, 1841, 1830, 1820,
1394 1827, 1834, 1827, 1828, 1826, 1806, 1804, 1805,
1395 1806, 1818, 1818, 1813, 1814, 1808, 1804, 1806,
1396 1813, 1816, 1820, 1821, 1816, 1815, 1813, 1814,
1397 1818, 1823, 1831, 1841, 1844, 1831, 1825, 1825,
1398 1821, 1826, 1827, 1827, 1831, 1836, 1841, 1840,
1399 1830, 1834, 1843, 1845, 1851, 1855, 1849, 1842,
1400 1839, 1838, 1837, 1841, 1841, 1842, 1842, 1836,
1401 1830, 1826, 1830, 1842, 1846, 1855, 1864, 1860,
1402 1859, 1857, 1850, 1853, 1859, 1858, 1862, 1867,
1403 1868, 1862, 1850, 1842, 1842, 1839, 1847, 1864,
1404 1870, 1869, 1870, 1862, 1850, 1842, 1846, 1856,
1405 1859, 1866, 1870, 1866, 1857, 1847, 1844, 1848,
1406 1858, 1863, 1863, 1861, 1856, 1853, 1858, 1867,
1407 1873, 1883, 1889, 1892, 1891, 1885, 1884, 1886,
1408 1891, 1904, 1919, 1925, 1924, 1919, 1911, 1904,
1409 1894, 1894, 1904, 1915, 1927, 1936, 1937, 1936,
1410 1926, 1918, 1920, 1926, 1931, 1938, 1937, 1935,
1411 1936, 1946, 1958, 1962, 1965, 1963, 1953, 1950,
1412 1947, 1935, 1923, 1914, 1911, 1914, 1925, 1931,
1413 1933, 1934, 1927, 1923, 1921, 1926, 1926, 1924,
1414 1929, 1938, 1952, 1956, 1956, 1959, 1957, 1960,
1415 1964, 1958, 1946, 1947, 1953, 1960, 1969, 1977,
1416 1983, 1981, 1975, 1965, 1955, 1948, 1937, 1921,
1417 1916, 1922, 1931, 1945, 1954, 1960, 1957, 1944,
1418 1927, 1922, 1923, 1925, 1929, 1932, 1943, 1952,
1419 1960, 1958, 1953, 1953, 1939, 1914, 1901, 1887,
1420 1880, 1878, 1878, 1883, 1881, 1882, 1888, 1896,
1421 1895, 1879, 1864, 1846, 1829, 1831, 1842, 1846,
1422 1851, 1867, 1873, 1866, 1852, 1838, 1834, 1833,
1423 1831, 1828, 1823, 1820, 1829, 1836, 1838, 1838,
1424 1837, 1827, 1814, 1801, 1801, 1802, 1797, 1797,
1425 1814, 1830, 1837, 1844, 1847, 1840, 1830, 1818,
1426 1803, 1797, 1801, 1811, 1823, 1838, 1837, 1823,
1427 1810, 1798, 1783, 1765, 1744, 1723, 1708, 1701,
1428 1701, 1715, 1728, 1737, 1731, 1725, 1723, 1719,
1429 1700, 1679, 1672, 1671, 1668, 1672, 1678, 1683,
1430 1692, 1698, 1695, 1684, 1671, 1662, 1660, 1653,
1431 1641, 1639, 1644, 1657, 1672, 1668, 1647, 1632,
1432 1626, 1617, 1598, 1584, 1588, 1597, 1603, 1613,
1433 1622, 1621, 1614, 1606, 1600, 1592, 1575, 1551,
1434 1537, 1531, 1525, 1531, 1557, 1573, 1574, 1571,
1435 1571, 1568, 1558, 1561, 1554, 1538, 1531, 1539,
1436 1553, 1560, 1558, 1547, 1531, 1511, 1498, 1493,
1437 1491, 1500, 1509, 1508, 1505, 1502, 1505, 1519,
1438 1531, 1527, 1524, 1529, 1524, 1513, 1517, 1521,
1439 1527, 1547, 1569, 1592, 1598, 1587, 1569, 1553,
1440 1538, 1528, 1531, 1538, 1540, 1540, 1544, 1552,
1441 1552, 1552, 1551, 1557, 1560, 1557, 1557, 1550,
1442 1535, 1513, 1493, 1501, 1524, 1536, 1543, 1542,
1443 1534, 1531, 1533, 1544, 1568, 1596, 1616, 1636,
1444 1653, 1658, 1654, 1647, 1641, 1634, 1637, 1632,
1445 1630, 1634, 1634, 1637, 1639, 1639, 1650, 1674,
1446 1689, 1687, 1672, 1663, 1647, 1635, 1646, 1661,
1447 1680, 1707, 1728, 1731, 1732, 1727, 1710, 1702,
1448 1711, 1730, 1758, 1770, 1772, 1779, 1778, 1776,
1449 1793, 1811, 1815, 1822, 1828, 1821, 1811, 1809,
1450 1812, 1828, 1852, 1871, 1891, 1899, 1881, 1856,
1451 1837, 1828, 1834, 1853, 1882, 1912, 1930, 1936,
1452 1931, 1924, 1934, 1962, 1991, 2007, 2007, 2003,
1453 2001, 1999, 2015, 2038, 2066, 2093, 2112, 2120,
1454 2119, 2112, 2104, 2106, 2123, 2136, 2155, 2178,
1455 2195, 2188, 2162, 2145, 2144, 2148, 2160, 2180,
1456 2194, 2201, 2196, 2189, 2186, 2197, 2213, 2233,
1457 2243, 2238, 2230, 2217, 2201, 2203, 2216, 2232,
1458 2251, 2267, 2278, 2283, 2276, 2258, 2252, 2264,
1459 2279, 2294, 2304, 2302, 2293, 2283, 2277, 2285,
1460 2302, 2315, 2320, 2313, 2309, 2311, 2316, 2322,
1461 2334, 2349, 2359, 2368, 2381, 2390, 2384, 2377,
1462 2381, 2404, 2430, 2449, 2464, 2479, 2481, 2471,
1463 2475, 2491, 2510, 2524, 2528, 2524, 2520, 2516,
1464 2523, 2539, 2550, 2559, 2572, 2582, 2583, 2579,
1465 2573, 2570, 2572, 2574, 2581, 2589, 2600, 2610,
1466 2602, 2594, 2596, 2610, 2629, 2641, 2642, 2638,
1467 2643, 2648, 2652, 2660, 2672, 2683, 2682, 2682,
1468 2692, 2700, 2699, 2703, 2715, 2721, 2724, 2734,
1469 2740, 2740, 2732, 2726, 2729, 2733, 2731, 2725,
1470 2721, 2722, 2718, 2708, 2703, 2707, 2714, 2720,
1471 2722, 2722, 2719, 2708, 2701, 2698, 2693, 2686,
1472 2679, 2678, 2676, 2676, 2672, 2671, 2663, 2648,
1473 2632, 2620, 2614, 2615, 2617, 2616, 2611, 2609,
1474 2603, 2592, 2586, 2587, 2590, 2594, 2590, 2584,
1475 2574, 2561, 2548, 2534, 2522, 2511, 2503, 2503,
1476 2501, 2496, 2488, 2488, 2486, 2484, 2492, 2504,
1477 2499, 2484, 2478, 2474, 2467, 2461, 2458, 2456,
1478 2449, 2438, 2429, 2426, 2422, 2413, 2404, 2394,
1479 2387, 2390, 2392, 2392, 2389, 2382, 2375, 2372,
1480 2367, 2355, 2347, 2346, 2344, 2340, 2333, 2325,
1481 2317, 2313, 2307, 2303, 2307, 2305, 2297, 2292,
1482 2288, 2282, 2280, 2282, 2289, 2295, 2298, 2289,
1483 2276, 2262, 2254, 2253, 2254, 2252, 2249, 2246,
1484 2234, 2221, 2213, 2214, 2208, 2198, 2192, 2194,
1485 2190, 2179, 2169, 2167, 2166, 2167, 2167, 2163,
1486 2155, 2144, 2133, 2130, 2130, 2127, 2123, 2124,
1487 2124, 2120, 2120, 2116, 2112, 2114, 2116, 2103,
1488 2083, 2074, 2068, 2068, 2069, 2079, 2093, 2098,
1489 2089, 2085, 2088, 2090, 2084, 2075, 2074, 2075,
1490 2079, 2081, 2079, 2075, 2076, 2086, 2096, 2099,
1491 2104, 2107, 2109, 2112, 2112, 2111, 2113, 2119,
1492 2123, 2128, 2131, 2130, 2123, 2117, 2118, 2120,
1493 2125, 2128, 2134, 2135, 2139, 2137, 2131, 2126,
1494 2123, 2127, 2127, 2126, 2121, 2119, 2114, 2115,
1495 2118, 2121, 2123, 2123, 2123, 2119, 2113, 2110,
1496 2107, 2102, 2102, 2105, 2109, 2109, 2099, 2085,
1497 2077, 2076, 2081, 2087, 2097, 2101, 2102, 2103,
1498 2104, 2103, 2104, 2108, 2111, 2112, 2111, 2109,
1499 2106, 2100, 2097, 2095, 2089, 2094, 2094, 2085,
1500 2074, 2067, 2058, 2053, 2056, 2058, 2056, 2052,
1501 2044, 2038, 2030, 2023, 2024, 2027, 2028, 2026,
1502 2019, 2015, 2020, 2022, 2020, 2013, 2013, 2010,
1503 2005, 2005, 2007, 2009, 2017, 2019, 2020, 2020,
1504 2021, 2021, 2019, 2015, 2019, 2023, 2031, 2039,
1505 2044, 2046, 2042, 2041, 2039, 2042, 2039, 2034,
1506 2030, 2025, 2019, 2020, 2022, 2026, 2028, 2026,
1507 2017, 2007, 1996, 1983, 1981, 1984, 1984, 1976,
1508 1973, 1974, 1966, 1953, 1947, 1948, 1947, 1943,
1509 1933, 1922, 1911, 1905, 1911, 1918, 1924, 1934,
1510 1942, 1938, 1933, 1927, 1928, 1932, 1937, 1950,
1511 1960, 1963, 1961, 1960, 1964, 1962, 1959, 1963,
1512 1964, 1956, 1946, 1936, 1935, 1931, 1925, 1926,
1513 1935, 1935, 1927, 1914, 1905, 1899, 1901, 1907,
1514 1910, 1912, 1910, 1908, 1908, 1909, 1914, 1918,
1515 1917, 1912, 1909, 1911, 1909, 1905, 1909, 1921,
1516 1931, 1936, 1938, 1940, 1942, 1937, 1934, 1926,
1517 1929, 1948, 1961, 1960, 1960, 1963, 1963, 1957,
1518 1954, 1955, 1955, 1953, 1950, 1948, 1953, 1959,
1519 1956, 1945, 1945, 1952, 1951, 1941, 1929, 1923,
1520 1926, 1931, 1933, 1940, 1959, 1969, 1961, 1949,
1521 1948, 1956, 1955, 1955, 1952, 1952, 1957, 1961,
1522 1968, 1977, 1986, 1991, 1985, 1987, 1991, 1988,
1523 1989, 1996, 2004, 2010, 2019, 2036, 2048, 2048,
1524 2044, 2041, 2040, 2048, 2062, 2075, 2078, 2074,
1525 2080, 2092, 2105, 2118, 2129, 2129, 2123, 2130,
1526 2141, 2144, 2148, 2163, 2173, 2168, 2169, 2179,
1527 2187, 2187, 2182, 2179, 2178, 2183, 2181, 2182,
1528 2190, 2202, 2204, 2195, 2194, 2196, 2198, 2197,
1529 2193, 2187, 2186, 2189, 2192, 2196, 2199, 2201,
1530 2198, 2196, 2201, 2201, 2196, 2191, 2193, 2202,
1531 2216, 2225, 2226, 2224, 2223, 2229, 2231, 2231,
1532 2236, 2241, 2242, 2240, 2251, 2260, 2265, 2267,
1533 2277, 2277, 2271, 2278, 2290, 2294, 2292, 2293,
1534 2301, 2308, 2320, 2332, 2339, 2336, 2327, 2320,
1535 2330, 2349, 2359, 2361, 2361, 2364, 2361, 2366,
1536 2371, 2378, 2380, 2379, 2374, 2367, 2367, 2370,
1537 2375, 2376, 2373, 2374, 2376, 2366, 2361, 2363,
1538 2362, 2358, 2354, 2351, 2355, 2360, 2359, 2361,
1539 2364, 2368, 2372, 2374, 2376, 2378, 2382, 2385,
1540 2393, 2400, 2400, 2393, 2394, 2399, 2399, 2397,
1541 2397, 2398, 2399, 2399, 2406, 2415, 2414, 2408,
1542 2402, 2405, 2408, 2405, 2404, 2404, 2404, 2410,
1543 2414, 2417, 2423, 2419, 2419, 2420, 2418, 2420,
1544 2423, 2423, 2420, 2424, 2421, 2420, 2426, 2431,
1545 2429, 2423, 2417, 2413, 2413, 2413, 2420, 2425,
1546 2424, 2424, 2419, 2416, 2417, 2422, 2418, 2420,
1547 2423, 2423, 2422, 2426, 2436, 2441, 2442, 2444,
1548 2446, 2446, 2442, 2443, 2446, 2449, 2446, 2445,
1549 2449, 2454, 2459, 2457, 2453, 2451, 2448, 2443,
1550 2441, 2445, 2447, 2449, 2450, 2452, 2455, 2459,
1551 2457, 2451, 2444, 2439, 2439, 2441, 2448, 2453,
1552 2455, 2462, 2468, 2471, 2476, 2482, 2486, 2490,
1553 2486, 2488, 2493, 2500, 2511, 2517, 2520, 2518,
1554 2521, 2526, 2525, 2521, 2528, 2539, 2545, 2547,
1555 2554, 2562, 2568, 2573, 2578, 2581, 2586, 2592,
1556 2596, 2600, 2607, 2612, 2619, 2631, 2639, 2641,
1557 2639, 2635, 2634, 2639, 2647, 2647, 2645, 2651,
1558 2650, 2649, 2646, 2635, 2628, 2628, 2627, 2621,
1559 2614, 2604, 2593, 2591, 2596, 2601, 2595, 2588,
1560 2590, 2587, 2578, 2579, 2585, 2590, 2589, 2587,
1561 2589, 2587, 2581, 2582, 2583, 2578, 2572, 2576,
1562 2576, 2578, 2577, 2576, 2577, 2580, 2584, 2586,
1563 2588, 2583, 2581, 2587, 2588, 2585, 2591, 2602,
1564 2605, 2607, 2607, 2609, 2611, 2612, 2614, 2615,
1565 2615, 2610, 2610, 2610, 2608, 2608, 2609, 2611,
1566 2600, 2591, 2593, 2592, 2589, 2582, 2575, 2572,
1567 2572, 2567, 2562, 2557, 2553, 2541, 2532, 2534,
1568 2534, 2530, 2529, 2526, 2522, 2518, 2512, 2504,
1569 2507, 2514, 2506, 2494, 2493, 2495, 2490, 2485,
1570 2487, 2489, 2483, 2470, 2468, 2471, 2471, 2468,
1571 2465, 2458, 2454, 2449, 2444, 2438, 2429, 2418,
1572 2416, 2412, 2408, 2404, 2394, 2395, 2395, 2384,
1573 2376, 2369, 2365, 2359, 2350, 2343, 2343, 2339,
1574 2331, 2330, 2324, 2320, 2315, 2303, 2295, 2292,
1575 2289, 2281, 2279, 2276, 2273, 2268, 2266, 2264,
1576 2259, 2251, 2248, 2244, 2242, 2238, 2234, 2231,
1577 2231, 2223, 2218, 2218, 2221, 2217, 2209, 2205,
1578 2201, 2200, 2199, 2202, 2205, 2207, 2203, 2202,
1579 2201, 2198, 2195, 2195, 2194, 2192, 2191, 2194,
1580 2196, 2200, 2199, 2202, 2200, 2199, 2196, 2197,
1581 2203, 2201, 2202, 2204, 2207, 2208, 2211, 2216,
1582 2215, 2214, 2212, 2213, 2217, 2223, 2227, 2230,
1583 2236, 2239, 2248, 2254, 2258, 2263, 2269, 2277,
1584 2286, 2300, 2315, 2331, 2342, 2355, 2371, 2385,
1585 2398, 2413, 2430, 2443, 2458, 2473, 2486, 2497,
1586 2512, 2523, 2529, 2533, 2538, 2542, 2546, 2549,
1587 2553, 2559, 2564, 2564, 2560, 2563, 2559, 2552,
1588 2548, 2546, 2545, 2540, 2540, 2541, 2537, 2539,
1589 2544, 2542, 2536, 2531, 2532, 2528, 2522, 2519,
1590 2516, 2524, 2527, 2527, 2531, 2536, 2536, 2532,
1591 2531, 2539, 2544, 2544, 2545, 2553, 2564, 2570,
1592 2571, 2571, 2573, 2574, 2578, 2587, 2595, 2598,
1593 2603, 2610, 2618, 2628, 2632, 2640, 2652, 2653,
1594 2650, 2652, 2655, 2660, 2671, 2676, 2681, 2691,
1595 2688, 2681, 2687, 2690, 2696, 2699, 2698, 2704,
1596 2709, 2706, 2708, 2717, 2717, 2711, 2710, 2709,
1597 2710, 2704, 2696, 2691, 2681, 2675, 2668, 2654,
1598 2634, 2608, 2581, 2560, 2539, 2511, 2479, 2446,
1599 2408, 2367, 2330, 2289, 2248, 2195, 2139, 2091,
1600 2037, 1980, 1927, 1871, 1817, 1766, 1716, 1665,
1601 1613, 1558, 1507, 1465, 1427, 1394, 1363, 1339,
1602 1315, 1291, 1276, 1266, 1257, 1252, 1253, 1260,
1603 1271, 1279, 1294, 1316, 1338, 1365, 1393, 1420,
1604 1443, 1471, 1502, 1534, 1568, 1599, 1629, 1655,
1605 1681, 1709, 1734, 1755, 1774, 1789, 1803, 1818,
1606 1828, 1841, 1851, 1855, 1859, 1862, 1864, 1869,
1607 1868, 1860, 1856, 1850, 1845, 1842, 1837, 1832,
1608 1824, 1818, 1807, 1802, 1794, 1792, 1786, 1778,
1609 1773, 1767, 1767, 1769, 1772, 1773, 1772, 1773,
1610 1777, 1782, 1788, 1799, 1816, 1836, 1857, 1880,
1611 1905, 1928, 1951, 1974, 2000, 2027, 2055, 2085,
1612 2120, 2149, 2179, 2208, 2240, 2272, 2298, 2323,
1613 2347, 2371, 2397, 2422, 2446, 2467, 2487, 2501,
1614 2516, 2532, 2544, 2550, 2557, 2561, 2567, 2575,
1615 2578, 2578, 2579, 2580, 2583, 2585, 2585, 2586,
1616 2587, 2585, 2582, 2590, 2595, 2599, 2601, 2602,
1617 2608, 2619, 2631, 2635, 2642, 2649, 2660, 2669,
1618 2683, 2704, 2721, 2739, 2755, 2769, 2791, 2811,
1619 2829, 2849, 2870, 2888, 2909, 2931, 2948, 2968,
1620 2989, 3004, 3031, 3052, 3063, 3069, 3081, 3095,
1621 3102, 3097, 3073, 3042, 3007, 2964, 2919, 2869,
1622 2814, 2755, 2694, 2634, 2584, 2535, 2473, 2404,
1623 2319, 2222, 2138, 2079, 2021, 1957, 1890, 1819,
1624 1758, 1713, 1675, 1641, 1610, 1569, 1526, 1500,
1625 1493, 1504, 1519, 1531, 1548, 1567, 1587, 1608,
1626 1634, 1661, 1680, 1704, 1738, 1782, 1844, 1901,
1627 1949, 1987, 2025, 2062, 2095, 2129, 2158, 2179,
1628 2192, 2209, 2225, 2246, 2277, 2294, 2301, 2296,
1629 2281, 2267, 2259, 2260, 2268, 2267, 2258, 2245,
1630 2229, 2214, 2201, 2187, 2168, 2145, 2119, 2090,
1631 2065, 2040, 2013, 1981, 1950, 1932, 1907, 1860,
1632 1805, 1751, 1700, 1661, 1626, 1591, 1554, 1504,
1633 1442, 1388, 1340, 1296, 1263, 1237, 1213, 1194,
1634 1173, 1159, 1154, 1154, 1160, 1173, 1190, 1202,
1635 1210, 1213, 1242, 1277, 1318, 1370, 1421, 1473,
1636 1517, 1558, 1603, 1657, 1711, 1762, 1812, 1857,
1637 1895, 1926, 1956, 1985, 2009, 2027, 2039, 2044,
1638 2042, 2038, 2037, 2039, 2047, 2055, 2057, 2049,
1639 2030, 2008, 1990, 1981, 1974, 1971, 1966, 1957,
1640 1949, 1943, 1944, 1953, 1964, 1979, 1986, 1991,
1641 2002, 2018, 2040, 2069, 2099, 2130, 2163, 2189,
1642 2212, 2233, 2261, 2297, 2338, 2381, 2416, 2454,
1643 2493, 2537, 2578, 2621, 2664, 2701, 2730, 2753,
1644 2776, 2805, 2841, 2877, 2914, 2940, 2961, 2975,
1645 2984, 2993, 3008, 3028, 3044, 3054, 3055, 3054,
1646 3058, 3063, 3072, 3080, 3086, 3082, 3074, 3069,
1647 3070, 3078, 3094, 3116, 3134, 3147, 3155, 3161,
1648 3171, 3185, 3203, 3222, 3235, 3235, 3229, 3218,
1649 3210, 3205, 3190, 3171, 3144, 3109, 3055, 3002,
1650 2953, 2902, 2840, 2760, 2669, 2559, 2445, 2337,
1651 2236, 2132, 2031, 1930, 1828, 1731, 1635, 1546,
1652 1473, 1410, 1352, 1298, 1258, 1226, 1205, 1195,
1653 1206, 1238, 1269, 1305, 1354, 1404, 1461, 1534,
1654 1624, 1727, 1839, 1952, 2056, 2159, 2258, 2362,
1655 2465, 2569, 2668, 2751, 2819, 2882, 2944, 3005,
1656 3063, 3111, 3143, 3152, 3148, 3135, 3115, 3092,
1657 3068, 3039, 2996, 2942, 2881, 2812, 2744, 2679,
1658 2611, 2549, 2481, 2412, 2346, 2283, 2230, 2185,
1659 2142, 2090, 2025, 1945, 1869, 1809, 1762, 1720,
1660 1681, 1633, 1574, 1519, 1480, 1451, 1427, 1397,
1661 1363, 1325, 1286, 1258, 1241, 1236, 1234, 1229,
1662 1226, 1224, 1222, 1220, 1230, 1252, 1284, 1329,
1663 1379, 1436, 1490, 1540, 1591, 1652, 1720, 1787,
1664 1850, 1907, 1961, 2016, 2078, 2145, 2213, 2274,
1665 2319, 2349, 2369, 2380, 2387, 2400, 2411, 2407,
1666 2392, 2366, 2329, 2292, 2255, 2225, 2192, 2149,
1667 2101, 2046, 1995, 1956, 1932, 1913, 1897, 1880,
1668 1851, 1825, 1806, 1799, 1808, 1830, 1854, 1880,
1669 1905, 1935, 1978, 2031, 2093, 2154, 2209, 2259,
1670 2315, 2369, 2428, 2497, 2564, 2630, 2685, 2733,
1671 2777, 2822, 2862, 2904, 2943, 2976, 3003, 3026,
1672 3043, 3062, 3076, 3079, 3077, 3076, 3075, 3063,
1673 3048, 3035, 3029, 3022, 3021, 3021, 3020, 3012,
1674 3004, 3001, 2998, 3004, 3013, 3022, 3031, 3035,
1675 3038, 3044, 3054, 3058, 3057, 3050, 3036, 3019,
1676 2998, 2976, 2955, 2925, 2883, 2829, 2770, 2691,
1677 2600, 2506, 2403, 2296, 2176, 2054, 1938, 1819,
1678 1703, 1592, 1488, 1383, 1281, 1183, 1096, 1024,
1679 961, 917, 890, 874, 873, 880, 901, 937,
1680 983, 1040, 1112, 1195, 1283, 1390, 1504, 1623,
1681 1753, 1883, 2011, 2131, 2245, 2356, 2464, 2566,
1682 2664, 2752, 2833, 2906, 2968, 3010, 3039, 3068,
1683 3070, 3054, 3033, 3002, 2960, 2908, 2853, 2792,
1684 2724, 2645, 2564, 2476, 2380, 2289, 2199, 2116,
1685 2039, 1969, 1899, 1839, 1780, 1722, 1670, 1626,
1686 1585, 1544, 1503, 1462, 1412, 1370, 1340, 1320,
1687 1299, 1272, 1252, 1224, 1193, 1168, 1156, 1155,
1688 1152, 1147, 1140, 1129, 1116, 1113, 1115, 1130,
1689 1143, 1146, 1152, 1169, 1187, 1215, 1258, 1301,
1690 1345, 1385, 1428, 1469, 1511, 1555, 1611, 1669,
1691 1716, 1761, 1802, 1841, 1880, 1920, 1959, 1995,
1692 2024, 2045, 2060, 2069, 2073, 2071, 2067, 2057,
1693 2039, 2006, 1965, 1921, 1879, 1835, 1799, 1764,
1694 1727, 1688, 1654, 1621, 1596, 1575, 1562, 1556,
1695 1549, 1545, 1545, 1557, 1578, 1610, 1654, 1700,
1696 1752, 1808, 1869, 1935, 2007, 2089, 2173, 2253,
1697 2327, 2396, 2458, 2518, 2580, 2640, 2694, 2739,
1698 2772, 2798, 2824, 2852, 2878, 2901, 2925, 2935,
1699 2940, 2938, 2935, 2931, 2927, 2927, 2921, 2911,
1700 2897, 2881, 2866, 2861, 2861, 2860, 2860, 2859,
1701 2858, 2855, 2858, 2860, 2863, 2864, 2863, 2856,
1702 2841, 2817, 2798, 2777, 2750, 2716, 2676, 2629,
1703 2570, 2498, 2413, 2325, 2232, 2122, 2010, 1907,
1704 1791, 1673, 1558, 1448, 1348, 1253, 1159, 1073,
1705 993, 920, 863, 823, 799, 791, 793, 806,
1706 836, 870, 913, 973, 1048, 1135, 1229, 1332,
1707 1440, 1556, 1679, 1806, 1939, 2067, 2184, 2295,
1708 2398, 2490, 2579, 2663, 2733, 2800, 2849, 2882,
1709 2903, 2910, 2900, 2880, 2851, 2810, 2755, 2692,
1710 2623, 2550, 2473, 2393, 2308, 2220, 2127, 2035,
1711 1944, 1859, 1783, 1713, 1649, 1596, 1549, 1509,
1712 1478, 1445, 1415, 1385, 1360, 1340, 1317, 1291,
1713 1271, 1259, 1243, 1229, 1219, 1212, 1199, 1181,
1714 1170, 1164, 1165, 1161, 1158, 1156, 1153, 1149,
1715 1150, 1159, 1173, 1185, 1196, 1212, 1236, 1264,
1716 1297, 1339, 1383, 1424, 1464, 1507, 1547, 1584,
1717 1627, 1668, 1711, 1747, 1781, 1813, 1845, 1872,
1718 1901, 1928, 1947, 1958, 1964, 1965, 1962, 1954,
1719 1943, 1927, 1906, 1875, 1838, 1802, 1770, 1737,
1720 1702, 1671, 1644, 1620, 1597, 1577, 1565, 1556,
1721 1550, 1547, 1549, 1557, 1572, 1587, 1610, 1645,
1722 1686, 1734, 1786, 1845, 1906, 1973, 2045, 2126,
1723 2209, 2289, 2365, 2435, 2502, 2571, 2632, 2690,
1724 2745, 2789, 2826, 2859, 2890, 2916, 2935, 2955,
1725 2975, 2991, 2997, 2994, 2989, 2977, 2966, 2959,
1726 2952, 2949, 2937, 2913, 2888, 2865, 2848, 2834,
1727 2820, 2794, 2762, 2729, 2699, 2671, 2644, 2619,
1728 2584, 2538, 2488, 2428, 2368, 2301, 2224, 2142,
1729 2053, 1956, 1853, 1754, 1662, 1572, 1481, 1390,
1730 1308, 1226, 1147, 1074, 1012, 962, 921, 893,
1731 877, 865, 870, 889, 924, 970, 1024, 1086,
1732 1153, 1230, 1315, 1407, 1510, 1618, 1729, 1841,
1733 1944, 2043, 2141, 2233, 2319, 2402, 2475, 2538,
1734 2598, 2649, 2685, 2714, 2732, 2734, 2725, 2703,
1735 2663, 2611, 2549, 2481, 2415, 2348, 2276, 2196,
1736 2114, 2031, 1949, 1867, 1792, 1723, 1661, 1605,
1737 1552, 1505, 1468, 1436, 1411, 1383, 1352, 1314,
1738 1281, 1252, 1236, 1221, 1201, 1186, 1171, 1157,
1739 1149, 1149, 1146, 1136, 1132, 1127, 1123, 1124,
1740 1135, 1145, 1155, 1163, 1160, 1169, 1187, 1210,
1741 1238, 1273, 1311, 1355, 1404, 1452, 1503, 1550,
1742 1598, 1647, 1691, 1729, 1764, 1798, 1828, 1857,
1743 1885, 1910, 1928, 1939, 1953, 1964, 1968, 1963,
1744 1955, 1941, 1919, 1892, 1865, 1834, 1804, 1772,
1745 1731, 1695, 1659, 1627, 1603, 1584, 1566, 1557,
1746 1554, 1551, 1552, 1560, 1580, 1595, 1617, 1646,
1747 1679, 1724, 1772, 1825, 1882, 1938, 1994, 2063,
1748 2135, 2205, 2276, 2347, 2419, 2491, 2564, 2640,
1749 2709, 2770, 2815, 2857, 2897, 2932, 2966, 2993,
1750 3017, 3035, 3045, 3052, 3059, 3067, 3068, 3072,
1751 3071, 3054, 3030, 3006, 2988, 2967, 2945, 2926,
1752 2897, 2854, 2807, 2758, 2711, 2665, 2621, 2573,
1753 2512, 2443, 2366, 2289, 2212, 2128, 2034, 1924,
1754 1801, 1677, 1567, 1465, 1369, 1283, 1202, 1126,
1755 1051, 982, 931, 896, 866, 842, 835, 845,
1756 865, 900, 951, 1014, 1086, 1160, 1242, 1332,
1757 1430, 1535, 1650, 1772, 1896, 2020, 2142, 2253,
1758 2352, 2438, 2514, 2578, 2632, 2675, 2708, 2731,
1759 2748, 2755, 2752, 2738, 2707, 2660, 2601, 2531,
1760 2453, 2371, 2289, 2206, 2121, 2038, 1951, 1867,
1761 1784, 1701, 1624, 1556, 1497, 1452, 1413, 1382,
1762 1366, 1357, 1345, 1330, 1316, 1299, 1272, 1237,
1763 1203, 1181, 1167, 1153, 1142, 1134, 1123, 1102,
1764 1086, 1080, 1077, 1072, 1067, 1071, 1079, 1087,
1765 1099, 1120, 1149, 1174, 1197, 1227, 1260, 1301,
1766 1348, 1402, 1464, 1528, 1587, 1642, 1694, 1739,
1767 1779, 1814, 1845, 1873, 1894, 1913, 1928, 1946,
1768 1962, 1974, 1982, 1978, 1964, 1939, 1912, 1883,
1769 1856, 1827, 1793, 1758, 1719, 1677, 1640, 1610,
1770 1583, 1561, 1542, 1537, 1538, 1546, 1567, 1592,
1771 1623, 1659, 1689, 1718, 1751, 1791, 1831, 1877,
1772 1930, 1990, 2051, 2110, 2172, 2236, 2297, 2353,
1773 2402, 2449, 2495, 2541, 2584, 2619, 2648, 2671,
1774 2693, 2711, 2727, 2742, 2753, 2769, 2782, 2803,
1775 2829, 2851, 2878, 2904, 2927, 2941, 2950, 2951,
1776 2942, 2928, 2917, 2901, 2876, 2843, 2803, 2766,
1777 2714, 2660, 2605, 2539, 2459, 2361, 2250, 2134,
1778 2021, 1900, 1768, 1634, 1507, 1377, 1254, 1147,
1779 1050, 960, 877, 803, 754, 726, 703, 690,
1780 699, 722, 757, 805, 874, 956, 1044, 1134,
1781 1238, 1357, 1481, 1608, 1737, 1864, 1991, 2113,
1782 2225, 2328, 2418, 2488, 2545, 2587, 2618, 2635,
1783 2642, 2639, 2620, 2592, 2552, 2505, 2447, 2375,
1784 2296, 2214, 2126, 2035, 1947, 1857, 1771, 1686,
1785 1604, 1532, 1471, 1415, 1371, 1338, 1316, 1304,
1786 1307, 1318, 1330, 1339, 1343, 1344, 1338, 1328,
1787 1319, 1297, 1262, 1225, 1196, 1172, 1148, 1120,
1788 1093, 1068, 1037, 1005, 987, 976, 965, 949,
1789 943, 942, 943, 953, 976, 1006, 1038, 1073,
1790 1118, 1173, 1236, 1308, 1381, 1456, 1531, 1599,
1791 1659, 1718, 1767, 1807, 1843, 1878, 1908, 1926,
1792 1936, 1943, 1945, 1941, 1934, 1917, 1890, 1851,
1793 1806, 1761, 1719, 1673, 1624, 1579, 1538, 1496,
1794 1460, 1442, 1435, 1437, 1447, 1467, 1499, 1536,
1795 1581, 1632, 1683, 1737, 1795, 1853, 1914, 1979,
1796 2042, 2105, 2168, 2238, 2308, 2369, 2428, 2482,
1797 2533, 2582, 2623, 2661, 2688, 2700, 2712, 2724,
1798 2733, 2739, 2735, 2729, 2724, 2719, 2718, 2734,
1799 2756, 2772, 2784, 2800, 2822, 2836, 2839, 2823,
1800 2803, 2780, 2749, 2714, 2676, 2636, 2582, 2508,
1801 2439, 2379, 2307, 2207, 2097, 1977, 1841, 1695,
1802 1563, 1455, 1351, 1237, 1117, 1015, 923, 843,
1803 781, 739, 709, 686, 675, 696, 742, 803,
1804 874, 961, 1055, 1146, 1237, 1334, 1440, 1562,
1805 1693, 1830, 1968, 2097, 2218, 2322, 2415, 2498,
1806 2564, 2606, 2631, 2638, 2623, 2603, 2579, 2547,
1807 2506, 2451, 2371, 2276, 2176, 2077, 1988, 1900,
1808 1818, 1734, 1648, 1571, 1500, 1429, 1366, 1308,
1809 1252, 1206, 1176, 1163, 1164, 1186, 1215, 1244,
1810 1267, 1279, 1285, 1271, 1246, 1230, 1216, 1196,
1811 1172, 1147, 1109, 1061, 1018, 988, 970, 944,
1812 908, 878, 858, 847, 850, 874, 915, 942,
1813 958, 979, 1013, 1060, 1118, 1193, 1280, 1361,
1814 1435, 1512, 1598, 1679, 1755, 1819, 1866, 1903,
1815 1928, 1939, 1954, 1973, 1977, 1973, 1961, 1934,
1816 1892, 1842, 1790, 1744, 1700, 1654, 1600, 1540,
1817 1483, 1428, 1385, 1354, 1329, 1309, 1296, 1298,
1818 1318, 1358, 1414, 1485, 1560, 1628, 1696, 1767,
1819 1842, 1913, 1991, 2071, 2150, 2229, 2292, 2350,
1820 2414, 2479, 2535, 2582, 2628, 2658, 2673, 2682,
1821 2700, 2721, 2728, 2725, 2719, 2707, 2679, 2653,
1822 2642, 2645, 2649, 2649, 2658, 2676, 2697, 2726,
1823 2755, 2770, 2767, 2755, 2739, 2722, 2696, 2663,
1824 2621, 2565, 2499, 2432, 2359, 2262, 2157, 2046,
1825 1915, 1769, 1624, 1487, 1368, 1254, 1134, 1031,
1826 931, 833, 759, 706, 669, 645, 635, 651,
1827 689, 745, 819, 914, 1021, 1131, 1240, 1348,
1828 1460, 1580, 1706, 1839, 1977, 2111, 2231, 2338,
1829 2431, 2513, 2577, 2616, 2638, 2643, 2627, 2592,
1830 2550, 2503, 2451, 2386, 2304, 2208, 2103, 1997,
1831 1897, 1801, 1719, 1645, 1576, 1513, 1455, 1402,
1832 1358, 1322, 1296, 1270, 1253, 1244, 1252, 1269,
1833 1290, 1315, 1335, 1346, 1342, 1325, 1299, 1269,
1834 1236, 1190, 1140, 1090, 1038, 986, 931, 880,
1835 837, 794, 755, 723, 711, 714, 726, 754,
1836 795, 844, 896, 954, 1020, 1100, 1186, 1273,
1837 1369, 1472, 1574, 1672, 1766, 1855, 1932, 1995,
1838 2040, 2069, 2094, 2106, 2103, 2096, 2079, 2048,
1839 2006, 1953, 1897, 1834, 1774, 1708, 1641, 1579,
1840 1520, 1465, 1414, 1377, 1348, 1328, 1321, 1319,
1841 1329, 1361, 1410, 1471, 1540, 1618, 1698, 1779,
1842 1866, 1952, 2034, 2117, 2192, 2258, 2320, 2377,
1843 2431, 2479, 2521, 2558, 2581, 2596, 2610, 2617,
1844 2616, 2618, 2625, 2624, 2610, 2601, 2597, 2589,
1845 2584, 2589, 2594, 2612, 2633, 2651, 2692, 2745,
1846 2787, 2813, 2835, 2854, 2852, 2837, 2821, 2803,
1847 2774, 2715, 2641, 2566, 2481, 2384, 2272, 2143,
1848 2003, 1843, 1666, 1507, 1374, 1251, 1128, 1015,
1849 915, 821, 744, 691, 659, 650, 654, 671,
1850 713, 783, 872, 979, 1108, 1238, 1364, 1477,
1851 1592, 1713, 1838, 1966, 2090, 2207, 2314, 2405,
1852 2475, 2525, 2559, 2571, 2561, 2537, 2497, 2435,
1853 2363, 2295, 2229, 2157, 2073, 1981, 1880, 1778,
1854 1689, 1613, 1551, 1506, 1470, 1436, 1418, 1406,
1855 1398, 1399, 1408, 1421, 1435, 1449, 1461, 1480,
1856 1502, 1516, 1514, 1500, 1473, 1432, 1372, 1303,
1857 1236, 1162, 1081, 995, 917, 848, 785, 718,
1858 669, 632, 595, 575, 574, 601, 646, 693,
1859 755, 835, 929, 1024, 1124, 1236, 1354, 1468,
1860 1576, 1688, 1800, 1903, 1985, 2051, 2106, 2150,
1861 2168, 2162, 2149, 2130, 2093, 2045, 1989, 1929,
1862 1862, 1792, 1715, 1639, 1573, 1511, 1451, 1398,
1863 1359, 1335, 1321, 1323, 1331, 1356, 1402, 1453,
1864 1507, 1576, 1665, 1755, 1838, 1929, 2023, 2110,
1865 2190, 2261, 2323, 2373, 2415, 2449, 2473, 2497,
1866 2513, 2504, 2491, 2485, 2468, 2443, 2430, 2413,
1867 2380, 2358, 2355, 2354, 2349, 2368, 2388, 2403,
1868 2436, 2478, 2526, 2594, 2673, 2745, 2809, 2877,
1869 2926, 2942, 2962, 2981, 2972, 2937, 2882, 2829,
1870 2752, 2666, 2568, 2448, 2320, 2183, 2012, 1813,
1871 1625, 1455, 1286, 1138, 1015, 902, 802, 715,
1872 646, 613, 614, 626, 649, 694, 772, 872,
1873 983, 1118, 1271, 1428, 1569, 1695, 1806, 1920,
1874 2040, 2151, 2251, 2344, 2415, 2460, 2491, 2500,
1875 2491, 2458, 2398, 2319, 2231, 2136, 2038, 1941,
1876 1856, 1782, 1709, 1633, 1556, 1487, 1428, 1387,
1877 1366, 1364, 1378, 1396, 1416, 1443, 1479, 1520,
1878 1565, 1604, 1637, 1658, 1671, 1679, 1685, 1674,
1879 1649, 1602, 1528, 1432, 1320, 1199, 1073, 955,
1880 842, 731, 635, 553, 482, 426, 391, 382,
1881 389, 409, 450, 515, 603, 706, 824, 959,
1882 1108, 1257, 1397, 1531, 1672, 1808, 1928, 2040,
1883 2137, 2213, 2259, 2286, 2291, 2285, 2256, 2196,
1884 2120, 2038, 1952, 1861, 1764, 1679, 1604, 1528,
1885 1451, 1384, 1332, 1293, 1267, 1256, 1265, 1294,
1886 1334, 1386, 1453, 1535, 1634, 1741, 1845, 1948,
1887 2053, 2151, 2234, 2305, 2380, 2451, 2504, 2523,
1888 2527, 2531, 2528, 2509, 2474, 2446, 2422, 2382,
1889 2322, 2274, 2253, 2240, 2215, 2184, 2172, 2186,
1890 2199, 2212, 2257, 2327, 2392, 2450, 2522, 2612,
1891 2714, 2823, 2921, 3008, 3092, 3154, 3180, 3186,
1892 3189, 3174, 3128, 3049, 2951, 2839, 2711, 2572,
1893 2418, 2254, 2092, 1912, 1708, 1505, 1315, 1151,
1894 1010, 895, 805, 739, 696, 670, 667, 710,
1895 786, 872, 967, 1070, 1196, 1336, 1482, 1634,
1896 1793, 1945, 2069, 2157, 2225, 2301, 2370, 2412,
1897 2438, 2451, 2442, 2407, 2349, 2283, 2213, 2133,
1898 2031, 1925, 1823, 1731, 1643, 1573, 1531, 1507,
1899 1497, 1485, 1485, 1492, 1520, 1560, 1611, 1676,
1900 1738, 1796, 1848, 1893, 1934, 1964, 1978, 1976,
1901 1957, 1904, 1815, 1726, 1631, 1513, 1380, 1243,
1902 1097, 940, 788, 649, 532, 436, 351, 290,
1903 258, 256, 276, 316, 391, 494, 613, 739,
1904 878, 1029, 1181, 1343, 1509, 1669, 1819, 1947,
1905 2052, 2145, 2220, 2263, 2282, 2284, 2264, 2223,
1906 2158, 2081, 1997, 1914, 1827, 1736, 1646, 1560,
1907 1483, 1424, 1377, 1346, 1339, 1346, 1359, 1391,
1908 1444, 1512, 1579, 1658, 1751, 1849, 1944, 2040,
1909 2133, 2221, 2300, 2372, 2426, 2464, 2490, 2496,
1910 2484, 2467, 2437, 2400, 2360, 2309, 2255, 2205,
1911 2169, 2130, 2080, 2051, 2049, 2068, 2081, 2113,
1912 2173, 2239, 2309, 2396, 2499, 2606, 2715, 2815,
1913 2917, 3026, 3140, 3237, 3323, 3408, 3472, 3491,
1914 3454, 3398, 3342, 3252, 3136, 3009, 2868, 2715,
1915 2552, 2390, 2240, 2090, 1934, 1769, 1609, 1465,
1916 1338, 1221, 1116, 1058, 1049, 1040, 1032, 1052,
1917 1100, 1169, 1245, 1330, 1438, 1550, 1650, 1740,
1918 1838, 1933, 2015, 2072, 2112, 2149, 2167, 2156,
1919 2133, 2126, 2121, 2105, 2072, 2027, 1981, 1930,
1920 1881, 1839, 1802, 1768, 1740, 1723, 1721, 1739,
1921 1773, 1812, 1866, 1924, 1988, 2047, 2102, 2159,
1922 2210, 2251, 2274, 2286, 2278, 2254, 2212, 2157,
1923 2084, 1999, 1909, 1802, 1678, 1548, 1416, 1278,
1924 1139, 997, 841, 704, 599, 505, 421, 370,
1925 363, 374, 395, 448, 538, 646, 759, 880,
1926 1015, 1157, 1299, 1422, 1541, 1671, 1790, 1879,
1927 1949, 2008, 2060, 2084, 2077, 2065, 2043, 2003,
1928 1939, 1867, 1803, 1735, 1659, 1589, 1536, 1507,
1929 1486, 1466, 1462, 1485, 1534, 1587, 1638, 1703,
1930 1781, 1853, 1917, 1987, 2058, 2121, 2172, 2215,
1931 2258, 2301, 2331, 2335, 2341, 2355, 2355, 2327,
1932 2291, 2261, 2221, 2172, 2122, 2080, 2050, 2030,
1933 2012, 2015, 2042, 2060, 2081, 2126, 2184, 2241,
1934 2296, 2369, 2449, 2526, 2596, 2663, 2741, 2830,
1935 2900, 2954, 3003, 3058, 3092, 3101, 3128, 3167,
1936 3178, 3160, 3129, 3100, 3050, 2972, 2880, 2785,
1937 2696, 2597, 2481, 2383, 2299, 2221, 2146, 2075,
1938 2018, 1959, 1883, 1804, 1739, 1681, 1619, 1568,
1939 1548, 1541, 1536, 1536, 1548, 1577, 1613, 1648,
1940 1678, 1710, 1737, 1750, 1758, 1779, 1804, 1822,
1941 1826, 1831, 1845, 1852, 1858, 1872, 1904, 1943,
1942 1970, 1991, 2015, 2044, 2070, 2084, 2097, 2110,
1943 2117, 2118, 2120, 2135, 2155, 2171, 2188, 2210,
1944 2226, 2223, 2208, 2194, 2173, 2142, 2097, 2046,
1945 1988, 1918, 1836, 1761, 1699, 1622, 1528, 1438,
1946 1355, 1269, 1186, 1109, 1036, 968, 906, 845,
1947 798, 773, 757, 749, 762, 803, 857, 915,
1948 984, 1067, 1151, 1229, 1305, 1380, 1451, 1518,
1949 1568, 1613, 1657, 1693, 1716, 1736, 1756, 1768,
1950 1769, 1759, 1750, 1750, 1744, 1728, 1709, 1700,
1951 1702, 1700, 1700, 1712, 1735, 1766, 1799, 1839,
1952 1887, 1935, 1969, 1999, 2036, 2069, 2092, 2106,
1953 2117, 2130, 2136, 2136, 2145, 2153, 2148, 2145,
1954 2142, 2141, 2136, 2131, 2134, 2147, 2154, 2157,
1955 2164, 2171, 2176, 2200, 2244, 2290, 2326, 2368,
1956 2436, 2502, 2560, 2631, 2712, 2769, 2814, 2855,
1957 2894, 2939, 2991, 3028, 3042, 3069, 3115, 3144,
1958 3139, 3149, 3177, 3146, 3045, 2956, 2888, 2804,
1959 2708, 2608, 2497, 2401, 2333, 2263, 2194, 2157,
1960 2126, 2058, 1970, 1902, 1862, 1818, 1760, 1719,
1961 1681, 1625, 1582, 1558, 1531, 1528, 1528, 1526,
1962 1534, 1553, 1588, 1610, 1631, 1655, 1670, 1654,
1963 1639, 1651, 1670, 1683, 1721, 1789, 1857, 1919,
1964 1977, 2027, 2076, 2120, 2145, 2162, 2177, 2191,
1965 2200, 2201, 2211, 2226, 2230, 2219, 2210, 2200,
1966 2188, 2183, 2180, 2179, 2162, 2132, 2093, 2045,
1967 1983, 1911, 1840, 1773, 1711, 1638, 1572, 1539,
1968 1512, 1456, 1381, 1314, 1248, 1178, 1112, 1042,
1969 980, 936, 887, 833, 809, 817, 825, 832,
1970 859, 909, 961, 1014, 1085, 1169, 1246, 1316,
1971 1375, 1420, 1468, 1524, 1575, 1623, 1672, 1715,
1972 1746, 1773, 1802, 1822, 1833, 1823, 1807, 1794,
1973 1778, 1761, 1754, 1754, 1768, 1792, 1804, 1818,
1974 1845, 1882, 1918, 1951, 1984, 2014, 2036, 2047,
1975 2062, 2071, 2068, 2066, 2068, 2068, 2064, 2063,
1976 2077, 2103, 2118, 2120, 2135, 2152, 2149, 2139,
1977 2148, 2171, 2185, 2192, 2211, 2254, 2303, 2353,
1978 2404, 2436, 2463, 2510, 2546, 2562, 2586, 2620,
1979 2648, 2674, 2701, 2718, 2744, 2786, 2828, 2847,
1980 2860, 2897, 2940, 2944, 2953, 2989, 3012, 3010,
1981 3010, 3007, 2977, 2931, 2881, 2830, 2764, 2696,
1982 2632, 2553, 2463, 2383, 2308, 2227, 2147, 2068,
1983 1981, 1885, 1804, 1738, 1656, 1584, 1538, 1514,
1984 1501, 1484, 1482, 1504, 1534, 1573, 1613, 1649,
1985 1691, 1734, 1762, 1782, 1814, 1847, 1865, 1877,
1986 1896, 1922, 1940, 1954, 1973, 1997, 2022, 2036,
1987 2039, 2043, 2052, 2057, 2055, 2059, 2061, 2064,
1988 2065, 2076, 2094, 2119, 2139, 2155, 2175, 2187,
1989 2186, 2175, 2156, 2131, 2096, 2051, 1997, 1944,
1990 1877, 1783, 1686, 1620, 1554, 1449, 1335, 1249,
1991 1153, 1045, 978, 932, 869, 820, 804, 793,
1992 790, 821, 881, 942, 1009, 1099, 1189, 1267,
1993 1349, 1437, 1508, 1563, 1617, 1660, 1676, 1686,
1994 1705, 1723, 1722, 1712, 1703, 1688, 1666, 1651,
1995 1646, 1636, 1634, 1650, 1663, 1682, 1726, 1772,
1996 1822, 1888, 1957, 2014, 2065, 2121, 2172, 2209,
1997 2237, 2255, 2252, 2240, 2225, 2204, 2169, 2139,
1998 2119, 2081, 2047, 2036, 2029, 2002, 1986, 2001,
1999 2023, 2039, 2065, 2114, 2155, 2197, 2257, 2326,
2000 2387, 2446, 2502, 2539, 2590, 2671, 2725, 2742,
2001 2786, 2852, 2893, 2909, 2931, 2955, 2967, 2974,
2002 2990, 3006, 3012, 3030, 3055, 3078, 3110, 3146,
2003 3172, 3187, 3175, 3122, 3050, 2998, 2952, 2876,
2004 2779, 2702, 2649, 2594, 2518, 2453, 2423, 2375,
2005 2289, 2205, 2122, 2041, 1980, 1915, 1848, 1793,
2006 1727, 1661, 1602, 1558, 1544, 1537, 1531, 1556,
2007 1597, 1638, 1679, 1727, 1763, 1782, 1783, 1771,
2008 1775, 1793, 1826, 1875, 1938, 2019, 2096, 2144,
2009 2174, 2207, 2230, 2232, 2226, 2229, 2232, 2235,
2010 2238, 2249, 2267, 2275, 2267, 2261, 2266, 2270,
2011 2278, 2291, 2310, 2326, 2314, 2272, 2217, 2158,
2012 2089, 2015, 1952, 1906, 1868, 1820, 1771, 1747,
2013 1731, 1670, 1566, 1474, 1385, 1287, 1202, 1122,
2014 1035, 976, 956, 932, 901, 904, 930, 952,
2015 991, 1055, 1130, 1195, 1253, 1314, 1372, 1419,
2016 1463, 1505, 1539, 1569, 1616, 1675, 1730, 1765,
2017 1786, 1802, 1815, 1814, 1802, 1780, 1758, 1764,
2018 1780, 1789, 1814, 1862, 1914, 1967, 2019, 2068,
2019 2111, 2153, 2194, 2211, 2219, 2230, 2220, 2196,
2020 2171, 2142, 2109, 2083, 2068, 2048, 2031, 2030,
2021 2039, 2044, 2040, 2048, 2071, 2099, 2123, 2159,
2022 2208, 2266, 2333, 2404, 2458, 2498, 2553, 2617,
2023 2651, 2660, 2681, 2704, 2706, 2691, 2674, 2667,
2024 2662, 2652, 2653, 2663, 2680, 2704, 2738, 2777,
2025 2833, 2895, 2936, 2970, 3020, 3065, 3101, 3148,
2026 3207, 3260, 3300, 3332, 3338, 3311, 3244, 3157,
2027 3055, 2947, 2826, 2691, 2553, 2429, 2328, 2240,
2028 2156, 2069, 1987, 1916, 1854, 1798, 1759, 1717,
2029 1672, 1653, 1667, 1676, 1669, 1679, 1708, 1740,
2030 1781, 1833, 1874, 1906, 1930, 1941, 1929, 1913,
2031 1895, 1866, 1836, 1814, 1812, 1829, 1856, 1895,
2032 1946, 1994, 2042, 2084, 2128, 2170, 2203, 2235,
2033 2266, 2292, 2311, 2320, 2325, 2338, 2348, 2342,
2034 2331, 2325, 2320, 2301, 2262, 2216, 2163, 2097,
2035 2025, 1953, 1890, 1838, 1796, 1768, 1755, 1738,
2036 1678, 1583, 1524, 1524, 1492, 1387, 1313, 1302,
2037 1264, 1200, 1181, 1187, 1175, 1151, 1115, 1105,
2038 1128, 1150, 1177, 1219, 1268, 1316, 1358, 1394,
2039 1436, 1476, 1523, 1577, 1629, 1681, 1720, 1745,
2040 1779, 1820, 1839, 1841, 1836, 1835, 1843, 1849,
2041 1852, 1870, 1909, 1941, 1944, 1944, 1968, 1999,
2042 2008, 2017, 2038, 2055, 2055, 2050, 2057, 2070,
2043 2073, 2060, 2049, 2050, 2058, 2059, 2054, 2064,
2044 2087, 2092, 2088, 2084, 2103, 2136, 2159, 2183,
2045 2222, 2267, 2310, 2349, 2391, 2434, 2465, 2475,
2046 2489, 2517, 2542, 2564, 2576, 2602, 2640, 2683,
2047 2727, 2763, 2792, 2822, 2893, 2982, 3023, 3033,
2048 3073, 3122, 3156, 3207, 3257, 3268, 3288, 3328,
2049 3359, 3391, 3399, 3342, 3235, 3125, 3034, 2927,
2050 2795, 2671, 2547, 2464, 2432, 2398, 2365, 2327,
2051 2260, 2199, 2151, 2078, 2010, 1966, 1924, 1892,
2052 1861, 1812, 1760, 1710, 1682, 1660, 1624, 1618,
2053 1643, 1664, 1687, 1723, 1746, 1744, 1728, 1693,
2054 1662, 1659, 1673, 1709, 1777, 1874, 1986, 2078,
2055 2131, 2162, 2187, 2193, 2185, 2180, 2179, 2174,
2056 2171, 2187, 2212, 2224, 2217, 2197, 2177, 2170,
2057 2173, 2182, 2197, 2213, 2218, 2200, 2168, 2126,
2058 2074, 2021, 1980, 1956, 1951, 1960, 1976, 1994,
2059 1990, 1953, 1870, 1770, 1693, 1623, 1514, 1393,
2060 1338, 1331, 1292, 1241, 1226, 1199, 1124, 1047,
2061 1013, 1026, 1043, 1046, 1072, 1135, 1198, 1244,
2062 1300, 1372, 1438, 1487, 1540, 1604, 1674, 1726,
2063 1742, 1749, 1765, 1768, 1732, 1679, 1657, 1657,
2064 1664, 1678, 1705, 1744, 1778, 1791, 1795, 1820,
2065 1856, 1881, 1907, 1952, 1996, 2032, 2074, 2104,
2066 2119, 2124, 2110, 2079, 2046, 2023, 2009, 1982,
2067 1947, 1923, 1905, 1880, 1860, 1867, 1885, 1908,
2068 1937, 1991, 2068, 2132, 2179, 2234, 2293, 2334,
2069 2370, 2401, 2419, 2438, 2479, 2513, 2518, 2531,
2070 2549, 2544, 2525, 2524, 2537, 2549, 2556, 2573,
2071 2607, 2654, 2705, 2766, 2848, 2924, 2965, 3009,
2072 3095, 3191, 3244, 3263, 3285, 3322, 3360, 3369,
2073 3358, 3366, 3377, 3362, 3309, 3223, 3100, 2971,
2074 2853, 2705, 2544, 2429, 2334, 2258, 2244, 2247,
2075 2249, 2259, 2246, 2209, 2162, 2093, 2036, 1997,
2076 1927, 1841, 1792, 1772, 1753, 1701, 1644, 1621,
2077 1614, 1607, 1606, 1603, 1600, 1609, 1609, 1587,
2078 1573, 1569, 1570, 1597, 1651, 1730, 1838, 1959,
2079 2065, 2153, 2212, 2247, 2253, 2234, 2202, 2168,
2080 2139, 2119, 2113, 2118, 2127, 2127, 2128, 2135,
2081 2136, 2143, 2153, 2172, 2190, 2190, 2179, 2166,
2082 2147, 2123, 2095, 2068, 2062, 2066, 2078, 2096,
2083 2113, 2110, 2076, 2028, 1963, 1880, 1789, 1692,
2084 1585, 1439, 1286, 1214, 1227, 1225, 1179, 1161,
2085 1195, 1237, 1278, 1329, 1359, 1366, 1356, 1329,
2086 1322, 1337, 1354, 1373, 1427, 1494, 1557, 1610,
2087 1653, 1676, 1670, 1652, 1633, 1618, 1592, 1550,
2088 1524, 1539, 1592, 1648, 1708, 1783, 1849, 1916,
2089 1987, 2036, 2066, 2101, 2110, 2080, 2044, 2026,
2090 2007, 1983, 1963, 1957, 1956, 1956, 1944, 1929,
2091 1928, 1926, 1899, 1866, 1847, 1847, 1861, 1889,
2092 1921, 1962, 2034, 2115, 2179, 2234, 2301, 2358,
2093 2384, 2393, 2392, 2381, 2362, 2343, 2330, 2339,
2094 2362, 2383, 2408, 2442, 2475, 2524, 2594, 2642,
2095 2654, 2663, 2705, 2764, 2806, 2840, 2899, 2984,
2096 3073, 3150, 3210, 3274, 3351, 3398, 3413, 3414,
2097 3426, 3448, 3427, 3394, 3394, 3422, 3435, 3389,
2098 3293, 3187, 3082, 2982, 2890, 2789, 2677, 2584,
2099 2551, 2552, 2545, 2534, 2520, 2465, 2386, 2306,
2100 2218, 2135, 2067, 1985, 1891, 1796, 1711, 1655,
2101 1602, 1532, 1459, 1434, 1451, 1476, 1514, 1567,
2102 1615, 1641, 1652, 1656, 1658, 1666, 1684, 1714,
2103 1771, 1860, 1952, 2039, 2107, 2133, 2122, 2096,
2104 2060, 2029, 2009, 1992, 1984, 2002, 2044, 2093,
2105 2131, 2166, 2195, 2222, 2254, 2291, 2333, 2381,
2106 2411, 2416, 2396, 2362, 2316, 2259, 2200, 2145,
2107 2107, 2091, 2088, 2089, 2084, 2057, 2020, 1972,
2108 1921, 1875, 1833, 1805, 1787, 1760, 1725, 1711,
2109 1724, 1723, 1665, 1582, 1539, 1528, 1519, 1470,
2110 1395, 1321, 1257, 1221, 1211, 1204, 1206, 1241,
2111 1307, 1386, 1481, 1564, 1612, 1640, 1645, 1639,
2112 1637, 1644, 1652, 1669, 1688, 1710, 1743, 1777,
2113 1792, 1785, 1773, 1763, 1752, 1748, 1750, 1751,
2114 1761, 1784, 1804, 1820, 1848, 1890, 1937, 1973,
2115 1999, 2027, 2053, 2064, 2054, 2025, 1990, 1950,
2116 1912, 1883, 1867, 1856, 1844, 1858, 1887, 1904,
2117 1929, 1966, 1997, 2011, 2021, 2044, 2090, 2135,
2118 2170, 2194, 2221, 2265, 2308, 2339, 2360, 2365,
2119 2374, 2383, 2393, 2411, 2432, 2433, 2417, 2442,
2120 2509, 2565, 2589, 2630, 2706, 2777, 2825, 2879,
2121 2951, 3017, 3067, 3106, 3145, 3206, 3269, 3305,
2122 3331, 3370, 3399, 3399, 3409, 3429, 3426, 3423,
2123 3438, 3448, 3428, 3388, 3318, 3224, 3143, 3055,
2124 2938, 2822, 2753, 2717, 2689, 2666, 2655, 2661,
2125 2657, 2613, 2524, 2431, 2341, 2221, 2102, 2012,
2126 1921, 1819, 1714, 1615, 1549, 1530, 1516, 1486,
2127 1483, 1518, 1560, 1594, 1627, 1650, 1647, 1627,
2128 1606, 1601, 1617, 1644, 1689, 1759, 1844, 1919,
2129 1969, 1991, 1983, 1960, 1934, 1899, 1879, 1887,
2130 1909, 1937, 1996, 2073, 2145, 2204, 2262, 2319,
2131 2371, 2416, 2452, 2479, 2500, 2503, 2474, 2425,
2132 2365, 2308, 2251, 2209, 2191, 2197, 2208, 2216,
2133 2229, 2240, 2232, 2203, 2160, 2115, 2081, 2062,
2134 2057, 2063, 2082, 2102, 2109, 2102, 2086, 2055,
2135 2006, 1946, 1855, 1713, 1552, 1432, 1352, 1247,
2136 1135, 1105, 1156, 1213, 1273, 1373, 1474, 1529,
2137 1555, 1553, 1526, 1488, 1435, 1396, 1396, 1421,
2138 1447, 1484, 1523, 1547, 1561, 1565, 1553, 1534,
2139 1524, 1516, 1511, 1525, 1554, 1587, 1630, 1687,
2140 1742, 1811, 1896, 1976, 2036, 2089, 2132, 2128,
2141 2082, 2033, 1984, 1932, 1874, 1837, 1834, 1856,
2142 1881, 1912, 1958, 2005, 2033, 2043, 2056, 2062,
2143 2060, 2052, 2051, 2059, 2071, 2088, 2103, 2109,
2144 2114, 2124, 2127, 2114, 2101, 2088, 2075, 2049,
2145 2015, 1989, 1971, 1978, 2007, 2040, 2083, 2137,
2146 2211, 2308, 2398, 2456, 2487, 2520, 2553, 2590,
2147 2637, 2610, 2541, 2576, 2666, 2721, 2798, 2921,
2148 3018, 3073, 3113, 3155, 3193, 3195, 3196, 3234,
2149 3295, 3344, 3386, 3442, 3477, 3483, 3516, 3567,
2150 3562, 3505, 3425, 3332, 3226, 3113, 3003, 2915,
2151 2846, 2762, 2686, 2652, 2632, 2626, 2646, 2648,
2152 2600, 2514, 2408, 2265, 2114, 1969, 1837, 1697,
2153 1544, 1430, 1392, 1388, 1372, 1366, 1399, 1443,
2154 1472, 1489, 1481, 1450, 1434, 1427, 1410, 1403,
2155 1418, 1449, 1494, 1555, 1620, 1690, 1760, 1808,
2156 1831, 1839, 1830, 1823, 1830, 1841, 1857, 1901,
2157 1974, 2050, 2131, 2226, 2331, 2429, 2521, 2589,
2158 2625, 2644, 2641, 2605, 2553, 2498, 2446, 2401,
2159 2368, 2349, 2345, 2357, 2375, 2392, 2406, 2406,
2160 2386, 2341, 2282, 2228, 2182, 2144, 2109, 2078,
2161 2060, 2044, 2018, 1989, 1961, 1934, 1897, 1845,
2162 1788, 1732, 1671, 1601, 1516, 1439, 1390, 1356,
2163 1315, 1272, 1251, 1253, 1265, 1276, 1291, 1306,
2164 1319, 1320, 1325, 1343, 1362, 1369, 1373, 1381,
2165 1393, 1409, 1439, 1474, 1514, 1554, 1591, 1634,
2166 1669, 1688, 1684, 1682, 1694, 1712, 1736, 1770,
2167 1812, 1866, 1925, 1980, 2018, 2044, 2056, 2048,
2168 2034, 2023, 2012, 1992, 1969, 1961, 1960, 1964,
2169 1961, 1956, 1950, 1952, 1952, 1947, 1946, 1939,
2170 1924, 1908, 1891, 1874, 1865, 1863, 1854, 1854,
2171 1864, 1870, 1863, 1855, 1852, 1846, 1824, 1794,
2172 1780, 1781, 1785, 1791, 1802, 1816, 1839, 1868,
2173 1903, 1943, 1974, 1996, 2020, 2039, 2066, 2101,
2174 2126, 2145, 2173, 2219, 2276, 2326, 2383, 2457,
2175 2529, 2596, 2678, 2775, 2858, 2928, 3002, 3073,
2176 3156, 3217, 3222, 3232, 3276, 3292, 3278, 3276,
2177 3286, 3298, 3326, 3372, 3409, 3426, 3448, 3477,
2178 3507, 3517, 3507, 3499, 3475, 3430, 3384, 3331,
2179 3252, 3169, 3102, 3032, 2937, 2838, 2773, 2714,
2180 2632, 2546, 2452, 2363, 2276, 2179, 2062, 1935,
2181 1831, 1751, 1652, 1538, 1472, 1461, 1462, 1453,
2182 1460, 1505, 1543, 1560, 1562, 1537, 1486, 1430,
2183 1380, 1344, 1329, 1335, 1370, 1432, 1511, 1599,
2184 1677, 1734, 1790, 1847, 1884, 1926, 1987, 2058,
2185 2126, 2195, 2258, 2320, 2373, 2411, 2448, 2487,
2186 2526, 2572, 2614, 2641, 2658, 2661, 2637, 2591,
2187 2545, 2506, 2478, 2464, 2477, 2514, 2556, 2588,
2188 2604, 2602, 2572, 2518, 2446, 2365, 2292, 2233,
2189 2181, 2132, 2089, 2049, 2002, 1947, 1891, 1842,
2190 1802, 1771, 1752, 1737, 1724, 1714, 1703, 1677,
2191 1641, 1606, 1585, 1577, 1578, 1594, 1610, 1607,
2192 1584, 1557, 1530, 1489, 1431, 1367, 1306, 1285,
2193 1323, 1372, 1373, 1384, 1451, 1526, 1581, 1625,
2194 1663, 1702, 1742, 1767, 1791, 1811, 1811, 1794,
2195 1771, 1771, 1786, 1799, 1812, 1831, 1854, 1872,
2196 1884, 1894, 1914, 1926, 1917, 1921, 1956, 1998,
2197 2021, 2032, 2043, 2061, 2074, 2051, 2014, 1986,
2198 1959, 1926, 1888, 1848, 1817, 1794, 1764, 1740,
2199 1734, 1741, 1755, 1765, 1781, 1802, 1810, 1809,
2200 1808, 1798, 1776, 1754, 1729, 1708, 1694, 1692,
2201 1680, 1667, 1657, 1655, 1647, 1641, 1651, 1658,
2202 1673, 1705, 1741, 1766, 1792, 1835, 1890, 1935,
2203 1957, 1977, 2017, 2055, 2080, 2109, 2140, 2164,
2204 2188, 2224, 2263, 2305, 2344, 2396, 2466, 2534,
2205 2617, 2713, 2807, 2896, 2988, 3086, 3178, 3240,
2206 3270, 3278, 3263, 3229, 3190, 3154, 3122, 3091,
2207 3079, 3114, 3189, 3260, 3320, 3390, 3475, 3555,
2208 3606, 3610, 3599, 3605, 3578, 3521, 3455, 3383,
2209 3306, 3208, 3112, 3042, 2970, 2890, 2812, 2744,
2210 2699, 2661, 2598, 2528, 2484, 2433, 2374, 2329,
2211 2285, 2244, 2187, 2104, 2015, 1908, 1774, 1629,
2212 1506, 1424, 1369, 1336, 1349, 1409, 1490, 1561,
2213 1624, 1652, 1664, 1676, 1661, 1644, 1666, 1708,
2214 1753, 1807, 1861, 1918, 1961, 1974, 1972, 1982,
2215 2004, 2041, 2097, 2170, 2258, 2338, 2399, 2453,
2216 2491, 2511, 2525, 2541, 2584, 2645, 2696, 2737,
2217 2767, 2767, 2730, 2658, 2561, 2472, 2398, 2340,
2218 2309, 2314, 2344, 2376, 2398, 2402, 2387, 2353,
2219 2298, 2240, 2195, 2154, 2115, 2075, 2035, 1984,
2220 1919, 1833, 1744, 1672, 1617, 1581, 1569, 1581,
2221 1606, 1630, 1642, 1640, 1628, 1607, 1581, 1567,
2222 1578, 1602, 1643, 1691, 1733, 1760, 1766, 1759,
2223 1733, 1704, 1681, 1673, 1688, 1724, 1778, 1837,
2224 1898, 1950, 1994, 2018, 2006, 1947, 1860, 1802,
2225 1808, 1852, 1877, 1871, 1876, 1905, 1928, 1927,
2226 1913, 1887, 1844, 1813, 1817, 1858, 1912, 1934,
2227 1926, 1913, 1900, 1874, 1832, 1788, 1751, 1724,
2228 1708, 1705, 1715, 1720, 1702, 1674, 1656, 1661,
2229 1676, 1684, 1686, 1701, 1723, 1732, 1718, 1693,
2230 1667, 1641, 1611, 1590, 1586, 1595, 1614, 1630,
2231 1644, 1658, 1660, 1638, 1616, 1619, 1628, 1629,
2232 1638, 1662, 1703, 1733, 1745, 1760, 1780, 1787,
2233 1779, 1769, 1774, 1787, 1798, 1794, 1791, 1788,
2234 1786, 1790, 1795, 1810, 1831, 1853, 1884, 1930,
2235 1974, 2000, 2014, 2016, 2009, 1999, 1991, 1991,
2236 1995, 2005, 2030, 2059, 2084, 2107, 2125, 2147,
2237 2175, 2207, 2246, 2290, 2337, 2392, 2451, 2507,
2238 2555, 2598, 2638, 2667, 2690, 2719, 2744, 2751,
2239 2748, 2745, 2745, 2760, 2783, 2827, 2871, 2902,
2240 2943, 3006, 3067, 3102, 3129, 3176, 3221, 3233,
2241 3258, 3285, 3304, 3307, 3285, 3257, 3210, 3162,
2242 3135, 3116, 3096, 3072, 3061, 3066, 3069, 3044,
2243 3013, 2994, 2960, 2933, 2904, 2868, 2849, 2832,
2244 2808, 2778, 2711, 2622, 2529, 2419, 2281, 2128,
2245 1981, 1840, 1737, 1683, 1663, 1682, 1732, 1810,
2246 1909, 2005, 2075, 2105, 2088, 2029, 1944, 1831,
2247 1726, 1639, 1568, 1521, 1501, 1511, 1545, 1591,
2248 1631, 1669, 1715, 1770, 1836, 1901, 1958, 2015,
2249 2062, 2089, 2103, 2105, 2089, 2074, 2069, 2074,
2250 2094, 2116, 2134, 2150, 2150, 2128, 2089, 2045,
2251 2016, 2010, 2029, 2077, 2155, 2245, 2333, 2399,
2252 2435, 2435, 2393, 2327, 2242, 2154, 2072, 1999,
2253 1945, 1904, 1870, 1845, 1828, 1820, 1829, 1846,
2254 1880, 1921, 1966, 2007, 2030, 2033, 2009, 1959,
2255 1893, 1818, 1749, 1706, 1681, 1674, 1689, 1707,
2256 1726, 1736, 1732, 1724, 1711, 1701, 1702, 1719,
2257 1750, 1792, 1844, 1893, 1928, 1950, 1957, 1952,
2258 1938, 1923, 1907, 1889, 1877, 1865, 1862, 1864,
2259 1867, 1866, 1850, 1822, 1803, 1810, 1830, 1855,
2260 1887, 1930, 1989, 2050, 2084, 2070, 2027, 1966,
2261 1895, 1822, 1755, 1707, 1691, 1694, 1722, 1770,
2262 1814, 1842, 1859, 1856, 1841, 1830, 1820, 1814,
2263 1803, 1791, 1782, 1769, 1750, 1730, 1705, 1676,
2264 1653, 1648, 1652, 1649, 1649, 1652, 1651, 1647,
2265 1635, 1625, 1628, 1632, 1641, 1667, 1695, 1713,
2266 1724, 1715, 1695, 1674, 1649, 1621, 1594, 1576,
2267 1580, 1597, 1617, 1645, 1685, 1719, 1738, 1755,
2268 1776, 1797, 1812, 1810, 1801, 1798, 1806, 1810,
2269 1805, 1790, 1780, 1790, 1806, 1817, 1832, 1843,
2270 1868, 1901, 1919, 1932, 1942, 1950, 1961, 1968,
2271 1973, 1983, 1991, 1993, 1994, 1993, 1983, 1976,
2272 1976, 1979, 1987, 2000, 2010, 2033, 2072, 2108,
2273 2148, 2196, 2244, 2299, 2353, 2397, 2440, 2468,
2274 2478, 2473, 2451, 2426, 2426, 2449, 2477, 2503,
2275 2537, 2609, 2715, 2815, 2883, 2932, 2965, 2970,
2276 2953, 2930, 2929, 2967, 3017, 3056, 3089, 3121,
2277 3185, 3277, 3343, 3378, 3378, 3376, 3385, 3349,
2278 3291, 3264, 3246, 3209, 3174, 3163, 3193, 3258,
2279 3315, 3361, 3385, 3377, 3372, 3372, 3338, 3251,
2280 3163, 3068, 2932, 2807, 2675, 2534, 2433, 2362,
2281 2322, 2314, 2331, 2364, 2376, 2350, 2292, 2214,
2282 2120, 2012, 1907, 1840, 1802, 1771, 1764, 1746,
2283 1706, 1661, 1587, 1504, 1444, 1419, 1420, 1455,
2284 1516, 1579, 1640, 1699, 1727, 1725, 1703, 1664,
2285 1628, 1624, 1655, 1699, 1741, 1783, 1822, 1836,
2286 1818, 1792, 1780, 1799, 1857, 1940, 2039, 2144,
2287 2251, 2331, 2360, 2349, 2315, 2264, 2199, 2150,
2288 2137, 2145, 2177, 2222, 2254, 2275, 2288, 2285,
2289 2271, 2257, 2249, 2257, 2272, 2281, 2286, 2269,
2290 2227, 2166, 2100, 2037, 1978, 1938, 1924, 1930,
2291 1954, 1988, 2010, 2017, 2007, 1985, 1947, 1910,
2292 1885, 1872, 1877, 1884, 1894, 1899, 1897, 1885,
2293 1866, 1840, 1814, 1807, 1810, 1823, 1842, 1870,
2294 1901, 1926, 1941, 1952, 1960, 1968, 1977, 1987,
2295 2003, 2022, 2040, 2058, 2069, 2068, 2065, 2062,
2296 2061, 2068, 2082, 2107, 2141, 2176, 2213, 2243,
2297 2261, 2262, 2234, 2179, 2126, 2097, 2086, 2073,
2298 2058, 2058, 2082, 2107, 2107, 2088, 2059, 2022,
2299 1981, 1951, 1924, 1896, 1875, 1861, 1863, 1873,
2300 1875, 1868, 1861, 1852, 1834, 1817, 1803, 1788,
2301 1766, 1729, 1687, 1655, 1637, 1615, 1587, 1579,
2302 1605, 1641, 1678, 1710, 1739, 1767, 1773, 1767,
2303 1752, 1738, 1706, 1677, 1654, 1649, 1664, 1682,
2304 1694, 1707, 1738, 1773, 1797, 1815, 1836, 1858,
2305 1880, 1882, 1877, 1879, 1877, 1869, 1852, 1843,
2306 1840, 1840, 1844, 1852, 1862, 1872, 1883, 1890,
2307 1894, 1892, 1896, 1906, 1916, 1923, 1931, 1937,
2308 1941, 1948, 1950, 1941, 1932, 1931, 1928, 1921,
2309 1916, 1910, 1905, 1913, 1931, 1961, 1990, 2008,
2310 2024, 2042, 2056, 2063, 2043, 2011, 1982, 1956,
2311 1936, 1927, 1932, 1950, 1979, 2012, 2046, 2082,
2312 2113, 2128, 2137, 2142, 2148, 2161, 2180, 2196,
2313 2213, 2248, 2299, 2350, 2405, 2460, 2499, 2530,
2314 2546, 2550, 2556, 2556, 2547, 2548, 2577, 2640,
2315 2720, 2786, 2846, 2921, 3004, 3063, 3069, 3056,
2316 3055, 3065, 3067, 3060, 3049, 3054, 3077, 3103,
2317 3126, 3137, 3145, 3161, 3187, 3206, 3211, 3231,
2318 3246, 3242, 3228, 3203, 3182, 3176, 3157, 3118,
2319 3075, 3031, 3006, 2990, 2952, 2903, 2849, 2812,
2320 2790, 2763, 2745, 2712, 2653, 2579, 2502, 2404,
2321 2267, 2098, 1929, 1827, 1771, 1732, 1734, 1804,
2322 1919, 2028, 2098, 2107, 2069, 1992, 1851, 1667,
2323 1499, 1371, 1291, 1254, 1250, 1289, 1363, 1435,
2324 1495, 1544, 1583, 1627, 1676, 1733, 1789, 1827,
2325 1845, 1849, 1833, 1798, 1746, 1692, 1667, 1686,
2326 1750, 1843, 1955, 2066, 2162, 2232, 2266, 2261,
2327 2230, 2198, 2180, 2188, 2219, 2271, 2335, 2398,
2328 2437, 2442, 2422, 2386, 2341, 2290, 2242, 2209,
2329 2207, 2215, 2226, 2232, 2230, 2232, 2228, 2219,
2330 2214, 2219, 2226, 2229, 2216, 2188, 2141, 2071,
2331 1991, 1905, 1834, 1782, 1761, 1775, 1819, 1878,
2332 1938, 1990, 2025, 2038, 2028, 2001, 1958, 1917,
2333 1876, 1841, 1811, 1792, 1783, 1781, 1782, 1793,
2334 1813, 1841, 1874, 1912, 1946, 1977, 1996, 2002,
2335 2000, 1987, 1971, 1955, 1947, 1952, 1966, 1985,
2336 2007, 2032, 2052, 2065, 2076, 2081, 2080, 2083,
2337 2090, 2103, 2120, 2139, 2159, 2181, 2201, 2211,
2338 2215, 2214, 2204, 2192, 2175, 2156, 2135, 2117,
2339 2102, 2086, 2077, 2075, 2081, 2084, 2078, 2081,
2340 2093, 2099, 2076, 2020, 1937, 1824, 1714, 1648,
2341 1607, 1576, 1560, 1579, 1647, 1740, 1800, 1814,
2342 1801, 1770, 1725, 1675, 1627, 1576, 1531, 1481,
2343 1439, 1424, 1430, 1437, 1449, 1470, 1511, 1561,
2344 1622, 1687, 1744, 1780, 1781, 1758, 1726, 1704,
2345 1679, 1638, 1611, 1619, 1643, 1675, 1713, 1751,
2346 1786, 1810, 1824, 1833, 1846, 1858, 1865, 1864,
2347 1862, 1858, 1856, 1856, 1859, 1858, 1851, 1842,
2348 1840, 1843, 1843, 1842, 1842, 1845, 1838, 1830,
2349 1827, 1836, 1849, 1863, 1877, 1888, 1902, 1916,
2350 1915, 1893, 1865, 1837, 1810, 1797, 1799, 1806,
2351 1817, 1834, 1864, 1897, 1929, 1960, 1981, 2007,
2352 2031, 2035, 2034, 2028, 2019, 2006, 1982, 1964,
2353 1965, 1983, 2006, 2033, 2067, 2104, 2144, 2179,
2354 2199, 2203, 2195, 2192, 2185, 2176, 2171, 2173,
2355 2194, 2222, 2244, 2259, 2284, 2315, 2342, 2376,
2356 2405, 2415, 2426, 2436, 2443, 2460, 2474, 2481,
2357 2488, 2505, 2544, 2598, 2652, 2706, 2760, 2798,
2358 2814, 2836, 2865, 2865, 2833, 2807, 2795, 2803,
2359 2827, 2847, 2877, 2928, 2958, 2979, 3006, 3042,
2360 3081, 3090, 3065, 3050, 3061, 3071, 3063, 3036,
2361 3006, 2987, 2962, 2932, 2920, 2919, 2895, 2866,
2362 2855, 2855, 2853, 2828, 2756, 2623, 2409, 2184,
2363 2063, 1996, 1882, 1807, 1871, 2060, 2301, 2485,
2364 2555, 2552, 2477, 2278, 1995, 1698, 1429, 1241,
2365 1139, 1114, 1204, 1368, 1522, 1640, 1719, 1756,
2366 1761, 1742, 1745, 1784, 1820, 1830, 1820, 1789,
2367 1722, 1606, 1446, 1308, 1235, 1253, 1354, 1533,
2368 1763, 1996, 2199, 2322, 2338, 2264, 2138, 2010,
2369 1902, 1827, 1805, 1859, 1970, 2091, 2185, 2220,
2370 2213, 2189, 2150, 2102, 2083, 2113, 2184, 2253,
2371 2304, 2335, 2342, 2316, 2258, 2188, 2128, 2099,
2372 2117, 2163, 2209, 2240, 2237, 2199, 2137, 2062,
2373 1982, 1911, 1879, 1900, 1971, 2061, 2149, 2224,
2374 2266, 2259, 2213, 2139, 2046, 1958, 1890, 1844,
2375 1823, 1821, 1826, 1839, 1859, 1879, 1897, 1923,
2376 1966, 2014, 2061, 2091, 2106, 2103, 2069, 2004,
2377 1927, 1856, 1808, 1787, 1785, 1809, 1867, 1943,
2378 2022, 2090, 2145, 2185, 2208, 2215, 2211, 2201,
2379 2186, 2172, 2156, 2140, 2126, 2120, 2121, 2132,
2380 2154, 2184, 2218, 2253, 2282, 2309, 2320, 2319,
2381 2308, 2289, 2271, 2258, 2243, 2230, 2231, 2233,
2382 2225, 2217, 2211, 2196, 2178, 2162, 2141, 2114,
2383 2090, 2078, 2077, 2063, 2049, 2059, 2070, 2077,
2384 2073, 2050, 2013, 1985, 1942, 1879, 1823, 1787,
2385 1762, 1756, 1764, 1774, 1792, 1795, 1793, 1805,
2386 1809, 1801, 1789, 1770, 1752, 1739, 1712, 1678,
2387 1656, 1643, 1633, 1629, 1646, 1681, 1722, 1753,
2388 1776, 1804, 1824, 1830, 1822, 1805, 1784, 1763,
2389 1740, 1727, 1731, 1745, 1762, 1776, 1805, 1843,
2390 1870, 1883, 1901, 1915, 1917, 1915, 1908, 1901,
2391 1899, 1893, 1873, 1862, 1859, 1864, 1870, 1877,
2392 1892, 1910, 1927, 1939, 1945, 1944, 1940, 1938,
2393 1932, 1922, 1911, 1904, 1908, 1915, 1919, 1923,
2394 1931, 1939, 1944, 1947, 1953, 1964, 1973, 1977,
2395 1986, 2006, 2027, 2033, 2031, 2040, 2061, 2078,
2396 2085, 2087, 2099, 2114, 2124, 2130, 2140, 2153,
2397 2165, 2178, 2196, 2223, 2250, 2268, 2279, 2292,
2398 2310, 2333, 2344, 2344, 2344, 2346, 2347, 2352,
2399 2350, 2345, 2346, 2361, 2383, 2408, 2426, 2436,
2400 2455, 2474, 2476, 2473, 2484, 2485, 2479, 2479,
2401 2477, 2470, 2467, 2461, 2456, 2464, 2470, 2482,
2402 2504, 2522, 2537, 2556, 2561, 2556, 2547, 2534,
2403 2522, 2509, 2485, 2473, 2487, 2502, 2512, 2513,
2404 2527, 2553, 2558, 2535, 2528, 2544, 2556, 2542,
2405 2518, 2513, 2521, 2527, 2520, 2500, 2497, 2511,
2406 2517, 2501, 2467, 2427, 2396, 2367, 2310, 2253,
2407 2226, 2226, 2250, 2280, 2302, 2331, 2358, 2366,
2408 2357, 2320, 2263, 2197, 2131, 2069, 2016, 1979,
2409 1949, 1933, 1934, 1943, 1951, 1964, 1982, 2007,
2410 2036, 2056, 2066, 2068, 2057, 2030, 1980, 1911,
2411 1844, 1795, 1766, 1751, 1754, 1781, 1832, 1887,
2412 1936, 1974, 2007, 2027, 2032, 2025, 2006, 1989,
2413 1976, 1963, 1948, 1934, 1918, 1915, 1914, 1919,
2414 1931, 1953, 1990, 2033, 2069, 2096, 2117, 2127,
2415 2125, 2111, 2084, 2056, 2040, 2029, 2023, 2025,
2416 2032, 2038, 2046, 2057, 2067, 2073, 2077, 2083,
2417 2095, 2107, 2113, 2121, 2123, 2122, 2121, 2117,
2418 2109, 2102, 2101, 2100, 2102, 2104, 2103, 2104,
2419 2104, 2101, 2096, 2093, 2091, 2093, 2100, 2108,
2420 2121, 2134, 2141, 2137, 2130, 2118, 2103, 2085,
2421 2068, 2055, 2047, 2042, 2046, 2052, 2059, 2069,
2422 2080, 2094, 2103, 2113, 2120, 2120, 2119, 2110,
2423 2098, 2084, 2072, 2058, 2047, 2040, 2039, 2044,
2424 2064, 2075, 2086, 2092, 2089, 2095, 2104, 2112,
2425 2113, 2104, 2082, 2056, 2033, 2026, 2027, 2025,
2426 2025, 2023, 2018, 2018, 2010, 1989, 1975, 1966,
2427 1946, 1919, 1910, 1920, 1932, 1939, 1939, 1939,
2428 1943, 1925, 1878, 1815, 1771, 1740, 1694, 1656,
2429 1659, 1689, 1722, 1751, 1766, 1779, 1792, 1791,
2430 1778, 1756, 1730, 1697, 1667, 1642, 1629, 1615,
2431 1589, 1580, 1583, 1593, 1621, 1656, 1696, 1743,
2432 1775, 1796, 1810, 1810, 1797, 1762, 1719, 1681,
2433 1649, 1632, 1627, 1640, 1670, 1702, 1741, 1785,
2434 1821, 1848, 1865, 1875, 1882, 1877, 1856, 1835,
2435 1815, 1796, 1775, 1749, 1738, 1742, 1756, 1774,
2436 1799, 1834, 1869, 1896, 1916, 1931, 1929, 1918,
2437 1905, 1888, 1869, 1852, 1842, 1849, 1860, 1872,
2438 1889, 1910, 1933, 1954, 1974, 1990, 2007, 2021,
2439 2029, 2028, 2034, 2041, 2042, 2045, 2058, 2072,
2440 2082, 2092, 2113, 2137, 2156, 2171, 2183, 2201,
2441 2225, 2242, 2248, 2260, 2279, 2300, 2322, 2337,
2442 2350, 2369, 2385, 2396, 2395, 2397, 2412, 2430,
2443 2446, 2459, 2471, 2493, 2516, 2539, 2555, 2570,
2444 2589, 2606, 2626, 2650, 2658, 2659, 2672, 2697,
2445 2709, 2714, 2721, 2737, 2762, 2772, 2768, 2775,
2446 2799, 2820, 2818, 2803, 2790, 2789, 2780, 2753,
2447 2717, 2681, 2647, 2577, 2477, 2416, 2401, 2371,
2448 2325, 2324, 2389, 2484, 2552, 2565, 2540, 2494,
2449 2418, 2288, 2121, 1974, 1863, 1782, 1728, 1721,
2450 1757, 1808, 1862, 1900, 1913, 1916, 1922, 1923,
2451 1922, 1918, 1907, 1895, 1866, 1812, 1734, 1642,
2452 1550, 1471, 1429, 1439, 1501, 1606, 1729, 1852,
2453 1956, 2028, 2050, 2026, 1979, 1920, 1854, 1789,
2454 1754, 1754, 1777, 1803, 1819, 1830, 1846, 1863,
2455 1880, 1905, 1951, 2014, 2077, 2127, 2174, 2199,
2456 2191, 2146, 2082, 2012, 1948, 1913, 1908, 1928,
2457 1967, 2013, 2062, 2107, 2139, 2153, 2149, 2143,
2458 2144, 2152, 2162, 2179, 2203, 2220, 2218, 2197,
2459 2166, 2128, 2089, 2058, 2039, 2040, 2058, 2085,
2460 2114, 2144, 2169, 2176, 2163, 2141, 2124, 2113,
2461 2099, 2085, 2077, 2071, 2061, 2044, 2021, 1995,
2462 1970, 1945, 1927, 1926, 1942, 1970, 2004, 2038,
2463 2065, 2087, 2093, 2090, 2081, 2063, 2039, 2018,
2464 2001, 1994, 1993, 1996, 2001, 2009, 2017, 2026,
2465 2039, 2057, 2080, 2107, 2130, 2151, 2170, 2180,
2466 2182, 2172, 2152, 2128, 2104, 2084, 2072, 2073,
2467 2079, 2094, 2116, 2139, 2159, 2174, 2187, 2194,
2468 2195, 2190, 2186, 2185, 2182, 2172, 2161, 2153,
2469 2139, 2125, 2116, 2109, 2103, 2101, 2104, 2118,
2470 2141, 2162, 2177, 2188, 2189, 2185, 2173, 2158,
2471 2145, 2129, 2114, 2099, 2091, 2085, 2077, 2070,
2472 2065, 2058, 2056, 2052, 2051, 2062, 2071, 2077,
2473 2080, 2079, 2072, 2059, 2042, 2019, 1997, 1981,
2474 1970, 1959, 1958, 1961, 1970, 1976, 1976, 1977,
2475 1979, 1976, 1974, 1969, 1960, 1954, 1952, 1951,
2476 1949, 1948, 1941, 1937, 1933, 1927, 1923, 1923,
2477 1927, 1930, 1931, 1932, 1920, 1892, 1884, 1894,
2478 1895, 1884, 1871, 1875, 1890, 1907, 1909, 1885,
2479 1865, 1864, 1874, 1884, 1883, 1878, 1870, 1865,
2480 1858, 1846, 1829, 1823, 1829, 1832, 1834, 1849,
2481 1874, 1902, 1917, 1920, 1920, 1929, 1941, 1948,
2482 1947, 1938, 1939, 1946, 1950, 1954, 1960, 1971,
2483 1979, 1989, 1998, 2011, 2026, 2046, 2066, 2079,
2484 2083, 2080, 2083, 2086, 2086, 2076, 2060, 2049,
2485 2052, 2060, 2067, 2076, 2081, 2089, 2101, 2114,
2486 2124, 2128, 2128, 2129, 2126, 2125, 2127, 2126,
2487 2121, 2117, 2109, 2098, 2093, 2096, 2109, 2119,
2488 2123, 2130, 2141, 2159, 2170, 2172, 2169, 2168,
2489 2175, 2172, 2163, 2165, 2168, 2170, 2170, 2169,
2490 2169, 2177, 2185, 2189, 2182, 2186, 2193, 2199,
2491 2206, 2218, 2224, 2217, 2215, 2212, 2209, 2205,
2492 2202, 2198, 2193, 2193, 2200, 2207, 2208, 2205,
2493 2208, 2208, 2205, 2207, 2209, 2208, 2208, 2212,
2494 2215, 2224, 2234, 2239, 2242, 2240, 2240, 2243,
2495 2239, 2233, 2238, 2245, 2241, 2242, 2243, 2243,
2496 2244, 2242, 2241, 2242, 2247, 2253, 2257, 2260,
2497 2268, 2274, 2271, 2262, 2258, 2256, 2252, 2244,
2498 2231, 2226, 2225, 2224, 2222, 2218, 2214, 2211,
2499 2208, 2209, 2212, 2213, 2215, 2218, 2220, 2220,
2500 2216, 2208, 2199, 2191, 2178, 2165, 2151, 2144,
2501 2140, 2137, 2131, 2127, 2128, 2127, 2123, 2118,
2502 2111, 2108, 2101, 2093, 2086, 2080, 2071, 2063,
2503 2052, 2039, 2028, 2016, 2007, 1998, 1990, 1987,
2504 1985, 1987, 1990, 1992, 1995, 1995, 1992, 1986,
2505 1979, 1973, 1966, 1955, 1945, 1938, 1929, 1926,
2506 1922, 1919, 1918, 1923, 1925, 1929, 1936, 1942,
2507 1944, 1946, 1947, 1945, 1942, 1937, 1934, 1930,
2508 1925, 1923, 1924, 1928, 1932, 1938, 1944, 1950,
2509 1959, 1969, 1974, 1979, 1984, 1985, 1983, 1983,
2510 1983, 1981, 1980, 1975, 1975, 1972, 1976, 1981,
2511 1983, 1986, 1987, 1989, 1990, 1990, 1992, 1993,
2512 1992, 1996, 1998, 1998, 1995, 1994, 1993, 1991,
2513 1988, 1982, 1977, 1973, 1970, 1968, 1965, 1963,
2514 1966, 1968, 1969, 1971, 1974, 1979, 1984, 1985,
2515 1987, 1988, 1985, 1979, 1973, 1965, 1957, 1954,
2516 1950, 1947, 1948, 1948, 1952, 1959, 1966, 1974,
2517 1980, 1986, 1990, 1992, 1993, 1994, 1992, 1987,
2518 1979, 1975, 1976, 1977, 1973, 1973, 1977, 1986,
2519 1995, 2004, 2008, 2018, 2026, 2025, 2026, 2024,
2520 2021, 2019, 2013, 2009, 2006, 2005, 2007, 2007,
2521 2011, 2018, 2028, 2038, 2047, 2056, 2063, 2074,
2522 2083, 2087, 2087, 2089, 2090, 2087, 2086, 2085,
2523 2090, 2094, 2094, 2105, 2118, 2127, 2131, 2136,
2524 2145, 2153, 2156, 2155, 2150, 2152, 2156, 2158,
2525 2155, 2154, 2158, 2165, 2167, 2165, 2166, 2170,
2526 2177, 2184, 2185, 2190, 2195, 2199, 2202, 2200,
2527 2198, 2197, 2199, 2199, 2196, 2193, 2197, 2202,
2528 2203, 2203, 2206, 2208, 2208, 2209, 2210, 2210,
2529 2210, 2212, 2213, 2214, 2214, 2215, 2215, 2214,
2530 2216, 2217, 2212, 2208, 2212, 2214, 2213, 2215,
2531 2216, 2222, 2226, 2226, 2229, 2225, 2221, 2224,
2532 2222, 2215, 2208, 2203, 2196, 2192, 2184, 2175,
2533 2170, 2165, 2163, 2159, 2154, 2150, 2146, 2142,
2534 2138, 2137, 2133, 2130, 2126, 2124, 2121, 2113,
2535 2104, 2094, 2087, 2081, 2075, 2064, 2058, 2054,
2536 2052, 2049, 2045, 2044, 2042, 2039, 2038, 2032,
2537 2028, 2025, 2022, 2020, 2015, 2008, 1999, 1993,
2538 1988, 1982, 1974, 1970, 1972, 1972, 1975, 1977,
2539 1977, 1980, 1980, 1976, 1973, 1973, 1970, 1966,
2540 1962, 1961, 1957, 1955, 1954, 1955, 1956, 1956,
2541 1958, 1961, 1969, 1975, 1978, 1981, 1983, 1984,
2542 1988, 1985, 1982, 1981, 1980, 1980, 1982, 1985,
2543 1990, 1997, 2003, 2010, 2015, 2021, 2027, 2030,
2544 2033, 2035, 2036, 2039, 2042, 2044, 2045, 2049,
2545 2050, 2050, 2052, 2055, 2056, 2058, 2061, 2066,
2546 2070, 2069, 2073, 2074, 2076, 2079, 2081, 2079,
2547 2077, 2076, 2074, 2075, 2074, 2072, 2070, 2070,
2548 2070, 2069, 2066, 2064, 2062, 2063, 2060, 2059,
2549 2060, 2061, 2061, 2057, 2055, 2053, 2049, 2043,
2550 2036, 2027, 2021, 2012, 2010, 1999, 1994, 1992,
2551 1987, 1980, 1972, 1973, 1972, 1968, 1965, 1965,
2552 1966, 1967, 1963, 1958, 1954, 1947, 1945, 1940,
2553 1935, 1933, 1930, 1929, 1931, 1933, 1933, 1933,
2554 1933, 1934, 1935, 1936, 1934, 1932, 1934, 1934,
2555 1933, 1935, 1933, 1932, 1934, 1933, 1930, 1928,
2556 1931, 1930, 1931, 1932, 1931, 1934, 1932, 1932,
2557 1932, 1934, 1937, 1936, 1937, 1940, 1943, 1942,
2558 1946, 1945, 1944, 1944, 1942, 1944, 1946, 1948,
2559 1947, 1949, 1953, 1956, 1958, 1961, 1964, 1968,
2560 1970, 1971, 1975, 1976, 1979, 1981, 1982, 1985,
2561 1988, 1990, 1992, 1997, 2002, 2009, 2013, 2018,
2562 2027, 2033, 2039, 2042, 2049, 2054, 2061, 2062,
2563 2062, 2066, 2069, 2076, 2080, 2084, 2089, 2094,
2564 2099, 2105, 2110, 2114, 2120, 2125, 2130, 2137,
2565 2141, 2146, 2152, 2159, 2164, 2168, 2172, 2177,
2566 2182, 2186, 2187, 2192, 2197, 2201, 2205, 2210,
2567 2218, 2220, 2224, 2228, 2232, 2238, 2243, 2246,
2568 2249, 2252, 2250, 2248, 2248, 2246, 2249, 2250,
2569 2252, 2252, 2252, 2258, 2262, 2264, 2268, 2271,
2570 2272, 2274, 2271, 2269, 2268, 2268, 2264, 2262,
2571 2261, 2261, 2255, 2251, 2249, 2248, 2248, 2243,
2572 2241, 2244, 2246, 2249, 2248, 2247, 2246, 2246,
2573 2245, 2240, 2238, 2237, 2241, 2240, 2240, 2239,
2574 2240, 2240, 2238, 2236, 2234, 2233, 2230, 2226,
2575 2222, 2222, 2219, 2215, 2213, 2209, 2204, 2201,
2576 2193, 2185, 2182, 2175, 2169, 2164, 2161, 2154,
2577 2150, 2143, 2134, 2132, 2127, 2122, 2114, 2109,
2578 2104, 2097, 2092, 2085, 2077, 2068, 2060, 2054,
2579 2049, 2045, 2039, 2035, 2033, 2033, 2031, 2029,
2580 2027, 2023, 2023, 2018, 2015, 2013, 2010, 2008,
2581 2008, 2005, 2001, 2002, 1997, 1996, 1993, 1991,
2582 1991, 1995, 1996, 1996, 1997, 1998, 1999, 1999,
2583 1995, 1994, 1998, 1996, 1996, 1997, 1999, 2001,
2584 2002, 2006, 2009, 2011, 2012, 2015, 2017, 2020,
2585 2023, 2031, 2035, 2039, 2041, 2042, 2047, 2049,
2586 2048, 2049, 2052, 2056, 2058, 2060, 2064, 2068,
2587 2071, 2073, 2071, 2073, 2077, 2079, 2077, 2078,
2588 2077, 2077, 2076, 2073, 2073, 2071, 2069, 2068,
2589 2069, 2066, 2068, 2070, 2069, 2070, 2068, 2070,
2590 2067, 2067, 2064, 2062, 2059, 2056, 2050, 2048,
2591 2047, 2044, 2041, 2040, 2038, 2038, 2036, 2036,
2592 2035, 2035, 2035, 2033, 2035, 2032, 2030, 2027,
2593 2024, 2019, 2015, 2014, 2013, 2011, 2011, 2011,
2594 2011, 2010, 2012, 2012, 2009, 2009, 2005, 2004,
2595 2002, 1997, 1995, 1991, 1990, 1989, 1985, 1983,
2596 1982, 1982, 1980, 1978, 1978, 1980, 1980, 1980,
2597 1984, 1986, 1984, 1984, 1986, 1987, 1987, 1986,
2598 1987, 1986, 1987, 1988, 1989, 1989, 1987, 1990,
2599 1992, 1996, 1998, 2002, 2007, 2011, 2015, 2018,
2600 2021, 2026, 2028, 2028, 2028, 2026, 2026, 2025,
2601 2024, 2024, 2024, 2025, 2027, 2033, 2033, 2034,
2602 2038, 2040, 2043, 2041, 2044, 2043, 2042, 2040,
2603 2036, 2036, 2038, 2040, 2043, 2044, 2045, 2048,
2604 2049, 2055, 2058, 2059, 2061, 2064, 2064, 2064,
2605 2064, 2064, 2063, 2064, 2064, 2064, 2065, 2066,
2606 2067, 2070, 2074, 2076, 2078, 2077, 2079, 2074,
2607 2075, 2074, 2071, 2073, 2073, 2074, 2075, 2077,
2608 2079, 2079, 2080, 2080, 2079, 2083, 2087, 2091,
2609 2093, 2093, 2097, 2098, 2100, 2105, 2108, 2107,
2610 2109, 2111, 2112, 2116, 2119, 2121, 2123, 2126,
2611 2131, 2134, 2138, 2140, 2143, 2144, 2148, 2149,
2612 2151, 2152, 2152, 2154, 2152, 2155, 2156, 2157,
2613 2158, 2162, 2165, 2165, 2167, 2169, 2171, 2170,
2614 2173, 2171, 2172, 2174, 2174, 2171, 2168, 2169,
2615 2168, 2163, 2162, 2164, 2166, 2167, 2169, 2165,
2616 2167, 2166, 2165, 2165, 2165, 2162, 2160, 2160,
2617 2159, 2156, 2153, 2152, 2152, 2146, 2143, 2141,
2618 2139, 2136, 2133, 2129, 2125, 2120, 2114, 2111,
2619 2108, 2103, 2100, 2092, 2091, 2091, 2087, 2080,
2620 2076, 2076, 2073, 2068, 2065, 2061, 2056, 2053,
2621 2050, 2044, 2039, 2036, 2032, 2028, 2024, 2024,
2622 2021, 2018, 2017, 2017, 2013, 2007, 2006, 2001,
2623 1996, 1997, 1992, 1990, 1988, 1982, 1979, 1977,
2624 1973, 1970, 1967, 1965, 1963, 1961, 1960, 1958,
2625 1954, 1955, 1951, 1949, 1947, 1941, 1937, 1935,
2626 1935, 1934, 1934, 1931, 1933, 1935, 1936, 1936,
2627 1936, 1937, 1939, 1939, 1942, 1943, 1946, 1945,
2628 1944, 1945, 1946, 1948, 1949, 1950, 1952, 1949,
2629 1948, 1948, 1947, 1946, 1946, 1949, 1949, 1949,
2630 1952, 1954, 1956, 1955, 1953, 1954, 1954, 1955,
2631 1957, 1953, 1952, 1950, 1948, 1948, 1948, 1948,
2632 1947, 1949, 1949, 1947, 1946, 1948, 1951, 1950,
2633 1951, 1953, 1953, 1952, 1955, 1955, 1953, 1951,
2634 1952, 1953, 1951, 1950, 1950, 1953, 1954, 1953,
2635 1954, 1951, 1952, 1953, 1953, 1952, 1953, 1954,
2636 1956, 1955, 1954, 1955, 1953, 1953, 1953, 1951,
2637 1951, 1951, 1950, 1954, 1955, 1956, 1956, 1957,
2638 1956, 1961, 1964, 1965, 1969, 1970, 1974, 1978,
2639 1980, 1981, 1981, 1983, 1983, 1986, 1987, 1992,
2640 1997, 2000, 2002, 2006, 2011, 2016, 2020, 2027,
2641 2031, 2033, 2039, 2044, 2046, 2049, 2053, 2058,
2642 2059, 2060, 2061, 2064, 2067, 2072, 2077, 2081,
2643 2086, 2090, 2096, 2100, 2102, 2104, 2108, 2111,
2644 2115, 2115, 2116, 2118, 2120, 2119, 2119, 2119,
2645 2118, 2119, 2119, 2120, 2120, 2120, 2124, 2128,
2646 2127, 2127, 2127, 2127, 2129, 2127, 2125, 2124,
2647 2124, 2125, 2124, 2125, 2123, 2122, 2123, 2122,
2648 2121, 2122, 2125, 2128, 2129, 2132, 2134, 2133,
2649 2134, 2136, 2135, 2137, 2136, 2134, 2137, 2137,
2650 2138, 2139, 2137, 2134, 2139, 2139, 2141, 2142,
2651 2145, 2150, 2152, 2154, 2156, 2159, 2159, 2160,
2652 2160, 2159, 2160, 2160, 2159, 2160, 2163, 2166,
2653 2166, 2166, 2165, 2166, 2168, 2169, 2171, 2174,
2654 2178, 2176, 2176, 2176, 2177, 2177, 2176, 2174,
2655 2174, 2177, 2181, 2181, 2182, 2183, 2186, 2188,
2656 2189, 2191, 2190, 2191, 2188, 2186, 2186, 2185,
2657 2183, 2185, 2186, 2184, 2183, 2183, 2182, 2183,
2658 2180, 2180, 2177, 2175, 2175, 2172, 2168, 2165,
2659 2165, 2165, 2163, 2162, 2162, 2158, 2158, 2154,
2660 2150, 2146, 2143, 2138, 2139, 2134, 2130, 2124,
2661 2122, 2117, 2116, 2109, 2104, 2099, 2097, 2089,
2662 2084, 2079, 2072, 2068, 2064, 2061, 2055, 2048,
2663 2043, 2041, 2034, 2032, 2028, 2022, 2019, 2012,
2664 2008, 2005, 2001, 1996, 1991, 1989, 1988, 1985,
2665 1982, 1978, 1974, 1972, 1970, 1967, 1964, 1960,
2666 1961, 1959, 1955, 1952, 1951, 1949, 1949, 1947,
2667 1944, 1945, 1944, 1944, 1942, 1941, 1940, 1937,
2668 1934, 1931, 1932, 1931, 1931, 1932, 1932, 1930,
2669 1929, 1927, 1926, 1926, 1928, 1931, 1933, 1935,
2670 1935, 1935, 1937, 1938, 1940, 1941, 1937, 1938,
2671 1940, 1940, 1942, 1942, 1943, 1945, 1947, 1948,
2672 1950, 1954, 1953, 1955, 1957, 1959, 1961, 1965,
2673 1965, 1965, 1966, 1968, 1971, 1971, 1972, 1972,
2674 1974, 1975, 1975, 1978, 1980, 1980, 1982, 1983,
2675 1983, 1984, 1986, 1988, 1992, 1993, 1994, 1997,
2676 1996, 1994, 1994, 1998, 1999, 2002, 2004, 2007,
2677 2009, 2010, 2012, 2013, 2017, 2020, 2022, 2024,
2678 2027, 2027, 2030, 2034, 2037, 2039, 2041, 2045,
2679 2049, 2050, 2052, 2055, 2055, 2057, 2060, 2062,
2680 2067, 2072, 2075, 2077, 2078, 2082, 2085, 2089,
2681 2090, 2094, 2095, 2098, 2099, 2103, 2107, 2108,
2682 2111, 2113, 2115, 2115, 2117, 2116, 2117, 2118,
2683 2120, 2121, 2124, 2125, 2126, 2126, 2127, 2129,
2684 2129, 2129, 2129, 2131, 2129, 2129, 2129, 2128,
2685 2128, 2126, 2127, 2127, 2128, 2128, 2126, 2126,
2686 2125, 2126, 2125, 2124, 2121, 2120, 2119, 2118,
2687 2118, 2118, 2116, 2114, 2114, 2116, 2115, 2115,
2688 2111, 2110, 2110, 2110, 2107, 2108, 2108, 2106,
2689 2109, 2109, 2110, 2110, 2109, 2108, 2107, 2103,
2690 2102, 2102, 2102, 2101, 2099, 2101, 2098, 2096,
2691 2093, 2093, 2094, 2093, 2094, 2095, 2095, 2097,
2692 2094, 2090, 2091, 2088, 2084, 2083, 2083, 2082,
2693 2079, 2076, 2076, 2076, 2076, 2073, 2073, 2071,
2694 2068, 2069, 2068, 2066, 2063, 2063, 2063, 2065,
2695 2064, 2063, 2062, 2063, 2065, 2065, 2068, 2068,
2696 2066, 2068, 2066, 2062, 2064, 2067, 2063, 2063,
2697 2063, 2063, 2064, 2061, 2060, 2062, 2061, 2061,
2698 2059, 2061, 2060, 2057, 2059, 2059, 2058, 2058,
2699 2055, 2053, 2054, 2052, 2047, 2044, 2041, 2042,
2700 2040, 2041, 2041, 2042, 2039, 2039, 2040, 2042,
2701 2042, 2040, 2040, 2036, 2036, 2037, 2035, 2034,
2702 2034, 2032, 2031, 2028, 2027, 2026, 2023, 2025,
2703 2026, 2028, 2027, 2027, 2028, 2026, 2026, 2027,
2704 2025, 2022, 2019, 2016, 2011, 2010, 2008, 2008,
2705 2004, 2001, 1999, 1998, 1996, 1997, 1994, 1992,
2706 1993, 1990, 1989, 1985, 1984, 1983, 1980, 1979,
2707 1975, 1970, 1969, 1971, 1970, 1969, 1969, 1969,
2708 1970, 1971, 1973, 1975, 1974, 1974, 1974, 1975,
2709 1972, 1974, 1974, 1974, 1976, 1972, 1973, 1973,
2710 1973, 1973, 1969, 1972, 1972, 1977, 1981, 1984,
2711 1987, 1989, 1989, 1990, 1991, 1991, 1990, 1991,
2712 1989, 1987, 1985, 1988, 1987, 1986, 1987, 1988,
2713 1989, 1988, 1992, 1993, 1992, 1994, 1995, 1995,
2714 1994, 1993, 1991, 1994, 1992, 1990, 1992, 1990,
2715 1994, 1994, 1997, 1997, 1999, 2001, 2002, 2003,
2716 2003, 2003, 2005, 2003, 2000, 2000, 2001, 2003,
2717 2004, 2004, 2002, 2002, 2003, 2002, 2002, 2002,
2718 2003, 2002, 2001, 2005, 2003, 2001, 2001, 2003,
2719 2002, 2001, 2001, 2000, 2002, 2000, 2002, 2002,
2720 2002, 2003, 2002, 2005, 2004, 2004, 2008, 2007,
2721 2008, 2010, 2013, 2018, 2019, 2020, 2021, 2022,
2722 2023, 2023, 2024, 2024, 2022, 2022, 2023, 2025,
2723 2026, 2026, 2029, 2030, 2030, 2032, 2032, 2034,
2724 2032, 2033, 2031, 2033, 2035, 2036, 2037, 2037,
2725 2036, 2035, 2038, 2040, 2040, 2040, 2039, 2039,
2726 2040, 2041, 2040, 2040, 2039, 2041, 2040, 2039,
2727 2041, 2039, 2038, 2038, 2041, 2042, 2042, 2044,
2728 2042, 2042, 2040, 2042, 2044, 2043, 2043, 2045,
2729 2045, 2044, 2047, 2048, 2048, 2049, 2050, 2049,
2730 2051, 2052, 2053, 2056, 2055, 2055, 2056, 2056,
2731 2059, 2056, 2058, 2056, 2055, 2056, 2054, 2058,
2732 2059, 2059, 2059, 2058, 2057, 2058, 2056, 2056,
2733 2059, 2060, 2060, 2062, 2064, 2064, 2063, 2065,
2734 2065, 2066, 2064, 2065, 2067, 2064, 2064, 2064,
2735 2066, 2064, 2066, 2064, 2064, 2066, 2065, 2065,
2736 2064, 2064, 2063, 2064, 2063, 2063, 2064, 2063,
2737 2064, 2066, 2066, 2068, 2068, 2063, 2062, 2062,
2738 2063, 2065, 2065, 2063, 2062, 2064, 2064, 2067,
2739 2064, 2065, 2066, 2062, 2063, 2064, 2064, 2065,
2740 2066, 2064, 2066, 2069, 2069, 2070, 2070, 2070,
2741 2068, 2069, 2071, 2073, 2074, 2077, 2076, 2079,
2742 2080, 2082, 2082, 2083, 2083, 2082, 2082, 2081,
2743 2083, 2083, 2080, 2081, 2081, 2083, 2083, 2083,
2744 2083, 2080, 2081, 2084, 2085, 2084, 2085, 2085,
2745 2083, 2082, 2080, 2081, 2080, 2080, 2078, 2079,
2746 2077, 2076, 2076, 2076, 2078, 2076, 2077, 2078,
2747 2080, 2080, 2082, 2084, 2082, 2082, 2082, 2081,
2748 2082, 2082, 2083, 2083, 2084, 2085, 2086, 2086,
2749 2084, 2085, 2086, 2087, 2087, 2089, 2088, 2085,
2750 2086, 2089, 2088, 2087, 2086, 2086, 2086, 2090,
2751 2089, 2089, 2090, 2092, 2094, 2095, 2095, 2097,
2752 2098, 2099, 2100, 2099, 2101, 2104, 2102, 2101,
2753 2101, 2101, 2103, 2102, 2099, 2096, 2097, 2098,
2754 2097, 2097, 2099, 2099, 2100, 2100, 2102, 2105,
2755 2104, 2100, 2099, 2096, 2097, 2095, 2092, 2094,
2756 2092, 2089, 2089, 2088, 2088, 2085, 2085, 2083,
2757 2082, 2081, 2080, 2081, 2082, 2082, 2080, 2080,
2758 2080, 2079, 2080, 2078, 2076, 2074, 2073, 2073,
2759 2073, 2072, 2071, 2067, 2067, 2069, 2070, 2072,
2760 2074, 2077, 2078, 2078, 2080, 2078, 2076, 2076,
2761 2073, 2073, 2071, 2070, 2071, 2069, 2069, 2069,
2762 2069, 2068, 2069, 2069, 2068, 2068, 2068, 2069,
2763 2068, 2066, 2064, 2064, 2063, 2062, 2061, 2055,
2764 2058, 2059, 2057, 2056, 2055, 2058, 2057, 2055,
2765 2054, 2055, 2056, 2055, 2055, 2055, 2052, 2053,
2766 2055, 2054, 2055, 2052, 2051, 2051, 2050, 2049,
2767 2049, 2050, 2048, 2049, 2049, 2049, 2050, 2052,
2768 2052, 2052, 2052, 2053, 2054, 2057, 2057, 2058,
2769 2058, 2058, 2061, 2061, 2062, 2064, 2065, 2066,
2770 2068, 2067, 2070, 2071, 2073, 2075, 2075, 2076,
2771 2078, 2078, 2077, 2076, 2080, 2077, 2079, 2080,
2772 2081, 2079, 2076, 2075, 2074, 2077, 2075, 2071,
2773 2071, 2070, 2070, 2073, 2073, 2076, 2074, 2071,
2774 2072, 2072, 2071, 2072, 2069, 2066, 2064, 2062,
2775 2061, 2062, 2063, 2062, 2064, 2062, 2060, 2062,
2776 2062, 2061, 2061, 2060, 2056, 2057, 2057, 2055,
2777 2056, 2056, 2055, 2056, 2057, 2057, 2058, 2059,
2778 2060, 2059, 2062, 2065, 2067, 2068, 2067, 2067,
2779 2067, 2066, 2066, 2065, 2063, 2060, 2064, 2067,
2780 2067, 2065, 2063, 2062, 2063, 2063, 2061, 2061,
2781 2060, 2060, 2059, 2059, 2061, 2060, 2064, 2064,
2782 2063, 2062, 2061, 2061, 2060, 2060, 2059, 2057,
2783 2056, 2055, 2056, 2058, 2058, 2060, 2058, 2060,
2784 2060, 2057, 2056, 2055, 2055, 2054, 2052, 2051,
2785 2052, 2048, 2048, 2050, 2051, 2046, 2044, 2043,
2786 2045, 2045, 2042, 2044, 2044, 2045, 2046, 2048,
2787 2047, 2049, 2045, 2043, 2042, 2042, 2040, 2039,
2788 2040, 2039, 2042, 2041, 2042, 2044, 2043, 2041,
2789 2040, 2039, 2036, 2038, 2039, 2040, 2042, 2043,
2790 2042, 2042, 2043, 2043, 2042, 2042, 2041, 2042,
2791 2041, 2044, 2044, 2041, 2042, 2043, 2040, 2041,
2792 2040, 2038, 2038, 2036, 2034, 2034, 2035, 2032,
2793 2032, 2031, 2032, 2031, 2029, 2030, 2029, 2029,
2794 2027, 2025, 2024, 2025, 2022, 2021, 2016, 2012,
2795 2012, 2014, 2014, 2014, 2013, 2011, 2010, 2008,
2796 2010, 2009, 2008, 2007, 2006, 2008, 2009, 2010,
2797 2011, 2008, 2009, 2011, 2010, 2012, 2012, 2011,
2798 2011, 2008, 2010, 2012, 2012, 2014, 2014, 2013,
2799 2007, 2012, 2017, 2018, 2016, 2013, 2011, 2015,
2800 2016, 2018, 2020, 2019, 2018, 2020, 2021, 2023,
2801 2024, 2023, 2026, 2024, 2025, 2027, 2027, 2026,
2802 2025, 2026, 2026, 2024, 2025, 2024, 2019, 2017,
2803 2015, 2012, 2010, 2009, 2010, 2010, 2008, 2005,
2804 2007, 2008, 2004, 2002, 1999, 1995, 1994, 1997,
2805 1997, 1997, 1996, 1995, 2000, 2001, 1998, 1998,
2806 1994, 1994, 1993, 1993, 1990, 1991, 1991, 1991,
2807 1996, 1993, 1995, 1995, 1997, 1994, 1994, 1994,
2808 1993, 1993, 1990, 1990, 1992, 1994, 1996, 1998,
2809 1998, 1998, 2000, 2002, 2001, 2001, 2000, 1998,
2810 2003, 2004, 2002, 2003, 2006, 2006, 2007, 2004,
2811 2002, 2001, 2000, 2000, 2002, 2001, 2002, 2003,
2812 2003, 2005, 2002, 2003, 2004, 2004, 2003, 1999,
2813 1996, 1998, 2000, 2001, 2001, 2000, 2001, 2003,
2814 2007, 2006, 2006, 2006, 2007, 2005, 2009, 2008,
2815 2008, 2011, 2011, 2017, 2016, 2016, 2019, 2021,
2816 2022, 2023, 2020, 2019, 2021, 2022, 2022, 2019,
2817 2020, 2021, 2022, 2021, 2025, 2027, 2025, 2025,
2818 2026, 2028, 2029, 2031, 2029, 2030, 2033, 2034,
2819 2034, 2031, 2030, 2032, 2033, 2032, 2033, 2032,
2820 2032, 2033, 2033, 2033, 2034, 2033, 2033, 2035,
2821 2034, 2032, 2033, 2034, 2030, 2028, 2026, 2026,
2822 2029, 2028, 2028, 2027, 2029, 2031, 2033, 2034,
2823 2034, 2033, 2032, 2034, 2034, 2032, 2031, 2034,
2824 2032, 2034, 2030, 2032, 2033, 2031, 2032, 2031,
2825 2030, 2031, 2031, 2030, 2029, 2028, 2027, 2028,
2826 2029, 2029, 2027, 2027, 2027, 2028, 2029, 2025,
2827 2024, 2022, 2022, 2025, 2026, 2027, 2026, 2027,
2828 2030, 2032, 2030, 2030, 2028, 2029, 2028, 2027,
2829 2028, 2030, 2032, 2030, 2032, 2033, 2032, 2031,
2830 2030, 2033, 2031, 2031, 2034, 2033, 2039, 2039,
2831 2039, 2041, 2043, 2043, 2041, 2039, 2038, 2038,
2832 2039, 2040, 2041, 2040, 2044, 2044, 2043, 2044,
2833 2044, 2047, 2049, 2045, 2046, 2046, 2044, 2046,
2834 2046, 2046, 2047, 2043, 2040, 2041, 2040, 2041,
2835 2045, 2044, 2044, 2046, 2043, 2042, 2042, 2041,
2836 2041, 2041, 2042, 2043, 2043, 2044, 2044, 2042,
2837 2042, 2044, 2044, 2044, 2046, 2045, 2046, 2046,
2838 2044, 2043, 2044, 2041, 2040, 2042, 2043, 2042,
2839 2043, 2047, 2046, 2048, 2045, 2045, 2046, 2046,
2840 2045, 2046, 2046, 2044, 2042, 2042, 2043, 2045,
2841 2047, 2046, 2046, 2048, 2048, 2049, 2050, 2049,
2842 2047, 2047, 2048, 2050, 2050, 2049, 2050, 2050,
2843 2051, 2050, 2048, 2048, 2047, 2044, 2044, 2043,
2844 2042, 2043, 2041, 2040, 2041, 2039, 2038, 2038,
2845 2038, 2038, 2039, 2036, 2034, 2034, 2031, 2031,
2846 2031, 2029, 2028, 2027, 2028, 2028, 2026, 2025,
2847 2027, 2030, 2028, 2027, 2025, 2024, 2023, 2020,
2848 2021, 2020, 2018, 2021, 2021, 2020, 2018, 2020,
2849 2019, 2021, 2026, 2027, 2027, 2027, 2028, 2027,
2850 2028, 2026, 2029, 2026, 2025, 2028, 2029, 2030,
2851 2033, 2034, 2034, 2034, 2036, 2036, 2039, 2041,
2852 2041, 2040, 2039, 2036, 2033, 2030, 2032, 2031,
2853 2029, 2034, 2039, 2044, 2048, 2051, 2054, 2055,
2854 2054, 2057, 2059, 2056, 2053, 2050, 2048, 2044,
2855 2037, 2033, 2030, 2026, 2027, 2028, 2031, 2037,
2856 2042, 2046, 2051, 2051, 2056, 2056, 2052, 2048,
2857 2044, 2037, 2029, 2023, 2014, 2007, 2003, 2002,
2858 2001, 1999, 1952, 1835, 1745, 1700, 1674, 1683,
2859 1730, 1806, 1892, 1979, 2053, 2095, 2102, 2106,
2860 2121, 2130, 2119, 2100, 2071, 2028, 1984, 1947,
2861 1918, 1900, 1904, 1935, 1979, 2022, 2068, 2117,
2862 2154, 2185, 2200, 2203, 2195, 2171, 2138, 2103,
2863 2079, 2045, 2012, 2001, 2006, 2014, 2025, 2046,
2864 2071, 2087, 2104, 2123, 2137, 2145, 2147, 2156,
2865 2150, 2130, 2105, 2082, 2044, 2005, 1982, 1967,
2866 1967, 1976, 1996, 1991, 1900, 1837, 1827, 1801,
2867 1808, 1817, 1847, 1897, 1932, 1965, 1973, 1967,
2868 1969, 2007, 2030, 2021, 2003, 1972, 1936, 1895,
2869 1870, 1845, 1822, 1827, 1856, 1892, 1915, 1937,
2870 1964, 1985, 2006, 2025, 2041, 2046, 2029, 2015,
2871 2001, 1988, 1969, 1936, 1912, 1908, 1909, 1918,
2872 1931, 1948, 1974, 2003, 2029, 2050, 2066, 2074,
2873 2075, 2065, 2045, 2027, 2012, 1990, 1967, 1957,
2874 1960, 1970, 1981, 1996, 2015, 2026, 2040, 2054,
2875 2058, 2051, 2049, 2056, 2058, 2049, 2029, 2008,
2876 1991, 1985, 1983, 1975, 1951, 1915, 1878, 1859,
2877 1850, 1841, 1846, 1863, 1891, 1923, 1957, 1977,
2878 1975, 1960, 1953, 1956, 1965, 1970, 1964, 1957,
2879 1943, 1933, 1923, 1910, 1898, 1892, 1897, 1914,
2880 1945, 1973, 2000, 2018, 2031, 2040, 2038, 2026,
2881 2002, 1975, 1954, 1945, 1942, 1938, 1941, 1951,
2882 1964, 1971, 1972, 1970, 1979, 1989, 1996, 2004,
2883 2013, 2012, 2009, 2022, 2016, 1991, 1975, 1980,
2884 1974, 1947, 1934, 1950, 1976, 2002, 2023, 2035,
2885 2041, 2047, 2053, 2046, 2030, 2021, 2017, 2011,
2886 2015, 2021, 2010, 1991, 1984, 1996, 2011, 2016,
2887 2013, 2008, 2006, 2017, 2024, 2023, 2026, 2032,
2888 2031, 2030, 2029, 2025, 2004, 1987, 1996, 2021,
2889 2041, 2042, 2035, 2033, 2031, 2026, 2011, 1998,
2890 1989, 1977, 1963, 1956, 1957, 1951, 1941, 1935,
2891 1939, 1951, 1956, 1956, 1952, 1948, 1950, 1950,
2892 1945, 1938, 1908, 1840, 1792, 1779, 1765, 1742,
2893 1726, 1745, 1771, 1801, 1839, 1877, 1904, 1924,
2894 1950, 1965, 1975, 1976, 1957, 1929, 1906, 1900,
2895 1888, 1864, 1847, 1846, 1861, 1881, 1909, 1945,
2896 1986, 2019, 2043, 2056, 2062, 2055, 2026, 2000,
2897 1988, 1976, 1954, 1935, 1934, 1950, 1972, 1984,
2898 1998, 2022, 2047, 2060, 2063, 2064, 2062, 2057,
2899 2046, 2040, 2033, 2016, 2000, 1991, 1978, 1969,
2900 1972, 1995, 2016, 2028, 2051, 2070, 2071, 2066,
2901 2059, 2044, 2023, 2007, 2003, 1999, 1984, 1970,
2902 1965, 1963, 1962, 1970, 1982, 1988, 1993, 1996,
2903 2001, 2005, 2000, 2001, 1999, 1991, 1984, 1972,
2904 1960, 1944, 1929, 1920, 1919, 1935, 1958, 1974,
2905 1980, 1991, 2005, 2018, 2015, 1997, 1984, 1971,
2906 1956, 1948, 1945, 1940, 1945, 1963, 1973, 1972,
2907 1975, 1981, 1986, 1988, 1995, 2009, 2020, 2032,
2908 2035, 2026, 2008, 1991, 1973, 1962, 1964, 1971,
2909 1981, 1999, 2025, 2050, 2063, 2068, 2062, 2052,
2910 2044, 2038, 2033, 2028, 2027, 2028, 2031, 2031,
2911 2033, 2029, 2021, 2019, 2017, 2021, 2031, 2044,
2912 2058, 2068, 2075, 2074, 2067, 2056, 2044, 2031,
2913 2015, 2002, 2000, 1997, 2001, 2010, 2012, 2025,
2914 2035, 2041, 2044, 2046, 2048, 2043, 2039, 2035,
2915 2036, 2032, 2025, 2016, 2004, 1989, 1982, 1983,
2916 1989, 1998, 2008, 2021, 2032, 2036, 2037, 2035,
2917 2031, 2021, 2012, 2011, 2008, 2002, 1999, 2000,
2918 2001, 2003, 2011, 2021, 2025, 2024, 2027, 2033,
2919 2036, 2036, 2038, 2039, 2042, 2040, 2037, 2034,
2920 2027, 2019, 2013, 2012, 2013, 2018, 2030, 2043,
2921 2057, 2067, 2074, 2075, 2069, 2060, 2051, 2044,
2922 2036, 2030, 2031, 2033, 2037, 2040, 2043, 2043,
2923 2048, 2053, 2054, 2054, 2061, 2069, 2066, 2060,
2924 2059, 2056, 2052, 2050, 2054, 2057, 2053, 2055,
2925 2055, 2059, 2060, 2063, 2067, 2069, 2068, 2070,
2926 2067, 2058, 2047, 2043, 2042, 2039, 2040, 2047,
2927 2051, 2050, 2052, 2055, 2058, 2056, 2055, 2053,
2928 2053, 2049, 2047, 2045, 2040, 2036, 2031, 2028,
2929 2026, 2026, 2032, 2039, 2047, 2053, 2058, 2061,
2930 2060, 2062, 2056, 2046, 2043, 2040, 2040, 2037,
2931 2036, 2037, 2041, 2042, 2044, 2048, 2048, 2050,
2932 2056, 2062, 2066, 2068, 2071, 2072, 2070, 2069,
2933 2066, 2057, 2048, 2044, 2044, 2047, 2050, 2055,
2934 2061, 2067, 2072, 2078, 2083, 2085, 2088, 2087,
2935 2084, 2083, 2076, 2071, 2067, 2062, 2060, 2060,
2936 2058, 2056, 2059, 2065, 2073, 2079, 2088, 2089,
2937 2093, 2097, 2097, 2092, 2084, 2078, 2074, 2067,
2938 2060, 2058, 2056, 2058, 2058, 2065, 2067, 2073,
2939 2077, 2081, 2080, 2074, 2072, 2069, 2067, 2063,
2940 2062, 2059, 2061, 2060, 2057, 2055, 2054, 2057,
2941 2061, 2065, 2067, 2065, 2063, 2063, 2061, 2058,
2942 2053, 2052, 2050, 2051, 2053, 2057, 2059, 2061,
2943 2060, 2058, 2060, 2058, 2061, 2068, 2071, 2070,
2944 2066, 2069, 2067, 2061, 2055, 2052, 2054, 2054,
2945 2055, 2056, 2061, 2063, 2065, 2066, 2071, 2076,
2946 2080, 2082, 2081, 2080, 2075, 2068, 2058, 2048,
2947 2040, 2036, 2035, 2040, 2050, 2059, 2070, 2083,
2948 2092, 2097, 2094, 2091, 2087, 2077, 2070, 2062,
2949 2054, 2049, 2048, 2048, 2046, 2044, 2051, 2058,
2950 2067, 2075, 2088, 2091, 2085, 2077, 2068, 2063,
2951 2056, 2056, 2062, 2064, 2061, 2056, 2051, 2046,
2952 2044, 2047, 2050, 2057, 2063, 2064, 2061, 2056,
2953 2057, 2059, 2063, 2068, 2068, 2068, 2063, 2054,
2954 2043, 2036, 2033, 2035, 2039, 2045, 2048, 2051,
2955 2049, 2047, 2048, 2046, 2052, 2057, 2058, 2058,
2956 2054, 2046, 2040, 2039, 2036, 2037, 2041, 2045,
2957 2049, 2052, 2049, 2042, 2030, 2022, 2020, 2022,
2958 2029, 2039, 2048, 2058, 2064, 2062, 2056, 2045,
2959 2040, 2036, 2032, 2029, 2024, 2020, 2014, 2012,
2960 2016, 2023, 2034, 2043, 2051, 2053, 2052, 2048,
2961 2041, 2034, 2030, 2028, 2027, 2024, 2016, 2008,
2962 2003, 2001, 2003, 2009, 2019, 2026, 2032, 2033,
2963 2033, 2032, 2033, 2036, 2038, 2038, 2034, 2035,
2964 2031, 2029, 2024, 2023, 2024, 2027, 2027, 2026,
2965 2020, 2017, 2018, 2022, 2026, 2031, 2038, 2039,
2966 2038, 2039, 2038, 2036, 2030, 2024, 2022, 2020,
2967 2016, 2012, 2011, 2011, 2013, 2018, 2025, 2028,
2968 2026, 2024, 2018, 2014, 2008, 2003, 2001, 2007,
2969 2014, 2025, 2029, 2026, 2019, 2008, 1999, 1990,
2970 1985, 1984, 1989, 1995, 2007, 2015, 2015, 2015,
2971 2014, 2013, 2012, 2016, 2016, 2015, 2014, 2008,
2972 2001, 1991, 1987, 1984, 1986, 1989, 1995, 2004,
2973 2009, 2011, 2010, 2006, 2000, 1996, 1997, 1996,
2974 2000, 2000, 1999, 2002, 2001, 2000, 1997, 1994,
2975 1989, 1988, 1986, 1981, 1977, 1979, 1982, 1986,
2976 1990, 1998, 2000, 2002, 2001, 2000, 1993, 1983,
2977 1977, 1970, 1963, 1960, 1963, 1962, 1965, 1966,
2978 1967, 1969, 1968, 1972, 1976, 1979, 1983, 1984,
2979 1985, 1986, 1982, 1975, 1969, 1963, 1960, 1958,
2980 1961, 1965, 1969, 1972, 1976, 1980, 1983, 1988,
2981 1989, 1990, 1991, 1990, 1986, 1984, 1983, 1980,
2982 1974, 1972, 1973, 1977, 1984, 1992, 1997, 2000,
2983 2005, 2009, 2009, 2003, 1998, 1992, 1986, 1983,
2984 1977, 1973, 1969, 1968, 1974, 1977, 1984, 1992,
2985 1998, 2004, 2001, 1996, 1990, 1986, 1984, 1982,
2986 1982, 1986, 1988, 1990, 1988, 1986, 1984, 1984,
2987 1983, 1984, 1988, 1993, 1998, 2003, 2005, 2001,
2988 1996, 1991, 1986, 1983, 1979, 1982, 1983, 1986,
2989 1991, 1992, 1990, 1986, 1984, 1980, 1982, 1982,
2990 1984, 1986, 1984, 1987, 1987, 1982, 1984, 1986,
2991 1983, 1984, 1985, 1987, 1986, 1985, 1982, 1982,
2992 1984, 1985, 1988, 1986, 1988, 1990, 1991, 1992,
2993 1993, 1992, 1991, 1991, 1988, 1987, 1990, 1991,
2994 1994, 1997, 2001, 2001, 1999, 1995, 1988, 1984,
2995 1980, 1976, 1976, 1982, 1985, 1987, 1989, 1991,
2996 1993, 1993, 1996, 1999, 2003, 2005, 2004, 2004,
2997 2002, 1998, 1994, 1989, 1986, 1984, 1983, 1984,
2998 1983, 1981, 1985, 1986, 1986, 1986, 1988, 1992,
2999 1997, 2000, 1999, 1996, 1991, 1991, 1988, 1982,
3000 1983, 1980, 1981, 1984, 1984, 1985, 1985, 1989,
3001 1991, 1994, 1999, 1996, 1994, 1989, 1988, 1988,
3002 1979, 1980, 1979, 1980, 1979, 1980, 1982, 1984,
3003 1985, 1986, 1988, 1988, 1992, 1991, 1989, 1987,
3004 1988, 1987, 1987, 1991, 1994, 1999, 2003, 2001,
3005 2000, 1999, 1996, 1991, 1990, 1990, 1991, 1990,
3006 1992, 1994, 1993, 1997, 1997, 2002, 2009, 2016,
3007 2022, 2025, 2028, 2027, 2024, 2024, 2024, 2022,
3008 2025, 2024, 2022, 2021, 2019, 2017, 2014, 2017,
3009 2020, 2023, 2026, 2030, 2034, 2036, 2033, 2032,
3010 2030, 2029, 2027, 2021, 2019, 2017, 2016, 2019,
3011 2027, 2031, 2033, 2035, 2032, 2030, 2024, 2022,
3012 2016, 2015, 2017, 2014, 2013, 2013, 2012, 2012,
3013 2014, 2017, 2023, 2029, 2033, 2036, 2037, 2034,
3014 2032, 2029, 2029, 2029, 2030, 2030, 2032, 2030,
3015 2026, 2021, 2019, 2021, 2027, 2033, 2038, 2040,
3016 2044, 2047, 2043, 2038, 2035, 2033, 2031, 2030,
3017 2030, 2030, 2031, 2033, 2038, 2039, 2038, 2037,
3018 2039, 2038, 2037, 2035, 2036, 2039, 2042, 2043,
3019 2041, 2042, 2042, 2040, 2036, 2037, 2040, 2040,
3020 2042, 2046, 2049, 2046, 2044, 2044, 2043, 2040,
3021 2036, 2039, 2042, 2045, 2048, 2043, 2040, 2037,
3022 2036, 2034, 2033, 2032, 2032, 2032, 2036, 2037,
3023 2040, 2041, 2042, 2043, 2047, 2051, 2051, 2049,
3024 2047, 2043, 2035, 2031, 2027, 2025, 2026, 2024,
3025 2030, 2034, 2036, 2038, 2039, 2045, 2052, 2054,
3026 2055, 2054, 2053, 2052, 2051, 2048, 2046, 2044,
3027 2048, 2048, 2046, 2046, 2047, 2046, 2047, 2048,
3028 2049, 2051, 2051, 2052, 2051, 2052, 2052, 2055,
3029 2062, 2064, 2067, 2068, 2066, 2068, 2067, 2066,
3030 2069, 2069, 2070, 2072, 2071, 2071, 2067, 2062,
3031 2061, 2063, 2064, 2067, 2067, 2067, 2071, 2071,
3032 2074, 2079, 2080, 2081, 2080, 2078, 2074, 2072,
3033 2068, 2062, 2060, 2061, 2064, 2065, 2069, 2073,
3034 2076, 2081, 2084, 2089, 2091, 2094, 2093, 2093,
3035 2090, 2086, 2085, 2081, 2081, 2081, 2082, 2082,
3036 2081, 2081, 2080, 2078, 2080, 2084, 2086, 2090,
3037 2096, 2095, 2095, 2093, 2091, 2085, 2086, 2088,
3038 2088, 2090, 2091, 2091, 2089, 2088, 2089, 2088,
3039 2087, 2089, 2089, 2092, 2096, 2099, 2102, 2101,
3040 2100, 2102, 2102, 2098, 2096, 2092, 2089, 2086,
3041 2084, 2086, 2093, 2097, 2105, 2111, 2115, 2116,
3042 2114, 2112, 2111, 2112, 2113, 2116, 2114, 2119,
3043 2124, 2127, 2122, 2115, 2114, 2111, 2111, 2112,
3044 2114, 2115, 2118, 2123, 2127, 2131, 2133, 2135,
3045 2136, 2135, 2131, 2130, 2130, 2131, 2130, 2129,
3046 2131, 2135, 2136, 2139, 2139, 2137, 2133, 2130,
3047 2126, 2124, 2129, 2129, 2129, 2126, 2126, 2128,
3048 2128, 2126, 2127, 2127, 2132, 2134, 2131, 2129,
3049 2126, 2124, 2122, 2119, 2115, 2112, 2110, 2111,
3050 2112, 2114, 2114, 2116, 2115, 2118, 2121, 2125,
3051 2126, 2124, 2124, 2120, 2118, 2115, 2113, 2110,
3052 2111, 2111, 2109, 2108, 2110, 2112, 2115, 2119,
3053 2121, 2123, 2123, 2121, 2121, 2120, 2123, 2124,
3054 2125, 2127, 2128, 2129, 2127, 2124, 2119, 2114,
3055 2112, 2110, 2111, 2114, 2114, 2118, 2123, 2126,
3056 2127, 2125, 2126, 2130, 2131, 2133, 2130, 2128,
3057 2125, 2120, 2118, 2117, 2116, 2119, 2129, 2132,
3058 2133, 2134, 2131, 2132, 2131, 2134, 2137, 2139,
3059 2140, 2139, 2138, 2133, 2130, 2126, 2123, 2123,
3060 2127, 2128, 2130, 2134, 2133, 2134, 2137, 2140,
3061 2142, 2144, 2144, 2141, 2136, 2133, 2128, 2121,
3062 2118, 2120, 2127, 2129, 2134, 2138, 2138, 2138,
3063 2134, 2133, 2131, 2133, 2134, 2131, 2126, 2121,
3064 2115, 2108, 2109, 2114, 2120, 2128, 2136, 2141,
3065 2142, 2142, 2143, 2139, 2139, 2139, 2137, 2135,
3066 2128, 2123, 2116, 2110, 2108, 2108, 2110, 2116,
3067 2119, 2122, 2128, 2129, 2126, 2123, 2125, 2127,
3068 2130, 2128, 2124, 2119, 2113, 2106, 2104, 2105,
3069 2107, 2110, 2115, 2118, 2118, 2118, 2118, 2115,
3070 2114, 2115, 2115, 2115, 2114, 2112, 2111, 2111,
3071 2110, 2112, 2115, 2116, 2117, 2119, 2116, 2115,
3072 2112, 2111, 2110, 2108, 2107, 2105, 2106, 2106,
3073 2106, 2106, 2106, 2106, 2107, 2108, 2108, 2107,
3074 2110, 2113, 2115, 2113, 2108, 2103, 2094, 2086,
3075 2084, 2086, 2087, 2084, 2085, 2089, 2090, 2091,
3076 2096, 2100, 2103, 2105, 2110, 2108, 2105, 2098,
3077 2093, 2091, 2087, 2089, 2094, 2099, 2101, 2101,
3078 2097, 2094, 2093, 2090, 2096, 2104, 2109, 2110,
3079 2108, 2104, 2102, 2102, 2104, 2108, 2113, 2117,
3080 2120, 2119, 2118, 2118, 2113, 2115, 2119, 2120,
3081 2125, 2126, 2121, 2117, 2111, 2108, 2110, 2112,
3082 2116, 2121, 2127, 2129, 2130, 2127, 2128, 2128,
3083 2130, 2134, 2137, 2136, 2133, 2129, 2124, 2119,
3084 2115, 2115, 2117, 2121, 2127, 2131, 2132, 2132,
3085 2131, 2131, 2135, 2138, 2140, 2138, 2136, 2130,
3086 2124, 2122, 2123, 2125, 2132, 2138, 2144, 2147,
3087 2147, 2146, 2144, 2144, 2143, 2143, 2144, 2143,
3088 2138, 2133, 2127, 2121, 2118, 2121, 2128, 2135,
3089 2143, 2151, 2154, 2152, 2151, 2147, 2143, 2142,
3090 2142, 2139, 2135, 2134, 2133, 2133, 2134, 2135,
3091 2136, 2140, 2144, 2143, 2143, 2144, 2144, 2144,
3092 2144, 2145, 2148, 2146, 2145, 2144, 2143, 2139,
3093 2139, 2138, 2139, 2140, 2141, 2144, 2149, 2152,
3094 2155, 2157, 2158, 2160, 2160, 2160, 2157, 2156,
3095 2153, 2151, 2152, 2152, 2149, 2148, 2148, 2147,
3096 2149, 2152, 2158, 2161, 2165, 2164, 2165, 2166,
3097 2166, 2164, 2161, 2163, 2163, 2163, 2160, 2157,
3098 2157, 2156, 2153, 2155, 2159, 2162, 2163, 2166,
3099 2171, 2171, 2170, 2166, 2161, 2157, 2153, 2153,
3100 2155, 2155, 2152, 2153, 2155, 2157, 2159, 2160,
3101 2165, 2168, 2167, 2167, 2161, 2156, 2154, 2152,
3102 2152, 2154, 2155, 2157, 2156, 2159, 2156, 2157,
3103 2157, 2158, 2159, 2163, 2169, 2166, 2162, 2158,
3104 2154, 2153, 2151, 2148, 2152, 2158, 2156, 2155,
3105 2157, 2159, 2156, 2154, 2154, 2157, 2156, 2158,
3106 2160, 2158, 2156, 2153, 2151, 2149, 2146, 2150,
3107 2155, 2156, 2159, 2160, 2161, 2163, 2166, 2168,
3108 2168, 2169, 2170, 2169, 2164, 2157, 2152, 2150,
3109 2150, 2148, 2150, 2155, 2162, 2165, 2170, 2172,
3110 2177, 2181, 2184, 2184, 2182, 2180, 2175, 2171,
3111 2164, 2160, 2156, 2157, 2161, 2162, 2164, 2167,
3112 2165, 2163, 2165, 2165, 2167, 2169, 2171, 2172,
3113 2172, 2171, 2170, 2170, 2173, 2176, 2172, 2171,
3114 2171, 2171, 2165, 2160, 2153, 2154, 2159, 2167,
3115 2170, 2170, 2171, 2173, 2172, 2170, 2169, 2171,
3116 2174, 2176, 2180, 2179, 2174, 2170, 2168, 2168,
3117 2167, 2167, 2168, 2169, 2171, 2169, 2169, 2171,
3118 2173, 2177, 2179, 2185, 2189, 2191, 2188, 2181,
3119 2179, 2178, 2176, 2179, 2182, 2183, 2178, 2177,
3120 2172, 2165, 2159, 2158, 2164, 2168, 2169, 2173,
3121 2173, 2170, 2173, 2175, 2177, 2179, 2185, 2189,
3122 2193, 2190, 2186, 2183, 2180, 2182, 2182, 2184,
3123 2188, 2188, 2185, 2180, 2174, 2172, 2171, 2170,
3124 2173, 2178, 2178, 2178, 2176, 2177, 2177, 2179,
3125 2184, 2188, 2194, 2199, 2200, 2198, 2193, 2188,
3126 2182, 2177, 2175, 2172, 2172, 2172, 2174, 2173,
3127 2175, 2173, 2179, 2186, 2190, 2197, 2200, 2201,
3128 2196, 2190, 2185, 2180, 2176, 2174, 2169, 2167,
3129 2164, 2162, 2158, 2157, 2158, 2162, 2169, 2177,
3130 2185, 2190, 2192, 2192, 2186, 2180, 2175, 2173,
3131 2169, 2166, 2165, 2162, 2158, 2153, 2152, 2155,
3132 2161, 2168, 2176, 2185, 2185, 2184, 2181, 2180,
3133 2176, 2174, 2175, 2177, 2181, 2185, 2185, 2179,
3134 2177, 2172, 2169, 2170, 2172, 2174, 2175, 2176,
3135 2172, 2170, 2171, 2174, 2179, 2185, 2191, 2198,
3136 2203, 2202, 2197, 2190, 2190, 2190, 2188, 2190,
3137 2188, 2183, 2178, 2173, 2168, 2167, 2166, 2173,
3138 2180, 2188, 2199, 2202, 2205, 2202, 2201, 2195,
3139 2192, 2191, 2190, 2189, 2186, 2182, 2179, 2177,
3140 2175, 2176, 2178, 2185, 2189, 2193, 2196, 2195,
3141 2197, 2195, 2192, 2193, 2194, 2196, 2196, 2189,
3142 2183, 2181, 2180, 2182, 2185, 2190, 2198, 2201,
3143 2206, 2203, 2198, 2192, 2186, 2185, 2182, 2179,
3144 2178, 2179, 2175, 2175, 2180, 2186, 2191, 2195,
3145 2199, 2201, 2199, 2196, 2190, 2190, 2185, 2184,
3146 2182, 2179, 2177, 2170, 2164, 2162, 2162, 2165,
3147 2169, 2173, 2180, 2186, 2191, 2193, 2194, 2193,
3148 2193, 2192, 2190, 2186, 2185, 2182, 2175, 2172,
3149 2171, 2171, 2172, 2174, 2179, 2180, 2182, 2188,
3150 2190, 2191, 2192, 2192, 2192, 2190, 2188, 2190,
3151 2188, 2185, 2183, 2182, 2181, 2179, 2178, 2178,
3152 2175, 2175, 2175, 2176, 2179, 2180, 2183, 2182,
3153 2179, 2179, 2178, 2177, 2179, 2180, 2187, 2188,
3154 2192, 2194, 2194, 2193, 2191, 2192, 2192, 2188,
3155 2185, 2183, 2183, 2182, 2180, 2184, 2186, 2191,
3156 2195, 2199, 2200, 2203, 2201, 2201, 2203, 2206,
3157 2208, 2207, 2209, 2205, 2198, 2193, 2186, 2185,
3158 2183, 2188, 2190, 2194, 2198, 2199, 2200, 2199,
3159 2200, 2202, 2203, 2204, 2202, 2202, 2200, 2192,
3160 2186, 2183, 2177, 2174, 2172, 2166, 2164, 2161,
3161 2160, 2158, 2158, 2160, 2161, 2167, 2169, 2169,
3162 2165, 2162, 2160, 2161, 2161, 2162, 2164, 2167,
3163 2167, 2165, 2161, 2156, 2155, 2150, 2146, 2147,
3164 2150, 2152, 2156, 2158, 2161, 2164, 2166, 2166,
3165 2165, 2165, 2163, 2163, 2161, 2159, 2158, 2157,
3166 2160, 2157, 2158, 2156, 2153, 2148, 2147, 2150,
3167 2154, 2155, 2159, 2162, 2166, 2165, 2165, 2166,
3168 2164, 2163, 2158, 2154, 2152, 2151, 2151, 2151,
3169 2148, 2147, 2147, 2147, 2148, 2149, 2154, 2158,
3170 2162, 2165, 2166, 2170, 2172, 2172, 2172, 2169,
3171 2169, 2166, 2164, 2162, 2160, 2159, 2159, 2162,
3172 2166, 2167, 2168, 2170, 2172, 2172, 2174, 2175,
3173 2177, 2178, 2183, 2185, 2181, 2179, 2176, 2174,
3174 2169, 2164, 2162, 2163, 2161, 2165, 2165, 2165,
3175 2169, 2171, 2173, 2175, 2177, 2178, 2177, 2177,
3176 2176, 2174, 2174, 2176, 2177, 2177, 2177, 2174,
3177 2173, 2170, 2167, 2167, 2170, 2173, 2179, 2182,
3178 2182, 2183, 2183, 2185, 2188, 2190, 2192, 2194,
3179 2193, 2193, 2192, 2191, 2190, 2191, 2194, 2194,
3180 2196, 2201, 2203, 2202, 2198, 2198, 2199, 2205,
3181 2208, 2214, 2218, 2220, 2218, 2220, 2218, 2219,
3182 2220, 2219, 2218, 2216, 2213, 2212, 2214, 2210,
3183 2210, 2212, 2213, 2215, 2217, 2216, 2217, 2218,
3184 2220, 2223, 2223, 2226, 2228, 2228, 2224, 2223,
3185 2220, 2219, 2218, 2219, 2218, 2216, 2216, 2218,
3186 2221, 2221, 2225, 2230, 2238, 2245, 2250, 2250,
3187 2250, 2249, 2241, 2237, 2235, 2232, 2230, 2227,
3188 2227, 2230, 2230, 2231, 2235, 2238, 2238, 2240,
3189 2244, 2246, 2244, 2243, 2244, 2246, 2247, 2246,
3190 2243, 2239, 2237, 2233, 2231, 2230, 2231, 2231,
3191 2234, 2237, 2240, 2243, 2242, 2239, 2238, 2240,
3192 2243, 2242, 2243, 2246, 2250, 2253, 2251, 2249,
3193 2251, 2250, 2249, 2249, 2249, 2247, 2247, 2247,
3194 2247, 2246, 2246, 2248, 2249, 2251, 2253, 2254,
3195 2256, 2258, 2258, 2261, 2261, 2260, 2261, 2258,
3196 2257, 2252, 2251, 2252, 2247, 2245, 2244, 2243,
3197 2245, 2241, 2239, 2239, 2241, 2241, 2242, 2243,
3198 2246, 2244, 2241, 2237, 2235, 2235, 2232, 2231,
3199 2231, 2232, 2230, 2230, 2229, 2230, 2233, 2233,
3200 2233, 2237, 2239, 2239, 2238, 2237, 2239, 2242,
3201 2244, 2244, 2245, 2243, 2236, 2232, 2227, 2223,
3202 2225, 2226, 2230, 2232, 2235, 2234, 2234, 2234,
3203 2235, 2240, 2240, 2245, 2248, 2249, 2245, 2239,
3204 2235, 2231, 2226, 2224, 2223, 2219, 2218, 2217,
3205 2217, 2217, 2221, 2223, 2227, 2230, 2232, 2233,
3206 2231, 2231, 2228, 2226, 2226, 2224, 2219, 2218,
3207 2216, 2211, 2211, 2213, 2217, 2218, 2221, 2223,
3208 2226, 2231, 2235, 2242, 2248, 2251, 2251, 2253,
3209 2254, 2259, 2259, 2254, 2255, 2254, 2250, 2246,
3210 2241, 2238, 2232, 2231, 2234, 2239, 2241, 2243,
3211 2248, 2250, 2254, 2256, 2259, 2262, 2264, 2263,
3212 2261, 2255, 2251, 2246, 2240, 2233, 2230, 2233,
3213 2232, 2228, 2224, 2223, 2222, 2221, 2223, 2227,
3214 2230, 2235, 2234, 2232, 2230, 2231, 2230, 2232,
3215 2232, 2232, 2229, 2227, 2228, 2225, 2224, 2224,
3216 2227, 2229, 2227, 2228, 2227, 2228, 2230, 2230,
3217 2229, 2231, 2233, 2233, 2231, 2226, 2226, 2223,
3218 2223, 2223, 2225, 2228, 2227, 2228, 2226, 2226,
3219 2224, 2221, 2223, 2224, 2225, 2227, 2229, 2227,
3220 2228, 2225, 2224, 2223, 2226, 2224, 2224, 2226,
3221 2225, 2226, 2226, 2226, 2225, 2224, 2225, 2227,
3222 2225, 2223, 2223, 2227, 2227, 2226, 2227, 2226,
3223 2226, 2225, 2226, 2228, 2227, 2229, 2229, 2232,
3224 2231, 2232, 2230, 2233, 2232, 2232, 2231, 2230,
3225 2231, 2230, 2230, 2231, 2231, 2233, 2234, 2235,
3226 2235, 2231, 2228, 2227, 2226, 2224, 2222, 2222,
3227 2222, 2224, 2221, 2220, 2217, 2215, 2213, 2214,
3228 2215, 2216, 2215, 2212, 2211, 2209, 2211, 2212,
3229 2209, 2211, 2212, 2210, 2206, 2203, 2199, 2197,
3230 2198, 2199, 2203, 2207, 2210, 2212, 2214, 2216,
3231 2219, 2220, 2222, 2224, 2226, 2227, 2223, 2217,
3232 2212, 2206, 2203, 2197, 2193, 2193, 2195, 2199,
3233 2203, 2209, 2213, 2216, 2218, 2223, 2225, 2227,
3234 2228, 2222, 2219, 2214, 2213, 2213, 2213, 2210,
3235 2210, 2207, 2207, 2206, 2204, 2201, 2204, 2207,
3236 2209, 2212, 2214, 2216, 2215, 2211, 2206, 2204,
3237 2203, 2199, 2200, 2198, 2199, 2202, 2200, 2199,
3238 2198, 2198, 2198, 2200, 2201, 2199, 2201, 2199,
3239 2198, 2193, 2192, 2191, 2190, 2190, 2192, 2192,
3240 2192, 2191, 2191, 2191, 2193, 2193, 2194, 2193,
3241 2192, 2192, 2188, 2185, 2182, 2181, 2177, 2177,
3242 2178, 2175, 2176, 2174, 2175, 2172, 2173, 2172,
3243 2172, 2172, 2170, 2169, 2164, 2158, 2153, 2149,
3244 2144, 2143, 2138, 2134, 2132, 2135, 2138, 2137,
3245 2138, 2140, 2144, 2147, 2148, 2149, 2150, 2147,
3246 2144, 2143, 2141, 2139, 2136, 2134, 2132, 2132,
3247 2133, 2132, 2131, 2136, 2138, 2142, 2146, 2146,
3248 2147, 2146, 2148, 2147, 2142, 2140, 2139, 2138,
3249 2138, 2133, 2130, 2126, 2122, 2121, 2123, 2124,
3250 2123, 2125, 2127, 2128, 2126, 2125, 2123, 2120,
3251 2117, 2112, 2110, 2107, 2104, 2102, 2096, 2092,
3252 2091, 2091, 2087, 2086, 2087, 2089, 2090, 2089,
3253 2087, 2086, 2088, 2090, 2094, 2095, 2095, 2093,
3254 2089, 2085, 2081, 2078, 2077, 2075, 2075, 2074,
3255 2073, 2073, 2069, 2066, 2065, 2064, 2064, 2062,
3256 2064, 2064, 2065, 2067, 2067, 2067, 2066, 2067,
3257 2065, 2064, 2064, 2062, 2059, 2055, 2053, 2053,
3258 2055, 2054, 2055, 2054, 2054, 2050, 2050, 2051,
3259 2051, 2051, 2052, 2055, 2059, 2060, 2058, 2058,
3260 2052, 2049, 2047, 2044, 2044, 2046, 2045, 2050,
3261 2051, 2052, 2051, 2052, 2055, 2053, 2055, 2056,
3262 2052, 2051, 2052, 2049, 2046, 2045, 2046, 2044,
3263 2043, 2043, 2043, 2041, 2042, 2043, 2045, 2047,
3264 2049, 2050, 2049, 2049, 2047, 2046, 2045, 2041,
3265 2042, 2041, 2041, 2038, 2039, 2038, 2036, 2036,
3266 2033, 2029, 2030, 2028, 2029, 2033, 2030, 2032,
3267 2031, 2030, 2030, 2030, 2029, 2028, 2031, 2030,
3268 2031, 2028, 2028, 2029, 2025, 2022, 2019, 2017,
3269 2013, 2011, 2010, 2009, 2011, 2012, 2013, 2016,
3270 2017, 2019, 2020, 2019, 2018, 2012, 2011, 2012,
3271 2012, 2013, 2009, 2008, 2007, 2008, 2008, 2011,
3272 2012, 2009, 2008, 2007, 2006, 2004, 2003, 2002,
3273 2003, 2001, 2001, 2001, 2002, 2002, 2005, 2004,
3274 2005, 2003, 2000, 2000, 1998, 1997, 1996, 1994,
3275 1990, 1987, 1983, 1985, 1985, 1988, 1991, 1994,
3276 1999, 2000, 1999, 1997, 1998, 1997, 1994, 1994,
3277 1993, 1990, 1988, 1985, 1979, 1977, 1977, 1977,
3278 1979, 1981, 1978, 1980, 1979, 1982, 1981, 1981,
3279 1983, 1983, 1983, 1984, 1983, 1985, 1983, 1977,
3280 1976, 1976, 1977, 1976, 1977, 1979, 1977, 1976,
3281 1971, 1966, 1965, 1963, 1962, 1965, 1968, 1967,
3282 1968, 1967, 1967, 1963, 1965, 1964, 1965, 1967,
3283 1969, 1968, 1964, 1962, 1960, 1957, 1955, 1953,
3284 1949, 1949, 1948, 1949, 1950, 1951, 1953, 1957,
3285 1963, 1964, 1963, 1965, 1960, 1959, 1957, 1951,
3286 1948, 1946, 1943, 1941, 1941, 1940, 1937, 1936,
3287 1939, 1939, 1941, 1944, 1944, 1945, 1945, 1946,
3288 1944, 1945, 1941, 1940, 1940, 1940, 1941, 1939,
3289 1935, 1936, 1936, 1934, 1933, 1934, 1935, 1937,
3290 1936, 1934, 1938, 1938, 1938, 1938, 1939, 1938,
3291 1938, 1939, 1939, 1940, 1937, 1936, 1932, 1933,
3292 1933, 1934, 1932, 1933, 1933, 1936, 1937, 1936,
3293 1941, 1944, 1946, 1948, 1952, 1954, 1953, 1950,
3294 1949, 1947, 1946, 1943, 1942, 1939, 1940, 1940,
3295 1940, 1938, 1939, 1940, 1940, 1940, 1942, 1945,
3296 1949, 1949, 1947, 1946, 1947, 1944, 1939, 1937,
3297 1938, 1936, 1936, 1939, 1937, 1938, 1937, 1935,
3298 1934, 1935, 1933, 1932, 1930, 1932, 1932, 1932,
3299 1933, 1933, 1936, 1938, 1942, 1945, 1947, 1948,
3300 1948, 1952, 1951, 1949, 1947, 1947, 1948, 1946,
3301 1945, 1945, 1945, 1946, 1944, 1945, 1948, 1952,
3302 1958, 1959, 1962, 1964, 1965, 1963, 1964, 1960,
3303 1957, 1956, 1951, 1947, 1943, 1942, 1938, 1939,
3304 1935, 1937, 1939, 1940, 1943, 1946, 1949, 1950,
3305 1948, 1947, 1948, 1948, 1947, 1943, 1938, 1939,
3306 1938, 1937, 1934, 1935, 1933, 1934, 1936, 1940,
3307 1941, 1942, 1943, 1943, 1946, 1944, 1944, 1944,
3308 1945, 1946, 1946, 1945, 1946, 1945, 1944, 1942,
3309 1939, 1936, 1937, 1935, 1935, 1936, 1935, 1937,
3310 1938, 1939, 1938, 1939, 1938, 1940, 1938, 1937,
3311 1936, 1935, 1932, 1929, 1926, 1925, 1921, 1921,
3312 1918, 1915, 1912, 1915, 1916, 1915, 1917, 1918,
3313 1921, 1925, 1927, 1924, 1921, 1918, 1920, 1918,
3314 1917, 1920, 1924, 1923, 1925, 1925, 1923, 1922,
3315 1923, 1926, 1929, 1929, 1932, 1936, 1937, 1936,
3316 1934, 1934, 1932, 1934, 1933, 1932, 1932, 1927,
3317 1926, 1926, 1926, 1927, 1925, 1924, 1923, 1923,
3318 1922, 1923, 1921, 1921, 1921, 1922, 1922, 1923,
3319 1922, 1923, 1925, 1926, 1927, 1927, 1927, 1928,
3320 1926, 1925, 1922, 1921, 1922, 1922, 1922, 1922,
3321 1920, 1921, 1921, 1918, 1919, 1919, 1923, 1924,
3322 1929, 1931, 1934, 1932, 1931, 1932, 1931, 1932,
3323 1933, 1931, 1931, 1930, 1931, 1932, 1930, 1930,
3324 1931, 1930, 1932, 1932, 1931, 1932, 1932, 1928,
3325 1928, 1930, 1931, 1932, 1932, 1933, 1932, 1930,
3326 1929, 1927, 1925, 1924, 1924, 1924, 1925, 1924,
3327 1925, 1927, 1927, 1927, 1924, 1925, 1928, 1927,
3328 1926, 1925, 1923, 1925, 1926, 1927, 1924, 1922,
3329 1921, 1919, 1921, 1918, 1917, 1918, 1921, 1922,
3330 1926, 1928, 1928, 1928, 1927, 1928, 1929, 1931,
3331 1931, 1930, 1932, 1932, 1928, 1930, 1928, 1927,
3332 1929, 1931, 1934, 1937, 1937, 1937, 1936, 1938,
3333 1938, 1939, 1937, 1938, 1937, 1937, 1936, 1933,
3334 1932, 1932, 1931, 1930, 1931, 1930, 1930, 1930,
3335 1932, 1932, 1932, 1934, 1936, 1937, 1937, 1936,
3336 1935, 1936, 1938, 1938, 1938, 1937, 1934, 1937,
3337 1934, 1928, 1930, 1928, 1930, 1930, 1932, 1934,
3338 1939, 1940, 1939, 1944, 1943, 1945, 1945, 1943,
3339 1940, 1940, 1942, 1939, 1942, 1938, 1936, 1935,
3340 1933, 1930, 1934, 1932, 1929, 1930, 1929, 1931,
3341 1929, 1927, 1928, 1926, 1925, 1923, 1920, 1920,
3342 1916, 1915, 1915, 1913, 1912, 1913, 1914, 1914,
3343 1911, 1911, 1909, 1907, 1909, 1909, 1907, 1909,
3344 1908, 1907, 1908, 1908, 1910, 1912, 1912, 1910,
3345 1910, 1913, 1912, 1915, 1916, 1913, 1914, 1911,
3346 1912, 1911, 1911, 1912, 1913, 1913, 1913, 1914,
3347 1916, 1916, 1914, 1912, 1911, 1909, 1909, 1907,
3348 1903, 1903, 1904, 1906, 1907, 1909, 1911, 1912,
3349 1913, 1912, 1913, 1913, 1912, 1914, 1913, 1913,
3350 1911, 1909, 1907, 1907, 1907, 1911, 1914, 1917,
3351 1920, 1922, 1925, 1927, 1928, 1929, 1927, 1927,
3352 1926, 1927, 1928, 1926, 1927, 1928, 1929, 1934,
3353 1937, 1938, 1939, 1940, 1941, 1940, 1938, 1937,
3354 1934, 1933, 1933, 1932, 1930, 1928, 1927, 1928,
3355 1928, 1928, 1930, 1934, 1936, 1934, 1936, 1938,
3356 1940, 1937, 1938, 1936, 1934, 1930, 1928, 1927,
3357 1929, 1928, 1925, 1928, 1930, 1932, 1936, 1940,
3358 1942, 1944, 1944, 1940, 1944, 1943, 1944, 1942,
3359 1941, 1941, 1942, 1941, 1943, 1944, 1946, 1950,
3360 1950, 1953, 1950, 1949, 1947, 1945, 1946, 1946,
3361 1946, 1948, 1950, 1948, 1946, 1946, 1947, 1946,
3362 1946, 1948, 1948, 1950, 1951, 1949, 1949, 1949,
3363 1948, 1944, 1942, 1946, 1945, 1946, 1944, 1949,
3364 1950, 1952, 1954, 1956, 1957, 1955, 1954, 1953,
3365 1952, 1949, 1948, 1949, 1950, 1951, 1955, 1956,
3366 1960, 1962, 1963, 1962, 1963, 1965, 1966, 1970,
3367 1970, 1969, 1967, 1964, 1962, 1959, 1958, 1957,
3368 1956, 1956, 1956, 1960, 1960, 1963, 1964, 1965,
3369 1965, 1966, 1964, 1963, 1962, 1960, 1959, 1958,
3370 1958, 1957, 1957, 1958, 1955, 1954, 1956, 1956,
3371 1956, 1957, 1957, 1958, 1959, 1959, 1957, 1958,
3372 1961, 1960, 1957, 1956, 1954, 1957, 1958, 1959,
3373 1958, 1957, 1961, 1961, 1963, 1959, 1960, 1963,
3374 1963, 1963, 1964, 1965, 1965, 1966, 1965, 1967,
3375 1965, 1967, 1968, 1966, 1971, 1971, 1970, 1969,
3376 1970, 1971, 1971, 1972, 1971, 1972, 1970, 1970,
3377 1969, 1967, 1967, 1966, 1967, 1971, 1972, 1974,
3378 1977, 1976, 1976, 1975, 1974, 1974, 1974, 1973,
3379 1971, 1972, 1973, 1973, 1973, 1974, 1974, 1975,
3380 1977, 1979, 1979, 1977, 1979, 1980, 1978, 1978,
3381 1976, 1976, 1975, 1975, 1974, 1973, 1971, 1974,
3382 1976, 1977, 1978, 1977, 1977, 1976, 1980, 1981,
3383 1977, 1977, 1977, 1976, 1975, 1977, 1975, 1974,
3384 1969, 1970, 1969, 1969, 1965, 1965, 1965, 1966,
3385 1968, 1967, 1970, 1971, 1972, 1973, 1974, 1973,
3386 1972, 1975, 1978, 1977, 1976, 1976, 1978, 1978,
3387 1979, 1981, 1980, 1980, 1981, 1980, 1981, 1980,
3388 1980, 1981, 1979, 1979, 1977, 1979, 1980, 1982,
3389 1983, 1984, 1985, 1987, 1992, 1994, 1996, 1997,
3390 1993, 1992, 1990, 1990, 1989, 1989, 1987, 1987,
3391 1988, 1986, 1988, 1992, 1993, 1993, 1993, 1994,
3392 1994, 1997, 1999, 2001, 2003, 2000, 1999, 1996,
3393 1997, 1996, 1996, 1995, 1996, 1996, 1994, 1994,
3394 1995, 1998, 1999, 2000, 2001, 2001, 2001, 2001,
3395 1999, 2001, 2004, 2003, 2006, 2008, 2005, 2007,
3396 2008, 2007, 2005, 2005, 2001, 2001, 2002, 2000,
3397 2001, 2002, 2000, 2001, 2003, 2001, 1997, 1994,
3398 1995, 1999, 2001, 2003, 2008, 2005, 2003, 2002,
3399 2001, 2001, 2000, 1999, 2000, 2001, 1998, 1997,
3400 1997, 1996, 1996, 1994, 1994, 1995, 1995, 1997,
3401 1996, 1996, 1999, 2001, 2001, 2003, 2006, 2004,
3402 2005, 2003, 2004, 2000, 1999, 1997, 1997, 1997,
3403 1994, 1994, 1993, 1993, 1994, 1996, 1995, 1994,
3404 1992, 1993, 1991, 1991, 1990, 1992, 1991, 1987,
3405 1986, 1986, 1985, 1984, 1986, 1982, 1980, 1979,
3406 1976, 1978, 1973, 1977, 1978, 1978, 1979, 1980,
3407 1981, 1981, 1983, 1982, 1983, 1985, 1982, 1985,
3408 1985, 1983, 1982, 1980, 1980, 1982, 1981, 1984,
3409 1986, 1986, 1986, 1986, 1984, 1982, 1984, 1987,
3410 1988, 1990, 1990, 1988, 1986, 1985, 1985, 1984,
3411 1983, 1983, 1984, 1986, 1986, 1986, 1986, 1986,
3412 1985, 1985, 1984, 1987, 1987, 1988, 1985, 1983,
3413 1981, 1979, 1980, 1976, 1974, 1977, 1978, 1979,
3414 1981, 1981, 1980, 1981, 1980, 1983, 1985, 1987,
3415 1986, 1984, 1983, 1981, 1980, 1978, 1980, 1978,
3416 1979, 1979, 1975, 1975, 1975, 1973, 1972, 1971,
3417 1971, 1969, 1971, 1970, 1970, 1969, 1966, 1964,
3418 1964, 1964, 1965, 1966, 1968, 1968, 1966, 1968,
3419 1967, 1967, 1968, 1964, 1962, 1964, 1962, 1963,
3420 1960, 1960, 1959, 1961, 1964, 1963, 1966, 1966,
3421 1968, 1969, 1971, 1968, 1967, 1969, 1969, 1969,
3422 1970, 1968, 1966, 1964, 1966, 1964, 1962, 1964,
3423 1964, 1962, 1961, 1961, 1958, 1957, 1958, 1958,
3424 1959, 1957, 1956, 1958, 1958, 1959, 1960, 1960,
3425 1961, 1960, 1961, 1958, 1958, 1956, 1955, 1954,
3426 1951, 1949, 1948, 1950, 1951, 1952, 1953, 1954,
3427 1955, 1955, 1956, 1957, 1958, 1956, 1954, 1954,
3428 1954, 1951, 1948, 1946, 1946, 1946, 1945, 1946,
3429 1946, 1946, 1946, 1946, 1946, 1946, 1945, 1943,
3430 1945, 1944, 1941, 1940, 1939, 1941, 1941, 1938,
3431 1939, 1941, 1944, 1941, 1941, 1939, 1938, 1939,
3432 1936, 1931, 1931, 1933, 1932, 1932, 1931, 1932,
3433 1933, 1933, 1934, 1934, 1936, 1937, 1934, 1935,
3434 1933, 1932, 1931, 1930, 1928, 1927, 1927, 1927,
3435 1928, 1930, 1928, 1928, 1930, 1930, 1930, 1930,
3436 1930, 1929, 1927, 1925, 1924, 1922, 1922, 1923,
3437 1918, 1917, 1915, 1916, 1917, 1916, 1916, 1915,
3438 1914, 1915, 1917, 1918, 1920, 1918, 1916, 1917,
3439 1916, 1914, 1912, 1913, 1914, 1913, 1914, 1914,
3440 1912, 1909, 1908, 1910, 1912, 1912, 1913, 1914,
3441 1914, 1913, 1912, 1914, 1914, 1915, 1914, 1913,
3442 1912, 1910, 1910, 1909, 1905, 1906, 1910, 1910,
3443 1910, 1906, 1908, 1905, 1903, 1906, 1908, 1908,
3444 1909, 1910, 1906, 1905, 1905, 1905, 1905, 1905,
3445 1907, 1907, 1908, 1910, 1911, 1911, 1909, 1910,
3446 1910, 1909, 1907, 1905, 1903, 1903, 1904, 1905,
3447 1907, 1905, 1905, 1906, 1906, 1907, 1909, 1909,
3448 1911, 1911, 1911, 1910, 1910, 1907, 1907, 1907,
3449 1906, 1905, 1903, 1902, 1905, 1903, 1906, 1907,
3450 1907, 1909, 1907, 1908, 1910, 1907, 1907, 1908,
3451 1908, 1905, 1904, 1903, 1903, 1903, 1904, 1905,
3452 1907, 1908, 1907, 1907, 1906, 1904, 1907, 1905,
3453 1905, 1906, 1903, 1902, 1901, 1901, 1901, 1898,
3454 1896, 1895, 1895, 1895, 1894, 1896, 1897, 1900,
3455 1896, 1896, 1898, 1897, 1898, 1901, 1900, 1899,
3456 1901, 1901, 1901, 1899, 1899, 1899, 1898, 1901,
3457 1903, 1904, 1904, 1905, 1906, 1905, 1903, 1903,
3458 1907, 1906, 1907, 1908, 1908, 1911, 1909, 1908,
3459 1911, 1911, 1913, 1916, 1917, 1915, 1915, 1913,
3460 1913, 1912, 1913, 1915, 1915, 1914, 1916, 1915,
3461 1917, 1918, 1916, 1918, 1920, 1920, 1922, 1921,
3462 1922, 1920, 1919, 1916, 1916, 1917, 1917, 1917,
3463 1918, 1921, 1920, 1921, 1919, 1920, 1922, 1921,
3464 1920, 1922, 1922, 1922, 1921, 1918, 1918, 1918,
3465 1919, 1919, 1919, 1919, 1919, 1920, 1920, 1925,
3466 1925, 1923, 1922, 1922, 1922, 1923, 1922, 1923,
3467 1922, 1919, 1919, 1919, 1919, 1920, 1919, 1921,
3468 1921, 1921, 1920, 1921, 1920, 1921, 1921, 1920,
3469 1921, 1924, 1924, 1923, 1922, 1923, 1921, 1923,
3470 1923, 1922, 1923, 1922, 1923, 1920, 1917, 1918,
3471 1916, 1917, 1921, 1922, 1922, 1923, 1925, 1925,
3472 1926, 1925, 1928, 1926, 1925, 1928, 1927, 1926,
3473 1926, 1925, 1925, 1925, 1922, 1923, 1923, 1925,
3474 1927, 1925, 1924, 1925, 1926, 1926, 1924, 1926,
3475 1924, 1922, 1925, 1925, 1925, 1925, 1925, 1926,
3476 1925, 1925, 1925, 1925, 1925, 1925, 1925, 1926,
3477 1927, 1926, 1926, 1926, 1926, 1926, 1927, 1926,
3478 1924, 1927, 1927, 1929, 1928, 1926, 1926, 1926,
3479 1925, 1926, 1926, 1927, 1931, 1932, 1932, 1932,
3480 1933, 1931, 1931, 1931, 1929, 1928, 1928, 1930,
3481 1931, 1931, 1931, 1931, 1931, 1929, 1932, 1932,
3482 1932, 1933, 1930, 1932, 1933, 1936, 1936, 1935,
3483 1933, 1932, 1930, 1931, 1931, 1932, 1932, 1932,
3484 1935, 1934, 1934, 1937, 1937, 1937, 1938, 1935,
3485 1935, 1935, 1935, 1936, 1937, 1937, 1939, 1941,
3486 1942, 1942, 1942, 1942, 1944, 1943, 1944, 1944,
3487 1943, 1943, 1944, 1946, 1949, 1949, 1947, 1947,
3488 1945, 1945, 1946, 1943, 1942, 1947, 1944, 1943,
3489 1942, 1942, 1943, 1944, 1945, 1946, 1949, 1949,
3490 1948, 1951, 1949, 1950, 1950, 1948, 1949, 1944,
3491 1945, 1946, 1946, 1946, 1944, 1945, 1949, 1950,
3492 1953, 1953, 1954, 1954, 1954, 1953, 1954, 1957,
3493 1955, 1957, 1958, 1956, 1955, 1953, 1953, 1952,
3494 1951, 1953, 1954, 1955, 1955, 1955, 1952, 1953,
3495 1954, 1951, 1953, 1952, 1953, 1956, 1957, 1957,
3496 1955, 1954, 1957, 1950, 1948, 1950, 1949, 1951,
3497 1950, 1947, 1946, 1943, 1943, 1942, 1942, 1944,
3498 1944, 1947, 1948, 1947, 1947, 1949, 1949, 1949,
3499 1951, 1950, 1946, 1945, 1945, 1945, 1942, 1939,
3500 1943, 1943, 1943, 1943, 1944, 1947, 1945, 1943,
3501 1944, 1946, 1947, 1949, 1949, 1948, 1949, 1951,
3502 1947, 1946, 1944, 1943, 1945, 1944, 1943, 1942,
3503 1940, 1940, 1939, 1940, 1941, 1939, 1939, 1939,
3504 1942, 1943, 1943, 1942, 1943, 1944, 1947, 1946,
3505 1946, 1948, 1946, 1944, 1943, 1941, 1941, 1940,
3506 1941, 1942, 1944, 1944, 1945, 1944, 1945, 1946,
3507 1943, 1945, 1945, 1946, 1944, 1945, 1945, 1947,
3508 1947, 1946, 1942, 1942, 1940, 1938, 1937, 1936,
3509 1936, 1936, 1936, 1936, 1936, 1937, 1937, 1939,
3510 1940, 1942, 1941, 1940, 1938, 1938, 1938, 1939,
3511 1938, 1935, 1936, 1935, 1934, 1934, 1933, 1934,
3512 1934, 1934, 1933, 1932, 1933, 1933, 1933, 1929,
3513 1928, 1929, 1929, 1928, 1928, 1929, 1927, 1928,
3514 1929, 1929, 1928, 1930, 1931, 1929, 1927, 1927,
3515 1925, 1926, 1926, 1928, 1928, 1927, 1925, 1923,
3516 1923, 1924, 1925, 1924, 1927, 1929, 1930, 1928,
3517 1927, 1929, 1928, 1927, 1927, 1927, 1926, 1927,
3518 1928, 1927, 1930, 1930, 1929, 1930, 1926, 1927,
3519 1929, 1932, 1933, 1933, 1931, 1929, 1927, 1927,
3520 1925, 1926, 1928, 1928, 1928, 1925, 1926, 1927,
3521 1929, 1929, 1932, 1931, 1930, 1929, 1928, 1928,
3522 1926, 1926, 1925, 1927, 1927, 1927, 1924, 1924,
3523 1923, 1923, 1922, 1923, 1925, 1921, 1921, 1920,
3524 1922, 1923, 1921, 1921, 1921, 1918, 1918, 1916,
3525 1916, 1915, 1914, 1913, 1913, 1913, 1911, 1910,
3526 1910, 1909, 1908, 1908, 1908, 1909, 1912, 1911,
3527 1909, 1909, 1907, 1908, 1910, 1907, 1907, 1906,
3528 1907, 1906, 1905, 1902, 1902, 1900, 1899, 1900,
3529 1900, 1901, 1901, 1901, 1902, 1902, 1901, 1901,
3530 1898, 1898, 1899, 1900, 1899, 1899, 1898, 1896,
3531 1895, 1895, 1893, 1892, 1893, 1890, 1890, 1889,
3532 1889, 1891, 1891, 1893, 1894, 1897, 1898, 1898,
3533 1897, 1899, 1898, 1897, 1897, 1896, 1896, 1895,
3534 1892, 1891, 1891, 1888, 1889, 1893, 1893, 1895,
3535 1895, 1896, 1899, 1902, 1900, 1899, 1899, 1900,
3536 1901, 1901, 1901, 1900, 1901, 1901, 1903, 1900,
3537 1902, 1903, 1904, 1902, 1902, 1903, 1902, 1901,
3538 1902, 1903, 1902, 1900, 1900, 1896, 1892, 1891,
3539 1897, 1899, 1902, 1908, 1907, 1914, 1916, 1917,
3540 1918, 1918, 1917, 1912, 1904, 1898, 1891, 1886,
3541 1885, 1884, 1886, 1885, 1888, 1894, 1900, 1911,
3542 1917, 1923, 1927, 1931, 1930, 1927, 1920, 1915,
3543 1911, 1902, 1894, 1887, 1883, 1883, 1887, 1891,
3544 1894, 1900, 1906, 1915, 1922, 1925, 1930, 1931,
3545 1931, 1925, 1921, 1915, 1907, 1901, 1898, 1895,
3546 1891, 1893, 1897, 1901, 1905, 1912, 1921, 1923,
3547 1929, 1934, 1936, 1937, 1934, 1932, 1928, 1924,
3548 1918, 1915, 1910, 1908, 1908, 1910, 1910, 1910,
3549 1914, 1918, 1922, 1925, 1928, 1927, 1929, 1927,
3550 1930, 1929, 1928, 1927, 1924, 1922, 1921, 1921,
3551 1921, 1921, 1918, 1918, 1920, 1920, 1920, 1920,
3552 1922, 1927, 1931, 1930, 1932, 1933, 1933, 1937,
3553 1935, 1935, 1935, 1932, 1930, 1929, 1928, 1926,
3554 1926, 1926, 1927, 1928, 1930, 1933, 1936, 1939,
3555 1941, 1945, 1945, 1947, 1946, 1942, 1939, 1935,
3556 1932, 1929, 1928, 1928, 1927, 1929, 1931, 1935,
3557 1936, 1938, 1939, 1942, 1945, 1946, 1949, 1949,
3558 1946, 1946, 1943, 1939, 1937, 1934, 1935, 1934,
3559 1934, 1934, 1933, 1935, 1938, 1940, 1942, 1942,
3560 1944, 1943, 1944, 1943, 1944, 1944, 1943, 1943,
3561 1942, 1941, 1941, 1941, 1941, 1941, 1942, 1943,
3562 1942, 1943, 1945, 1946, 1947, 1947, 1948, 1950,
3563 1949, 1948, 1947, 1945, 1947, 1949, 1949, 1948,
3564 1950, 1952, 1948, 1950, 1954, 1952, 1952, 1955,
3565 1955, 1956, 1956, 1955, 1957, 1956, 1956, 1957,
3566 1960, 1958, 1959, 1960, 1959, 1960, 1963, 1964,
3567 1963, 1963, 1962, 1964, 1964, 1964, 1964, 1965,
3568 1967, 1967, 1966, 1964, 1965, 1962, 1961, 1961,
3569 1962, 1960, 1962, 1961, 1961, 1962, 1963, 1966,
3570 1968, 1969, 1967, 1968, 1967, 1967, 1966, 1967,
3571 1969, 1967, 1968, 1966, 1967, 1967, 1968, 1966,
3572 1966, 1969, 1970, 1973, 1972, 1974, 1978, 1976,
3573 1976, 1977, 1979, 1978, 1975, 1974, 1972, 1972,
3574 1971, 1969, 1969, 1970, 1971, 1972, 1974, 1976,
3575 1979, 1980, 1979, 1980, 1981, 1982, 1982, 1982,
3576 1980, 1978, 1980, 1980, 1978, 1976, 1977, 1979,
3577 1979, 1977, 1978, 1979, 1981, 1982, 1986, 1987,
3578 1988, 1989, 1989, 1994, 1993, 1995, 1994, 1993,
3579 1993, 1994, 1997, 1997, 1995, 1993, 1993, 1993,
3580 1995, 1995, 1997, 1996, 2000, 2002, 2001, 2001,
3581 2000, 2002, 2002, 2001, 2000, 2001, 2001, 2000,
3582 2001, 1998, 1998, 1998, 1998, 1997, 1997, 1998,
3583 1996, 1996, 1997, 1998, 2000, 1999, 2000, 2000,
3584 2000, 2003, 2002, 2001, 2001, 2002, 2004, 2005,
3585 2002, 2001, 2001, 2001, 2001, 1998, 2000, 1999,
3586 2000, 2000, 1998, 1999, 2001, 2000, 2002, 2004,
3587 2005, 2007, 2006, 2006, 2004, 2004, 2004, 2003,
3588 2003, 2001, 2001, 2000, 2000, 1999, 1999, 1998,
3589 1996, 1998, 1998, 1998, 1996, 1997, 1996, 1994,
3590 1995, 1995, 1994, 1997, 1997, 1997, 2002, 2002,
3591 2000, 2000, 1999, 2000, 1998, 2000, 2001, 2001,
3592 2001, 1999, 1998, 1998, 1999, 1999, 1999, 2000,
3593 2003, 2006, 2006, 2008, 2006, 2004, 2006, 2007,
3594 2008, 2007, 2007, 2006, 2005, 2007, 2006, 2010,
3595 2009, 2007, 2008, 2010, 2011, 2011, 2012, 2013,
3596 2012, 2014, 2011, 2012, 2014, 2013, 2015, 2013,
3597 2015, 2013, 2012, 2014, 2014, 2012, 2013, 2010,
3598 2010, 2012, 2013, 2014, 2014, 2011, 2013, 2014,
3599 2013, 2011, 2010, 2011, 2009, 2009, 2008, 2008,
3600 2007, 2006, 2005, 2005, 2004, 2005, 2005, 2004,
3601 2004, 2003, 2003, 2004, 2006, 2007, 2008, 2007,
3602 2008, 2010, 2011, 2009, 2008, 2006, 2007, 2007,
3603 2007, 2005, 2005, 2006, 2005, 2007, 2009, 2008,
3604 2008, 2008, 2008, 2007, 2006, 2004, 2004, 2005,
3605 2004, 2004, 2003, 2003, 2002, 2002, 2001, 2000,
3606 2000, 1999, 2000, 1997, 2000, 2000, 1999, 1999,
3607 2000, 2002, 2002, 2004, 2003, 2003, 2003, 2003,
3608 2002, 2003, 2006, 2007, 2007, 2009, 2007, 2006,
3609 2005, 2005, 2004, 2002, 2001, 2001, 2002, 2000,
3610 1999, 1996, 1999, 2000, 1999, 2001, 2001, 2000,
3611 1998, 2000, 2001, 2001, 2001, 2001, 2000, 1999,
3612 1998, 1998, 2000, 2000, 2000, 1999, 1998, 1996,
3613 1994, 1992, 1992, 1993, 1994, 1993, 1995, 1994,
3614 1993, 1998, 1999, 1996, 1994, 1995, 1995, 1996,
3615 1994, 1994, 1995, 1995, 1994, 1994, 1992, 1992,
3616 1993, 1992, 1992, 1993, 1994, 1994, 1994, 1996,
3617 1996, 1996, 1996, 1996, 1995, 1997, 1997, 1998,
3618 2001, 2000, 2000, 1998, 1999, 2000, 1999, 2000,
3619 1999, 1998, 1998, 1997, 1999, 2001, 2000, 2000,
3620 2001, 1998, 1998, 1997, 1998, 1998, 1998, 1998,
3621 1998, 1997, 1994, 1995, 1997, 1997, 1995, 1996,
3622 1995, 1993, 1995, 1994, 1997, 1995, 1995, 1994,
3623 1997, 1997, 1996, 1998, 1999, 1998, 1997, 1999,
3624 1999, 1999, 1999, 1998, 1997, 1995, 1998, 1999,
3625 1999, 1997, 1998, 1999, 1998, 1999, 2000, 2000,
3626 1998, 1998, 1997, 1992, 1994, 1996, 1993, 1994,
3627 1993, 1995, 1995, 1997, 1994, 1995, 1995, 1995,
3628 1994, 1993, 1993, 1992, 1991, 1993, 1992, 1993,
3629 1992, 1991, 1993, 1991, 1992, 1992, 1991, 1992,
3630 1989, 1990, 1990, 1992, 1990, 1991, 1991, 1991,
3631 1989, 1991, 1989, 1990, 1989, 1990, 1991, 1990,
3632 1990, 1990, 1990, 1990, 1991, 1993, 1991, 1991,
3633 1991, 1992, 1993, 1994, 1993, 1994, 1994, 1994,
3634 1995, 1995, 2000, 2000, 1999, 2001, 2000, 1997,
3635 1999, 1998, 1996, 1997, 1996, 1996, 1996, 1995,
3636 1997, 1997, 1997, 1996, 1995, 1997, 1997, 1999,
3637 1999, 2000, 1999, 1999, 2000, 2001, 2000, 2002,
3638 2005, 2004, 2007, 2006, 2006, 2005, 2005, 2006,
3639 2006, 2008, 2007, 2008, 2009, 2009, 2011, 2013,
3640 2013, 2013, 2017, 2017, 2019, 2020, 2019, 2021,
3641 2021, 2021, 2022, 2022, 2023, 2022, 2024, 2023,
3642 2027, 2025, 2027, 2027, 2026, 2029, 2029, 2027,
3643 2029, 2030, 2029, 2029, 2031, 2029, 2028, 2030,
3644 2029, 2033, 2032, 2035, 2032, 2031, 2032, 2027,
3645 2031, 2030, 2029, 2030, 2030, 2029, 2030, 2034,
3646 2033, 2033, 2036, 2038, 2038, 2039, 2038, 2040,
3647 2040, 2041, 2040, 2040, 2039, 2040, 2040, 2043,
3648 2044, 2044, 2044, 2044, 2045, 2047, 2045, 2047,
3649 2048, 2047, 2048, 2048, 2049, 2051, 2051, 2051,
3650 2051, 2054, 2052, 2049, 2051, 2051, 2049, 2050,
3651 2050, 2050, 2052, 2050, 2052, 2052, 2051, 2051,
3652 2051, 2050, 2051, 2050, 2052, 2053, 2053, 2052,
3653 2054, 2053, 2052, 2053, 2054, 2052, 2056, 2057,
3654 2057, 2056, 2057, 2056, 2056, 2057, 2057, 2056,
3655 2056, 2056, 2059, 2058, 2058, 2059, 2059, 2059,
3656 2059, 2061, 2059, 2059, 2059, 2062, 2062, 2061,
3657 2062, 2061, 2062, 2063, 2063, 2064, 2064, 2064,
3658 2064, 2062, 2061, 2061, 2061, 2061, 2059, 2058,
3659 2059, 2061, 2062, 2059, 2059, 2061, 2060, 2059,
3660 2060, 2060, 2062, 2062, 2064, 2067, 2064, 2066,
3661 2067, 2066, 2066, 2066, 2067, 2067, 2066, 2066,
3662 2066, 2066, 2069, 2068, 2066, 2069, 2067, 2067,
3663 2069, 2069, 2070, 2069, 2071, 2072, 2074, 2072,
3664 2071, 2073, 2073, 2073, 2071, 2073, 2076, 2073,
3665 2071, 2072, 2074, 2072, 2075, 2073, 2074, 2077,
3666 2079, 2080, 2081, 2084, 2083, 2083, 2082, 2086,
3667 2087, 2086, 2086, 2086, 2088, 2089, 2088, 2088,
3668 2088, 2088, 2090, 2090, 2090, 2090, 2093, 2093,
3669 2093, 2094, 2093, 2097, 2098, 2096, 2096, 2094,
3670 2095, 2096, 2096, 2092, 2095, 2097, 2094, 2096,
3671 2095, 2097, 2097, 2095, 2095, 2097, 2097, 2097,
3672 2095, 2094, 2097, 2097, 2098, 2097, 2096, 2096,
3673 2096, 2099, 2100, 2100, 2098, 2099, 2099, 2099,
3674 2102, 2104, 2103, 2103, 2105, 2104, 2105, 2104,
3675 2106, 2107, 2107, 2106, 2107, 2109, 2110, 2110,
3676 2111, 2113, 2115, 2113, 2114, 2116, 2114, 2116,
3677 2113, 2114, 2112, 2112, 2112, 2111, 2114, 2114,
3678 2112, 2112, 2112, 2115, 2116, 2115, 2114, 2112,
3679 2113, 2114, 2114, 2114, 2114, 2114, 2114, 2112,
3680 2113, 2115, 2113, 2115, 2114, 2115, 2117, 2115,
3681 2116, 2116, 2117, 2118, 2116, 2116, 2117, 2117,
3682 2117, 2118, 2118, 2120, 2121, 2120, 2117, 2116,
3683 2118, 2120, 2121, 2120, 2120, 2122, 2121, 2124,
3684 2122, 2120, 2123, 2121, 2121, 2123, 2121, 2121,
3685 2121, 2119, 2119, 2118, 2115, 2117, 2119, 2117,
3686 2116, 2115, 2115, 2115, 2114, 2113, 2112, 2113,
3687 2111, 2111, 2111, 2112, 2110, 2111, 2111, 2111,
3688 2111, 2111, 2112, 2111, 2111, 2112, 2111, 2110,
3689 2111, 2113, 2113, 2111, 2111, 2109, 2110, 2109,
3690 2107, 2109, 2110, 2112, 2111, 2112, 2109, 2109,
3691 2110, 2110, 2109, 2112, 2112, 2110, 2108, 2108,
3692 2108, 2109, 2107, 2108, 2112, 2111, 2109, 2108,
3693 2109, 2111, 2112, 2108, 2106, 2107, 2108, 2107,
3694 2107, 2106, 2106, 2107, 2107, 2107, 2107, 2109,
3695 2109, 2112, 2111, 2108, 2106, 2108, 2108, 2105,
3696 2106, 2107, 2106, 2107, 2105, 2104, 2105, 2105,
3697 2104, 2104, 2103, 2102, 2101, 2100, 2098, 2099,
3698 2098, 2098, 2098, 2097, 2099, 2099, 2097, 2094,
3699 2095, 2097, 2094, 2094, 2090, 2092, 2093, 2093,
3700 2094, 2094, 2094, 2093, 2094, 2094, 2094, 2093,
3701 2090, 2093, 2092, 2089, 2092, 2091, 2092, 2088,
3702 2088, 2090, 2088, 2087, 2087, 2088, 2087, 2088,
3703 2086, 2087, 2087, 2088, 2089, 2085, 2085, 2086,
3704 2088, 2087, 2086, 2088, 2087, 2085, 2085, 2086,
3705 2087, 2086, 2085, 2084, 2085, 2085, 2087, 2089,
3706 2091, 2091, 2086, 2086, 2085, 2083, 2083, 2082,
3707 2081, 2084, 2085, 2085, 2082, 2081, 2082, 2080,
3708 2082, 2084, 2082, 2082, 2082, 2079, 2080, 2080,
3709 2079, 2078, 2077, 2076, 2076, 2075, 2076, 2076,
3710 2077, 2074, 2077, 2077, 2075, 2075, 2075, 2074,
3711 2074, 2074, 2075, 2075, 2072, 2073, 2071, 2072,
3712 2072, 2070, 2070, 2068, 2070, 2068, 2069, 2068,
3713 2067, 2068, 2069, 2066, 2063, 2065, 2067, 2065,
3714 2065, 2065, 2064, 2064, 2062, 2063, 2062, 2061,
3715 2061, 2060, 2063, 2060, 2059, 2058, 2055, 2058,
3716 2059, 2059, 2061, 2058, 2057, 2057, 2058, 2058,
3717 2058, 2057, 2056, 2054, 2054, 2055, 2056, 2058,
3718 2058, 2058, 2054, 2058, 2060, 2059, 2056, 2056,
3719 2055, 2056, 2058, 2057, 2057, 2057, 2056, 2056,
3720 2057, 2058, 2058, 2058, 2058, 2058, 2058, 2058,
3721 2059, 2059, 2059, 2060, 2061, 2060, 2059, 2059,
3722 2060, 2061, 2062, 2063, 2065, 2063, 2062, 2061,
3723 2062, 2063, 2064, 2064, 2061, 2061, 2062, 2065,
3724 2067, 2065, 2068, 2065, 2066, 2066, 2066, 2067,
3725 2068, 2069, 2070, 2068, 2068, 2068, 2066, 2066,
3726 2066, 2068, 2070, 2068, 2071, 2070, 2068, 2067,
3727 2066, 2068, 2069, 2068, 2067, 2069, 2067, 2067,
3728 2070, 2069, 2068, 2067, 2066, 2066, 2068, 2069,
3729 2069, 2069, 2069, 2071, 2071, 2069, 2070, 2070,
3730 2067, 2070, 2072, 2073, 2074, 2073, 2068, 2069,
3731 2071, 2073, 2075, 2077, 2080, 2078, 2079, 2078,
3732 2078, 2078, 2078, 2077, 2076, 2078, 2076, 2079,
3733 2079, 2079, 2078, 2079, 2080, 2079, 2081, 2080,
3734 2082, 2084, 2084, 2085, 2085, 2086, 2088, 2089,
3735 2087, 2087, 2088, 2090, 2090, 2090, 2091, 2092,
3736 2093, 2093, 2092, 2094, 2093, 2095, 2093, 2093,
3737 2093, 2094, 2093, 2095, 2096, 2097, 2095, 2092,
3738 2097, 2093, 2093, 2094, 2096, 2095, 2092, 2092,
3739 2093, 2093, 2093, 2095, 2093, 2092, 2092, 2090,
3740 2090, 2091, 2091, 2092, 2094, 2095, 2096, 2094,
3741 2096, 2097, 2094, 2097, 2096, 2094, 2096, 2096,
3742 2096, 2097, 2097, 2097, 2094, 2095, 2097, 2098,
3743 2100, 2099, 2099, 2099, 2098, 2100, 2100, 2097,
3744 2099, 2100, 2101, 2100, 2100, 2102, 2102, 2100,
3745 2100, 2100, 2102, 2103, 2106, 2104, 2102, 2101,
3746 2101, 2101, 2099, 2100, 2102, 2103, 2103, 2103,
3747 2102, 2101, 2103, 2105, 2104, 2106, 2104, 2105,
3748 2105, 2105, 2105, 2102, 2101, 2102, 2103, 2103,
3749 2103, 2102, 2101, 2102, 2103, 2101, 2105, 2102,
3750 2103, 2104, 2104, 2103, 2104, 2104, 2103, 2105,
3751 2103, 2102, 2103, 2103, 2105, 2104, 2101, 2100,
3752 2099, 2099, 2100, 2101, 2101, 2099, 2100, 2100,
3753 2101, 2103, 2104, 2104, 2105, 2103, 2103, 2104,
3754 2103, 2103, 2102, 2100, 2100, 2101, 2101, 2100,
3755 2101, 2099, 2098, 2099, 2099, 2102, 2101, 2099,
3756 2099, 2098, 2100, 2103, 2103, 2104, 2107, 2106,
3757 2108, 2107, 2105, 2107, 2104, 2104, 2105, 2105,
3758 2104, 2104, 2107, 2107, 2107, 2108, 2107, 2108,
3759 2108, 2109, 2110, 2111, 2112, 2111, 2110, 2110,
3760 2111, 2110, 2111, 2112, 2113, 2114, 2114, 2112,
3761 2112, 2112, 2116, 2116, 2115, 2116, 2116, 2118,
3762 2119, 2120, 2119, 2121, 2122, 2120, 2122, 2125,
3763 2125, 2124, 2124, 2125, 2124, 2123, 2123, 2123,
3764 2121, 2122, 2122, 2125, 2124, 2123, 2124, 2126,
3765 2123, 2125, 2126, 2126, 2125, 2125, 2124, 2125,
3766 2125, 2124, 2126, 2126, 2127, 2127, 2125, 2127,
3767 2126, 2128, 2128, 2126, 2127, 2129, 2129, 2131,
3768 2131, 2131, 2131, 2132, 2130, 2130, 2132, 2132,
3769 2132, 2130, 2132, 2132, 2134, 2136, 2136, 2137,
3770 2139, 2138, 2138, 2136, 2136, 2136, 2135, 2132,
3771 2133, 2132, 2133, 2133, 2132, 2134, 2132, 2133,
3772 2136, 2131, 2132, 2133, 2133, 2135, 2134, 2134,
3773 2133, 2132, 2132, 2133, 2135, 2133, 2133, 2132,
3774 2133, 2133, 2133, 2134, 2135, 2136, 2135, 2133,
3775 2135, 2137, 2136, 2136, 2137, 2136, 2139, 2138,
3776 2137, 2138, 2137, 2139, 2138, 2138, 2139, 2139,
3777 2137, 2137, 2139, 2136, 2132, 2134, 2134, 2132,
3778 2130, 2132, 2132, 2129, 2128, 2126, 2126, 2128,
3779 2129, 2128, 2127, 2128, 2128, 2127, 2129, 2130,
3780 2130, 2128, 2128, 2128, 2129, 2129, 2131, 2132,
3781 2130, 2128, 2129, 2130, 2128, 2127, 2128, 2128,
3782 2128, 2128, 2129, 2131, 2131, 2132, 2132, 2132,
3783 2131, 2132, 2131, 2130, 2130, 2132, 2131, 2127,
3784 2130, 2127, 2127, 2127, 2128, 2124, 2123, 2124,
3785 2124, 2124, 2124, 2125, 2124, 2122, 2121, 2121,
3786 2119, 2120, 2119, 2118, 2117, 2118, 2118, 2114,
3787 2114, 2113, 2113, 2115, 2112, 2114, 2114, 2111,
3788 2111, 2111, 2111, 2109, 2110, 2110, 2109, 2108,
3789 2111, 2113, 2110, 2110, 2107, 2109, 2108, 2106,
3790 2108, 2106, 2107, 2106, 2108, 2109, 2109, 2108,
3791 2108, 2109, 2108, 2107, 2110, 2108, 2104, 2103,
3792 2105, 2106, 2104, 2104, 2103, 2103, 2102, 2102,
3793 2102, 2103, 2103, 2101, 2102, 2101, 2103, 2106,
3794 2105, 2102, 2104, 2103, 2102, 2100, 2101, 2102,
3795 2099, 2101, 2102, 2104, 2102, 2101, 2101, 2101,
3796 2103, 2102, 2103, 2105, 2103, 2104, 2102, 2102
3797};
diff --git a/keyboards/planck/keymaps/synth_wavetable/config.h b/keyboards/planck/keymaps/synth_wavetable/config.h
new file mode 100644
index 000000000..930b26b00
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_wavetable/config.h
@@ -0,0 +1,56 @@
1/*
2Copyright 2020 Jack Humbert
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#ifdef AUDIO_ENABLE
21 #define AUDIO_PIN A5
22 #define STARTUP_SONG SONG(PLANCK_SOUND)
23 // #define STARTUP_SONG SONG(NO_SOUND)
24
25 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
26 SONG(COLEMAK_SOUND), \
27 SONG(DVORAK_SOUND) \
28 }
29#endif
30
31/*
32 * MIDI options
33 */
34
35/* Prevent use of disabled MIDI features in the keymap */
36//#define MIDI_ENABLE_STRICT 1
37
38/* enable basic MIDI features:
39 - MIDI notes can be sent when in Music mode is on
40*/
41
42#define MIDI_BASIC
43
44/* enable advanced MIDI features:
45 - MIDI notes can be added to the keymap
46 - Octave shift and transpose
47 - Virtual sustain, portamento, and modulation wheel
48 - etc.
49*/
50//#define MIDI_ADVANCED
51
52/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
53//#define MIDI_TONE_KEYCODE_OCTAVES 2
54
55// Most tactile encoders have detents every 4 stages
56#define ENCODER_RESOLUTION 4
diff --git a/keyboards/planck/keymaps/synth_wavetable/keymap.c b/keyboards/planck/keymaps/synth_wavetable/keymap.c
new file mode 100644
index 000000000..a0d710679
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_wavetable/keymap.c
@@ -0,0 +1,320 @@
1/* Copyright 2019 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include QMK_KEYBOARD_H
18
19enum planck_layers {
20 _QWERTY,
21 _COLEMAK,
22 _DVORAK,
23 _LOWER,
24 _RAISE,
25 _PLOVER,
26 _ADJUST
27};
28
29enum planck_keycodes {
30 QWERTY = SAFE_RANGE,
31 COLEMAK,
32 DVORAK,
33 PLOVER,
34 BACKLIT,
35 EXT_PLV
36};
37
38#define LOWER MO(_LOWER)
39#define RAISE MO(_RAISE)
40
41const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42
43/* Qwerty
44 * ,-----------------------------------------------------------------------------------.
45 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
46 * |------+------+------+------+------+-------------+------+------+------+------+------|
47 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
48 * |------+------+------+------+------+------|------+------+------+------+------+------|
49 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
50 * |------+------+------+------+------+------+------+------+------+------+------+------|
51 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
52 * `-----------------------------------------------------------------------------------'
53 */
54[_QWERTY] = LAYOUT_planck_grid(
55 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
56 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
57 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
58 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
59),
60
61/* Colemak
62 * ,-----------------------------------------------------------------------------------.
63 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
64 * |------+------+------+------+------+-------------+------+------+------+------+------|
65 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
66 * |------+------+------+------+------+------|------+------+------+------+------+------|
67 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
70 * `-----------------------------------------------------------------------------------'
71 */
72[_COLEMAK] = LAYOUT_planck_grid(
73 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
74 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
75 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
76 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
77),
78
79/* Dvorak
80 * ,-----------------------------------------------------------------------------------.
81 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_DVORAK] = LAYOUT_planck_grid(
91 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
92 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
93 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
94 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
95),
96
97/* Lower
98 * ,-----------------------------------------------------------------------------------.
99 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
100 * |------+------+------+------+------+-------------+------+------+------+------+------|
101 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
102 * |------+------+------+------+------+------|------+------+------+------+------+------|
103 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | | Next | Vol- | Vol+ | Play |
106 * `-----------------------------------------------------------------------------------'
107 */
108[_LOWER] = LAYOUT_planck_grid(
109 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
110 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
111 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
112 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
113),
114
115/* Raise
116 * ,-----------------------------------------------------------------------------------.
117 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
118 * |------+------+------+------+------+-------------+------+------+------+------+------|
119 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
120 * |------+------+------+------+------+------|------+------+------+------+------+------|
121 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
122 * |------+------+------+------+------+------+------+------+------+------+------+------|
123 * | | | | | | | | Next | Vol- | Vol+ | Play |
124 * `-----------------------------------------------------------------------------------'
125 */
126[_RAISE] = LAYOUT_planck_grid(
127 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
128 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
129 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
130 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
131),
132
133/* Plover layer (http://opensteno.org)
134 * ,-----------------------------------------------------------------------------------.
135 * | # | # | # | # | # | # | # | # | # | # | # | # |
136 * |------+------+------+------+------+-------------+------+------+------+------+------|
137 * | | S | T | P | H | * | * | F | P | L | T | D |
138 * |------+------+------+------+------+------|------+------+------+------+------+------|
139 * | | S | K | W | R | * | * | R | B | G | S | Z |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | Exit | | | A | O | | E | U | | | |
142 * `-----------------------------------------------------------------------------------'
143 */
144[_PLOVER] = LAYOUT_planck_grid(
145 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
146 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
147 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
148 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
149),
150
151/* Adjust (Lower + Raise)
152 * ,-----------------------------------------------------------------------------------.
153 * | | Reset| | | | | | | | | | Del |
154 * |------+------+------+------+------+-------------+------+------+------+------+------|
155 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
156 * |------+------+------+------+------+------|------+------+------+------+------+------|
157 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
158 * |------+------+------+------+------+------+------+------+------+------+------+------|
159 * | | | | | | | | | | | |
160 * `-----------------------------------------------------------------------------------'
161 */
162[_ADJUST] = LAYOUT_planck_grid(
163 _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
164 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
165 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
166 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
167)
168
169};
170
171#ifdef AUDIO_ENABLE
172 float plover_song[][2] = SONG(PLOVER_SOUND);
173 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
174#endif
175
176uint32_t layer_state_set_user(uint32_t state) {
177 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
178}
179
180bool process_record_user(uint16_t keycode, keyrecord_t *record) {
181 switch (keycode) {
182 case QWERTY:
183 if (record->event.pressed) {
184 print("mode just switched to qwerty and this is a huge string\n");
185 set_single_persistent_default_layer(_QWERTY);
186 }
187 return false;
188 break;
189 case COLEMAK:
190 if (record->event.pressed) {
191 set_single_persistent_default_layer(_COLEMAK);
192 }
193 return false;
194 break;
195 case DVORAK:
196 if (record->event.pressed) {
197 set_single_persistent_default_layer(_DVORAK);
198 }
199 return false;
200 break;
201 case BACKLIT:
202 if (record->event.pressed) {
203 register_code(KC_RSFT);
204 #ifdef BACKLIGHT_ENABLE
205 backlight_step();
206 #endif
207 #ifdef KEYBOARD_planck_rev5
208 PORTE &= ~(1<<6);
209 #endif
210 } else {
211 unregister_code(KC_RSFT);
212 #ifdef KEYBOARD_planck_rev5
213 PORTE |= (1<<6);
214 #endif
215 }
216 return false;
217 break;
218 case PLOVER:
219 if (record->event.pressed) {
220 #ifdef AUDIO_ENABLE
221 stop_all_notes();
222 PLAY_SONG(plover_song);
223 #endif
224 layer_off(_RAISE);
225 layer_off(_LOWER);
226 layer_off(_ADJUST);
227 layer_on(_PLOVER);
228 if (!eeconfig_is_enabled()) {
229 eeconfig_init();
230 }
231 keymap_config.raw = eeconfig_read_keymap();
232 keymap_config.nkro = 1;
233 eeconfig_update_keymap(keymap_config.raw);
234 }
235 return false;
236 break;
237 case EXT_PLV:
238 if (record->event.pressed) {
239 #ifdef AUDIO_ENABLE
240 PLAY_SONG(plover_gb_song);
241 #endif
242 layer_off(_PLOVER);
243 }
244 return false;
245 break;
246 }
247 return true;
248}
249
250void matrix_scan_user(void) {
251
252}
253
254bool music_mask_user(uint16_t keycode) {
255 switch (keycode) {
256 case RAISE:
257 case LOWER:
258 return false;
259 default:
260 return true;
261 }
262}
263
264#include "wavetable.h"
265
266float dac_if[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
267uint8_t dac_morph = 0;
268
269
270uint16_t dac_value_generate(void) {
271 uint16_t value = AUDIO_DAC_OFF_VALUE;
272 uint8_t active_tones = audio_get_number_of_active_tones();
273 if (active_tones > AUDIO_MAX_SIMULTANEOUS_TONES)
274 active_tones = AUDIO_MAX_SIMULTANEOUS_TONES;
275
276 if (active_tones > 0) {
277 uint16_t value_avg = 0;
278 for (uint8_t i = 0; i < active_tones; i++) {
279 dac_if[i] = dac_if[i]
280 + ((audio_get_frequency(i) * AUDIO_DAC_BUFFER_SIZE) / AUDIO_DAC_SAMPLE_RATE)
281 * 2/3; // necessary to adjust for the gpt-timer frequency (three times the sample rate) and the dac-conversion beeing called twice per sample
282
283 // Needed because % doesn't work with floats
284 while (dac_if[i] >= (AUDIO_DAC_BUFFER_SIZE))
285 dac_if[i] = dac_if[i] - AUDIO_DAC_BUFFER_SIZE;
286
287 // #define AUDIO_DAC_MORPH_SPEED 372
288 // #define AUDIO_DAC_MORPH_SPEED_COMPUTED (AUDIO_DAC_SAMPLE_RATE / AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH * (1000 / AUDIO_DAC_MORPH_SPEED))
289
290 uint16_t dac_i = (uint16_t)dac_if[i];
291 // value_avg += dac_buffer_custom[dac_morph_flipped][dac_i] / active_tones / 2 * ((dac_morph >= 63) ? 6400 - dac_morph_counter : dac_morph_counter) / 6400;
292 // value_avg += dac_buffer_custom[dac_morph_flipped + 1][dac_i] / active_tones / 2 * ((dac_morph >= 63) ? dac_morph_counter : 6400 - dac_morph_counter) / 6400;
293
294 // value_avg += dac_wavetable_custom[dac_morph][dac_i] / active_tones / 2 * (AUDIO_DAC_MORPH_SPEED_COMPUTED - dac_morph_counter) / AUDIO_DAC_MORPH_SPEED_COMPUTED;
295 // value_avg += dac_wavetable_custom[dac_morph + 1][dac_i] / active_tones / 2 * dac_morph_counter / AUDIO_DAC_MORPH_SPEED_COMPUTED;
296 value_avg += dac_wavetable_custom[dac_morph][dac_i] / active_tones;
297 }
298 value = value_avg;
299
300 // dac_morph_counter++;
301 // if (dac_morph_counter >= AUDIO_DAC_MORPH_SPEED_COMPUTED) {
302 // dac_morph_counter = 0;
303 // dac_morph = (dac_morph + 1) % 125;
304 // dac_morph_flipped = ((dac_morph >= 63) ? (125 - dac_morph) : dac_morph);
305 // dac_morph = (dac_morph + 1) % (AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH - 1);
306 // }
307 }
308 return value;
309}
310
311void encoder_update(bool clockwise) {
312 if (clockwise) {
313 dac_morph = (dac_morph + 1) % AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH;
314 } else {
315 if (dac_morph == 0)
316 dac_morph = (AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH - 1);
317 else
318 dac_morph--;
319 }
320}
diff --git a/keyboards/planck/keymaps/synth_wavetable/rules.mk b/keyboards/planck/keymaps/synth_wavetable/rules.mk
new file mode 100644
index 000000000..ebfcda221
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_wavetable/rules.mk
@@ -0,0 +1,2 @@
1AUDIO_ENABLE = yes
2AUDIO_DRIVER = dac_additive
diff --git a/keyboards/planck/keymaps/synth_wavetable/wavetable.h b/keyboards/planck/keymaps/synth_wavetable/wavetable.h
new file mode 100644
index 000000000..89a0eefcb
--- /dev/null
+++ b/keyboards/planck/keymaps/synth_wavetable/wavetable.h
@@ -0,0 +1,2197 @@
1/*
2Copyright 2020 Jack Humbert
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#define AUDIO_DAC_WAVETABLE_CUSTOM_LENGTH 64
19
20static const dacsample_t dac_wavetable_custom[64][256] = {
21 {
22 3038, 4095, 3745, 3945, 3779, 3889, 3782, 3850,
23 3775, 3817, 3766, 3788, 3755, 3762, 3743, 3738,
24 3729, 3716, 3715, 3695, 3700, 3676, 3683, 3658,
25 3667, 3642, 3649, 3626, 3632, 3611, 3614, 3596,
26 3596, 3581, 3579, 3567, 3561, 3552, 3544, 3537,
27 3528, 3522, 3511, 3507, 3495, 3491, 3479, 3476,
28 3464, 3460, 3449, 3444, 3433, 3428, 3419, 3412,
29 3404, 3397, 3389, 3382, 3374, 3366, 3359, 3351,
30 3345, 3336, 3330, 3322, 3314, 3307, 3299, 3293,
31 3285, 3279, 3270, 3265, 3255, 3251, 3241, 3237,
32 3227, 3223, 3213, 3208, 3200, 3194, 3187, 3179,
33 3173, 3165, 3161, 3150, 3149, 3136, 3137, 3121,
34 3125, 3107, 3112, 3093, 3099, 3080, 3086, 3068,
35 3072, 3056, 3058, 3045, 3043, 3036, 3027, 3027,
36 3010, 3019, 2992, 3013, 2974, 3007, 2955, 3002,
37 2935, 2999, 2913, 2998, 2886, 3006, 2842, 3067,
38 2464, 221, 205, 228, 215, 260, 231, 285,
39 249, 307, 270, 326, 291, 344, 313, 359,
40 335, 374, 357, 388, 378, 403, 399, 416,
41 419, 431, 438, 445, 457, 460, 475, 476,
42 492, 492, 509, 508, 525, 524, 540, 541,
43 555, 558, 571, 574, 586, 591, 601, 607,
44 616, 624, 631, 639, 647, 656, 662, 671,
45 677, 687, 692, 702, 708, 718, 723, 733,
46 738, 748, 753, 763, 768, 777, 783, 792,
47 798, 806, 812, 820, 827, 834, 842, 848,
48 857, 862, 872, 875, 887, 888, 901, 902,
49 915, 915, 929, 929, 943, 942, 956, 956,
50 969, 971, 981, 986, 992, 1001, 1003, 1017,
51 1013, 1032, 1023, 1048, 1033, 1064, 1043, 1079,
52 1054, 1093, 1065, 1106, 1078, 1118, 1092, 1127,
53 1109, 1132, 1130, 1132, 1160, 1118, 1217, 1036
54 },
55 {
56 2048, 2049, 2056, 2071, 2096, 2130, 2174, 2225,
57 2280, 2337, 2392, 2444, 2490, 2529, 2559, 2581,
58 2593, 2597, 2594, 2589, 2585, 2588, 2603, 2635,
59 2685, 2755, 2842, 2943, 3050, 3157, 3258, 3347,
60 3423, 3485, 3535, 3577, 3612, 3641, 3665, 3682,
61 3692, 3694, 3692, 3689, 3690, 3700, 3724, 3761,
62 3811, 3867, 3924, 3972, 4005, 4019, 4013, 3993,
63 3964, 3936, 3915, 3906, 3912, 3931, 3959, 3990,
64 4020, 4043, 4059, 4067, 4068, 4063, 4051, 4030,
65 3997, 3946, 3875, 3782, 3671, 3546, 3419, 3299,
66 3197, 3120, 3072, 3053, 3062, 3091, 3133, 3180,
67 3224, 3257, 3276, 3277, 3259, 3221, 3163, 3084,
68 2986, 2870, 2741, 2607, 2474, 2351, 2245, 2161,
69 2102, 2069, 2058, 2067, 2091, 2124, 2160, 2195,
70 2222, 2239, 2245, 2238, 2219, 2191, 2155, 2116,
71 2077, 2042, 2014, 1995, 1987, 1991, 2003, 2023,
72 2048, 2074, 2101, 2124, 2144, 2158, 2166, 2170,
73 2172, 2175, 2181, 2195, 2221, 2260, 2315, 2384,
74 2465, 2555, 2648, 2740, 2826, 2903, 2971, 3029,
75 3076, 3114, 3142, 3159, 3167, 3167, 3160, 3153,
76 3150, 3157, 3180, 3222, 3283, 3362, 3452, 3546,
77 3636, 3715, 3777, 3823, 3854, 3874, 3889, 3905,
78 3923, 3944, 3968, 3989, 4007, 4019, 4026, 4030,
79 4033, 4040, 4051, 4066, 4081, 4090, 4086, 4063,
80 4019, 3956, 3878, 3794, 3716, 3651, 3606, 3586,
81 3589, 3612, 3647, 3688, 3728, 3760, 3781, 3787,
82 3780, 3757, 3718, 3661, 3584, 3485, 3366, 3230,
83 3085, 2938, 2801, 2683, 2589, 2525, 2492, 2486,
84 2503, 2537, 2580, 2624, 2663, 2691, 2703, 2698,
85 2674, 2633, 2574, 2500, 2415, 2322, 2228, 2139,
86 2059, 1994, 1945, 1914, 1900, 1901, 1913, 1933,
87 1957, 1983, 2006, 2025, 2038, 2046, 2049, 2048
88 },
89 {
90 2048, 2053, 2074, 2119, 2191, 2291, 2416, 2559,
91 2710, 2860, 3000, 3124, 3225, 3301, 3350, 3371,
92 3364, 3334, 3288, 3234, 3182, 3144, 3127, 3137,
93 3173, 3231, 3304, 3378, 3441, 3483, 3495, 3475,
94 3423, 3344, 3243, 3128, 3002, 2867, 2726, 2581,
95 2433, 2286, 2142, 2001, 1865, 1731, 1597, 1460,
96 1317, 1171, 1023, 881, 750, 637, 546, 476,
97 423, 380, 341, 300, 254, 205, 154, 109,
98 75, 56, 55, 72, 105, 153, 217, 296,
99 395, 513, 651, 806, 972, 1139, 1299, 1444,
100 1572, 1680, 1772, 1855, 1935, 2018, 2110, 2212,
101 2323, 2442, 2563, 2680, 2786, 2877, 2944, 2982,
102 2986, 2951, 2877, 2771, 2640, 2498, 2360, 2238,
103 2145, 2087, 2069, 2088, 2140, 2215, 2303, 2392,
104 2469, 2524, 2550, 2543, 2505, 2437, 2346, 2241,
105 2132, 2031, 1949, 1893, 1870, 1878, 1915, 1974,
106 2048, 2128, 2206, 2276, 2332, 2371, 2394, 2402,
107 2403, 2404, 2417, 2449, 2510, 2603, 2728, 2882,
108 3056, 3236, 3410, 3564, 3690, 3783, 3842, 3868,
109 3864, 3833, 3777, 3700, 3604, 3495, 3378, 3261,
110 3150, 3048, 2958, 2877, 2801, 2723, 2637, 2536,
111 2420, 2289, 2146, 1997, 1847, 1698, 1552, 1410,
112 1271, 1133, 999, 870, 748, 637, 536, 446,
113 364, 288, 216, 150, 92, 49, 29, 37,
114 76, 144, 235, 339, 444, 541, 623, 689,
115 741, 784, 826, 874, 933, 1009, 1101, 1209,
116 1330, 1461, 1598, 1739, 1877, 2007, 2123, 2219,
117 2291, 2338, 2364, 2374, 2378, 2385, 2404, 2443,
118 2503, 2585, 2684, 2794, 2904, 3004, 3084, 3136,
119 3154, 3133, 3070, 2965, 2823, 2650, 2458, 2261,
120 2075, 1914, 1787, 1701, 1656, 1649, 1675, 1726,
121 1791, 1861, 1927, 1981, 2020, 2043, 2051, 2050
122 },
123 {
124 2048, 2051, 2065, 2095, 2144, 2212, 2298, 2397,
125 2504, 2612, 2716, 2811, 2894, 2961, 3011, 3042,
126 3055, 3052, 3036, 3014, 2996, 2988, 3001, 3040,
127 3108, 3204, 3324, 3459, 3598, 3728, 3841, 3930,
128 3992, 4029, 4045, 4045, 4032, 4009, 3975, 3930,
129 3874, 3809, 3738, 3665, 3596, 3534, 3481, 3436,
130 3397, 3357, 3312, 3255, 3184, 3099, 3003, 2900,
131 2795, 2693, 2595, 2503, 2413, 2325, 2235, 2143,
132 2048, 1950, 1850, 1750, 1651, 1554, 1460, 1370,
133 1287, 1215, 1159, 1122, 1105, 1107, 1124, 1147,
134 1168, 1179, 1172, 1143, 1091, 1019, 931, 836,
135 741, 655, 584, 535, 510, 514, 549, 618,
136 721, 856, 1019, 1201, 1388, 1569, 1730, 1862,
137 1956, 2012, 2029, 2013, 1971, 1911, 1844, 1779,
138 1725, 1690, 1676, 1686, 1719, 1771, 1838, 1913,
139 1989, 2059, 2115, 2152, 2167, 2161, 2136, 2097,
140 2048, 1994, 1942, 1894, 1856, 1829, 1813, 1805,
141 1803, 1800, 1788, 1762, 1715, 1643, 1544, 1420,
142 1276, 1120, 962, 811, 675, 558, 463, 390,
143 337, 304, 290, 294, 316, 353, 399, 447,
144 489, 517, 526, 513, 479, 430, 375, 322,
145 283, 264, 269, 297, 345, 405, 473, 542,
146 612, 682, 754, 829, 910, 996, 1086, 1179,
147 1273, 1366, 1459, 1553, 1649, 1747, 1848, 1949,
148 2048, 2141, 2227, 2305, 2375, 2440, 2505, 2574,
149 2649, 2733, 2825, 2923, 3023, 3122, 3215, 3300,
150 3373, 3433, 3476, 3499, 3496, 3465, 3403, 3313,
151 3200, 3073, 2945, 2829, 2735, 2672, 2644, 2652,
152 2691, 2756, 2836, 2921, 3000, 3062, 3101, 3111,
153 3090, 3036, 2950, 2835, 2695, 2539, 2375, 2214,
154 2069, 1947, 1855, 1795, 1766, 1765, 1786, 1824,
155 1871, 1920, 1965, 2003, 2029, 2044, 2050, 2049
156 },
157 {
158 2048, 2061, 2117, 2228, 2396, 2610, 2844, 3065,
159 3240, 3343, 3358, 3283, 3125, 2900, 2629, 2337,
160 2048, 1783, 1558, 1379, 1241, 1136, 1049, 971,
161 900, 843, 815, 838, 930, 1103, 1358, 1680,
162 2048, 2435, 2816, 3170, 3479, 3729, 3908, 4008,
163 4025, 3959, 3819, 3616, 3364, 3076, 2757, 2413,
164 2048, 1667, 1285, 922, 601, 347, 175, 92,
165 93, 168, 304, 490, 722, 998, 1315, 1668,
166 2048, 2437, 2818, 3173, 3483, 3736, 3919, 4021,
167 4035, 3956, 3788, 3544, 3247, 2924, 2605, 2309,
168 2048, 1819, 1614, 1422, 1234, 1050, 878, 733,
169 633, 597, 635, 751, 939, 1186, 1471, 1768,
170 2048, 2280, 2443, 2523, 2523, 2457, 2354, 2241,
171 2146, 2087, 2067, 2081, 2113, 2142, 2149, 2118,
172 2048, 1944, 1824, 1711, 1629, 1601, 1637, 1740,
173 1896, 2080, 2261, 2404, 2481, 2478, 2394, 2243,
174 2048, 1835, 1634, 1468, 1354, 1299, 1300, 1342,
175 1408, 1479, 1540, 1586, 1625, 1670, 1744, 1865,
176 2048, 2292, 2585, 2903, 3215, 3491, 3707, 3846,
177 3899, 3864, 3745, 3550, 3296, 2999, 2682, 2360,
178 2048, 1749, 1462, 1186, 917, 661, 432, 250,
179 137, 112, 184, 351, 600, 912, 1268, 1651,
180 2048, 2444, 2828, 3184, 3496, 3749, 3932, 4040,
181 4072, 4031, 3919, 3739, 3493, 3185, 2828, 2441,
182 2048, 1675, 1346, 1074, 862, 705, 592, 516,
183 476, 475, 524, 632, 806, 1046, 1343, 1684,
184 2048, 2412, 2755, 3051, 3279, 3421, 3468, 3421,
185 3295, 3116, 2914, 2717, 2543, 2398, 2277, 2166,
186 2048, 1909, 1744, 1557, 1361, 1178, 1031, 940,
187 919, 975, 1102, 1284, 1497, 1708, 1886, 2004,
188 2048, 2018, 1931, 1812, 1689, 1590, 1536, 1534,
189 1585, 1676, 1786, 1894, 1981, 2035, 2056, 2053
190 },
191 {
192 2048, 2072, 2162, 2326, 2531, 2717, 2808, 2744,
193 2504, 2112, 1636, 1162, 781, 560, 536, 708,
194 1040, 1468, 1922, 2340, 2681, 2929, 3082, 3144,
195 3108, 2958, 2676, 2261, 1739, 1174, 654, 273,
196 103, 179, 496, 1009, 1653, 2344, 2997, 3529,
197 3874, 3994, 3882, 3563, 3082, 2497, 1866, 1246,
198 698, 284, 64, 82, 347, 829, 1459, 2145,
199 2795, 3334, 3712, 3900, 3885, 3668, 3262, 2702,
200 2048, 1375, 770, 310, 56, 39, 261, 696,
201 1287, 1952, 2594, 3120, 3458, 3578, 3497, 3260,
202 2927, 2549, 2159, 1774, 1409, 1084, 836, 709,
203 741, 951, 1327, 1819, 2353, 2844, 3211, 3395,
204 3374, 3170, 2846, 2488, 2179, 1975, 1891, 1901,
205 1956, 2008, 2027, 2015, 1996, 2006, 2073, 2203,
206 2370, 2529, 2630, 2636, 2539, 2368, 2176, 2032,
207 1989, 2070, 2251, 2471, 2649, 2712, 2622, 2385,
208 2048, 1681, 1362, 1153, 1086, 1157, 1334, 1565,
209 1803, 2019, 2207, 2378, 2545, 2706, 2837, 2892,
210 2819, 2583, 2185, 1674, 1130, 653, 328, 216,
211 337, 675, 1182, 1782, 2392, 2928, 3328, 3557,
212 3606, 3490, 3229, 2845, 2359, 1803, 1223, 690,
213 283, 77, 118, 409, 910, 1551, 2247, 2916,
214 3483, 3886, 4077, 4031, 3750, 3266, 2640, 1948,
215 1273, 689, 261, 35, 43, 291, 753, 1368,
216 2048, 2691, 3210, 3550, 3691, 3645, 3437, 3096,
217 2649, 2126, 1569, 1033, 587, 298, 216, 362,
218 722, 1248, 1866, 2486, 3015, 3375, 3519, 3446,
219 3200, 2855, 2490, 2166, 1911, 1723, 1584, 1478,
220 1404, 1379, 1435, 1593, 1858, 2201, 2566, 2885,
221 3090, 3140, 3027, 2785, 2480, 2196, 2006, 1951,
222 2026, 2183, 2350, 2459, 2469, 2375, 2208, 2022,
223 1871, 1793, 1798, 1865, 1955, 2028, 2061, 2057
224 },
225 {
226 2048, 1736, 1511, 1423, 1476, 1630, 1822, 1987,
227 2083, 2101, 2063, 2006, 1968, 1967, 2000, 2045,
228 2073, 2061, 2011, 1944, 1899, 1908, 1981, 2099,
229 2218, 2291, 2292, 2226, 2129, 2054, 2044, 2111,
230 2237, 2375, 2471, 2480, 2385, 2198, 1962, 1735,
231 1574, 1515, 1563, 1694, 1861, 2022, 2148, 2232,
232 2282, 2305, 2299, 2254, 2154, 1996, 1798, 1599,
233 1449, 1393, 1464, 1664, 1967, 2319, 2651, 2890,
234 2979, 2896, 2660, 2325, 1964, 1648, 1430, 1334,
235 1360, 1494, 1707, 1967, 2238, 2480, 2658, 2740,
236 2709, 2561, 2310, 1987, 1639, 1327, 1114, 1056,
237 1181, 1476, 1889, 2335, 2720, 2967, 3034, 2923,
238 2673, 2345, 2010, 1727, 1537, 1455, 1475, 1580,
239 1747, 1955, 2184, 2411, 2607, 2733, 2751, 2632,
240 2378, 2025, 1643, 1320, 1132, 1123, 1287, 1573,
241 1902, 2192, 2386, 2461, 2433, 2339, 2225, 2123,
242 2048, 1993, 1946, 1898, 1854, 1834, 1865, 1966,
243 2133, 2334, 2512, 2611, 2593, 2463, 2263, 2058,
244 1913, 1862, 1902, 1996, 2088, 2130, 2099, 2001,
245 1871, 1755, 1694, 1710, 1795, 1918, 2036, 2111,
246 2130, 2104, 2062, 2034, 2032, 2044, 2044, 2008,
247 1930, 1832, 1756, 1745, 1830, 2008, 2250, 2502,
248 2700, 2790, 2741, 2556, 2273, 1955, 1672, 1483,
249 1414, 1463, 1600, 1789, 1998, 2202, 2383, 2519,
250 2590, 2574, 2460, 2253, 1979, 1682, 1414, 1233,
251 1183, 1291, 1551, 1925, 2344, 2723, 2981, 3065,
252 2964, 2707, 2356, 1983, 1656, 1424, 1315, 1335,
253 1468, 1686, 1950, 2223, 2467, 2652, 2748, 2736,
254 2601, 2347, 2004, 1624, 1283, 1058, 1009, 1154,
255 1466, 1873, 2285, 2614, 2801, 2826, 2710, 2501,
256 2259, 2036, 1862, 1751, 1697, 1692, 1733, 1822,
257 1963, 2154, 2374, 2582, 2721, 2742, 2619, 2369
258 },
259 {
260 2048, 2099, 2228, 2259, 1999, 1514, 1195, 1450,
261 2280, 3163, 3424, 2780, 1605, 678, 618, 1447,
262 2593, 3312, 3203, 2425, 1510, 990, 1120, 1807,
263 2685, 3258, 3119, 2226, 1045, 353, 712, 2001,
264 3423, 4031, 3396, 1899, 483, 41, 848, 2389,
265 3692, 3949, 3033, 1544, 405, 291, 1255, 2722,
266 3811, 3831, 2719, 1136, 90, 268, 1555, 3114,
267 3964, 3614, 2324, 895, 183, 617, 1954, 3388,
268 4020, 3424, 1949, 514, 27, 798, 2345, 3693,
269 3997, 3089, 1590, 481, 425, 1338, 2538, 3274,
270 3197, 2470, 1563, 978, 1033, 1728, 2698, 3356,
271 3224, 2300, 1137, 500, 836, 1934, 3058, 3478,
272 2986, 2018, 1282, 1194, 1621, 2108, 2314, 2242,
273 2102, 2039, 2030, 2009, 2004, 2101, 2286, 2386,
274 2222, 1832, 1496, 1506, 1876, 2312, 2478, 2313,
275 2077, 2067, 2276, 2385, 2108, 1542, 1143, 1321,
276 2048, 2836, 3127, 2729, 1951, 1338, 1247, 1633,
277 2172, 2537, 2581, 2321, 1874, 1441, 1300, 1669,
278 2465, 3215, 3317, 2530, 1269, 374, 507, 1646,
279 3076, 3872, 3523, 2269, 928, 339, 820, 2008,
280 3150, 3579, 3074, 1933, 812, 393, 1006, 2361,
281 3636, 3973, 3084, 1503, 242, 106, 1176, 2779,
282 3923, 3906, 2735, 1128, 88, 267, 1552, 3134,
283 4033, 3701, 2345, 796, 14, 497, 1947, 3438,
284 4019, 3364, 1958, 721, 380, 1054, 2279, 3324,
285 3589, 2905, 1647, 566, 367, 1237, 2668, 3752,
286 3780, 2721, 1257, 332, 511, 1607, 2838, 3413,
287 3085, 2234, 1489, 1248, 1506, 2001, 2450, 2652,
288 2503, 2030, 1460, 1167, 1432, 2176, 2932, 3161,
289 2674, 1808, 1170, 1163, 1680, 2239, 2430, 2258,
290 2059, 2108, 2334, 2426, 2195, 1777, 1510, 1606,
291 1957, 2266, 2327, 2193, 2057, 2033, 2068, 2069
292 },
293 {
294 2048, 2119, 2229, 2372, 2541, 2724, 2909, 3085,
295 3240, 3368, 3466, 3533, 3571, 3581, 3566, 3529,
296 3473, 3403, 3326, 3251, 3188, 3144, 3128, 3145,
297 3195, 3276, 3382, 3503, 3628, 3747, 3850, 3932,
298 3992, 4032, 4055, 4067, 4071, 4069, 4061, 4047,
299 4025, 3996, 3965, 3934, 3910, 3898, 3902, 3922,
300 3956, 3998, 4040, 4074, 4093, 4093, 4074, 4041,
301 4002, 3964, 3935, 3920, 3921, 3936, 3961, 3991,
302 4020, 4044, 4062, 4073, 4078, 4078, 4073, 4060,
303 4035, 3994, 3932, 3848, 3744, 3626, 3504, 3389,
304 3291, 3220, 3180, 3174, 3198, 3247, 3313, 3388,
305 3462, 3527, 3577, 3607, 3615, 3598, 3553, 3479,
306 3374, 3240, 3081, 2904, 2720, 2541, 2379, 2245,
307 2146, 2087, 2069, 2088, 2140, 2218, 2311, 2410,
308 2503, 2580, 2633, 2654, 2639, 2585, 2492, 2361,
309 2199, 2014, 1817, 1619, 1435, 1273, 1142, 1045,
310 984, 959, 967, 1005, 1067, 1148, 1238, 1328,
311 1408, 1468, 1498, 1493, 1450, 1369, 1254, 1113,
312 956, 796, 643, 508, 397, 311, 251, 214,
313 196, 195, 211, 240, 283, 334, 391, 445,
314 489, 515, 519, 496, 449, 380, 299, 215,
315 137, 74, 31, 7, 0, 3, 10, 16,
316 18, 14, 8, 2, 0, 2, 8, 16,
317 23, 25, 22, 13, 4, 0, 7, 31,
318 76, 139, 215, 296, 371, 432, 472, 486,
319 476, 445, 398, 345, 291, 244, 207, 183,
320 172, 177, 199, 241, 305, 395, 510, 648,
321 800, 958, 1109, 1242, 1347, 1416, 1448, 1443,
322 1404, 1338, 1255, 1164, 1077, 1002, 947, 918,
323 919, 954, 1024, 1129, 1268, 1436, 1624, 1822,
324 2017, 2197, 2351, 2472, 2554, 2597, 2602, 2571,
325 2510, 2427, 2331, 2232, 2141, 2070, 2027, 2018
326 },
327 {
328 2048, 2055, 2083, 2142, 2236, 2366, 2526, 2705,
329 2891, 3068, 3227, 3358, 3455, 3515, 3537, 3522,
330 3473, 3396, 3302, 3199, 3101, 3015, 2946, 2896,
331 2859, 2827, 2789, 2734, 2652, 2541, 2399, 2232,
332 2048, 1853, 1656, 1461, 1273, 1094, 929, 779,
333 649, 541, 454, 384, 327, 277, 229, 182,
334 139, 106, 93, 108, 158, 244, 363, 506,
335 666, 832, 999, 1165, 1330, 1499, 1674, 1857,
336 2048, 2243, 2440, 2635, 2825, 3005, 3173, 3324,
337 3453, 3552, 3614, 3635, 3614, 3558, 3476, 3382,
338 3291, 3215, 3159, 3125, 3110, 3105, 3100, 3084,
339 3048, 2986, 2897, 2783, 2647, 2497, 2341, 2188,
340 2048, 1931, 1846, 1799, 1790, 1815, 1863, 1922,
341 1978, 2017, 2030, 2012, 1962, 1885, 1789, 1687,
342 1592, 1517, 1473, 1467, 1501, 1574, 1678, 1805,
343 1940, 2069, 2176, 2249, 2282, 2272, 2224, 2146,
344 2048, 1941, 1837, 1745, 1672, 1623, 1598, 1591,
345 1596, 1599, 1590, 1558, 1495, 1398, 1269, 1117,
346 956, 802, 670, 575, 523, 516, 554, 630,
347 738, 873, 1027, 1196, 1372, 1550, 1724, 1890,
348 2048, 2198, 2346, 2498, 2659, 2833, 3019, 3210,
349 3398, 3573, 3724, 3847, 3939, 4004, 4046, 4069,
350 4078, 4071, 4048, 4005, 3939, 3852, 3743, 3618,
351 3479, 3331, 3173, 3006, 2830, 2642, 2446, 2245,
352 2048, 1860, 1690, 1539, 1406, 1286, 1172, 1057,
353 936, 808, 676, 546, 425, 322, 242, 192,
354 172, 186, 235, 319, 438, 590, 769, 965,
355 1166, 1356, 1526, 1668, 1779, 1864, 1931, 1988,
356 2048, 2117, 2202, 2304, 2419, 2541, 2659, 2764,
357 2845, 2893, 2899, 2857, 2767, 2633, 2463, 2272,
358 2078, 1899, 1750, 1642, 1579, 1563, 1587, 1643,
359 1721, 1807, 1890, 1961, 2012, 2041, 2052, 2050
360 },
361 {
362 2048, 2060, 2109, 2207, 2360, 2560, 2787, 3015,
363 3217, 3368, 3451, 3458, 3391, 3257, 3067, 2840,
364 2593, 2344, 2110, 1900, 1717, 1554, 1404, 1253,
365 1093, 924, 753, 596, 475, 410, 418, 507,
366 673, 905, 1189, 1509, 1849, 2196, 2537, 2858,
367 3146, 3391, 3587, 3732, 3830, 3884, 3899, 3876,
368 3811, 3695, 3524, 3294, 3012, 2689, 2345, 1999,
369 1666, 1358, 1077, 824, 599, 404, 246, 133,
370 75, 80, 151, 285, 478, 721, 1006, 1323,
371 1660, 2000, 2324, 2612, 2847, 3019, 3127, 3181,
372 3197, 3192, 3179, 3165, 3148, 3119, 3064, 2972,
373 2833, 2647, 2419, 2162, 1894, 1634, 1404, 1223,
374 1109, 1072, 1113, 1222, 1379, 1556, 1726, 1867,
375 1965, 2019, 2035, 2029, 2021, 2027, 2060, 2127,
376 2222, 2333, 2441, 2526, 2569, 2558, 2487, 2361,
377 2197, 2016, 1849, 1723, 1659, 1666, 1742, 1876,
378 2048, 2234, 2412, 2562, 2670, 2729, 2742, 2718,
379 2674, 2627, 2591, 2574, 2575, 2583, 2581, 2548,
380 2465, 2322, 2116, 1859, 1568, 1267, 977, 719,
381 508, 354, 266, 245, 291, 396, 550, 737,
382 945, 1165, 1394, 1634, 1891, 2170, 2472, 2790,
383 3109, 3408, 3667, 3870, 4007, 4077, 4082, 4030,
384 3923, 3765, 3559, 3306, 3013, 2689, 2347, 1998,
385 1653, 1320, 1006, 719, 468, 266, 126, 61,
386 76, 167, 322, 524, 752, 993, 1237, 1486,
387 1741, 2008, 2289, 2582, 2875, 3157, 3411, 3623,
388 3780, 3872, 3893, 3841, 3715, 3523, 3282, 3013,
389 2740, 2489, 2276, 2107, 1979, 1879, 1791, 1699,
390 1592, 1467, 1331, 1196, 1082, 1005, 980, 1015,
391 1109, 1256, 1438, 1635, 1821, 1973, 2068, 2097,
392 2059, 1967, 1844, 1713, 1601, 1526, 1499, 1525,
393 1594, 1694, 1805, 1908, 1988, 2036, 2055, 2053
394 },
395 {
396 2048, 2072, 2095, 2075, 2062, 2149, 2347, 2534,
397 2584, 2527, 2537, 2732, 3017, 3166, 3074, 2884,
398 2844, 3021, 3223, 3212, 2982, 2782, 2838, 3104,
399 3321, 3317, 3206, 3252, 3548, 3896, 4028, 3910,
400 3782, 3875, 4095, 4095, 4095, 3855, 3719, 3863,
401 4080, 4065, 3759, 3424, 3355, 3556, 3739, 3649,
402 3342, 3105, 3136, 3332, 3412, 3231, 2919, 2715,
403 2707, 2768, 2724, 2551, 2362, 2259, 2219, 2157,
404 2048, 1944, 1881, 1811, 1665, 1473, 1350, 1361,
405 1417, 1359, 1150, 949, 947, 1145, 1329, 1300,
406 1095, 955, 1044, 1254, 1316, 1103, 782, 627,
407 713, 835, 759, 498, 306, 386, 653, 834,
408 792, 690, 804, 1192, 1608, 1771, 1678, 1603,
409 1778, 2118, 2309, 2159, 1822, 1629, 1734, 1954,
410 1990, 1762, 1493, 1456, 1681, 1943, 2022, 1925,
411 1847, 1930, 2119, 2249, 2238, 2153, 2095, 2080,
412 2048, 1973, 1912, 1915, 1938, 1892, 1763, 1668,
413 1723, 1885, 1968, 1842, 1593, 1438, 1481, 1578,
414 1487, 1150, 775, 614, 689, 765, 627, 325,
415 123, 191, 407, 501, 366, 185, 212, 466,
416 698, 671, 436, 273, 366, 584, 630, 389,
417 77, 8, 248, 539, 586, 384, 215, 329,
418 667, 935, 929, 753, 682, 863, 1169, 1364,
419 1361, 1292, 1331, 1505, 1700, 1812, 1863, 1934,
420 2048, 2147, 2196, 2244, 2360, 2521, 2615, 2582,
421 2519, 2589, 2834, 3096, 3182, 3084, 3009, 3147,
422 3446, 3657, 3604, 3387, 3271, 3380, 3552, 3521,
423 3228, 2893, 2770, 2865, 2939, 2800, 2540, 2436,
424 2621, 2923, 3052, 2930, 2780, 2860, 3153, 3370,
425 3268, 2930, 2671, 2689, 2844, 2820, 2484, 2039,
426 1804, 1875, 2038, 2026, 1804, 1593, 1602, 1812,
427 2013, 2049, 1961, 1906, 1958, 2053, 2091, 2066
428 },
429 {
430 2048, 2070, 2146, 2287, 2483, 2702, 2900, 3027,
431 3040, 2918, 2664, 2307, 1895, 1485, 1132, 876,
432 736, 714, 794, 950, 1160, 1403, 1672, 1964,
433 2279, 2614, 2955, 3279, 3551, 3731, 3784, 3687,
434 3434, 3043, 2547, 1997, 1446, 948, 545, 265,
435 123, 122, 252, 500, 850, 1280, 1768, 2284,
436 2795, 3265, 3654, 3930, 4065, 4046, 3875, 3567,
437 3152, 2664, 2143, 1626, 1146, 731, 405, 187,
438 94, 136, 319, 637, 1073, 1592, 2150, 2693,
439 3169, 3530, 3746, 3807, 3720, 3514, 3223, 2886,
440 2537, 2196, 1875, 1578, 1306, 1063, 862, 723,
441 671, 729, 908, 1201, 1584, 2009, 2421, 2763,
442 2992, 3084, 3043, 2896, 2687, 2466, 2275, 2142,
443 2070, 2044, 2037, 2021, 1974, 1892, 1789, 1690,
444 1628, 1627, 1697, 1828, 1989, 2140, 2238, 2252,
445 2173, 2016, 1819, 1633, 1508, 1484, 1577, 1776,
446 2048, 2343, 2610, 2807, 2911, 2919, 2849, 2726,
447 2581, 2434, 2291, 2147, 1986, 1794, 1565, 1306,
448 1043, 816, 670, 645, 766, 1034, 1430, 1909,
449 2417, 2895, 3293, 3576, 3726, 3744, 3643, 3442,
450 3162, 2819, 2430, 2008, 1570, 1139, 742, 413,
451 189, 97, 158, 374, 732, 1201, 1741, 2303,
452 2842, 3316, 3692, 3947, 4067, 4047, 3887, 3596,
453 3191, 2697, 2150, 1590, 1066, 621, 297, 117,
454 94, 220, 475, 826, 1240, 1683, 2127, 2551,
455 2937, 3270, 3535, 3711, 3780, 3723, 3531, 3209,
456 2779, 2282, 1770, 1302, 930, 693, 608, 664,
457 834, 1076, 1345, 1606, 1836, 2031, 2199, 2355,
458 2509, 2665, 2811, 2922, 2971, 2931, 2792, 2562,
459 2271, 1966, 1698, 1514, 1444, 1491, 1632, 1826,
460 2020, 2164, 2228, 2200, 2097, 1953, 1809, 1705,
461 1663, 1689, 1767, 1869, 1964, 2029, 2055, 2053
462 },
463 {
464 2048, 2561, 2882, 1925, 1133, 2097, 3797, 4088,
465 2776, 1767, 2291, 3280, 3257, 2487, 2059, 2126,
466 2101, 1630, 1064, 1182, 1941, 2104, 1196, 546,
467 1140, 2073, 2181, 1769, 1821, 2365, 2600, 2511,
468 2925, 3644, 3507, 2704, 2607, 3268, 3505, 3065,
469 2629, 2418, 2195, 2003, 2003, 1859, 1066, 110,
470 157, 1030, 1220, 450, 80, 694, 1448, 1721,
471 1786, 2100, 2633, 2799, 2270, 1758, 2203, 3394,
472 4094, 3495, 2357, 2200, 3036, 3279, 2512, 2047,
473 2132, 1482, 103, 0, 966, 2027, 1434, 250,
474 475, 1883, 2525, 1973, 1589, 1913, 2175, 1995,
475 1842, 2221, 3014, 3437, 3043, 2581, 2900, 3549,
476 3502, 2694, 2013, 1982, 2001, 1505, 1262, 2009,
477 2685, 2173, 1503, 2031, 3013, 2982, 2080, 1531,
478 1740, 2035, 2040, 2150, 2357, 2095, 1711, 2170,
479 3093, 3197, 2417, 1724, 1547, 1653, 1797, 1905,
480 2048, 2242, 2334, 2300, 2332, 2628, 3225, 3649,
481 3156, 2071, 1676, 2141, 2380, 2129, 2035, 2014,
482 1542, 1048, 1384, 2197, 2109, 877, 120, 825,
483 1656, 1357, 856, 1254, 1923, 2056, 2093, 2657,
484 3405, 3542, 2994, 2621, 2942, 3334, 3120, 2552,
485 2206, 2220, 2250, 1874, 1385, 1543, 1973, 1423,
486 198, 29, 1125, 1695, 806, 0, 263, 1560,
487 2130, 2050, 2522, 3231, 2971, 2280, 2656, 3851,
488 4095, 3374, 2153, 1810, 2357, 2798, 2562, 2088,
489 1879, 1846, 1581, 940, 509, 921, 1484, 1011,
490 31, 79, 1132, 1898, 1978, 1988, 2205, 2327,
491 2334, 2625, 3035, 2727, 1825, 1636, 2371, 2727,
492 2323, 2121, 2341, 2265, 1886, 1866, 2171, 1986,
493 1120, 626, 1239, 2015, 1854, 1326, 1485, 2132,
494 2467, 2287, 2008, 2142, 2522, 2233, 1167, 733,
495 1793, 3076, 2860, 1469, 909, 1947, 2928, 2560
496 },
497 {
498 2048, 2504, 2795, 1937, 1211, 2093, 3713, 4049,
499 2790, 1746, 2327, 3617, 3862, 2964, 2133, 1958,
500 2048, 1906, 1540, 1495, 1969, 2095, 1253, 469,
501 957, 2084, 2288, 1309, 413, 609, 1420, 1878,
502 2048, 2416, 2641, 2415, 2445, 3116, 3618, 3425,
503 3094, 3057, 2976, 2556, 2157, 2260, 2607, 2510,
504 2048, 1846, 1730, 1126, 470, 562, 1118, 1256,
505 707, 0, 0, 657, 1800, 2252, 1982, 1778,
506 2048, 2337, 2178, 2155, 3149, 4095, 3814, 2019,
507 1613, 3417, 4095, 4095, 2914, 2060, 2283, 2403,
508 2048, 2008, 2319, 1963, 931, 522, 1245, 2190,
509 2418, 1813, 1007, 831, 1340, 1749, 1701, 1701,
510 2048, 2283, 2008, 1749, 2382, 3485, 3459, 2102,
511 1281, 1916, 2557, 2061, 1334, 1451, 2031, 2222,
512 2048, 2033, 2105, 1834, 1584, 1987, 2435, 1916,
513 981, 920, 1695, 2348, 2505, 2404, 2271, 2175,
514 2048, 1874, 1791, 1820, 1787, 1507, 926, 477,
515 918, 2022, 2475, 1928, 1548, 1878, 2145, 2009,
516 2048, 2386, 2390, 1952, 2002, 3023, 3848, 3333,
517 2518, 3030, 4095, 4095, 2947, 2084, 2100, 2270,
518 2048, 1702, 1663, 1726, 1412, 921, 893, 1364,
519 1762, 1577, 771, 85, 433, 1479, 2005, 1899,
520 2048, 2447, 2401, 2251, 3043, 4095, 4095, 3226,
521 1627, 2142, 3851, 4095, 3076, 2212, 2305, 2408,
522 2048, 1782, 2003, 2215, 1703, 660, 90, 449,
523 1182, 1559, 1324, 832, 814, 1398, 1831, 1842,
524 2048, 2517, 2569, 2216, 2218, 2717, 3036, 2810,
525 2563, 2830, 3111, 2643, 1890, 1817, 2179, 2205,
526 2048, 2021, 1715, 1061, 879, 1567, 2270, 1959,
527 932, 554, 1292, 2021, 1905, 1587, 1757, 2076,
528 2048, 1774, 1737, 2244, 2760, 2283, 1035, 637,
529 1788, 3057, 2821, 1509, 1006, 1957, 2836, 2504
530 },
531 {
532 2048, 2448, 2705, 1949, 1297, 2089, 3594, 3952,
533 2776, 1740, 2347, 3840, 4095, 3348, 2198, 1801,
534 1994, 2206, 2113, 1926, 2015, 2073, 1535, 882,
535 1140, 2082, 2300, 1162, 0, 0, 565, 1339,
536 1170, 960, 1385, 1871, 1992, 2142, 2460, 2617,
537 2629, 2757, 2854, 2594, 2196, 2427, 3507, 4095,
538 3938, 2920, 2662, 3067, 3099, 2608, 2195, 2028,
539 1786, 1282, 808, 955, 1777, 2367, 1886, 688,
540 1, 586, 1725, 1880, 843, 258, 1065, 2058,
541 2132, 2013, 2527, 3003, 2625, 2061, 2503, 3589,
542 3621, 2244, 1338, 2198, 3558, 3686, 2746, 1947,
543 1842, 2145, 2321, 2155, 1950, 1904, 1660, 1024,
544 593, 1060, 2140, 2565, 1577, 323, 565, 1997,
545 2685, 2145, 1719, 2040, 2341, 2179, 2045, 2244,
546 2355, 2087, 1946, 2350, 2626, 2116, 1633, 2182,
547 3093, 3120, 2374, 1774, 1637, 1732, 1850, 1936,
548 2048, 2199, 2274, 2250, 2281, 2539, 3089, 3542,
549 3156, 2073, 1590, 2184, 2670, 2289, 1876, 2152,
550 2553, 2428, 2091, 2069, 2066, 1520, 887, 1098,
551 1656, 1132, 0, 0, 782, 1984, 1924, 1117,
552 690, 1029, 1618, 1893, 1959, 2147, 2351, 2330,
553 2206, 2379, 3157, 4095, 4095, 3062, 2159, 2793,
554 3897, 3778, 2732, 2273, 2711, 2971, 2487, 2018,
555 2130, 2013, 1044, 328, 923, 1791, 1414, 226,
556 0, 708, 1938, 2310, 1670, 958, 958, 1461,
557 1879, 2035, 2162, 2506, 2870, 2767, 2466, 2936,
558 4064, 4095, 3409, 2348, 2278, 2767, 2907, 2584,
559 2334, 2371, 2327, 2100, 2069, 2158, 1901, 1584,
560 1772, 1935, 1261, 335, 403, 1472, 2281, 1965,
561 1120, 944, 1561, 2033, 1989, 1946, 2085, 2015,
562 1628, 1297, 1503, 2326, 2936, 2317, 964, 610,
563 1793, 3007, 2766, 1557, 1113, 1967, 2741, 2447
564 },
565 {
566 2048, 2391, 2614, 1962, 1390, 2084, 3441, 3798,
567 2733, 1749, 2349, 3933, 4095, 3601, 2245, 1678,
568 1949, 2480, 2673, 2383, 2069, 2045, 1963, 1657,
569 1630, 2067, 2213, 1389, 126, 0, 478, 1190,
570 807, 179, 564, 1450, 1580, 1095, 969, 1325,
571 1647, 1798, 1949, 2078, 2078, 2176, 2736, 3459,
572 3495, 2877, 2778, 3608, 4095, 3832, 3049, 2830,
573 3286, 3873, 3912, 3170, 2242, 1891, 2097, 2250,
574 2048, 1830, 1948, 1965, 1182, 208, 570, 2072,
575 2449, 693, 0, 0, 845, 2027, 1506, 582,
576 844, 1928, 2383, 1996, 1740, 1958, 2133, 2012,
577 1906, 2171, 2762, 3132, 2879, 2533, 2914, 3805,
578 4095, 3243, 1950, 1562, 2441, 3329, 3017, 2076,
579 1754, 2015, 2102, 2047, 2244, 2409, 2068, 1514,
580 1479, 1988, 2180, 1686, 1404, 1975, 2465, 1917,
581 1062, 1061, 1753, 2291, 2407, 2322, 2217, 2143,
582 2048, 1917, 1853, 1872, 1843, 1611, 1109, 674,
583 1004, 2023, 2508, 1904, 1355, 1759, 2273, 1890,
584 1114, 1014, 1626, 2105, 2060, 1990, 2239, 2366,
585 2228, 2562, 3518, 3922, 3105, 2107, 2178, 3174,
586 3968, 3797, 3010, 2570, 2795, 3051, 2841, 2406,
587 2157, 2164, 2183, 1932, 1602, 1703, 1995, 1593,
588 632, 402, 1233, 1703, 667, 0, 0, 882,
589 2436, 1965, 539, 279, 1239, 1921, 1852, 1776,
590 2048, 2247, 2081, 1919, 2319, 3168, 3686, 3445,
591 2847, 2530, 2827, 3508, 3758, 3148, 2545, 2893,
592 3591, 3482, 2690, 2150, 2095, 2087, 1943, 1859,
593 1850, 1637, 1317, 1517, 2233, 2422, 1719, 1252,
594 1659, 1911, 1215, 442, 674, 1620, 2200, 2001,
595 1621, 1677, 1967, 2049, 2087, 2327, 2405, 1960,
596 1272, 921, 1332, 2380, 3036, 2331, 957, 652,
597 1807, 2930, 2695, 1612, 1229, 1978, 2645, 2391
598 },
599 {
600 2048, 2334, 2522, 1976, 1490, 2079, 3258, 3593,
601 2665, 1773, 2333, 3889, 4095, 3697, 2269, 1604,
602 1919, 2679, 3113, 2768, 2118, 2017, 2415, 2552,
603 2260, 2045, 2060, 1896, 1377, 998, 1204, 1514,
604 1170, 558, 718, 1443, 1509, 781, 350, 647,
605 1021, 1071, 1139, 1531, 1928, 1784, 1177, 880,
606 1264, 1772, 1926, 2007, 2266, 2439, 2386, 2410,
607 2792, 3438, 3834, 3414, 2357, 1705, 2214, 3417,
608 4094, 3520, 2379, 2228, 3421, 4095, 3464, 2029,
609 1806, 2675, 3147, 2715, 2168, 2047, 1957, 1561,
610 1396, 1948, 2471, 1943, 827, 498, 1262, 2186,
611 2411, 1809, 922, 606, 1091, 1557, 1271, 647,
612 593, 1304, 2100, 2265, 1910, 1752, 1973, 2052,
613 1898, 2005, 2283, 2056, 1407, 1270, 2012, 2828,
614 2791, 2119, 1898, 2432, 2701, 2118, 1653, 2168,
615 2934, 2918, 2303, 1839, 1742, 1817, 1905, 1968,
616 2048, 2156, 2211, 2195, 2221, 2422, 2863, 3260,
617 2987, 2070, 1612, 2188, 2750, 2353, 1795, 2236,
618 3268, 3558, 2766, 1923, 2007, 2675, 2881, 2459,
619 2139, 2121, 1934, 1615, 1678, 2021, 1977, 1347,
620 690, 653, 1185, 1519, 1188, 713, 799, 1352,
621 1768, 1592, 799, 53, 282, 1342, 1981, 1671,
622 1281, 1501, 1912, 2039, 2186, 2693, 3057, 2588,
623 1814, 2110, 3494, 4095, 3331, 2323, 2700, 3882,
624 4095, 3396, 2161, 1766, 2478, 3411, 3618, 3112,
625 2529, 2271, 2311, 2368, 2218, 2019, 1965, 1767,
626 1212, 861, 1236, 1839, 1861, 1367, 1080, 1309,
627 1542, 1252, 897, 1342, 2261, 2426, 1753, 1413,
628 1772, 1963, 1600, 1328, 1568, 1949, 2059, 2054,
629 2265, 2525, 2397, 2065, 2176, 2648, 2657, 1920,
630 1034, 696, 1245, 2400, 3050, 2324, 1016, 763,
631 1831, 2827, 2610, 1674, 1353, 1989, 2548, 2334
632 },
633 {
634 2048, 2277, 2428, 1990, 1595, 2073, 3049, 3342,
635 2572, 1810, 2299, 3712, 4095, 3626, 2267, 1589,
636 1909, 2769, 3349, 2999, 2150, 1997, 2763, 3291,
637 2819, 2024, 1903, 2466, 2932, 2799, 2368, 2132,
638 2048, 1862, 1745, 1856, 1832, 1442, 1103, 1156,
639 1308, 1252, 1212, 1508, 1905, 1682, 615, 0,
640 1, 1020, 1235, 461, 0, 472, 1211, 1424,
641 1100, 697, 708, 1259, 1913, 2154, 2014, 1912,
642 2048, 2193, 2114, 2104, 2644, 3339, 3110, 2029,
643 1740, 3127, 4095, 4095, 3180, 2068, 2650, 3863,
644 3750, 2248, 1351, 2193, 3506, 3666, 2770, 1935,
645 1786, 2199, 2674, 2737, 2430, 2203, 2224, 2222,
646 2048, 1929, 2068, 2203, 1867, 1232, 1199, 2013,
647 2590, 2151, 1589, 2033, 2980, 3075, 2091, 1155,
648 1243, 1973, 2195, 1680, 1441, 1984, 2396, 1944,
649 1293, 1318, 1836, 2218, 2295, 2234, 2162, 2111,
650 2048, 1960, 1917, 1928, 1907, 1741, 1373, 1032,
651 1249, 2028, 2432, 1921, 1395, 1755, 2298, 1853,
652 727, 320, 1170, 2212, 2107, 1013, 427, 1035,
653 1715, 1412, 760, 855, 1561, 2029, 2021, 1936,
654 2048, 2221, 2244, 2215, 2391, 2686, 2742, 2490,
655 2249, 2419, 3196, 4095, 4095, 3026, 2157, 2808,
656 4050, 4086, 2953, 2398, 3348, 4095, 4095, 2977,
657 1750, 2109, 3132, 3289, 2604, 2133, 2179, 2229,
658 2048, 1914, 2025, 2135, 1861, 1261, 870, 1014,
659 1435, 1663, 1397, 758, 436, 929, 1494, 1001,
660 0, 0, 711, 1758, 1825, 1337, 1158, 1447,
661 1683, 1541, 1408, 1710, 2133, 2168, 1981, 1969,
662 2048, 2061, 2217, 2563, 2680, 2320, 1914, 2105,
663 2836, 3225, 2727, 2076, 2234, 2841, 2792, 1901,
664 951, 652, 1252, 2385, 2978, 2298, 1136, 936,
665 1864, 2700, 2513, 1742, 1484, 2000, 2449, 2277
666 },
667 {
668 2048, 2220, 2334, 2004, 1704, 2067, 2818, 3053,
669 2460, 1858, 2251, 3414, 4031, 3396, 2240, 1636,
670 1919, 2736, 3335, 3028, 2158, 1991, 2907, 3645,
671 3117, 2011, 1802, 2860, 4086, 4095, 3365, 2704,
672 2925, 3282, 2971, 2401, 2313, 2568, 2620, 2422,
673 2252, 2173, 2097, 2033, 2032, 1982, 1693, 1304,
674 1264, 1583, 1622, 1093, 632, 815, 1302, 1412,
675 933, 196, 0, 488, 1712, 2406, 1877, 671,
676 1, 568, 1709, 1859, 557, 0, 319, 2073,
677 2409, 947, 0, 0, 1270, 2035, 1732, 1227,
678 1396, 1984, 2220, 2022, 1893, 2003, 2090, 2030,
679 1975, 2111, 2427, 2640, 2519, 2335, 2587, 3208,
680 3502, 2962, 1965, 1594, 2464, 3628, 3486, 2101,
681 1295, 1914, 2598, 2064, 1043, 989, 2005, 2899,
682 2791, 2114, 1918, 2362, 2555, 2100, 1766, 2130,
683 2640, 2614, 2210, 1917, 1860, 1907, 1962, 2000,
684 2048, 2113, 2146, 2137, 2154, 2281, 2567, 2837,
685 2675, 2063, 1737, 2152, 2593, 2298, 1828, 2222,
686 3268, 3696, 2916, 1879, 1984, 3221, 3994, 3348,
687 2509, 3013, 4095, 4095, 3169, 2103, 2157, 2910,
688 3405, 3203, 2647, 2357, 2471, 2597, 2469, 2233,
689 2103, 2106, 2115, 1990, 1824, 1873, 2020, 1808,
690 1281, 1126, 1573, 1837, 1154, 17, 0, 1100,
691 2397, 1964, 283, 0, 655, 1759, 1382, 204,
692 0, 692, 1932, 2342, 1581, 491, 132, 630,
693 1328, 1655, 1467, 1039, 941, 1374, 1757, 1575,
694 1212, 1292, 1716, 1996, 2024, 2028, 2100, 2143,
695 2148, 2260, 2435, 2338, 1942, 1826, 2252, 2573,
696 2323, 2152, 2746, 3548, 3505, 2575, 1821, 2134,
697 3142, 3559, 2864, 2080, 2248, 2864, 2784, 1908,
698 1034, 795, 1352, 2336, 2826, 2253, 1312, 1163,
699 1903, 2555, 2406, 1814, 1620, 2012, 2350, 2220
700 },
701 {
702 2048, 2162, 2239, 2018, 1817, 2061, 2571, 2735,
703 2332, 1916, 2190, 3018, 3473, 3030, 2190, 1738,
704 1949, 2585, 3073, 2846, 2140, 1999, 2806, 3502,
705 3055, 2012, 1798, 2909, 4095, 4095, 3680, 2913,
706 3288, 3935, 3590, 2702, 2599, 3294, 3674, 3370,
707 3014, 2978, 2933, 2572, 2176, 2355, 3177, 3803,
708 3495, 2741, 2573, 3035, 3287, 2966, 2522, 2392,
709 2561, 2764, 2748, 2454, 2116, 1994, 2064, 2115,
710 2048, 1975, 2014, 2019, 1744, 1382, 1493, 2057,
711 2214, 1451, 509, 482, 1366, 2035, 1658, 822,
712 844, 1898, 2597, 1926, 735, 474, 1281, 2179,
713 2390, 1822, 969, 628, 1067, 1516, 1146, 273,
714 0, 841, 2149, 2578, 1584, 370, 585, 1996,
715 2756, 2169, 1562, 2033, 2887, 2910, 2081, 1383,
716 1479, 1997, 2143, 1819, 1683, 2010, 2245, 1990,
717 1639, 1660, 1937, 2135, 2174, 2142, 2105, 2080,
718 2048, 2004, 1982, 1987, 1976, 1890, 1695, 1508,
719 1615, 2037, 2265, 1974, 1655, 1865, 2210, 1916,
720 1114, 762, 1356, 2185, 2101, 1041, 329, 863,
721 1613, 1105, 0, 0, 800, 1983, 1912, 910,
722 127, 281, 1047, 1476, 1166, 733, 851, 1391,
723 1784, 1613, 829, 23, 149, 1226, 1961, 1482,
724 632, 672, 1462, 1829, 1265, 533, 635, 1534,
725 2209, 2015, 1481, 1408, 1764, 2004, 1982, 1957,
726 2048, 2114, 2059, 2003, 2143, 2453, 2663, 2596,
727 2379, 2260, 2417, 2799, 3016, 2744, 2406, 2754,
728 3591, 3831, 3101, 2291, 2248, 2738, 2991, 2750,
729 2524, 2799, 3150, 2742, 1829, 1638, 2389, 2851,
730 2436, 2185, 2913, 3805, 3668, 2608, 1817, 2132,
731 3078, 3425, 2768, 2075, 2215, 2713, 2634, 1939,
732 1272, 1106, 1533, 2258, 2607, 2193, 1531, 1433,
733 1948, 2394, 2291, 1890, 1760, 2024, 2249, 2162
734 },
735 {
736 2048, 2105, 2143, 2033, 1932, 2054, 2312, 2396,
737 2192, 1980, 2121, 2551, 2793, 2565, 2123, 1882,
738 1994, 2341, 2615, 2495, 2100, 2020, 2490, 2908,
739 2654, 2026, 1892, 2594, 3514, 3739, 3149, 2645,
740 2925, 3416, 3196, 2548, 2482, 3061, 3413, 3196,
741 2917, 2917, 2909, 2579, 2184, 2389, 3368, 4095,
742 3938, 3011, 2828, 3622, 4095, 3770, 3023, 2835,
743 3362, 4095, 4095, 3707, 2396, 1681, 2219, 3427,
744 4094, 3530, 2389, 2240, 3598, 4095, 3939, 2019,
745 1621, 3410, 4095, 4095, 3221, 2068, 2626, 3750,
746 3621, 2232, 1405, 2183, 3439, 3644, 2793, 1924,
747 1740, 2243, 2953, 3201, 2820, 2454, 2719, 3335,
748 3502, 2881, 1979, 1697, 2347, 3111, 2958, 2079,
749 1621, 1976, 2331, 2056, 1572, 1565, 2029, 2411,
750 2355, 2074, 1997, 2168, 2238, 2067, 1946, 2077,
751 2256, 2244, 2103, 2003, 1984, 2000, 2019, 2032,
752 2048, 2069, 2080, 2078, 2084, 2127, 2226, 2321,
753 2268, 2053, 1935, 2086, 2252, 2144, 1961, 2118,
754 2553, 2751, 2430, 1970, 2017, 2626, 3049, 2749,
755 2309, 2624, 3428, 3604, 2854, 2090, 2139, 2833,
756 3405, 3329, 2793, 2485, 2742, 3116, 3052, 2617,
757 2285, 2453, 3232, 4095, 4062, 2961, 2148, 2746,
758 3897, 3959, 2917, 2395, 3395, 4095, 4095, 3220,
759 1635, 2142, 3978, 4095, 3496, 2342, 2719, 3896,
760 4095, 3406, 2164, 1747, 2533, 3703, 4095, 3653,
761 2897, 2533, 2807, 3457, 3716, 3158, 2579, 3029,
762 4064, 4095, 3279, 2318, 2260, 2748, 2965, 2704,
763 2476, 2700, 2973, 2612, 1875, 1734, 2302, 2630,
764 2323, 2143, 2632, 3208, 3096, 2403, 1904, 2099,
765 2667, 2862, 2468, 2063, 2143, 2420, 2372, 1988,
766 1628, 1543, 1774, 2158, 2340, 2123, 1781, 1732,
767 1997, 2223, 2170, 1968, 1903, 2036, 2149, 2105
768 },
769 {
770 2048, 2081, 2108, 2062, 2033, 2108, 2213, 2231,
771 2171, 2169, 2313, 2495, 2523, 2399, 2282, 2198,
772 2086, 2082, 2304, 2509, 2430, 2273, 2364, 2557,
773 2495, 2238, 2211, 2647, 3262, 3494, 3182, 2884,
774 3081, 3340, 3015, 2465, 2546, 3166, 3465, 3191,
775 2875, 2836, 2831, 2605, 2347, 2539, 3295, 3937,
776 3765, 3197, 3214, 3747, 3836, 3319, 3028, 3351,
777 3799, 3942, 3782, 3381, 2828, 2390, 2345, 2780,
778 3431, 3666, 3188, 2747, 3186, 3917, 3676, 2669,
779 2404, 3379, 4095, 4095, 3542, 2912, 2971, 3195,
780 2856, 2177, 2097, 2766, 3226, 2929, 2452, 2338,
781 2369, 2329, 2435, 2739, 2953, 2972, 2976, 3055,
782 3070, 2820, 2318, 1989, 2255, 2794, 2819, 2258,
783 1859, 1983, 2135, 1924, 1650, 1723, 2062, 2302,
784 2263, 2109, 2092, 2194, 2176, 2011, 1965, 2133,
785 2271, 2208, 2073, 2013, 2010, 2007, 2008, 2025,
786 2048, 2062, 2073, 2093, 2113, 2126, 2178, 2283,
787 2302, 2132, 1953, 2000, 2163, 2178, 2096, 2181,
788 2443, 2593, 2437, 2158, 2152, 2515, 2813, 2693,
789 2533, 2857, 3355, 3288, 2694, 2318, 2490, 2851,
790 3034, 3022, 2962, 2951, 2919, 2748, 2575, 2643,
791 2816, 2840, 2969, 3484, 3859, 3453, 2747, 2699,
792 3236, 3489, 3234, 3128, 3642, 4095, 4095, 3247,
793 2351, 2675, 3676, 3893, 3199, 2870, 3422, 3924,
794 3615, 2867, 2387, 2435, 2850, 3295, 3533, 3569,
795 3399, 2991, 2695, 2959, 3443, 3394, 2993, 3131,
796 3787, 3963, 3300, 2558, 2412, 2676, 2811, 2651,
797 2532, 2756, 2984, 2622, 1895, 1703, 2209, 2582,
798 2419, 2303, 2653, 3027, 2911, 2454, 2158, 2257,
799 2522, 2573, 2384, 2295, 2416, 2406, 2088, 1777,
800 1737, 1830, 1894, 1984, 2097, 2096, 1974, 1898,
801 1956, 2060, 2088, 2032, 2001, 2056, 2110, 2082
802 },
803 {
804 2048, 1781, 1533, 1328, 1188, 1124, 1143, 1240,
805 1403, 1614, 1851, 2091, 2309, 2484, 2597, 2633,
806 2583, 2447, 2234, 1964, 1663, 1365, 1105, 912,
807 811, 812, 918, 1116, 1384, 1696, 2022, 2334,
808 2610, 2832, 2990, 3078, 3096, 3046, 2937, 2779,
809 2588, 2381, 2175, 1988, 1831, 1709, 1621, 1557,
810 1503, 1443, 1361, 1248, 1094, 899, 665, 395,
811 95, 0, 0, 0, 0, 0, 0, 0,
812 0, 0, 0, 0, 0, 0, 0, 0,
813 0, 0, 0, 0, 166, 384, 583, 766,
814 938, 1107, 1283, 1476, 1697, 1953, 2250, 2587,
815 2956, 3344, 3735, 4095, 4095, 4095, 4095, 4095,
816 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
817 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
818 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
819 4095, 3719, 3312, 2947, 2640, 2399, 2226, 2113,
820 2048, 2012, 1986, 1950, 1884, 1773, 1608, 1389,
821 1126, 836, 546, 284, 83, 0, 0, 59,
822 274, 587, 976, 1413, 1868, 2312, 2719, 3070,
823 3346, 3538, 3638, 3645, 3564, 3409, 3198, 2956,
824 2709, 2483, 2299, 2168, 2094, 2069, 2080, 2107,
825 2131, 2132, 2096, 2015, 1884, 1704, 1477, 1212,
826 917, 605, 291, 0, 0, 0, 0, 0,
827 0, 0, 0, 0, 0, 0, 0, 0,
828 0, 0, 0, 0, 0, 0, 0, 0,
829 0, 0, 0, 0, 0, 0, 0, 0,
830 195, 562, 935, 1298, 1639, 1951, 2228, 2469,
831 2677, 2855, 3015, 3168, 3329, 3511, 3729, 3991,
832 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
833 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
834 4095, 4095, 3769, 3464, 3233, 3077, 2987, 2951,
835 2950, 2961, 2963, 2934, 2858, 2727, 2540, 2308
836 },
837 {
838 2048, 1952, 1949, 1768, 1386, 1123, 1378, 2211,
839 3175, 3594, 3098, 1985, 1073, 1108, 2177, 3602,
840 4095, 4052, 2791, 1493, 964, 1374, 2192, 2654,
841 2372, 1590, 934, 876, 1388, 2030, 2357, 2278,
842 2048, 1963, 2047, 2045, 1726, 1193, 892, 1244,
843 2221, 3244, 3550, 2777, 1292, 0, 0, 118,
844 983, 1287, 636, 0, 0, 0, 0, 779,
845 1546, 1488, 916, 452, 518, 1050, 1650, 1981,
846 2048, 2115, 2382, 2741, 2875, 2608, 2181, 2155,
847 2966, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
848 4095, 4095, 4095, 4095, 3621, 2562, 2500, 3327,
849 4095, 4095, 4095, 3627, 2872, 2516, 2453, 2357,
850 2048, 1668, 1511, 1672, 1890, 1743, 1060, 167,
851 0, 121, 1263, 2408, 2778, 2135, 981, 181,
852 286, 1100, 1823, 1683, 543, 0, 0, 0,
853 0, 565, 1406, 1588, 1422, 1356, 1574, 1898,
854 2048, 1971, 1925, 2214, 2846, 3444, 3531, 2971,
855 2159, 1763, 2181, 3173, 3984, 3916, 2897, 1582,
856 883, 1282, 2447, 3481, 3584, 2644, 1282, 365,
857 373, 1108, 1940, 2337, 2229, 1947, 1840, 1956,
858 2048, 1886, 1553, 1420, 1810, 2663, 3513, 3854,
859 3587, 3151, 3191, 3999, 4095, 4095, 4095, 4095,
860 3032, 2330, 2796, 4021, 4095, 4095, 4095, 3178,
861 2396, 2381, 2873, 3295, 3253, 2807, 2325, 2091,
862 2048, 1899, 1453, 865, 538, 744, 1328, 1772,
863 1624, 918, 212, 166, 965, 2085, 2614, 1931,
864 204, 0, 0, 0, 0, 0, 0, 0,
865 0, 0, 0, 808, 1588, 1863, 1805, 1795,
866 2048, 2419, 2597, 2452, 2221, 2322, 2954, 3842,
867 4095, 4095, 3540, 2958, 3201, 4095, 4095, 4095,
868 4095, 4095, 3278, 2418, 2608, 3384, 3934, 3743,
869 2950, 2165, 1934, 2315, 2887, 3143, 2906, 2416
870 },
871 {
872 2048, 2249, 2630, 3002, 3260, 3501, 3941, 4095,
873 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
874 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
875 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
876 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
877 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
878 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
879 4095, 4049, 4012, 4008, 3770, 3277, 2720, 2299,
880 2048, 1828, 1484, 998, 506, 139, 0, 0,
881 0, 0, 0, 0, 0, 0, 0, 0,
882 0, 0, 0, 0, 0, 0, 0, 0,
883 0, 0, 0, 0, 0, 0, 0, 0,
884 0, 0, 0, 970, 2325, 2665, 2012, 1093,
885 817, 1633, 3210, 4095, 4095, 4095, 3150, 1878,
886 1285, 1384, 1706, 1717, 1236, 549, 159, 400,
887 1194, 2129, 2764, 2912, 2708, 2426, 2253, 2169,
888 2048, 1826, 1593, 1502, 1589, 1683, 1506, 908,
889 47, 0, 0, 0, 0, 102, 0, 0,
890 0, 0, 0, 0, 0, 0, 0, 0,
891 0, 0, 0, 0, 0, 0, 0, 0,
892 0, 0, 0, 0, 0, 0, 0, 0,
893 0, 0, 0, 0, 0, 0, 0, 0,
894 0, 0, 0, 0, 0, 0, 0, 0,
895 0, 0, 0, 0, 276, 753, 1285, 1720,
896 2048, 2395, 2870, 3414, 3810, 3864, 3601, 3308,
897 3340, 3843, 4095, 4095, 4095, 4095, 4095, 4095,
898 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
899 4095, 4095, 4095, 4095, 4095, 3704, 3989, 4095,
900 4095, 4095, 4095, 4051, 2637, 2334, 3235, 4095,
901 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
902 4095, 4095, 3282, 2286, 2136, 2589, 3105, 3255,
903 2981, 2548, 2276, 2280, 2418, 2463, 2320, 2109
904 },
905 {
906 2048, 1981, 2022, 2010, 1837, 1586, 1497, 1768,
907 2349, 2925, 3133, 2858, 2376, 2189, 2660, 3701,
908 4095, 4095, 4095, 3995, 3304, 3429, 4095, 4095,
909 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
910 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
911 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
912 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
913 4095, 3832, 3750, 3782, 3652, 3274, 2774, 2342,
914 2048, 1790, 1424, 922, 427, 127, 60, 23,
915 0, 0, 0, 0, 0, 0, 0, 0,
916 0, 0, 0, 0, 0, 0, 0, 0,
917 0, 0, 0, 0, 0, 0, 0, 0,
918 0, 0, 0, 0, 0, 0, 0, 0,
919 0, 0, 0, 0, 24, 0, 0, 0,
920 0, 0, 22, 745, 854, 467, 36, 0,
921 431, 1118, 1677, 1894, 1833, 1725, 1753, 1908,
922 2048, 2060, 1990, 1997, 2183, 2459, 2576, 2336,
923 1788, 1254, 1108, 1472, 2077, 2413, 2102, 1214,
924 260, 0, 244, 1107, 1727, 1510, 430, 0,
925 0, 0, 0, 788, 1040, 227, 0, 0,
926 0, 0, 0, 0, 0, 0, 0, 0,
927 0, 0, 0, 0, 0, 0, 0, 0,
928 0, 0, 0, 0, 0, 0, 0, 0,
929 0, 0, 40, 66, 241, 660, 1203, 1688,
930 2048, 2376, 2811, 3365, 3880, 4095, 4095, 4066,
931 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
932 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
933 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
934 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
935 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
936 4095, 4095, 4095, 3805, 3597, 3930, 4095, 4095,
937 4026, 3378, 2835, 2600, 2608, 2634, 2512, 2264
938 },
939 {
940 2048, 1979, 2009, 1964, 1767, 1541, 1505, 1758,
941 2132, 2275, 1927, 1182, 498, 415, 1153, 2399,
942 3472, 3777, 3230, 2333, 1819, 2110, 2990, 3747,
943 3706, 2764, 1532, 945, 1611, 3353, 4095, 4095,
944 4095, 4095, 3789, 3389, 3945, 4095, 4095, 4095,
945 3758, 2753, 2668, 3694, 4095, 4095, 4095, 4095,
946 4095, 4095, 4095, 4095, 4095, 4095, 4055, 3294,
947 2817, 2815, 3125, 3395, 3363, 3026, 2587, 2249,
948 2048, 1864, 1579, 1221, 950, 892, 965, 883,
949 359, 0, 0, 0, 0, 0, 0, 0,
950 0, 0, 0, 0, 0, 0, 0, 0,
951 0, 0, 0, 0, 0, 0, 0, 0,
952 0, 0, 0, 0, 0, 0, 0, 0,
953 0, 0, 0, 0, 25, 0, 0, 0,
954 0, 0, 272, 531, 159, 0, 0, 0,
955 112, 1003, 1620, 1819, 1749, 1675, 1747, 1917,
956 2048, 2087, 2137, 2350, 2744, 3124, 3204, 2846,
957 2219, 1720, 1692, 2143, 2708, 2905, 2525, 1832,
958 1408, 1721, 2721, 3800, 4095, 3433, 1879, 361,
959 0, 227, 1372, 2263, 2247, 1378, 370, 51,
960 733, 1941, 2725, 2320, 702, 0, 0, 0,
961 0, 0, 0, 0, 0, 0, 0, 0,
962 265, 688, 265, 0, 0, 0, 0, 0,
963 349, 696, 720, 703, 872, 1233, 1620, 1885,
964 2048, 2262, 2651, 3160, 3571, 3694, 3553, 3408,
965 3559, 4089, 4095, 4095, 4095, 4095, 4095, 4095,
966 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
967 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
968 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
969 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
970 4095, 4095, 4095, 3630, 3510, 3867, 4095, 4095,
971 3651, 3107, 2795, 2789, 2907, 2897, 2658, 2307
972 },
973 {
974 2048, 1872, 1766, 1689, 1616, 1562, 1560, 1621,
975 1701, 1715, 1605, 1390, 1179, 1103, 1224, 1486,
976 1746, 1869, 1832, 1740, 1752, 1968, 2344, 2724,
977 2953, 2991, 2957, 3045, 3380, 3923, 4095, 4095,
978 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
979 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
980 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4063,
981 3723, 3511, 3391, 3280, 3110, 2869, 2590, 2314,
982 2048, 1762, 1431, 1059, 683, 332, 0, 0,
983 0, 0, 0, 0, 0, 0, 0, 0,
984 0, 0, 0, 0, 0, 0, 0, 0,
985 0, 0, 0, 0, 0, 0, 0, 0,
986 0, 0, 0, 0, 0, 0, 0, 0,
987 0, 0, 0, 0, 0, 0, 0, 0,
988 0, 0, 0, 0, 0, 0, 0, 0,
989 50, 538, 940, 1218, 1401, 1552, 1714, 1886,
990 2048, 2191, 2340, 2527, 2752, 2966, 3097, 3104,
991 3013, 2909, 2869, 2903, 2942, 2891, 2712, 2471,
992 2305, 2325, 2529, 2785, 2913, 2805, 2509, 2198,
993 2051, 2125, 2315, 2419, 2288, 1922, 1470, 1113,
994 925, 814, 584, 80, 0, 0, 0, 0,
995 0, 0, 0, 0, 0, 0, 0, 0,
996 0, 0, 0, 0, 0, 0, 0, 0,
997 0, 0, 138, 382, 682, 1035, 1400, 1738,
998 2048, 2359, 2699, 3058, 3393, 3664, 3881, 4095,
999 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1000 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1001 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1002 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1003 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1004 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1005 4095, 4019, 3703, 3441, 3199, 2929, 2620, 2307
1006 },
1007 {
1008 2048, 2324, 2624, 2954, 3284, 3568, 3796, 4005,
1009 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1010 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1011 4095, 4095, 4095, 4095, 4095, 4095, 3881, 3732,
1012 3693, 3578, 3283, 2863, 2500, 2370, 2510, 2788,
1013 2985, 2945, 2673, 2325, 2089, 2063, 2189, 2312,
1014 2292, 2097, 1816, 1580, 1463, 1441, 1421, 1321,
1015 1138, 950, 855, 909, 1092, 1337, 1585, 1816,
1016 2048, 2293, 2541, 2762, 2946, 3128, 3378, 3746,
1017 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1018 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1019 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1020 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1021 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1022 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1023 4095, 4095, 4031, 3757, 3452, 3099, 2725, 2371,
1024 2048, 1733, 1398, 1043, 710, 449, 268, 119,
1025 0, 0, 0, 0, 0, 0, 0, 0,
1026 0, 0, 0, 0, 0, 0, 0, 0,
1027 0, 62, 277, 623, 1009, 1254, 1223, 941,
1028 599, 434, 584, 993, 1456, 1759, 1818, 1730,
1029 1683, 1824, 2153, 2532, 2794, 2860, 2799, 2761,
1030 2873, 3137, 3439, 3623, 3604, 3411, 3161, 2970,
1031 2880, 2853, 2815, 2720, 2581, 2438, 2318, 2203,
1032 2048, 1821, 1537, 1244, 981, 748, 506, 225,
1033 0, 0, 0, 0, 0, 0, 0, 0,
1034 0, 0, 0, 0, 0, 0, 0, 0,
1035 0, 0, 0, 0, 0, 0, 0, 0,
1036 0, 0, 0, 0, 0, 0, 0, 0,
1037 0, 0, 0, 0, 0, 0, 0, 0,
1038 0, 0, 0, 0, 0, 0, 0, 0,
1039 0, 108, 359, 569, 812, 1113, 1444, 1762
1040 },
1041 {
1042 2048, 2136, 2184, 2258, 2362, 2450, 2495, 2543,
1043 2698, 3031, 3494, 3907, 4050, 3808, 3252, 2597,
1044 2059, 1711, 1452, 1102, 565, 0, 0, 0,
1045 0, 0, 0, 0, 0, 0, 0, 0,
1046 0, 0, 0, 0, 0, 0, 0, 427,
1047 900, 1324, 1741, 2214, 2763, 3334, 3848, 4095,
1048 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1049 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1050 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1051 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1052 4095, 4095, 4095, 4095, 3382, 2375, 1392, 392,
1053 0, 0, 0, 0, 0, 0, 0, 0,
1054 0, 0, 0, 0, 0, 0, 0, 0,
1055 0, 0, 0, 0, 0, 0, 0, 0,
1056 0, 0, 0, 0, 0, 0, 0, 0,
1057 0, 0, 0, 195, 503, 850, 1247, 1656,
1058 2048, 2448, 2907, 3435, 3967, 4095, 4095, 4095,
1059 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1060 4095, 4095, 4095, 4095, 4095, 3718, 2480, 1360,
1061 481, 0, 0, 0, 0, 0, 0, 0,
1062 0, 0, 0, 0, 0, 0, 0, 0,
1063 1, 806, 1558, 2292, 3019, 3707, 4095, 4095,
1064 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1065 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1066 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1067 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1068 4095, 4095, 4095, 4046, 3131, 2308, 1533, 749,
1069 0, 0, 0, 0, 0, 0, 0, 0,
1070 0, 0, 0, 0, 0, 0, 0, 0,
1071 0, 0, 0, 0, 0, 0, 0, 0,
1072 0, 0, 0, 0, 0, 0, 0, 0,
1073 0, 0, 0, 74, 551, 1028, 1482, 1838
1074 },
1075 {
1076 2048, 1652, 1202, 705, 224, 0, 0, 0,
1077 0, 0, 0, 0, 0, 0, 0, 0,
1078 0, 0, 0, 0, 0, 0, 0, 0,
1079 0, 0, 0, 0, 0, 0, 0, 0,
1080 0, 0, 0, 0, 0, 0, 0, 0,
1081 0, 0, 1214, 2449, 3595, 4095, 4095, 4095,
1082 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1083 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1084 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1085 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1086 4095, 4095, 3911, 3359, 2788, 2223, 1730, 1342,
1087 1019, 683, 285, 0, 0, 0, 0, 0,
1088 0, 0, 0, 0, 0, 0, 0, 0,
1089 0, 0, 0, 0, 0, 0, 0, 0,
1090 0, 0, 0, 236, 1269, 2189, 2856, 3287,
1091 3595, 3868, 4095, 4095, 4063, 3715, 3216, 2650,
1092 2048, 1375, 591, 0, 0, 0, 0, 0,
1093 0, 0, 0, 0, 0, 0, 0, 0,
1094 0, 0, 0, 0, 0, 0, 0, 0,
1095 0, 0, 0, 0, 0, 0, 0, 0,
1096 0, 0, 0, 0, 0, 0, 0, 0,
1097 0, 386, 1403, 2358, 3256, 4095, 4095, 4095,
1098 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1099 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1100 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1101 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1102 4095, 4095, 4095, 3807, 3002, 2267, 1658, 1199,
1103 849, 542, 257, 54, 38, 267, 673, 1087,
1104 1334, 1350, 1222, 1104, 1090, 1126, 1049, 726,
1105 188, 0, 0, 0, 282, 1093, 1794, 2245,
1106 2504, 2743, 3095, 3544, 3939, 4095, 4046, 3813,
1107 3592, 3498, 3518, 3536, 3436, 3179, 2817, 2428
1108 },
1109 {
1110 2048, 824, 0, 0, 0, 0, 0, 0,
1111 0, 0, 0, 0, 0, 0, 0, 0,
1112 0, 0, 0, 0, 0, 0, 0, 0,
1113 0, 0, 0, 0, 0, 0, 0, 0,
1114 0, 0, 0, 0, 0, 0, 0, 0,
1115 0, 661, 1505, 2315, 3100, 3819, 4095, 4095,
1116 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1117 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1118 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1119 4095, 4095, 4095, 4095, 4095, 4095, 3826, 3648,
1120 3469, 3194, 2815, 2426, 2146, 2043, 2107, 2294,
1121 2591, 3033, 3661, 4095, 4095, 4095, 4095, 4095,
1122 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1123 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1124 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1125 4095, 4095, 4095, 4095, 4095, 4095, 3630, 2887,
1126 2048, 1109, 133, 0, 0, 0, 0, 0,
1127 0, 0, 0, 0, 0, 0, 0, 0,
1128 0, 0, 0, 0, 0, 0, 0, 0,
1129 0, 0, 0, 0, 0, 0, 0, 0,
1130 0, 0, 0, 0, 0, 0, 0, 0,
1131 0, 354, 1368, 2393, 3450, 4095, 4095, 4095,
1132 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1133 4095, 4095, 4095, 4095, 4095, 4095, 4095, 3514,
1134 3057, 2966, 3065, 3137, 3087, 2988, 3006, 3240,
1135 3624, 3948, 4002, 3708, 3173, 2605, 2182, 1954,
1136 1859, 1803, 1751, 1735, 1808, 1977, 2194, 2399,
1137 2590, 2832, 3206, 3724, 4095, 4095, 4095, 4095,
1138 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1139 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1140 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1141 4095, 4095, 4095, 4095, 4095, 4095, 4095, 3196
1142 },
1143 {
1144 2048, 1477, 923, 367, 0, 0, 0, 0,
1145 0, 0, 0, 0, 0, 0, 0, 0,
1146 0, 0, 0, 0, 0, 0, 0, 0,
1147 0, 0, 0, 0, 0, 0, 0, 0,
1148 0, 0, 223, 940, 1648, 2184, 2491, 2611,
1149 2612, 2516, 2290, 1898, 1357, 736, 105, 0,
1150 0, 0, 0, 0, 0, 0, 0, 0,
1151 0, 0, 0, 0, 0, 0, 0, 0,
1152 0, 0, 0, 0, 0, 0, 0, 0,
1153 0, 0, 0, 0, 0, 0, 0, 0,
1154 0, 0, 0, 0, 774, 1727, 2702, 3715,
1155 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1156 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1157 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1158 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1159 4095, 4095, 4095, 4095, 4095, 4095, 4050, 2990,
1160 2048, 1224, 481, 0, 0, 0, 0, 0,
1161 0, 0, 0, 0, 0, 0, 174, 807,
1162 1142, 1166, 1034, 944, 978, 1044, 964, 629,
1163 117, 0, 0, 0, 571, 1314, 1898, 2238,
1164 2420, 2586, 2817, 3071, 3233, 3221, 3048, 2808,
1165 2590, 2413, 2220, 1944, 1572, 1160, 775, 428,
1166 63, 0, 0, 0, 0, 0, 0, 0,
1167 0, 0, 0, 0, 0, 0, 0, 0,
1168 0, 0, 0, 0, 0, 0, 0, 0,
1169 0, 0, 0, 0, 0, 0, 0, 0,
1170 0, 0, 0, 0, 442, 1643, 2875, 4095,
1171 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1172 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1173 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1174 4095, 4095, 4095, 4095, 4095, 4095, 4095, 4095,
1175 4095, 4095, 4095, 4095, 4095, 4095, 3458, 2696
1176 },
1177 {
1178 1987, 2084, 2164, 2206, 2261, 2413, 2694, 3034,
1179 3296, 3367, 3248, 3051, 2909, 2853, 2781, 2527,
1180 2008, 1320, 710, 426, 552, 949, 1342, 1506,
1181 1401, 1175, 1033, 1084, 1263, 1404, 1385, 1232,
1182 1112, 1214, 1614, 2226, 2867, 3375, 3694, 3867,
1183 3964, 4006, 3959, 3788, 3507, 3183, 2884, 2610,
1184 2289, 1846, 1285, 729, 350, 262, 431, 704,
1185 918, 1027, 1128, 1368, 1808, 2329, 2693, 2698,
1186 2326, 1780, 1359, 1274, 1522, 1915, 2227, 2346,
1187 2336, 2355, 2510, 2771, 2994, 3032, 2852, 2551,
1188 2286, 2163, 2180, 2259, 2327, 2370, 2421, 2501,
1189 2577, 2576, 2454, 2250, 2071, 2006, 2043, 2054,
1190 1878, 1451, 867, 332, 27, 0, 107, 208,
1191 231, 284, 575, 1246, 2243, 3308, 4095, 4095,
1192 4095, 4095, 4032, 3954, 3931, 3821, 3535, 3119,
1193 2706, 2412, 2246, 2115, 1902, 1565, 1157, 778,
1194 494, 300, 155, 42, 6, 113, 382, 742,
1195 1067, 1277, 1411, 1619, 2051, 2729, 3500, 4095,
1196 4095, 4095, 4046, 3783, 3614, 3452, 3122, 2520,
1197 1730, 1003, 607, 659, 1051, 1532, 1869, 1985,
1198 1967, 1963, 2057, 2209, 2308, 2272, 2117, 1938,
1199 1825, 1796, 1793, 1750, 1652, 1552, 1515, 1550,
1200 1597, 1579, 1488, 1407, 1460, 1699, 2044, 2314,
1201 2354, 2157, 1892, 1802, 2033, 2537, 3104, 3508,
1202 3666, 3670, 3698, 3846, 4036, 4048, 3685, 2913,
1203 1911, 960, 286, 0, 0, 0, 0, 0,
1204 0, 147, 539, 957, 1333, 1674, 2033, 2442,
1205 2863, 3202, 3389, 3436, 3433, 3474, 3572, 3638,
1206 3555, 3291, 2949, 2712, 2705, 2888, 3052, 2955,
1207 2488, 1760, 1030, 544, 377, 414, 461, 408,
1208 315, 362, 697, 1307, 2009, 2557, 2796, 2743,
1209 2546, 2367, 2278, 2242, 2188, 2087, 1981, 1939
1210 },
1211 {
1212 1039, 1027, 1033, 1037, 1091, 1279, 1630, 2072,
1213 2464, 2687, 2739, 2725, 2771, 2905, 3017, 2936,
1214 2574, 2024, 1528, 1331, 1517, 1944, 2340, 2478,
1215 2320, 2016, 1776, 1709, 1757, 1756, 1587, 1283,
1216 1014, 971, 1234, 1723, 2254, 2669, 2915, 3034,
1217 3099, 3131, 3097, 2959, 2732, 2482, 2273, 2105,
1218 1904, 1591, 1168, 753, 518, 570, 873, 1271,
1219 1597, 1802, 1979, 2275, 2746, 3274, 3619, 3578,
1220 3135, 2494, 1955, 1731, 1825, 2052, 2188, 2131,
1221 1946, 1798, 1799, 1925, 2035, 1988, 1752, 1429,
1222 1176, 1099, 1197, 1389, 1600, 1810, 2049, 2332,
1223 2619, 2831, 2916, 2907, 2904, 2991, 3150, 3247,
1224 3121, 2703, 2088, 1482, 1069, 890, 832, 736,
1225 544, 371, 432, 878, 1662, 2532, 3179, 3416,
1226 3281, 2985, 2759, 2699, 2735, 2721, 2567, 2313,
1227 2086, 1997, 2048, 2137, 2143, 2013, 1796, 1585,
1228 1442, 1357, 1286, 1211, 1176, 1247, 1446, 1704,
1229 1900, 1956, 1920, 1945, 2188, 2677, 3264, 3709,
1230 3827, 3613, 3229, 2878, 2649, 2456, 2125, 1549,
1231 811, 162, 0, 34, 558, 1180, 1666, 1933,
1232 2065, 2206, 2436, 2712, 2921, 2977, 2896, 2770,
1233 2689, 2670, 2656, 2579, 2427, 2254, 2126, 2054,
1234 1981, 1834, 1605, 1382, 1292, 1391, 1602, 1747,
1235 1675, 1382, 1041, 895, 1094, 1592, 2178, 2628,
1236 2857, 2957, 3102, 3389, 3733, 3912, 3723, 3129,
1237 2301, 1517, 997, 790, 788, 838, 859, 880,
1238 983, 1211, 1522, 1827, 2061, 2234, 2405, 2611,
1239 2821, 2948, 2928, 2779, 2599, 2489, 2466, 2445,
1240 2313, 2039, 1728, 1562, 1664, 1990, 2326, 2427,
1241 2176, 1673, 1173, 911, 958, 1189, 1406, 1491,
1242 1501, 1612, 1969, 2562, 3205, 3657, 3764, 3549,
1243 3166, 2782, 2476, 2220, 1948, 1639, 1342, 1132
1244 },
1245 {
1246 1698, 1773, 1820, 1816, 1815, 1903, 2116, 2392,
1247 2597, 2628, 2490, 2304, 2205, 2228, 2272, 2169,
1248 1833, 1355, 971, 922, 1281, 1894, 2479, 2798,
1249 2801, 2627, 2480, 2462, 2511, 2466, 2208, 1776,
1250 1348, 1125, 1199, 1500, 1857, 2122, 2250, 2295,
1251 2330, 2380, 2410, 2380, 2296, 2217, 2198, 2224,
1252 2211, 2068, 1786, 1475, 1299, 1363, 1630, 1944,
1253 2144, 2189, 2181, 2278, 2549, 2887, 3065, 2889,
1254 2353, 1666, 1131, 962, 1157, 1527, 1841, 1982,
1255 2007, 2066, 2260, 2552, 2792, 2830, 2629, 2287,
1256 1964, 1769, 1707, 1708, 1706, 1696, 1719, 1805,
1257 1925, 2010, 2017, 1983, 2010, 2181, 2472, 2743,
1258 2823, 2630, 2245, 1862, 1651, 1641, 1709, 1686,
1259 1512, 1300, 1266, 1568, 2165, 2818, 3229, 3226,
1260 2861, 2359, 1962, 1777, 1742, 1715, 1608, 1457,
1261 1384, 1491, 1769, 2102, 2355, 2461, 2455, 2417,
1262 2397, 2382, 2320, 2194, 2048, 1959, 1955, 1980,
1263 1926, 1730, 1454, 1267, 1336, 1700, 2220, 2658,
1264 2831, 2730, 2511, 2367, 2375, 2435, 2358, 2023,
1265 1500, 1023, 850, 1085, 1613, 2178, 2549, 2649,
1266 2573, 2476, 2453, 2475, 2444, 2289, 2036, 1789,
1267 1645, 1623, 1668, 1707, 1722, 1757, 1865, 2044,
1268 2221, 2309, 2288, 2232, 2258, 2417, 2627, 2712,
1269 2523, 2064, 1519, 1141, 1095, 1348, 1705, 1955,
1270 2024, 2014, 2106, 2397, 2804, 3100, 3075, 2682,
1271 2080, 1535, 1250, 1262, 1450, 1650, 1772, 1839,
1272 1932, 2093, 2286, 2428, 2466, 2419, 2361, 2343,
1273 2345, 2295, 2138, 1899, 1684, 1592, 1641, 1740,
1274 1769, 1688, 1589, 1642, 1956, 2475, 2974, 3197,
1275 3021, 2542, 2014, 1673, 1595, 1665, 1693, 1573,
1276 1374, 1286, 1466, 1913, 2451, 2843, 2941, 2767,
1277 2472, 2218, 2076, 2006, 1933, 1822, 1711, 1662
1278 },
1279 {
1280 951, 1041, 1085, 1054, 1021, 1103, 1347, 1669,
1281 1899, 1910, 1721, 1488, 1376, 1423, 1500, 1419,
1282 1094, 642, 321, 349, 753, 1341, 1831, 2037,
1283 1960, 1750, 1562, 1452, 1366, 1237, 1069, 945,
1284 951, 1087, 1258, 1350, 1327, 1264, 1269, 1380,
1285 1513, 1528, 1361, 1099, 939, 1036, 1369, 1732,
1286 1872, 1675, 1249, 858, 734, 921, 1266, 1546,
1287 1625, 1531, 1394, 1318, 1305, 1277, 1174, 1031,
1288 951, 1020, 1222, 1444, 1575, 1591, 1567, 1596,
1289 1677, 1700, 1527, 1134, 670, 385, 457, 862,
1290 1374, 1722, 1768, 1592, 1406, 1385, 1534, 1707,
1291 1733, 1556, 1274, 1043, 960, 994, 1037, 1015,
1292 951, 937, 1038, 1229, 1416, 1527, 1581, 1669,
1293 1851, 2065, 2134, 1893, 1335, 659, 170, 85,
1294 396, 890, 1303, 1500, 1536, 1575, 1725, 1943,
1295 2073, 1978, 1660, 1262, 960, 843, 868, 927,
1296 951, 961, 1025, 1167, 1326, 1408, 1377, 1312,
1297 1354, 1580, 1907, 2126, 2039, 1619, 1047, 603,
1298 477, 654, 940, 1131, 1161, 1133, 1213, 1471,
1299 1812, 2042, 2014, 1735, 1354, 1049, 908, 902,
1300 951, 1013, 1113, 1284, 1493, 1630, 1585, 1354,
1301 1076, 946, 1074, 1384, 1664, 1714, 1501, 1184,
1302 992, 1051, 1290, 1503, 1517, 1324, 1085, 997,
1303 1139, 1416, 1637, 1659, 1485, 1235, 1041, 957,
1304 951, 979, 1052, 1225, 1522, 1860, 2071, 2010,
1305 1671, 1215, 870, 775, 884, 1023, 1040, 933,
1306 855, 983, 1356, 1820, 2126, 2104, 1784, 1371,
1307 1096, 1056, 1176, 1291, 1286, 1169, 1031, 957,
1308 951, 965, 974, 1026, 1205, 1538, 1928, 2188,
1309 2167, 1868, 1455, 1139, 1023, 1036, 1006, 822,
1310 548, 389, 540, 1025, 1653, 2139, 2287, 2105,
1311 1769, 1482, 1334, 1279, 1213, 1092, 962, 905
1312 },
1313 {
1314 1705, 1810, 1851, 1793, 1729, 1803, 2071, 2426,
1315 2667, 2650, 2412, 2142, 2026, 2092, 2194, 2142,
1316 1878, 1538, 1355, 1478, 1855, 2278, 2533, 2547,
1317 2396, 2204, 2035, 1868, 1680, 1526, 1535, 1796,
1318 2245, 2669, 2834, 2657, 2271, 1930, 1811, 1898,
1319 2008, 1966, 1754, 1523, 1462, 1641, 1955, 2217,
1320 2316, 2290, 2266, 2334, 2459, 2523, 2444, 2257,
1321 2078, 1988, 1947, 1828, 1555, 1212, 1025, 1198,
1322 1745, 2444, 2971, 3109, 2878, 2489, 2168, 2005,
1323 1934, 1849, 1722, 1631, 1671, 1844, 2041, 2131,
1324 2083, 1993, 1996, 2131, 2293, 2317, 2134, 1851,
1325 1684, 1783, 2103, 2422, 2511, 2311, 1976, 1746,
1326 1770, 1998, 2247, 2350, 2274, 2104, 1943, 1812,
1327 1670, 1504, 1397, 1492, 1864, 2416, 2903, 3085,
1328 2900, 2499, 2127, 1942, 1906, 1857, 1671, 1393,
1329 1204, 1277, 1622, 2075, 2421, 2546, 2502, 2421,
1330 2390, 2384, 2319, 2163, 1991, 1920, 1988, 2095,
1331 2069, 1827, 1472, 1246, 1355, 1799, 2359, 2743,
1332 2786, 2547, 2232, 2025, 1959, 1943, 1880, 1778,
1333 1740, 1857, 2100, 2330, 2406, 2306, 2136, 2031,
1334 2025, 2022, 1899, 1644, 1407, 1399, 1716, 2238,
1335 2693, 2843, 2653, 2299, 2026, 1965, 2060, 2150,
1336 2116, 1973, 1823, 1744, 1719, 1672, 1577, 1518,
1337 1634, 1988, 2472, 2859, 2956, 2749, 2409, 2151,
1338 2067, 2064, 1966, 1691, 1341, 1139, 1254, 1663,
1339 2166, 2528, 2639, 2553, 2401, 2267, 2141, 1983,
1340 1813, 1736, 1849, 2129, 2405, 2467, 2232, 1832,
1341 1528, 1525, 1816, 2191, 2399, 2335, 2094, 1881,
1342 1829, 1916, 2015, 2029, 1982, 1987, 2122, 2343,
1343 2512, 2511, 2349, 2146, 2017, 1964, 1877, 1655,
1344 1335, 1111, 1198, 1657, 2314, 2862, 3060, 2889,
1345 2534, 2226, 2079, 2041, 1987, 1858, 1710, 1647
1346 },
1347 {
1348 1144, 1198, 1236, 1220, 1256, 1498, 1990, 2580,
1349 3014, 3122, 2948, 2697, 2556, 2538, 2499, 2288,
1350 1909, 1529, 1341, 1403, 1593, 1730, 1729, 1658,
1351 1647, 1748, 1886, 1951, 1934, 1974, 2238, 2746,
1352 3301, 3592, 3419, 2835, 2106, 1518, 1195, 1071,
1353 1019, 992, 1053, 1274, 1625, 1966, 2173, 2255,
1354 2364, 2643, 3076, 3449, 3501, 3131, 2477, 1826,
1355 1399, 1224, 1171, 1115, 1063, 1132, 1407, 1829,
1356 2218, 2417, 2426, 2383, 2429, 2573, 2682, 2623,
1357 2404, 2187, 2145, 2298, 2464, 2405, 2021, 1449,
1358 964, 779, 913, 1222, 1552, 1858, 2191, 2580,
1359 2940, 3119, 3034, 2771, 2536, 2481, 2566, 2577,
1360 2302, 1726, 1061, 603, 523, 776, 1178, 1581,
1361 1963, 2380, 2832, 3200, 3316, 3115, 2717, 2344,
1362 2153, 2114, 2064, 1872, 1576, 1354, 1362, 1583,
1363 1829, 1895, 1741, 1524, 1469, 1683, 2078, 2463,
1364 2706, 2818, 2888, 2952, 2932, 2709, 2273, 1779,
1365 1455, 1419, 1570, 1669, 1535, 1206, 921, 932,
1366 1318, 1939, 2561, 3025, 3314, 3477, 3507, 3315,
1367 2831, 2128, 1439, 1019, 968, 1161, 1361, 1415,
1368 1373, 1414, 1672, 2096, 2486, 2665, 2620, 2502,
1369 2475, 2571, 2672, 2636, 2436, 2180, 2004, 1932,
1370 1854, 1648, 1325, 1058, 1048, 1351, 1804, 2147,
1371 2226, 2111, 2030, 2171, 2533, 2940, 3191, 3203,
1372 3032, 2762, 2401, 1897, 1248, 607, 235, 329,
1373 867, 1593, 2194, 2507, 2599, 2661, 2815, 3011,
1374 3087, 2937, 2613, 2279, 2058, 1930, 1775, 1516,
1375 1222, 1063, 1161, 1467, 1789, 1956, 1962, 1964,
1376 2128, 2464, 2797, 2915, 2746, 2427, 2187, 2161,
1377 2286, 2380, 2302, 2060, 1775, 1545, 1360, 1148,
1378 909, 781, 967, 1553, 2391, 3157, 3555, 3510,
1379 3184, 2829, 2581, 2401, 2164, 1816, 1448, 1202
1380 },
1381 {
1382 1925, 1987, 2037, 2030, 2087, 2379, 2938, 3577,
1383 4008, 4060, 3804, 3468, 3236, 3108, 2955, 2685,
1384 2367, 2173, 2208, 2399, 2553, 2539, 2413, 2363,
1385 2529, 2862, 3172, 3307, 3296, 3312, 3486, 3756,
1386 3894, 3697, 3168, 2517, 1999, 1727, 1646, 1657,
1387 1757, 2044, 2579, 3251, 3804, 4014, 3875, 3595,
1388 3425, 3440, 3489, 3352, 2942, 2387, 1919, 1686,
1389 1669, 1770, 1951, 2282, 2827, 3495, 4031, 4095,
1390 3856, 3301, 2843, 2698, 2822, 2999, 3038, 2922,
1391 2758, 2633, 2515, 2313, 2030, 1824, 1908, 2356,
1392 3005, 3555, 3790, 3733, 3585, 3526, 3555, 3514,
1393 3265, 2837, 2405, 2130, 2020, 1959, 1854, 1773,
1394 1899, 2352, 3045, 3709, 4087, 4095, 3946, 3756,
1395 3596, 3363, 2942, 2375, 1873, 1658, 1780, 2087,
1396 2371, 2544, 2685, 2914, 3234, 3491, 3522, 3319,
1397 3071, 3005, 3182, 3441, 3524, 3300, 2864, 2435,
1398 2170, 2058, 1994, 1936, 1977, 2245, 2744, 3288,
1399 3627, 3647, 3473, 3352, 3437, 3649, 3745, 3534,
1400 3032, 2435, 1947, 1640, 1475, 1427, 1580, 2054,
1401 2846, 3729, 4095, 4095, 4095, 3589, 3154, 2933,
1402 2832, 2696, 2486, 2300, 2249, 2320, 2381, 2328,
1403 2214, 2227, 2517, 3033, 3531, 3760, 3659, 3396,
1404 3207, 3191, 3247, 3196, 2970, 2671, 2458, 2387,
1405 2361, 2244, 2030, 1884, 2007, 2447, 3035, 3516,
1406 3751, 3802, 3831, 3907, 3919, 3679, 3119, 2392,
1407 1780, 1490, 1521, 1726, 1974, 2266, 2682, 3223,
1408 3730, 3979, 3863, 3510, 3189, 3093, 3188, 3257,
1409 3105, 2732, 2320, 2068, 2025, 2094, 2168, 2258,
1410 2472, 2868, 3331, 3627, 3592, 3289, 2979, 2914,
1411 3137, 3451, 3591, 3433, 3059, 2642, 2283, 1965,
1412 1659, 1444, 1506, 1980, 2784, 3620, 4095, 4095,
1413 4031, 3737, 3527, 3366, 3117, 2724, 2293, 2000
1414 },
1415 {
1416 1117, 1190, 1253, 1255, 1331, 1665, 2274, 2933,
1417 3330, 3305, 2964, 2552, 2241, 2014, 1766, 1479,
1418 1282, 1326, 1599, 1899, 1996, 1843, 1635, 1631,
1419 1925, 2370, 2721, 2850, 2827, 2790, 2766, 2626,
1420 2237, 1641, 1080, 811, 903, 1198, 1477, 1667,
1421 1883, 2264, 2785, 3234, 3381, 3179, 2793, 2430,
1422 2150, 1848, 1419, 930, 618, 693, 1149, 1751,
1423 2236, 2511, 2678, 2865, 3054, 3086, 2829, 2351,
1424 1891, 1661, 1666, 1723, 1652, 1461, 1331, 1421,
1425 1704, 1986, 2103, 2083, 2115, 2351, 2733, 3031,
1426 3045, 2777, 2407, 2101, 1865, 1577, 1177, 795,
1427 677, 970, 1568, 2188, 2594, 2767, 2863, 3009,
1428 3154, 3114, 2775, 2226, 1695, 1355, 1187, 1058,
1429 907, 856, 1104, 1712, 2486, 3090, 3293, 3127,
1430 2813, 2546, 2345, 2112, 1804, 1533, 1464, 1633,
1431 1869, 1930, 1727, 1422, 1300, 1520, 1986, 2451,
1432 2733, 2842, 2898, 2949, 2891, 2584, 2038, 1467,
1433 1139, 1151, 1352, 1496, 1473, 1406, 1518, 1908,
1434 2452, 2917, 3161, 3218, 3188, 3073, 2747, 2108,
1435 1260, 527, 249, 531, 1175, 1844, 2318, 2594,
1436 2782, 2923, 2935, 2732, 2377, 2080, 2022, 2176,
1437 2305, 2168, 1744, 1261, 1006, 1094, 1405, 1735,
1438 1989, 2229, 2534, 2852, 3006, 2864, 2498, 2159,
1439 2059, 2181, 2288, 2137, 1700, 1186, 861, 839,
1440 1049, 1375, 1794, 2366, 3076, 3715, 3966, 3636,
1441 2834, 1923, 1265, 989, 979, 1051, 1142, 1323,
1442 1650, 2041, 2319, 2386, 2341, 2398, 2670, 3025,
1443 3174, 2917, 2326, 1687, 1277, 1163, 1220, 1308,
1444 1418, 1633, 1980, 2323, 2461, 2326, 2084, 2016,
1445 2271, 2723, 3066, 3059, 2705, 2198, 1730, 1347,
1446 999, 697, 596, 878, 1557, 2395, 3041, 3286,
1447 3189, 2978, 2823, 2694, 2448, 2022, 1538, 1203
1448 },
1449 {
1450 1117, 1190, 1253, 1255, 1331, 1665, 2274, 2933,
1451 3330, 3305, 2964, 2552, 2241, 2014, 1766, 1479,
1452 1282, 1326, 1599, 1899, 1996, 1843, 1635, 1631,
1453 1925, 2370, 2721, 2850, 2827, 2790, 2766, 2626,
1454 2237, 1641, 1080, 811, 903, 1198, 1477, 1667,
1455 1883, 2264, 2785, 3234, 3381, 3179, 2793, 2430,
1456 2150, 1848, 1419, 930, 618, 693, 1149, 1751,
1457 2236, 2511, 2678, 2865, 3054, 3086, 2829, 2351,
1458 1891, 1661, 1666, 1723, 1652, 1461, 1331, 1421,
1459 1704, 1986, 2103, 2083, 2115, 2351, 2733, 3031,
1460 3045, 2777, 2407, 2101, 1865, 1577, 1177, 795,
1461 677, 970, 1568, 2188, 2594, 2767, 2863, 3009,
1462 3154, 3114, 2775, 2226, 1695, 1355, 1187, 1058,
1463 907, 856, 1104, 1712, 2486, 3090, 3293, 3127,
1464 2813, 2546, 2345, 2112, 1804, 1533, 1464, 1633,
1465 1869, 1930, 1727, 1422, 1300, 1520, 1986, 2451,
1466 2733, 2842, 2898, 2949, 2891, 2584, 2038, 1467,
1467 1139, 1151, 1352, 1496, 1473, 1406, 1518, 1908,
1468 2452, 2917, 3161, 3218, 3188, 3073, 2747, 2108,
1469 1260, 527, 249, 531, 1175, 1844, 2318, 2594,
1470 2782, 2923, 2935, 2732, 2377, 2080, 2022, 2176,
1471 2305, 2168, 1744, 1261, 1006, 1094, 1405, 1735,
1472 1989, 2229, 2534, 2852, 3006, 2864, 2498, 2159,
1473 2059, 2181, 2288, 2137, 1700, 1186, 861, 839,
1474 1049, 1375, 1794, 2366, 3076, 3715, 3966, 3636,
1475 2834, 1923, 1265, 989, 979, 1051, 1142, 1323,
1476 1650, 2041, 2319, 2386, 2341, 2398, 2670, 3025,
1477 3174, 2917, 2326, 1687, 1277, 1163, 1220, 1308,
1478 1418, 1633, 1980, 2323, 2461, 2326, 2084, 2016,
1479 2271, 2723, 3066, 3059, 2705, 2198, 1730, 1347,
1480 999, 697, 596, 878, 1557, 2395, 3041, 3286,
1481 3189, 2978, 2823, 2694, 2448, 2022, 1538, 1203
1482 },
1483 {
1484 1718, 1921, 1999, 1656, 1132, 1032, 1712, 2848,
1485 3643, 3512, 2596, 1623, 1246, 1506, 1915, 2017,
1486 1844, 1803, 2145, 2612, 2653, 2019, 1111, 688,
1487 1190, 2308, 3242, 3398, 2864, 2229, 1969, 2022,
1488 1965, 1564, 1094, 1081, 1711, 2557, 2915, 2470,
1489 1625, 1150, 1483, 2345, 3029, 3067, 2612, 2185,
1490 2096, 2139, 1883, 1234, 647, 732, 1629, 2782,
1491 3379, 3061, 2216, 1596, 1624, 2069, 2372, 2248,
1492 1953, 1942, 2320, 2666, 2456, 1648, 817, 673,
1493 1391, 2432, 3022, 2838, 2248, 1891, 2042, 2394,
1494 2450, 2085, 1692, 1745, 2251, 2681, 2470, 1618,
1495 757, 605, 1314, 2340, 2962, 2917, 2559, 2405,
1496 2574, 2687, 2333, 1581, 995, 1097, 1825, 2543,
1497 2617, 2016, 1334, 1217, 1764, 2469, 2751, 2515,
1498 2186, 2209, 2546, 2708, 2296, 1481, 909, 1099,
1499 1922, 2684, 2761, 2163, 1491, 1343, 1761, 2265,
1500 2393, 2177, 2070, 2401, 2954, 3126, 2538, 1473,
1501 689, 746, 1508, 2285, 2490, 2151, 1804, 1902,
1502 2355, 2664, 2482, 2010, 1796, 2145, 2747, 2934,
1503 2340, 1301, 593, 739, 1553, 2355, 2620, 2417,
1504 2233, 2394, 2701, 2669, 2100, 1381, 1161, 1710,
1505 2604, 3073, 2700, 1796, 1093, 1072, 1566, 2017,
1506 2081, 1946, 2065, 2586, 3118, 3090, 2358, 1432,
1507 1049, 1496, 2335, 2804, 2518, 1780, 1244, 1274,
1508 1656, 1913, 1860, 1810, 2187, 2986, 3642, 3514,
1509 2517, 1276, 618, 874, 1639, 2210, 2240, 1983,
1510 1918, 2192, 2465, 2316, 1768, 1353, 1601, 2477,
1511 3320, 3416, 2637, 1569, 968, 1111, 1625, 1943,
1512 1888, 1782, 2016, 2544, 2867, 2552, 1738, 1103,
1513 1261, 2175, 3150, 3442, 2895, 2013, 1437, 1358,
1514 1450, 1342, 1089, 1143, 1827, 2881, 3588, 3398,
1515 2455, 1508, 1250, 1731, 2377, 2578, 2246, 1815
1516 },
1517 {
1518 1956, 2312, 2492, 2158, 1587, 1440, 2075, 3103,
1519 3686, 3310, 2251, 1289, 964, 1148, 1318, 1207,
1520 1102, 1470, 2337, 3132, 3196, 2466, 1596, 1370,
1521 1972, 2846, 3266, 3016, 2500, 2211, 2166, 1932,
1522 1202, 279, 0, 514, 1825, 2970, 3298, 2911,
1523 2460, 2438, 2721, 2794, 2395, 1846, 1708, 2128,
1524 2613, 2496, 1639, 644, 310, 889, 1878, 2537,
1525 2593, 2411, 2483, 2835, 2993, 2546, 1687, 1118,
1526 1375, 2266, 3014, 2986, 2268, 1526, 1315, 1565,
1527 1757, 1572, 1273, 1419, 2191, 3093, 3371, 2751,
1528 1734, 1144, 1359, 2019, 2463, 2416, 2209, 2316,
1529 2752, 2995, 2547, 1529, 660, 598, 1311, 2116,
1530 2356, 2015, 1666, 1816, 2379, 2798, 2684, 2258,
1531 2113, 2543, 3164, 3261, 2510, 1347, 574, 613,
1532 1161, 1574, 1564, 1455, 1755, 2519, 3211, 3232,
1533 2567, 1849, 1757, 2343, 2992, 3048, 2449, 1737,
1534 1454, 1580, 1619, 1216, 628, 520, 1267, 2504,
1535 3408, 3450, 2855, 2318, 2281, 2532, 2517, 2013,
1536 1407, 1298, 1822, 2459, 2530, 1902, 1140, 958,
1537 1517, 2286, 2609, 2356, 2002, 2057, 2485, 2743,
1538 2396, 1643, 1184, 1516, 2413, 3111, 3038, 2338,
1539 1674, 1530, 1760, 1837, 1500, 1087, 1183, 1941,
1540 2834, 3122, 2577, 1723, 1337, 1707, 2410, 2796,
1541 2657, 2373, 2410, 2734, 2807, 2177, 1045, 176,
1542 210, 1065, 2032, 2466, 2362, 2242, 2514, 3006,
1543 3170, 2727, 2032, 1745, 2140, 2771, 2886, 2175,
1544 1096, 437, 583, 1209, 1704, 1825, 1894, 2338,
1545 3102, 3601, 3299, 2321, 1415, 1285, 1930, 2673,
1546 2829, 2339, 1732, 1513, 1639, 1648, 1264, 805,
1547 906, 1822, 3065, 3773, 3486, 2550, 1755, 1582,
1548 1830, 1959, 1751, 1543, 1806, 2530, 3118, 2944,
1549 2015, 1030, 751, 1302, 2097, 2453, 2239, 1915
1550 },
1551 {
1552 1964, 2362, 2559, 2189, 1568, 1414, 2067, 3059,
1553 3526, 3046, 2033, 1276, 1149, 1327, 1288, 987,
1554 936, 1584, 2708, 3521, 3425, 2621, 1903, 1856,
1555 2309, 2599, 2335, 1808, 1611, 1918, 2247, 1998,
1556 1166, 443, 549, 1503, 2603, 3140, 3062, 2903,
1557 3077, 3364, 3157, 2203, 1000, 375, 684, 1474,
1558 1982, 1920, 1700, 1887, 2497, 2950, 2717, 1961,
1559 1425, 1673, 2496, 3112, 2972, 2281, 1721, 1683,
1560 1882, 1764, 1217, 782, 1086, 2110, 3112, 3324,
1561 2695, 1899, 1625, 1901, 2178, 2031, 1671, 1687,
1562 2317, 3076, 3199, 2439, 1367, 825, 1111, 1751,
1563 2065, 1899, 1721, 2001, 2610, 2919, 2518, 1731,
1564 1353, 1830, 2779, 3352, 3069, 2250, 1598, 1445,
1565 1472, 1203, 669, 468, 1120, 2420, 3528, 3741,
1566 3144, 2457, 2266, 2453, 2438, 1916, 1254, 1094,
1567 1614, 2272, 2351, 1722, 1001, 913, 1554, 2336,
1568 2649, 2506, 2458, 2890, 3503, 3576, 2750, 1475,
1569 615, 626, 1170, 1560, 1528, 1462, 1874, 2718,
1570 3334, 3129, 2236, 1437, 1396, 2018, 2602, 2606,
1571 2183, 1928, 2145, 2474, 2310, 1544, 781, 764,
1572 1596, 2598, 2979, 2593, 2012, 1853, 2129, 2320,
1573 2047, 1576, 1549, 2236, 3140, 3434, 2781, 1683,
1574 980, 1029, 1443, 1618, 1441, 1379, 1878, 2749,
1575 3283, 2983, 2126, 1531, 1738, 2479, 2991, 2808,
1576 2197, 1776, 1790, 1858, 1476, 702, 214, 644,
1577 1885, 3131, 3627, 3348, 2903, 2803, 2914, 2686,
1578 1876, 935, 595, 1104, 1936, 2317, 2009, 1510,
1579 1471, 1978, 2486, 2467, 2030, 1820, 2285, 3129,
1580 3560, 3092, 2049, 1221, 1077, 1352, 1459, 1214,
1581 1058, 1522, 2535, 3375, 3355, 2530, 1651, 1420,
1582 1826, 2259, 2233, 1913, 1866, 2338, 2895, 2850,
1583 2036, 1061, 736, 1277, 2114, 2503, 2272, 1916
1584 },
1585 {
1586 1639, 1664, 1562, 1341, 1360, 1915, 2829, 3528,
1587 3547, 2949, 2219, 1761, 1548, 1288, 877, 621,
1588 938, 1861, 2903, 3446, 3282, 2734, 2268, 2022,
1589 1771, 1321, 868, 873, 1570, 2635, 3406, 3454,
1590 2920, 2299, 1919, 1689, 1347, 896, 694, 1077,
1591 1938, 2737, 2992, 2720, 2385, 2390, 2662, 2769,
1592 2419, 1793, 1356, 1365, 1621, 1732, 1581, 1463,
1593 1732, 2345, 2832, 2753, 2162, 1583, 1512, 1960,
1594 2502, 2750, 2711, 2665, 2725, 2631, 2028, 958,
1595 0, 0, 496, 1736, 2834, 3458, 3723, 3841,
1596 3752, 3184, 2069, 822, 110, 289, 1094, 1902,
1597 2304, 2395, 2518, 2782, 2906, 2557, 1804, 1148,
1598 1076, 1597, 2255, 2598, 2593, 2554, 2689, 2805,
1599 2511, 1715, 836, 485, 898, 1731, 2409, 2656,
1600 2660, 2728, 2863, 2746, 2156, 1334, 853, 1093,
1601 1868, 2596, 2846, 2685, 2489, 2460, 2405, 2012,
1602 1304, 722, 730, 1335, 2064, 2430, 2399, 2364,
1603 2665, 3183, 3442, 3110, 2344, 1619, 1245, 1108,
1604 918, 647, 646, 1270, 2402, 3433, 3752, 3276,
1605 2479, 1920, 1759, 1753, 1669, 1610, 1864, 2469,
1606 3015, 2959, 2167, 1103, 447, 518, 1081, 1689,
1607 2157, 2652, 3327, 3959, 4051, 3323, 2069, 966,
1608 513, 658, 980, 1199, 1437, 1979, 2804, 3469,
1609 3484, 2808, 1918, 1372, 1319, 1472, 1526, 1535,
1610 1822, 2522, 3289, 3542, 3008, 2017, 1205, 958,
1611 1133, 1343, 1427, 1594, 2085, 2776, 3197, 2987,
1612 2297, 1689, 1605, 1967, 2306, 2280, 2009, 1884,
1613 2086, 2358, 2294, 1817, 1301, 1203, 1573, 2011,
1614 2103, 1872, 1753, 2114, 2839, 3420, 3451, 2996,
1615 2439, 2029, 1639, 1019, 242, 0, 205, 1436,
1616 2883, 3816, 3952, 3559, 3062, 2600, 2024, 1278,
1617 664, 643, 1346, 2343, 2958, 2854, 2286, 1788
1618 },
1619 {
1620 1664, 1710, 1621, 1407, 1442, 2003, 2873, 3465,
1621 3372, 2745, 2084, 1708, 1489, 1146, 713, 612,
1622 1202, 2315, 3312, 3633, 3266, 2647, 2153, 1768,
1623 1286, 760, 609, 1212, 2410, 3513, 3856, 3344,
1624 2445, 1678, 1182, 798, 495, 559, 1284, 2512,
1625 3601, 3926, 3426, 2610, 2030, 1793, 1607, 1266,
1626 968, 1098, 1726, 2439, 2713, 2438, 2006, 1863,
1627 2044, 2194, 2047, 1785, 1847, 2396, 3057, 3245,
1628 2741, 1890, 1225, 956, 880, 784, 811, 1334,
1629 2449, 3684, 4095, 4001, 3035, 2052, 1429, 1079,
1630 781, 592, 827, 1619, 2608, 3172, 2997, 2384,
1631 1932, 1937, 2162, 2183, 1912, 1690, 1855, 2317,
1632 2620, 2441, 1951, 1617, 1681, 1910, 1901, 1595,
1633 1381, 1666, 2386, 3011, 3069, 2603, 2079, 1865,
1634 1879, 1787, 1488, 1298, 1590, 2308, 2924, 2932,
1635 2348, 1676, 1389, 1493, 1645, 1637, 1660, 2042,
1636 2762, 3350, 3316, 2665, 1904, 1532, 1564, 1603,
1637 1355, 1002, 995, 1531, 2303, 2818, 2898, 2809,
1638 2868, 3011, 2849, 2155, 1229, 689, 883, 1548,
1639 2098, 2207, 2062, 2049, 2261, 2408, 2227, 1862,
1640 1767, 2190, 2838, 3128, 2766, 2035, 1479, 1347,
1641 1410, 1328, 1118, 1157, 1721, 2593, 3217, 3234,
1642 2828, 2472, 2390, 2340, 1956, 1257, 718, 808,
1643 1498, 2286, 2699, 2716, 2652, 2684, 2608, 2120,
1644 1299, 686, 820, 1690, 2713, 3260, 3186, 2822,
1645 2502, 2202, 1692, 990, 515, 722, 1593, 2569,
1646 3045, 2906, 2541, 2359, 2356, 2214, 1783, 1351,
1647 1368, 1923, 2586, 2811, 2473, 1952, 1679, 1683,
1648 1634, 1326, 1011, 1176, 1997, 3075, 3770, 3769,
1649 3287, 2713, 2162, 1452, 521, 0, 0, 704,
1650 2221, 3469, 3925, 3689, 3199, 2718, 2167, 1448,
1651 794, 672, 1285, 2261, 2912, 2846, 2291, 1798
1652 },
1653 {
1654 1007, 1856, 3088, 3141, 1847, 693, 1019, 2402,
1655 3221, 2669, 1652, 1511, 2265, 2661, 1926, 902,
1656 1029, 2441, 3641, 3260, 1719, 730, 1238, 2375,
1657 2679, 1956, 1422, 1994, 3006, 3042, 1827, 706,
1658 1023, 2433, 3287, 2649, 1408, 1118, 2052, 2925,
1659 2601, 1546, 1185, 2010, 2913, 2633, 1438, 857,
1660 1747, 3148, 3408, 2207, 934, 975, 2063, 2745,
1661 2291, 1564, 1775, 2782, 3198, 2211, 766, 519,
1662 1815, 3231, 3271, 2120, 1291, 1679, 2511, 2481,
1663 1542, 991, 1744, 3042, 3318, 2172, 930, 1040,
1664 2298, 3130, 2564, 1398, 1127, 2028, 2866, 2544,
1665 1544, 1280, 2202, 3139, 2764, 1349, 530, 1323,
1666 2864, 3450, 2579, 1454, 1382, 2157, 2479, 1781,
1667 1038, 1485, 2882, 3653, 2796, 1178, 554, 1486,
1668 2736, 2860, 1960, 1411, 1992, 2872, 2739, 1593,
1669 829, 1472, 2813, 3235, 2228, 1036, 1114, 2328,
1670 3157, 2624, 1479, 1185, 2020, 2769, 2363, 1324,
1671 1121, 2227, 3406, 3187, 1710, 604, 1030, 2335,
1672 2953, 2368, 1638, 1880, 2743, 2873, 1777, 620,
1673 857, 2375, 3534, 3105, 1716, 1022, 1666, 2595,
1674 2523, 1612, 1201, 1986, 3034, 2956, 1739, 846,
1675 1407, 2768, 3270, 2302, 1044, 990, 2114, 2978,
1676 2598, 1645, 1484, 2330, 2945, 2295, 996, 656,
1677 1854, 3341, 3494, 2243, 1092, 1233, 2166, 2501,
1678 1839, 1266, 1837, 3059, 3406, 2261, 808, 665,
1679 1934, 3095, 2878, 1764, 1266, 1962, 2817, 2600,
1680 1538, 1039, 1834, 2968, 2975, 1770, 819, 1333,
1681 2738, 3371, 2522, 1266, 1073, 1987, 2681, 2254,
1682 1408, 1483, 2608, 3416, 2742, 1172, 431, 1320,
1683 2771, 3183, 2343, 1540, 1807, 2599, 2598, 1556,
1684 737, 1323, 2823, 3559, 2693, 1261, 902, 1879,
1685 2844, 2605, 1599, 1244, 2041, 2919, 2658, 1531
1686 },
1687 {
1688 1940, 2558, 3310, 3167, 1867, 350, 0, 1062,
1689 2800, 3765, 3383, 2325, 1683, 1824, 2122, 1810,
1690 973, 562, 1363, 3030, 4095, 3948, 2338, 733,
1691 312, 1081, 2042, 2327, 2055, 2043, 2730, 3541,
1692 3433, 2069, 354, 0, 660, 2465, 3674, 3555,
1693 2627, 1952, 1980, 2174, 1778, 840, 310, 1054,
1694 2820, 4095, 4095, 2750, 1016, 328, 870, 1758,
1695 2102, 1931, 2002, 2773, 3699, 3704, 2351, 483,
1696 0, 332, 2127, 3511, 3617, 2819, 2147, 2119,
1697 2272, 1849, 837, 165, 780, 2548, 4095, 4095,
1698 3056, 1293, 441, 815, 1624, 1964, 1795, 1856,
1699 2655, 3707, 3898, 2665, 738, 0, 137, 1836,
1700 3299, 3559, 2871, 2228, 2206, 2400, 2025, 983,
1701 161, 577, 2243, 3964, 4095, 3212, 1509, 607,
1702 911, 1683, 1987, 1722, 1634, 2344, 3478, 3919,
1703 2958, 1144, 0, 179, 1657, 3024, 3299, 2677,
1704 2126, 2247, 2633, 2411, 1352, 294, 368, 1792,
1705 3522, 4095, 3306, 1795, 924, 1157, 1829, 2014,
1706 1589, 1330, 1958, 3199, 3921, 3260, 1583, 231,
1707 275, 1525, 2778, 3042, 2448, 1949, 2189, 2781,
1708 2774, 1790, 573, 315, 1429, 3049, 3826, 3210,
1709 1931, 1202, 1494, 2155, 2234, 1577, 1016, 1432,
1710 2711, 3741, 3497, 2102, 754, 565, 1507, 2523,
1711 2671, 2061, 1640, 2072, 2958, 3236, 2353, 953,
1712 300, 1029, 2487, 3382, 3051, 2056, 1509, 1878,
1713 2532, 2499, 1601, 718, 888, 2167, 3485, 3671,
1714 2604, 1315, 927, 1562, 2316, 2308, 1645, 1274,
1715 1887, 3079, 3677, 2945, 1400, 361, 677, 1927,
1716 2902, 2843, 2138, 1788, 2244, 2901, 2778, 1670,
1717 489, 408, 1648, 3195, 3762, 3008, 1804, 1276,
1718 1670, 2211, 2062, 1311, 912, 1616, 3052, 3976,
1719 3474, 1900, 566, 489, 1470, 2418, 2532, 2072
1720 },
1721 {
1722 2305, 1950, 1626, 1814, 2468, 2972, 2698, 1651,
1723 599, 493, 1629, 3299, 4095, 3750, 2036, 322,
1724 0, 716, 2337, 3494, 3539, 2733, 1873, 1551,
1725 1713, 1874, 1704, 1400, 1477, 2176, 3100, 3465,
1726 2796, 1444, 411, 557, 1859, 3357, 3885, 3012,
1727 1398, 273, 466, 1773, 3173, 3670, 3055, 1956,
1728 1225, 1225, 1645, 1927, 1865, 1776, 2102, 2843,
1729 3423, 3156, 1941, 508, 0, 771, 2528, 3975,
1730 4081, 2811, 1147, 304, 788, 2069, 3085, 3132,
1731 2367, 1558, 1356, 1763, 2238, 2291, 1965, 1758,
1732 2067, 2709, 3020, 2475, 1275, 311, 477, 1870,
1733 3595, 4095, 3648, 1838, 238, 0, 953, 2472,
1734 3385, 3239, 2444, 1786, 1701, 1974, 2076, 1773,
1735 1386, 1465, 2176, 3031, 3252, 2491, 1234, 486,
1736 945, 2362, 3668, 3808, 2604, 928, 25, 542,
1737 2045, 3415, 3744, 2992, 1892, 1252, 1307, 1669,
1738 1826, 1700, 1681, 2158, 2993, 3517, 3093, 1773,
1739 411, 53, 1073, 2800, 3984, 3764, 2346, 833,
1740 342, 1140, 2499, 3344, 3124, 2182, 1357, 1230,
1741 1687, 2150, 2196, 1957, 1926, 2378, 2991, 3078,
1742 2252, 913, 57, 492, 2102, 3831, 4095, 3481,
1743 1632, 203, 113, 1246, 2634, 3287, 2946, 2155,
1744 1671, 1781, 2137, 2202, 1837, 1454, 1587, 2295,
1745 3011, 3008, 2101, 926, 482, 1281, 2841, 3994,
1746 3798, 2312, 588, 0, 597, 2192, 3484, 3681,
1747 2895, 1901, 1409, 1511, 1759, 1733, 1500, 1531,
1748 2148, 3075, 3557, 3017, 1650, 404, 259, 1409,
1749 3036, 3917, 3390, 1883, 571, 434, 1497, 2873,
1750 3520, 3065, 2014, 1233, 1196, 1675, 2076, 2072,
1751 1891, 2018, 2606, 3204, 3117, 2089, 689, 0,
1752 611, 2318, 3929, 4095, 3162, 1386, 241, 446,
1753 1669, 2875, 3209, 2628, 1811, 1479, 1772, 2227
1754 },
1755 {
1756 2335, 1960, 1685, 1991, 2665, 2957, 2364, 1256,
1757 1187, 675, 1385, 2969, 4095, 3891, 2178, 296,
1758 0, 858, 2528, 3499, 3277, 2384, 1687, 1864,
1759 1755, 1891, 1800, 1493, 1474, 2117, 3086, 3446,
1760 2627, 1190, 321, 799, 2247, 3423, 3310, 3107,
1761 1738, 395, 255, 1464, 3033, 3737, 3149, 1995,
1762 1297, 1347, 1704, 1834, 1723, 1823, 2108, 2639,
1763 3261, 3208, 2125, 617, 0, 748, 2661, 4066,
1764 3914, 2447, 933, 547, 1394, 1601, 2804, 3229,
1765 2646, 1734, 1332, 1636, 2113, 2142, 1819, 1735,
1766 2218, 2881, 2971, 2189, 1720, 621, 355, 1441,
1767 3232, 4095, 3802, 1959, 273, 50, 1212, 2640,
1768 3225, 2756, 1910, 2316, 1840, 1897, 2026, 1814,
1769 1434, 1470, 2204, 3124, 3256, 2304, 984, 435,
1770 1171, 2551, 3314, 3642, 2920, 1289, 77, 298,
1771 1775, 3318, 3760, 2948, 1844, 1312, 1466, 1796,
1772 1872, 1825, 1577, 1917, 2711, 3406, 3216, 1970,
1773 487, 10, 1148, 2954, 3986, 3485, 1998, 851,
1774 972, 994, 2116, 3181, 3271, 2421, 1473, 1207,
1775 1641, 2110, 2109, 1863, 1914, 2408, 2823, 2479,
1776 2808, 1550, 347, 282, 1634, 3479, 4095, 3526,
1777 1607, 217, 326, 1591, 2839, 3159, 2604, 1942,
1778 1762, 1656, 1999, 2221, 1988, 1609, 1694, 2407,
1779 3070, 2862, 1756, 638, 549, 1686, 3126, 3294,
1780 3719, 2662, 912, 0, 407, 2032, 3459, 3612,
1781 2747, 1800, 1467, 1676, 1899, 1861, 1595, 1503,
1782 1915, 2795, 3437, 3078, 1735, 392, 309, 1631,
1783 3271, 3888, 3033, 1515, 651, 866, 1341, 2604,
1784 3487, 3253, 2196, 1262, 1125, 1617, 2009, 1977,
1785 1857, 2125, 2738, 3044, 2446, 2512, 1180, 155,
1786 433, 2025, 3791, 4095, 3137, 1246, 193, 622,
1787 1932, 2950, 3001, 2393, 2115, 1507, 1558, 1991
1788 },
1789 {
1790 2299, 1606, 1862, 2187, 2600, 3114, 2824, 819,
1791 742, 762, 1777, 2857, 3979, 4095, 2607, 70,
1792 0, 1274, 2290, 3296, 3402, 2624, 1883, 2093,
1793 1423, 1682, 1942, 1277, 1503, 2618, 2805, 3895,
1794 2249, 1512, 0, 904, 1903, 3739, 3659, 3477,
1795 1378, 119, 643, 1169, 2648, 4095, 3128, 2162,
1796 1306, 1460, 1690, 1974, 1373, 1684, 1967, 3108,
1797 3257, 3304, 2323, 309, 7, 529, 2826, 4095,
1798 3817, 2606, 606, 565, 1564, 1755, 2924, 3206,
1799 2565, 1884, 1147, 1262, 2231, 2237, 2195, 2100,
1800 1944, 2626, 3225, 1916, 1444, 924, 395, 1723,
1801 3132, 4095, 3586, 1748, 42, 268, 1482, 2742,
1802 3110, 2570, 2025, 2385, 1828, 2180, 1616, 1958,
1803 1380, 1703, 2019, 3249, 3581, 2116, 685, 199,
1804 1554, 2900, 3289, 3588, 2850, 1045, 0, 597,
1805 1989, 3292, 3640, 3076, 1633, 1156, 1650, 2200,
1806 1884, 1603, 1349, 2034, 2754, 3521, 3437, 1599,
1807 744, 0, 1040, 3065, 4095, 3458, 1782, 963,
1808 997, 977, 1824, 3559, 3467, 2488, 1558, 699,
1809 1750, 1983, 2306, 1793, 2240, 2704, 2237, 2629,
1810 2939, 1330, 530, 545, 1391, 3086, 4095, 3624,
1811 1583, 443, 206, 1788, 2457, 3132, 2913, 1810,
1812 1654, 1539, 2375, 2330, 2305, 1378, 1366, 2269,
1813 3182, 3207, 1447, 648, 813, 1931, 3069, 3286,
1814 3459, 2647, 833, 0, 589, 2201, 3797, 3585,
1815 2499, 1455, 1353, 2169, 2045, 1862, 1599, 1248,
1816 1735, 3087, 3519, 3073, 1783, 586, 403, 1230,
1817 3053, 4030, 3230, 1553, 814, 1012, 1239, 2409,
1818 3612, 3022, 2454, 988, 1344, 1690, 2015, 2311,
1819 1661, 1882, 2970, 3096, 2259, 2286, 1362, 415,
1820 382, 2202, 4077, 4095, 2592, 1052, 470, 805,
1821 2008, 3117, 3179, 2167, 1896, 1466, 1818, 2081
1822 },
1823 {
1824 1966, 2056, 2324, 2444, 1716, 1440, 1465, 1652,
1825 1875, 2034, 2094, 2076, 2037, 2105, 2583, 1888,
1826 994, 1008, 1565, 2138, 2414, 2398, 2270, 2152,
1827 2001, 1726, 1370, 1159, 1325, 1872, 2502, 2825,
1828 2599, 1908, 1177, 1358, 1754, 1897, 1956, 1973,
1829 1965, 1970, 2000, 2020, 1980, 1914, 1867, 1698,
1830 1633, 1822, 2021, 2054, 1931, 1831, 1905, 2094,
1831 2140, 1824, 1297, 1964, 2188, 1828, 1576, 2128,
1832 2255, 1961, 1600, 1533, 1823, 2209, 2347, 2115,
1833 1705, 1447, 1526, 1839, 2117, 2168, 2035, 1919,
1834 1948, 2041, 1998, 1724, 1392, 1362, 1896, 2811,
1835 2122, 1739, 1726, 1901, 2062, 2040, 1867, 1669,
1836 1531, 1527, 1740, 2238, 2702, 2377, 1984, 1563,
1837 1305, 1376, 1742, 2165, 2333, 2139, 1788, 1624,
1838 1819, 2208, 2414, 2176, 1596, 1106, 1087, 1600,
1839 2354, 2838, 2758, 2219, 1598, 1247, 1250, 1468,
1840 1734, 2029, 2451, 2851, 2030, 1593, 1481, 1600,
1841 1808, 1954, 2009, 2012, 1969, 1886, 1800, 1768,
1842 1812, 1937, 2247, 2475, 1925, 1398, 1223, 1479,
1843 1957, 2335, 2421, 2267, 2054, 1870, 1614, 1148,
1844 1402, 2051, 2361, 2381, 2151, 1806, 1621, 1674,
1845 1793, 1900, 1995, 2059, 2054, 1959, 1750, 1419,
1846 1732, 2123, 2329, 2207, 1857, 1571, 1594, 1896,
1847 2180, 2116, 1639, 1438, 1959, 2116, 2093, 2051,
1848 2049, 2037, 1956, 1739, 1214, 911, 2104, 2666,
1849 2618, 2292, 1979, 1758, 1557, 1351, 1268, 1485,
1850 2014, 2601, 2861, 2571, 1885, 1233, 989, 1278,
1851 1853, 2301, 2449, 2380, 2080, 1765, 1562, 1513,
1852 1617, 1930, 2552, 2071, 1735, 1723, 1797, 1809,
1853 1807, 1898, 2059, 2111, 2091, 2188, 1924, 1185,
1854 1048, 1869, 2546, 2656, 2239, 1647, 1338, 1500,
1855 1926, 2232, 2194, 1935, 1853, 1585, 1647, 1843
1856 },
1857 {
1858 1659, 2675, 2749, 995, 2173, 1940, 1758, 1737,
1859 1805, 1884, 1945, 2020, 2163, 2406, 1786, 2321,
1860 991, 844, 1698, 2413, 2642, 2402, 2020, 1879,
1861 1873, 1701, 1340, 1179, 1629, 2362, 2546, 2823,
1862 2611, 635, 1054, 2099, 1830, 1970, 2091, 2189,
1863 2174, 2003, 1706, 1379, 1301, 1802, 2504, 3525,
1864 1931, 631, 1107, 1894, 2188, 2207, 2261, 2251,
1865 1696, 718, 3108, 1636, 1614, 2164, 1962, 1527,
1866 2214, 2001, 1463, 1379, 1962, 2680, 2826, 2236,
1867 1296, 814, 1099, 1902, 2559, 2590, 2142, 1841,
1868 1891, 2012, 1954, 1594, 1161, 1342, 2876, 1538,
1869 2388, 2161, 1968, 1905, 1876, 1872, 1781, 1648,
1870 1622, 1774, 2024, 1808, 1350, 3460, 2891, 1498,
1871 1072, 1273, 1372, 1966, 2476, 2263, 1679, 1448,
1872 1930, 2703, 2997, 2280, 930, 682, 802, 982,
1873 2550, 3717, 3622, 2527, 1167, 573, 651, 1194,
1874 2057, 3027, 3472, 328, 2460, 2176, 1868, 1735,
1875 1734, 1783, 1780, 1757, 1784, 1880, 2039, 2201,
1876 2229, 2073, 1483, 1629, 2971, 1691, 851, 1072,
1877 1864, 2609, 2790, 2451, 1961, 1515, 1103, 1847,
1878 2014, 1647, 1888, 2020, 2063, 2184, 2102, 1878,
1879 1874, 1891, 1808, 1635, 1480, 1540, 2049, 3897,
1880 1024, 1088, 2025, 2385, 2069, 1655, 1649, 2000,
1881 2132, 1527, 1310, 2922, 1737, 1758, 1870, 1969,
1882 2088, 2176, 2080, 1699, 1295, 1033, 1600, 2820,
1883 2718, 2287, 1985, 1875, 1713, 1312, 1028, 1302,
1884 2030, 2858, 3103, 2414, 1614, 1352, 673, 1103,
1885 3016, 3299, 1642, 303, 1899, 2475, 2407, 2217,
1886 2137, 2046, 0, 2298, 2414, 2355, 2160, 1584,
1887 1115, 1349, 2022, 3000, 3585, 1751, 1024, 1398,
1888 0, 1191, 3177, 3342, 3377, 2277, 1124, 914,
1889 1094, 1158, 1371, 2973, 3320, 3253, 614, 540
1890 },
1891 {
1892 2099, 2469, 2236, 702, 2306, 2265, 1928, 1672,
1893 1726, 1987, 2127, 1964, 1717, 1825, 1554, 2705,
1894 1775, 1502, 1837, 2050, 2091, 1947, 1738, 1739,
1895 1928, 2072, 2002, 1816, 1805, 1889, 1699, 2154,
1896 2518, 1076, 1654, 2496, 1911, 1823, 1821, 1849,
1897 1867, 1940, 2050, 1998, 1745, 1642, 1760, 2739,
1898 1747, 1219, 1994, 2375, 1945, 1549, 1785, 2277,
1899 2037, 959, 3051, 1449, 1562, 2284, 2050, 1433,
1900 2072, 2097, 1863, 1753, 1851, 1981, 1988, 1929,
1901 1821, 1824, 1884, 1978, 2013, 1910, 1751, 1793,
1902 1972, 2055, 2014, 1821, 1560, 1700, 2938, 1246,
1903 1937, 1827, 1891, 2013, 2000, 1913, 1785, 1739,
1904 1875, 2124, 2270, 1727, 862, 2745, 2341, 1478,
1905 1641, 2081, 1896, 1913, 2030, 1912, 1750, 1767,
1906 1969, 2110, 2036, 1726, 1441, 2175, 2393, 1596,
1907 1717, 1928, 1974, 1960, 1874, 1981, 1892, 1671,
1908 1728, 2290, 2824, 56, 2531, 2354, 1939, 1671,
1909 1684, 1912, 2091, 2064, 1866, 1685, 1736, 2015,
1910 2225, 2101, 1361, 1380, 2857, 1977, 1503, 1703,
1911 2007, 2108, 1943, 1793, 1857, 1922, 1671, 2226,
1912 2096, 1558, 1797, 1981, 2008, 2034, 1869, 1668,
1913 1813, 2043, 2128, 1982, 1677, 1472, 1753, 3561,
1914 869, 1194, 2258, 2509, 1963, 1436, 1561, 2174,
1915 2442, 1702, 1200, 2655, 1589, 1862, 2067, 1960,
1916 1757, 1756, 1974, 2111, 2016, 1591, 1633, 2335,
1917 2028, 1730, 1723, 1922, 2063, 1955, 1810, 1841,
1918 1901, 1979, 1939, 1732, 1897, 2363, 1614, 1272,
1919 2407, 2579, 1525, 879, 2556, 2497, 1674, 1351,
1920 1926, 2700, 844, 2684, 1928, 1498, 1787, 2108,
1921 2115, 1928, 1585, 1766, 2412, 1472, 1850, 2833,
1922 998, 1559, 2529, 2010, 2009, 1560, 1460, 2158,
1923 2552, 1961, 1049, 1816, 2175, 2885, 1132, 1374
1924 },
1925 {
1926 2298, 2981, 1544, 1907, 2114, 2357, 2312, 2031,
1927 1922, 2051, 2257, 2329, 2136, 1889, 1951, 2330,
1928 2524, 1904, 1503, 2689, 2381, 1845, 1847, 2222,
1929 2478, 2244, 1733, 1671, 2468, 3711, 0, 2679,
1930 2483, 2319, 2099, 1806, 1780, 2394, 3172, 907,
1931 2428, 2019, 1976, 3332, 949, 2022, 2567, 2323,
1932 1942, 1935, 2190, 2256, 2131, 2022, 2136, 2259,
1933 2068, 1982, 2103, 2405, 2424, 1147, 2599, 2418,
1934 2080, 1906, 1999, 2236, 2336, 2151, 1935, 1952,
1935 2363, 2253, 1921, 2191, 2200, 1994, 1982, 2335,
1936 2577, 1839, 774, 4095, 1331, 2647, 760, 2895,
1937 2687, 1875, 1701, 2040, 2404, 2410, 2086, 1796,
1938 1879, 2320, 2724, 2512, 11, 3311, 3102, 1436,
1939 1248, 3032, 2012, 2081, 2195, 1962, 2073, 2353,
1940 2250, 1298, 3430, 1288, 2013, 2392, 2304, 2042,
1941 1870, 2446, 1774, 2216, 2566, 1933, 1739, 2235,
1942 2345, 2240, 2076, 1867, 2092, 2289, 2236, 2183,
1943 2067, 1880, 1944, 2478, 2615, 1919, 1406, 1820,
1944 3158, 2882, 1131, 777, 3423, 2936, 1687, 1391,
1945 1985, 2647, 2670, 1894, 950, 3538, 1441, 2122,
1946 2405, 2205, 1920, 1914, 2189, 2417, 2283, 1842,
1947 1983, 2034, 2172, 2886, 2024, 916, 2464, 2887,
1948 2448, 1253, 1916, 2446, 2377, 2219, 2125, 1761,
1949 1342, 3767, 1742, 1619, 2008, 2362, 2340, 2127,
1950 1995, 1992, 2119, 2263, 2278, 2123, 1862, 1684,
1951 3480, 1143, 1973, 2577, 2351, 1813, 1654, 2372,
1952 3429, 458, 2493, 2385, 2266, 2090, 1932, 2110,
1953 1759, 3261, 1250, 2307, 2104, 1810, 2959, 1710,
1954 1826, 2277, 2319, 2116, 2022, 2111, 2165, 2106,
1955 2081, 2200, 2374, 2014, 1103, 3510, 1988, 1764,
1956 1659, 2400, 2848, 1755, 1832, 1996, 2283, 2580,
1957 2140, 1399, 2388, 2249, 2290, 2145, 2045, 1628
1958 },
1959 {
1960 1924, 2444, 2813, 2991, 2986, 2843, 2628, 2452,
1961 2434, 2498, 2306, 1709, 1257, 1437, 1788, 1893,
1962 1862, 1859, 1900, 1934, 1937, 2067, 2535, 3037,
1963 2605, 1507, 2993, 4095, 2387, 1241, 1643, 1400,
1964 1577, 1690, 1700, 1583, 1320, 1297, 897, 4095,
1965 1859, 4095, 3945, 1699, 4095, 2586, 839, 274,
1966 2773, 861, 522, 638, 3159, 670, 3569, 3585,
1967 2275, 2822, 3052, 2773, 1831, 1291, 2065, 1950,
1968 1808, 1722, 1680, 1706, 1839, 2112, 2552, 3205,
1969 3077, 2986, 9, 2037, 2278, 2969, 1623, 247,
1970 814, 3418, 3028, 3659, 3881, 1185, 3474, 610,
1971 706, 1054, 1511, 1892, 2219, 2487, 2671, 2743,
1972 2690, 2535, 2346, 2195, 2099, 2027, 1929, 1766,
1973 1551, 1422, 1955, 3456, 1602, 1469, 1901, 2533,
1974 2937, 2774, 2129, 1705, 2157, 2768, 2283, 1411,
1975 1188, 1551, 2052, 2447, 2685, 2751, 2625, 2315,
1976 1913, 1593, 1500, 1659, 1967, 2259, 2430, 2493,
1977 2525, 2565, 2554, 2374, 1960, 1424, 1070, 1200,
1978 1881, 2674, 2940, 2849, 2779, 2370, 1681, 1327,
1979 1582, 2205, 2654, 2062, 1522, 2701, 2513, 2191,
1980 1971, 1869, 1866, 1953, 2125, 2366, 2612, 2655,
1981 1259, 2467, 2051, 1394, 2036, 1824, 2313, 2528,
1982 2549, 2764, 2979, 100, 3505, 2383, 1098, 570,
1983 3751, 1455, 1648, 1943, 2152, 2304, 2368, 2476,
1984 2677, 2783, 2720, 2510, 2188, 1792, 1355, 904,
1985 494, 1440, 749, 4095, 3212, 2926, 4095, 1520,
1986 2034, 1383, 1679, 1814, 1792, 1641, 1368, 1075,
1987 3968, 1321, 4081, 1908, 2868, 2153, 433, 2197,
1988 2089, 1958, 1946, 1979, 2098, 2196, 2320, 2614,
1989 2993, 3269, 3108, 2003, 630, 616, 1624, 1690,
1990 1185, 1322, 1960, 2600, 3081, 3429, 3627, 3562,
1991 3123, 2349, 1527, 976, 714, 658, 869, 1345
1992 },
1993 {
1994 1978, 2287, 2526, 2669, 2687, 2577, 2388, 2225,
1995 2197, 2323, 2481, 2505, 2388, 2223, 1976, 1694,
1996 1507, 1450, 1453, 1439, 1427, 1561, 2010, 2746,
1997 3403, 3628, 4078, 3807, 2389, 899, 1003, 1447,
1998 1671, 1739, 1691, 1522, 1184, 554, 648, 3083,
1999 3818, 3891, 3918, 3834, 3555, 2432, 1470, 767,
2000 771, 762, 962, 883, 941, 1513, 3249, 4000,
2001 3729, 3335, 2717, 2321, 2333, 2123, 1688, 1383,
2002 1269, 1282, 1383, 1574, 1866, 2260, 2766, 3457,
2003 4095, 3462, 1413, 1042, 1071, 1153, 780, 812,
2004 1586, 3041, 4083, 3878, 3731, 3467, 2518, 32,
2005 304, 967, 1415, 1780, 2103, 2382, 2594, 2715,
2006 2729, 2642, 2496, 2374, 2319, 2292, 2230, 2098,
2007 1878, 1568, 1256, 1339, 1443, 1902, 2434, 2940,
2008 3241, 3172, 2728, 2140, 1745, 1611, 1490, 1512,
2009 1766, 2091, 2349, 2503, 2567, 2543, 2416, 2195,
2010 1936, 1741, 1692, 1804, 2010, 2210, 2339, 2400,
2011 2437, 2471, 2465, 2345, 2074, 1728, 1483, 1520,
2012 1888, 2416, 2792, 2848, 2593, 2085, 1562, 1321,
2013 1470, 1907, 2449, 2909, 2959, 2629, 2217, 1945,
2014 1799, 1740, 1744, 1802, 1916, 2092, 2334, 2643,
2015 2867, 2610, 1676, 1174, 1590, 2542, 2417, 2057,
2016 2012, 2246, 2772, 2886, 2961, 2174, 1527, 927,
2017 1176, 1434, 1980, 2292, 2408, 2433, 2521, 2716,
2018 2869, 2872, 2728, 2479, 2159, 1797, 1417, 1020,
2019 551, 0, 965, 3313, 4095, 4095, 4036, 1891,
2020 1026, 1725, 2085, 2203, 2157, 1975, 1642, 1080,
2021 858, 1439, 3279, 3362, 2978, 2705, 2345, 2051,
2022 1614, 1552, 1722, 1899, 1989, 2034, 2174, 2497,
2023 2904, 3160, 3029, 2405, 1550, 993, 950, 1074,
2024 1350, 1848, 2358, 2732, 2971, 3126, 3193, 3108,
2025 2807, 2308, 1746, 1299, 1076, 1091, 1304, 1631
2026 },
2027 {
2028 1974, 2482, 2875, 3104, 3130, 2965, 2685, 2444,
2029 2398, 2432, 1941, 1529, 1311, 1281, 1417, 1638,
2030 1741, 1802, 1867, 1875, 1834, 1943, 2424, 3078,
2031 2950, 3018, 3414, 3767, 1893, 292, 1172, 1495,
2032 1619, 1650, 1618, 1519, 1311, 830, 542, 2902,
2033 3970, 3585, 3716, 4095, 3246, 2351, 1679, 1158,
2034 715, 432, 429, 557, 1153, 2006, 2746, 3118,
2035 3104, 2866, 2619, 2497, 2500, 2536, 2518, 2417,
2036 2251, 2029, 1729, 1335, 915, 637, 609, 848,
2037 1492, 2361, 3139, 3618, 3787, 3748, 3570, 3205,
2038 2516, 1447, 246, 0, 141, 0, 1344, 3608,
2039 3264, 2852, 2669, 2550, 2442, 2336, 2235, 2148,
2040 2085, 2047, 2016, 1955, 1850, 1735, 1654, 1631,
2041 1679, 1810, 2036, 2349, 2723, 2936, 2377, 1778,
2042 1434, 1578, 2217, 2631, 2160, 1995, 2078, 2414,
2043 2843, 2278, 1754, 1414, 1251, 1265, 1475, 1865,
2044 2337, 2726, 2890, 2798, 2540, 2262, 2057, 1923,
2045 1798, 1655, 1563, 1640, 1947, 2381, 2691, 2628,
2046 2133, 1456, 1160, 1408, 1536, 2233, 2960, 3266,
2047 3025, 2384, 1601, 1562, 1834, 1990, 2038, 2014,
2048 1962, 1916, 1895, 1901, 1924, 1944, 1932, 1833,
2049 1534, 1899, 2945, 3446, 3179, 2286, 1999, 2217,
2050 2057, 1587, 814, 1088, 1536, 1786, 1929, 2092,
2051 2305, 2494, 2576, 2539, 2454, 2421, 2474, 2546,
2052 2514, 2299, 1938, 1557, 1276, 1131, 1077, 1094,
2053 1249, 1656, 2360, 3211, 3866, 3997, 3421, 2169,
2054 772, 1352, 1724, 1879, 1916, 1860, 1692, 1325,
2055 485, 1603, 3374, 3302, 2657, 2380, 2388, 2362,
2056 1822, 1674, 1777, 1871, 1880, 1838, 1921, 2255,
2057 2723, 3033, 2863, 2051, 920, 840, 1432, 1622,
2058 1483, 1466, 2179, 2729, 3087, 3321, 3428, 3313,
2059 2880, 2155, 1339, 723, 458, 499, 853, 1398
2060 },
2061 {
2062 2279, 2196, 2046, 1841, 1621, 1468, 1478, 1682,
2063 1981, 2172, 2058, 1578, 1603, 1950, 2077, 2075,
2064 2013, 1946, 1898, 1848, 1763, 1631, 1488, 1448,
2065 1612, 1884, 2125, 2292, 2378, 2372, 2259, 2020,
2066 1630, 1020, 0, 1267, 2810, 2483, 2166, 2366,
2067 3306, 2194, 1046, 725, 1498, 1846, 1907, 1695,
2068 1498, 1747, 2090, 2433, 2596, 2448, 2018, 1500,
2069 1142, 1098, 1352, 1750, 2108, 2310, 2340, 2238,
2070 2048, 1801, 1550, 1398, 1482, 1896, 2603, 1967,
2071 1676, 1600, 1639, 1732, 1835, 1922, 2015, 2173,
2072 2124, 2066, 1991, 1537, 1367, 1433, 1626, 1856,
2073 2058, 2186, 2208, 2120, 1947, 1754, 1650, 1828,
2074 2055, 1266, 1253, 1769, 2332, 2499, 2108, 1342,
2075 1447, 2148, 2385, 2317, 2024, 1567, 936, 850,
2076 1389, 2093, 2694, 2927, 2690, 2117, 1485, 1062,
2077 1250, 1474, 1423, 1730, 2003, 2236, 2408, 2460,
2078 2333, 2031, 1654, 1353, 1243, 1334, 1540, 1754,
2079 1927, 2090, 2286, 2487, 2568, 2383, 1892, 1253,
2080 771, 729, 1201, 1984, 2690, 2961, 2668, 1948,
2081 1188, 1675, 1847, 1892, 1871, 1789, 1633, 1343,
2082 592, 1891, 3408, 2563, 2227, 1999, 1802, 1619,
2083 1456, 1343, 1324, 1459, 1807, 2286, 2475, 2255,
2084 2021, 1904, 1852, 1813, 1759, 1681, 1589, 1523,
2085 1555, 1773, 2269, 2057, 1921, 1968, 2072, 2100,
2086 2003, 1824, 1657, 1561, 1535, 1547, 1591, 1712,
2087 1955, 2290, 2567, 2580, 2192, 1458, 763, 1698,
2088 1995, 1819, 1036, 1630, 2202, 2731, 2993, 1909,
2089 1342, 1142, 1288, 1852, 2834, 1816, 1329, 1438,
2090 1885, 2275, 2331, 2041, 1606, 1686, 1699, 1684,
2091 1779, 1942, 2064, 2106, 2069, 1940, 1660, 1087,
2092 1472, 2026, 2215, 2204, 2118, 1966, 1691, 1679,
2093 1969, 2028, 1853, 1400, 1193, 1701, 2076, 2258
2094 },
2095 {
2096 2084, 2007, 2033, 2179, 2411, 2617, 2660, 2466,
2097 2097, 1732, 1555, 1632, 1858, 2024, 1955, 1623,
2098 1136, 625, 1234, 1712, 2121, 2454, 2702, 2873,
2099 2976, 3011, 2962, 2795, 2457, 1905, 1840, 2225,
2100 2377, 2208, 1524, 1695, 2066, 2151, 2080, 1907,
2101 1634, 1214, 462, 498, 1595, 2495, 3312, 2586,
2102 2206, 2032, 2016, 2142, 2357, 2511, 2491, 2398,
2103 2385, 2535, 2903, 2783, 2397, 2106, 1917, 1809,
2104 1778, 1839, 1977, 2104, 2076, 1772, 1187, 711,
2105 1265, 1519, 1606, 1578, 1443, 1129, 1080, 2214,
2106 3585, 4095, 3795, 3636, 3792, 3998, 2811, 1929,
2107 1447, 1217, 1030, 812, 683, 851, 1401, 2164,
2108 2767, 2855, 2327, 1433, 643, 374, 758, 1597,
2109 2511, 3177, 3493, 3554, 3493, 3321, 2894, 2032,
2110 1194, 1977, 2284, 2397, 2397, 2311, 2145, 1894,
2111 1549, 1075, 625, 1121, 1481, 1663, 1693, 1674,
2112 1732, 1935, 2244, 2554, 2771, 2876, 2920, 2957,
2113 2974, 2899, 2671, 2325, 2013, 1910, 2072, 2352,
2114 2441, 2048, 1087, 0, 824, 1237, 1469, 1617,
2115 1714, 1765, 1732, 1478, 1188, 3153, 4095, 4095,
2116 4095, 4095, 2770, 981, 1235, 1454, 1479, 1428,
2117 1319, 1132, 794, 25, 829, 2188, 2980, 3127,
2118 2836, 2442, 2205, 2192, 2294, 2361, 2327, 2242,
2119 2205, 2259, 2350, 2372, 2259, 2048, 1854, 1787,
2120 1878, 2061, 2231, 2314, 2296, 2191, 1991, 1659,
2121 1187, 672, 673, 528, 1256, 2661, 4095, 3440,
2122 3037, 2800, 2620, 2461, 2317, 2194, 2102, 2051,
2123 2043, 2043, 1976, 1822, 1654, 1532, 1474, 1475,
2124 1527, 1611, 1700, 1786, 1889, 2036, 2231, 2419,
2125 2501, 2470, 2431, 2455, 2562, 2770, 3156, 4014,
2126 3029, 1936, 1119, 505, 696, 858, 752, 640,
2127 1462, 2286, 2867, 3090, 3001, 2745, 2465, 2238
2128 },
2129 {
2130 2258, 2290, 2417, 2658, 2973, 3251, 3352, 3201,
2131 2860, 2505, 2321, 2374, 2560, 2670, 2531, 2115,
2132 1533, 918, 1416, 1778, 2070, 2285, 2419, 2481,
2133 2484, 2428, 2301, 2070, 1683, 1099, 1019, 1408,
2134 1581, 1450, 821, 1063, 1519, 1701, 1738, 1680,
2135 1529, 1233, 605, 763, 1977, 2985, 3901, 3262,
2136 2954, 2837, 2860, 3007, 3224, 3362, 3307, 3161,
2137 3080, 3146, 3416, 3186, 2682, 2266, 1948, 1710,
2138 1551, 1488, 1510, 1531, 1408, 1023, 374, 0,
2139 375, 619, 716, 717, 629, 380, 412, 1642,
2140 3121, 4054, 3575, 3547, 3836, 4095, 3115, 2355,
2141 1985, 1857, 1758, 1612, 1539, 1743, 2310, 3072,
2142 3653, 3701, 3115, 2145, 1264, 891, 1160, 1875,
2143 2659, 3193, 3376, 3306, 3120, 2831, 2298, 1343,
2144 426, 1147, 1410, 1497, 1491, 1418, 1284, 1084,
2145 807, 416, 63, 669, 1147, 1455, 1615, 1727,
2146 1916, 2244, 2672, 3091, 3406, 3595, 3708, 3795,
2147 3846, 3786, 3554, 3185, 2831, 2670, 2758, 2948,
2148 2936, 2432, 1352, 17, 838, 1124, 1232, 1261,
2149 1248, 1198, 1078, 750, 403, 2327, 4029, 3456,
2150 3518, 3701, 2009, 284, 617, 927, 1055, 1114,
2151 1122, 1056, 839, 191, 1111, 2580, 3472, 3709,
2152 3495, 3163, 2973, 2990, 3104, 3167, 3111, 2988,
2153 2897, 2881, 2890, 2819, 2605, 2285, 1977, 1794,
2154 1770, 1840, 1904, 1887, 1779, 1596, 1331, 949,
2155 441, 0, 0, 0, 537, 1988, 3802, 2902,
2156 2585, 2443, 2365, 2314, 2281, 2269, 2286, 2340,
2157 2430, 2519, 2531, 2443, 2327, 2244, 2207, 2214,
2158 2255, 2312, 2359, 2388, 2421, 2486, 2589, 2678,
2159 2654, 2515, 2366, 2282, 2284, 2393, 2689, 3468,
2160 2415, 1266, 411, 0, 0, 127, 46, 0,
2161 852, 1745, 2408, 2723, 2735, 2585, 2416, 2301
2162 },
2163 {
2164 2185, 2170, 2249, 2442, 2711, 2942, 2998, 2803,
2165 2420, 2025, 1803, 1822, 1976, 2058, 1894, 1457,
2166 857, 229, 718, 1076, 1368, 1587, 1730, 1806,
2167 1827, 1793, 1693, 1493, 1141, 595, 558, 991,
2168 1213, 1133, 558, 855, 1367, 1607, 1703, 1705,
2169 1613, 1376, 806, 1021, 2290, 3352, 4095, 3728,
2170 3467, 3392, 3454, 3636, 3884, 4049, 4017, 3890,
2171 3822, 3896, 4095, 3941, 3432, 3007, 2675, 2419,
2172 2238, 2150, 2142, 2130, 1971, 1548, 856, 289,
2173 769, 966, 1015, 968, 831, 532, 515, 1697,
2174 3129, 4016, 3493, 3422, 3671, 3972, 2878, 2086,
2175 1687, 1532, 1411, 1246, 1156, 1348, 1907, 2662,
2176 3242, 3290, 2708, 1746, 875, 515, 800, 1533,
2177 2337, 2892, 3098, 3053, 2893, 2630, 2124, 1196,
2178 307, 1055, 1344, 1457, 1476, 1428, 1316, 1137,
2179 880, 506, 170, 789, 1280, 1597, 1765, 1883,
2180 2074, 2404, 2832, 3249, 3559, 3741, 3847, 3925,
2181 3966, 3894, 3649, 3267, 2899, 2723, 2796, 2972,
2182 2944, 2425, 1330, 0, 789, 1062, 1158, 1176,
2183 1153, 1095, 966, 632, 279, 2200, 3899, 3324,
2184 3385, 3569, 1879, 157, 493, 808, 941, 1006,
2185 1021, 961, 751, 110, 1038, 2513, 3413, 3656,
2186 3448, 3122, 2937, 2959, 3077, 3143, 3090, 2969,
2187 2878, 2864, 2872, 2800, 2584, 2262, 1951, 1765,
2188 1737, 1804, 1864, 1844, 1732, 1545, 1277, 892,
2189 383, 0, 0, 0, 479, 1933, 3751, 2856,
2190 2546, 2411, 2343, 2302, 2281, 2282, 2313, 2383,
2191 2489, 2596, 2626, 2558, 2462, 2398, 2382, 2409,
2192 2471, 2548, 2614, 2662, 2712, 2794, 2912, 3014,
2193 3002, 2872, 2730, 2651, 2655, 2764, 3057, 3829,
2194 2767, 1607, 736, 79, 241, 388, 280, 179,
2195 1024, 1882, 2507, 2783, 2752, 2559, 2345, 2185
2196 }
2197};
diff --git a/keyboards/planck/light/config.h b/keyboards/planck/light/config.h
index c7bc9cb1a..c570ec766 100644
--- a/keyboards/planck/light/config.h
+++ b/keyboards/planck/light/config.h
@@ -15,8 +15,8 @@
15#define MATRIX_ROW_PINS { B0, E7, F0, F1 } 15#define MATRIX_ROW_PINS { B0, E7, F0, F1 }
16#define MATRIX_COL_PINS { E6, E3, E4, D3, D4, D5, C0, A7, A6, E1, E0, D7 } 16#define MATRIX_COL_PINS { E6, E3, E4, D3, D4, D5, C0, A7, A6, E1, E0, D7 }
17 17
18#define C6_AUDIO 18#define AUDIO_PIN C6
19#define B5_AUDIO 19#define AUDIO_PIN_ALT B5
20 20
21#undef BACKLIGHT_PIN 21#undef BACKLIGHT_PIN
22 22
diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h
index f60b0ec2e..055610c69 100644
--- a/keyboards/planck/rev6/config.h
+++ b/keyboards/planck/rev6/config.h
@@ -53,8 +53,10 @@
53 53
54#define MUSIC_MAP 54#define MUSIC_MAP
55#undef AUDIO_VOICES 55#undef AUDIO_VOICES
56// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related 56#undef AUDIO_PIN
57#undef C6_AUDIO 57#define AUDIO_PIN A5
58#define AUDIO_PIN_ALT A4
59#define AUDIO_PIN_ALT_AS_NEGATIVE
58 60
59/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 61/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
60// #define DEBOUNCE 6 62// #define DEBOUNCE 6
diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h
index c4aa5805d..f08be58c6 100644
--- a/keyboards/preonic/config.h
+++ b/keyboards/preonic/config.h
@@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
41#define QMK_SPEAKER C6 41#define QMK_SPEAKER C6
42 42
43#define AUDIO_VOICES 43#define AUDIO_VOICES
44#define C6_AUDIO 44#define AUDIO_PIN C6
45 45
46#define BACKLIGHT_PIN B7 46#define BACKLIGHT_PIN B7
47 47
diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h
index 773a9c5fb..e8b09e848 100644
--- a/keyboards/preonic/rev3/config.h
+++ b/keyboards/preonic/rev3/config.h
@@ -40,8 +40,10 @@
40 40
41#define MUSIC_MAP 41#define MUSIC_MAP
42#undef AUDIO_VOICES 42#undef AUDIO_VOICES
43// Note: following undef isn't really necessary on STM32, C6_AUDIO is AVR related 43#undef AUDIO_PIN
44#undef C6_AUDIO 44#define AUDIO_PIN A5
45#define AUDIO_PIN_ALT A4
46#define AUDIO_PIN_ALT_AS_NEGATIVE
45 47
46/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 48/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
47// #define DEBOUNCE 6 49// #define DEBOUNCE 6
diff --git a/keyboards/scarletbandana/config.h b/keyboards/scarletbandana/config.h
index 38a15f676..b9c8dd9b0 100644
--- a/keyboards/scarletbandana/config.h
+++ b/keyboards/scarletbandana/config.h
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
45#define QMK_SPEAKER C6 45#define QMK_SPEAKER C6
46 46
47#ifdef AUDIO_ENABLE 47#ifdef AUDIO_ENABLE
48#define C6_AUDIO 48#define AUDIO_PIN C6
49#define STARTUP_SONG SONG(PREONIC_SOUND) 49#define STARTUP_SONG SONG(PREONIC_SOUND)
50// Disable music mode to keep the firmware size down 50// Disable music mode to keep the firmware size down
51#define NO_MUSIC_MODE 51#define NO_MUSIC_MODE
diff --git a/keyboards/silverbullet44/config.h b/keyboards/silverbullet44/config.h
index dfd5e0aa9..cd78ef341 100644
--- a/keyboards/silverbullet44/config.h
+++ b/keyboards/silverbullet44/config.h
@@ -111,7 +111,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
111 111
112/* Audio */ 112/* Audio */
113#ifdef AUDIO_ENABLE 113#ifdef AUDIO_ENABLE
114 #define B6_AUDIO 114 #define AUDIO_PIN B6
115 #define STARTUP_SONG SONG(STARTUP_SOUND) 115 #define STARTUP_SONG SONG(STARTUP_SOUND)
116 #define AUDIO_CLICKY 116 #define AUDIO_CLICKY
117 #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f 117 #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f
diff --git a/keyboards/splitkb/zima/config.h b/keyboards/splitkb/zima/config.h
index b39ef7308..fcfa37ff3 100644
--- a/keyboards/splitkb/zima/config.h
+++ b/keyboards/splitkb/zima/config.h
@@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
49// #define QMK_ESC_INPUT C6 49// #define QMK_ESC_INPUT C6
50// #define QMK_SPEAKER B6 50// #define QMK_SPEAKER B6
51 51
52#define B6_AUDIO 52#define AUDIO_PIN B6
53#define AUDIO_CLICKY 53#define AUDIO_CLICKY
54#define NO_MUSIC_MODE 54#define NO_MUSIC_MODE
55 55
diff --git a/keyboards/subatomic/config.h b/keyboards/subatomic/config.h
index db65287fc..b19339ad6 100644
--- a/keyboards/subatomic/config.h
+++ b/keyboards/subatomic/config.h
@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37#define UNUSED_PINS 37#define UNUSED_PINS
38 38
39// #define AUDIO_VOICES 39// #define AUDIO_VOICES
40// #define C6_AUDIO 40// #define AUDIO_PIN C6
41 41
42#define BACKLIGHT_PIN B7 42#define BACKLIGHT_PIN B7
43 43
diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h
index a38c3a8d4..1f13f5f16 100755
--- a/keyboards/tetris/config.h
+++ b/keyboards/tetris/config.h
@@ -34,7 +34,7 @@
34#define NO_ACTION_FUNCTION 34#define NO_ACTION_FUNCTION
35 35
36#ifdef AUDIO_ENABLE 36#ifdef AUDIO_ENABLE
37 #define B5_AUDIO 37 #define AUDIO_PIN B5
38 #define STARTUP_SONG SONG(ONE_UP_SOUND) 38 #define STARTUP_SONG SONG(ONE_UP_SOUND)
39 #define NO_MUSIC_MODE 39 #define NO_MUSIC_MODE
40#endif 40#endif
diff --git a/keyboards/vitamins_included/rev1/config.h b/keyboards/vitamins_included/rev1/config.h
index ff0c6bcb5..e8390aa27 100644
--- a/keyboards/vitamins_included/rev1/config.h
+++ b/keyboards/vitamins_included/rev1/config.h
@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
61 61
62/* Audio settings */ 62/* Audio settings */
63#ifdef AUDIO_ENABLE 63#ifdef AUDIO_ENABLE
64 #define C6_AUDIO // Define this to enable the buzzer 64 #define AUDIO_PIN C6 // Define this to enable the buzzer
65#endif 65#endif
66 66
67/* 67/*
diff --git a/keyboards/vitamins_included/rev2/config.h b/keyboards/vitamins_included/rev2/config.h
index ebbbc15ea..8bf640f0b 100644
--- a/keyboards/vitamins_included/rev2/config.h
+++ b/keyboards/vitamins_included/rev2/config.h
@@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
61 61
62/* Audio settings */ 62/* Audio settings */
63#ifdef AUDIO_ENABLE 63#ifdef AUDIO_ENABLE
64 #define C6_AUDIO // Define this to enable the buzzer 64 #define AUDIO_PIN C6 // Define this to enable the buzzer
65#endif 65#endif
66 66
67#define QMK_ESC_OUTPUT F1 // usually COL 67#define QMK_ESC_OUTPUT F1 // usually COL
diff --git a/keyboards/wilba_tech/wt60_xt/config.h b/keyboards/wilba_tech/wt60_xt/config.h
index 6ddad99df..5914e59fd 100644
--- a/keyboards/wilba_tech/wt60_xt/config.h
+++ b/keyboards/wilba_tech/wt60_xt/config.h
@@ -25,7 +25,7 @@
25#define MANUFACTURER wilba.tech 25#define MANUFACTURER wilba.tech
26#define PRODUCT wilba.tech WT60-XT 26#define PRODUCT wilba.tech WT60-XT
27 27
28#define C6_AUDIO 28#define AUDIO_PIN C6
29#define AUDIO_CLICKY 29#define AUDIO_CLICKY
30 30
31/* key matrix size */ 31/* key matrix size */
diff --git a/keyboards/yoichiro/lunakey_mini/config.h b/keyboards/yoichiro/lunakey_mini/config.h
index 86290cd4e..abbecef44 100644
--- a/keyboards/yoichiro/lunakey_mini/config.h
+++ b/keyboards/yoichiro/lunakey_mini/config.h
@@ -89,7 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
89#endif 89#endif
90 90
91/* Audio Support */ 91/* Audio Support */
92#define C6_AUDIO 92#define AUDIO_PIN C6
93 93
94/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 94/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
95#define DEBOUNCE 5 95#define DEBOUNCE 5
diff --git a/layouts/community/numpad_5x6/bjohnson/config.h b/layouts/community/numpad_5x6/bjohnson/config.h
index 668450d88..6f1c53970 100644
--- a/layouts/community/numpad_5x6/bjohnson/config.h
+++ b/layouts/community/numpad_5x6/bjohnson/config.h
@@ -1,7 +1,5 @@
1#pragma once 1#pragma once
2 2
3// #define B6_AUDIO
4
5#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) 3#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
6#define RGB_DI_PIN B7 4#define RGB_DI_PIN B7
7#define RGBLED_NUM 13 // Number of LEDs 5#define RGBLED_NUM 13 // Number of LEDs
diff --git a/layouts/community/numpad_5x6/drashna/config.h b/layouts/community/numpad_5x6/drashna/config.h
index 97c1170d7..1f485e193 100644
--- a/layouts/community/numpad_5x6/drashna/config.h
+++ b/layouts/community/numpad_5x6/drashna/config.h
@@ -16,7 +16,6 @@
16 16
17#pragma once 17#pragma once
18 18
19// #define B6_AUDIO
20 19
21#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) 20#if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM)
22# define RGB_DI_PIN B1 21# define RGB_DI_PIN B1
diff --git a/layouts/community/ortho_4x12/bakingpy/config.h b/layouts/community/ortho_4x12/bakingpy/config.h
index a153adffb..f7d2c2425 100644
--- a/layouts/community/ortho_4x12/bakingpy/config.h
+++ b/layouts/community/ortho_4x12/bakingpy/config.h
@@ -16,5 +16,5 @@
16#define RGBLIGHT_VAL_STEP 8 16#define RGBLIGHT_VAL_STEP 8
17 17
18#ifdef AUDIO_ENABLE 18#ifdef AUDIO_ENABLE
19#define C6_AUDIO 19#define AUDIO_PIN C6
20#endif 20#endif
diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h
index 76bd642a3..619b460a7 100644
--- a/layouts/community/ortho_5x12/drashna/config.h
+++ b/layouts/community/ortho_5x12/drashna/config.h
@@ -33,6 +33,6 @@
33 33
34# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 34# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3
35# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 35# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14
36# define B7_AUDIO 36# define AUDIO_PIN B7
37# define NO_MUSIC_MODE 37# define NO_MUSIC_MODE
38#endif 38#endif
diff --git a/layouts/community/ortho_5x14/yet-another-developer/config.h b/layouts/community/ortho_5x14/yet-another-developer/config.h
index 7504338ff..3f8dbd3c5 100644
--- a/layouts/community/ortho_5x14/yet-another-developer/config.h
+++ b/layouts/community/ortho_5x14/yet-another-developer/config.h
@@ -17,6 +17,6 @@
17 17
18# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3 18# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3
19# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14 19# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14
20# define B7_AUDIO 20# define AUDIO_PIN B7
21# define NO_MUSIC_MODE 21# define NO_MUSIC_MODE
22#endif 22#endif
diff --git a/layouts/community/split_3x6_3/drashna/config.h b/layouts/community/split_3x6_3/drashna/config.h
index b9b1d073d..17d7b9ec7 100644
--- a/layouts/community/split_3x6_3/drashna/config.h
+++ b/layouts/community/split_3x6_3/drashna/config.h
@@ -74,7 +74,7 @@
74#endif 74#endif
75 75
76#ifdef AUDIO_ENABLE 76#ifdef AUDIO_ENABLE
77# define B6_AUDIO 77# define AUDIO_PIN B6
78# define NO_MUSIC_MODE 78# define NO_MUSIC_MODE
79#endif 79#endif
80 80
diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c
new file mode 100644
index 000000000..46277dd70
--- /dev/null
+++ b/quantum/audio/audio.c
@@ -0,0 +1,539 @@
1/* Copyright 2016-2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#include "audio.h"
18#include "eeconfig.h"
19#include "timer.h"
20#include "wait.h"
21
22/* audio system:
23 *
24 * audio.[ch] takes care of all overall state, tracking the actively playing
25 * notes/tones; the notes a SONG consists of;
26 * ...
27 * = everything audio-related that is platform agnostic
28 *
29 * driver_[avr|chibios]_[dac|pwm] take care of the lower hardware dependent parts,
30 * specific to each platform and the used subsystem/driver to drive
31 * the output pins/channels with the calculated frequencies for each
32 * active tone
33 * as part of this, the driver has to trigger regular state updates by
34 * calling 'audio_update_state' through some sort of timer - be it a
35 * dedicated one or piggybacking on for example the timer used to
36 * generate a pwm signal/clock.
37 *
38 *
39 * A Note on terminology:
40 * tone, pitch and frequency are used somewhat interchangeably, in a strict Wikipedia-sense:
41 * "(Musical) tone, a sound characterized by its duration, pitch (=frequency),
42 * intensity (=volume), and timbre"
43 * - intensity/volume is currently not handled at all, although the 'dac_additive' driver could do so
44 * - timbre is handled globally (TODO: only used with the pwm drivers at the moment)
45 *
46 * in musical_note.h a 'note' is the combination of a pitch and a duration
47 * these are used to create SONG arrays; during playback their frequencies
48 * are handled as single successive tones, while the durations are
49 * kept track of in 'audio_update_state'
50 *
51 * 'voice' as it is used here, equates to a sort of instrument with its own
52 * characteristics sound and effects
53 * the audio system as-is deals only with (possibly multiple) tones of one
54 * instrument/voice at a time (think: chords). since the number of tones that
55 * can be reproduced depends on the hardware/driver in use: pwm can only
56 * reproduce one tone per output/speaker; DACs can reproduce/mix multiple
57 * when doing additive synthesis.
58 *
59 * 'duration' can either be in the beats-per-minute related unit found in
60 * musical_notes.h, OR in ms; keyboards create SONGs with the former, while
61 * the internal state of the audio system does its calculations with the later - ms
62 */
63
64#ifndef AUDIO_TONE_STACKSIZE
65# define AUDIO_TONE_STACKSIZE 8
66#endif
67uint8_t active_tones = 0; // number of tones pushed onto the stack by audio_play_tone - might be more than the hardware is able to reproduce at any single time
68musical_tone_t tones[AUDIO_TONE_STACKSIZE]; // stack of currently active tones
69
70bool playing_melody = false; // playing a SONG?
71bool playing_note = false; // or (possibly multiple simultaneous) tones
72bool state_changed = false; // global flag, which is set if anything changes with the active_tones
73
74// melody/SONG related state variables
75float (*notes_pointer)[][2]; // SONG, an array of MUSICAL_NOTEs
76uint16_t notes_count; // length of the notes_pointer array
77bool notes_repeat; // PLAY_SONG or PLAY_LOOP?
78uint16_t melody_current_note_duration = 0; // duration of the currently playing note from the active melody, in ms
79uint8_t note_tempo = TEMPO_DEFAULT; // beats-per-minute
80uint16_t current_note = 0; // index into the array at notes_pointer
81bool note_resting = false; // if a short pause was introduced between two notes with the same frequency while playing a melody
82uint16_t last_timestamp = 0;
83
84#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
85# ifndef AUDIO_MAX_SIMULTANEOUS_TONES
86# define AUDIO_MAX_SIMULTANEOUS_TONES 3
87# endif
88uint16_t tone_multiplexing_rate = AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT;
89uint8_t tone_multiplexing_index_shift = 0; // offset used on active-tone array access
90#endif
91
92// provided and used by voices.c
93extern uint8_t note_timbre;
94extern bool glissando;
95extern bool vibrato;
96extern uint16_t voices_timer;
97
98#ifndef STARTUP_SONG
99# define STARTUP_SONG SONG(STARTUP_SOUND)
100#endif
101#ifndef AUDIO_ON_SONG
102# define AUDIO_ON_SONG SONG(AUDIO_ON_SOUND)
103#endif
104#ifndef AUDIO_OFF_SONG
105# define AUDIO_OFF_SONG SONG(AUDIO_OFF_SOUND)
106#endif
107float startup_song[][2] = STARTUP_SONG;
108float audio_on_song[][2] = AUDIO_ON_SONG;
109float audio_off_song[][2] = AUDIO_OFF_SONG;
110
111static bool audio_initialized = false;
112static bool audio_driver_stopped = true;
113audio_config_t audio_config;
114
115void audio_init() {
116 if (audio_initialized) {
117 return;
118 }
119
120 // Check EEPROM
121#ifdef EEPROM_ENABLE
122 if (!eeconfig_is_enabled()) {
123 eeconfig_init();
124 }
125 audio_config.raw = eeconfig_read_audio();
126#else // EEPROM settings
127 audio_config.enable = true;
128# ifdef AUDIO_CLICKY_ON
129 audio_config.clicky_enable = true;
130# endif
131#endif // EEPROM settings
132
133 for (uint8_t i = 0; i < AUDIO_TONE_STACKSIZE; i++) {
134 tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0};
135 }
136
137 if (!audio_initialized) {
138 audio_driver_initialize();
139 audio_initialized = true;
140 }
141 stop_all_notes();
142}
143
144void audio_startup(void) {
145 if (audio_config.enable) {
146 PLAY_SONG(startup_song);
147 }
148
149 last_timestamp = timer_read();
150}
151
152void audio_toggle(void) {
153 if (audio_config.enable) {
154 stop_all_notes();
155 }
156 audio_config.enable ^= 1;
157 eeconfig_update_audio(audio_config.raw);
158 if (audio_config.enable) {
159 audio_on_user();
160 }
161}
162
163void audio_on(void) {
164 audio_config.enable = 1;
165 eeconfig_update_audio(audio_config.raw);
166 audio_on_user();
167 PLAY_SONG(audio_on_song);
168}
169
170void audio_off(void) {
171 PLAY_SONG(audio_off_song);
172 wait_ms(100);
173 audio_stop_all();
174 audio_config.enable = 0;
175 eeconfig_update_audio(audio_config.raw);
176}
177
178bool audio_is_on(void) { return (audio_config.enable != 0); }
179
180void audio_stop_all() {
181 if (audio_driver_stopped) {
182 return;
183 }
184
185 active_tones = 0;
186
187 audio_driver_stop();
188
189 playing_melody = false;
190 playing_note = false;
191
192 melody_current_note_duration = 0;
193
194 for (uint8_t i = 0; i < AUDIO_TONE_STACKSIZE; i++) {
195 tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0};
196 }
197
198 audio_driver_stopped = true;
199}
200
201void audio_stop_tone(float pitch) {
202 if (pitch < 0.0f) {
203 pitch = -1 * pitch;
204 }
205
206 if (playing_note) {
207 if (!audio_initialized) {
208 audio_init();
209 }
210 bool found = false;
211 for (int i = AUDIO_TONE_STACKSIZE - 1; i >= 0; i--) {
212 found = (tones[i].pitch == pitch);
213 if (found) {
214 tones[i] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0};
215 for (int j = i; (j < AUDIO_TONE_STACKSIZE - 1); j++) {
216 tones[j] = tones[j + 1];
217 tones[j + 1] = (musical_tone_t){.time_started = 0, .pitch = -1.0f, .duration = 0};
218 }
219 break;
220 }
221 }
222 if (!found) {
223 return;
224 }
225
226 state_changed = true;
227 active_tones--;
228 if (active_tones < 0) active_tones = 0;
229#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
230 if (tone_multiplexing_index_shift >= active_tones) {
231 tone_multiplexing_index_shift = 0;
232 }
233#endif
234 if (active_tones == 0) {
235 audio_driver_stop();
236 audio_driver_stopped = true;
237 playing_note = false;
238 }
239 }
240}
241
242void audio_play_note(float pitch, uint16_t duration) {
243 if (!audio_config.enable) {
244 return;
245 }
246
247 if (!audio_initialized) {
248 audio_init();
249 }
250
251 if (pitch < 0.0f) {
252 pitch = -1 * pitch;
253 }
254
255 // round-robin: shifting out old tones, keeping only unique ones
256 // if the new frequency is already amongst the active tones, shift it to the top of the stack
257 bool found = false;
258 for (int i = active_tones - 1; i >= 0; i--) {
259 found = (tones[i].pitch == pitch);
260 if (found) {
261 for (int j = i; (j < active_tones - 1); j++) {
262 tones[j] = tones[j + 1];
263 tones[j + 1] = (musical_tone_t){.time_started = timer_read(), .pitch = pitch, .duration = duration};
264 }
265 return; // since this frequency played already, the hardware was already started
266 }
267 }
268
269 // frequency/tone is actually new, so we put it on the top of the stack
270 active_tones++;
271 if (active_tones > AUDIO_TONE_STACKSIZE) {
272 active_tones = AUDIO_TONE_STACKSIZE;
273 // shift out the oldest tone to make room
274 for (int i = 0; i < active_tones - 1; i++) {
275 tones[i] = tones[i + 1];
276 }
277 }
278 state_changed = true;
279 playing_note = true;
280 tones[active_tones - 1] = (musical_tone_t){.time_started = timer_read(), .pitch = pitch, .duration = duration};
281
282 // TODO: needs to be handled per note/tone -> use its timestamp instead?
283 voices_timer = timer_read(); // reset to zero, for the effects added by voices.c
284
285 if (audio_driver_stopped) {
286 audio_driver_start();
287 audio_driver_stopped = false;
288 }
289}
290
291void audio_play_tone(float pitch) { audio_play_note(pitch, 0xffff); }
292
293void audio_play_melody(float (*np)[][2], uint16_t n_count, bool n_repeat) {
294 if (!audio_config.enable) {
295 audio_stop_all();
296 return;
297 }
298
299 if (!audio_initialized) {
300 audio_init();
301 }
302
303 // Cancel note if a note is playing
304 if (playing_note) audio_stop_all();
305
306 playing_melody = true;
307 note_resting = false;
308
309 notes_pointer = np;
310 notes_count = n_count;
311 notes_repeat = n_repeat;
312
313 current_note = 0; // note in the melody-array/list at note_pointer
314
315 // start first note manually, which also starts the audio_driver
316 // all following/remaining notes are played by 'audio_update_state'
317 audio_play_note((*notes_pointer)[current_note][0], audio_duration_to_ms((*notes_pointer)[current_note][1]));
318 last_timestamp = timer_read();
319 melody_current_note_duration = audio_duration_to_ms((*notes_pointer)[current_note][1]);
320}
321
322float click[2][2];
323void audio_play_click(uint16_t delay, float pitch, uint16_t duration) {
324 uint16_t duration_tone = audio_ms_to_duration(duration);
325 uint16_t duration_delay = audio_ms_to_duration(delay);
326
327 if (delay <= 0.0f) {
328 click[0][0] = pitch;
329 click[0][1] = duration_tone;
330 click[1][0] = 0.0f;
331 click[1][1] = 0.0f;
332 audio_play_melody(&click, 1, false);
333 } else {
334 // first note is a rest/pause
335 click[0][0] = 0.0f;
336 click[0][1] = duration_delay;
337 // second note is the actual click
338 click[1][0] = pitch;
339 click[1][1] = duration_tone;
340 audio_play_melody(&click, 2, false);
341 }
342}
343
344bool audio_is_playing_note(void) { return playing_note; }
345
346bool audio_is_playing_melody(void) { return playing_melody; }
347
348uint8_t audio_get_number_of_active_tones(void) { return active_tones; }
349
350float audio_get_frequency(uint8_t tone_index) {
351 if (tone_index >= active_tones) {
352 return 0.0f;
353 }
354 return tones[active_tones - tone_index - 1].pitch;
355}
356
357float audio_get_processed_frequency(uint8_t tone_index) {
358 if (tone_index >= active_tones) {
359 return 0.0f;
360 }
361
362 int8_t index = active_tones - tone_index - 1;
363 // new tones are stacked on top (= appended at the end), so the most recent/current is MAX-1
364
365#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
366 index = index - tone_multiplexing_index_shift;
367 if (index < 0) // wrap around
368 index += active_tones;
369#endif
370
371 if (tones[index].pitch <= 0.0f) {
372 return 0.0f;
373 }
374
375 return voice_envelope(tones[index].pitch);
376}
377
378bool audio_update_state(void) {
379 if (!playing_note && !playing_melody) {
380 return false;
381 }
382
383 bool goto_next_note = false;
384 uint16_t current_time = timer_read();
385
386 if (playing_melody) {
387 goto_next_note = timer_elapsed(last_timestamp) >= melody_current_note_duration;
388 if (goto_next_note) {
389 uint16_t delta = timer_elapsed(last_timestamp) - melody_current_note_duration;
390 last_timestamp = current_time;
391 uint16_t previous_note = current_note;
392 current_note++;
393 voices_timer = timer_read(); // reset to zero, for the effects added by voices.c
394
395 if (current_note >= notes_count) {
396 if (notes_repeat) {
397 current_note = 0;
398 } else {
399 audio_stop_all();
400 return false;
401 }
402 }
403
404 if (!note_resting && (*notes_pointer)[previous_note][0] == (*notes_pointer)[current_note][0]) {
405 note_resting = true;
406
407 // special handling for successive notes of the same frequency:
408 // insert a short pause to separate them audibly
409 audio_play_note(0.0f, audio_duration_to_ms(2));
410 current_note = previous_note;
411 melody_current_note_duration = audio_duration_to_ms(2);
412
413 } else {
414 note_resting = false;
415
416 // TODO: handle glissando here (or remember previous and current tone)
417 /* there would need to be a freq(here we are) -> freq(next note)
418 * and do slide/glissando in between problem here is to know which
419 * frequency on the stack relates to what other? e.g. a melody starts
420 * tones in a sequence, and stops expiring one, so the most recently
421 * stopped is the starting point for a glissando to the most recently started?
422 * how to detect and preserve this relation?
423 * and what about user input, chords, ...?
424 */
425
426 // '- delta': Skip forward in the next note's length if we've over shot
427 // the last, so the overall length of the song is the same
428 uint16_t duration = audio_duration_to_ms((*notes_pointer)[current_note][1]);
429
430 // Skip forward past any completely missed notes
431 while (delta > duration && current_note < notes_count - 1) {
432 delta -= duration;
433 current_note++;
434 duration = audio_duration_to_ms((*notes_pointer)[current_note][1]);
435 }
436
437 if (delta < duration) {
438 duration -= delta;
439 } else {
440 // Only way to get here is if it is the last note and
441 // we have completely missed it. Play it for 1ms...
442 duration = 1;
443 }
444
445 audio_play_note((*notes_pointer)[current_note][0], duration);
446 melody_current_note_duration = duration;
447 }
448 }
449 }
450
451 if (playing_note) {
452#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
453 tone_multiplexing_index_shift = (int)(current_time / tone_multiplexing_rate) % MIN(AUDIO_MAX_SIMULTANEOUS_TONES, active_tones);
454 goto_next_note = true;
455#endif
456 if (vibrato || glissando) {
457 // force update on each cycle, since vibrato shifts the frequency slightly
458 goto_next_note = true;
459 }
460
461 // housekeeping: stop notes that have no playtime left
462 for (int i = 0; i < active_tones; i++) {
463 if ((tones[i].duration != 0xffff) // indefinitely playing notes, started by 'audio_play_tone'
464 && (tones[i].duration != 0) // 'uninitialized'
465 ) {
466 if (timer_elapsed(tones[i].time_started) >= tones[i].duration) {
467 audio_stop_tone(tones[i].pitch); // also sets 'state_changed=true'
468 }
469 }
470 }
471 }
472
473 // state-changes have a higher priority, always triggering the hardware to update
474 if (state_changed) {
475 state_changed = false;
476 return true;
477 }
478
479 return goto_next_note;
480}
481
482// Tone-multiplexing functions
483#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
484void audio_set_tone_multiplexing_rate(uint16_t rate) { tone_multiplexing_rate = rate; }
485void audio_enable_tone_multiplexing(void) { tone_multiplexing_rate = AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT; }
486void audio_disable_tone_multiplexing(void) { tone_multiplexing_rate = 0; }
487void audio_increase_tone_multiplexing_rate(uint16_t change) {
488 if ((0xffff - change) > tone_multiplexing_rate) {
489 tone_multiplexing_rate += change;
490 }
491}
492void audio_decrease_tone_multiplexing_rate(uint16_t change) {
493 if (change <= tone_multiplexing_rate) {
494 tone_multiplexing_rate -= change;
495 }
496}
497#endif
498
499// Tempo functions
500
501void audio_set_tempo(uint8_t tempo) {
502 if (tempo < 10) note_tempo = 10;
503 // else if (tempo > 250)
504 // note_tempo = 250;
505 else
506 note_tempo = tempo;
507}
508
509void audio_increase_tempo(uint8_t tempo_change) {
510 if (tempo_change > 255 - note_tempo)
511 note_tempo = 255;
512 else
513 note_tempo += tempo_change;
514}
515
516void audio_decrease_tempo(uint8_t tempo_change) {
517 if (tempo_change >= note_tempo - 10)
518 note_tempo = 10;
519 else
520 note_tempo -= tempo_change;
521}
522
523// TODO in the int-math version are some bugs; songs sometimes abruptly end - maybe an issue with the timer/system-tick wrapping around?
524uint16_t audio_duration_to_ms(uint16_t duration_bpm) {
525#if defined(__AVR__)
526 // doing int-math saves us some bytes in the overall firmware size, but the intermediate result is less accurate before being cast to/returned as uint
527 return ((uint32_t)duration_bpm * 60 * 1000) / (64 * note_tempo);
528 // NOTE: beware of uint16_t overflows when note_tempo is low and/or the duration is long
529#else
530 return ((float)duration_bpm * 60) / (64 * note_tempo) * 1000;
531#endif
532}
533uint16_t audio_ms_to_duration(uint16_t duration_ms) {
534#if defined(__AVR__)
535 return ((uint32_t)duration_ms * 64 * note_tempo) / 60 / 1000;
536#else
537 return ((float)duration_ms * 64 * note_tempo) / 60 / 1000;
538#endif
539}
diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h
index dccf03d5f..56b9158a1 100644
--- a/quantum/audio/audio.h
+++ b/quantum/audio/audio.h
@@ -1,4 +1,5 @@
1/* Copyright 2016 Jack Humbert 1/* Copyright 2016-2020 Jack Humbert
2 * Copyright 2020 JohSchneider
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -13,28 +14,30 @@
13 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 16 */
16
17#pragma once 17#pragma once
18 18
19#include <stdint.h> 19#include <stdint.h>
20#include <stdbool.h> 20#include <stdbool.h>
21#if defined(__AVR__)
22# include <avr/io.h>
23#endif
24#include "wait.h"
25#include "musical_notes.h" 21#include "musical_notes.h"
26#include "song_list.h" 22#include "song_list.h"
27#include "voices.h" 23#include "voices.h"
28#include "quantum.h" 24#include "quantum.h"
29#include <math.h> 25#include <math.h>
30 26
31// Largely untested PWM audio mode (doesn't sound as good) 27#if defined(__AVR__)
32// #define PWM_AUDIO 28# include <avr/io.h>
33 29# if defined(AUDIO_DRIVER_PWM)
34// #define VIBRATO_ENABLE 30# include "driver_avr_pwm.h"
31# endif
32#endif
35 33
36// Enable vibrato strength/amplitude - slows down ISR too much 34#if defined(PROTOCOL_CHIBIOS)
37// #define VIBRATO_STRENGTH_ENABLE 35# if defined(AUDIO_DRIVER_PWM)
36# include "driver_chibios_pwm.h"
37# elif defined(AUDIO_DRIVER_DAC)
38# include "driver_chibios_dac.h"
39# endif
40#endif
38 41
39typedef union { 42typedef union {
40 uint8_t raw; 43 uint8_t raw;
@@ -45,62 +48,238 @@ typedef union {
45 }; 48 };
46} audio_config_t; 49} audio_config_t;
47 50
48bool is_audio_on(void); 51// AVR/LUFA has a MIN, arm/chibios does not
52#ifndef MIN
53# define MIN(a, b) (((a) < (b)) ? (a) : (b))
54#endif
55
56/*
57 * a 'musical note' is represented by pitch and duration; a 'musical tone' adds intensity and timbre
58 * https://en.wikipedia.org/wiki/Musical_tone
59 * "A musical tone is characterized by its duration, pitch, intensity (or loudness), and timbre (or quality)"
60 */
61typedef struct {
62 uint16_t time_started; // timestamp the tone/note was started, system time runs with 1ms resolution -> 16bit timer overflows every ~64 seconds, long enough under normal circumstances; but might be too soon for long-duration notes when the note_tempo is set to a very low value
63 float pitch; // aka frequency, in Hz
64 uint16_t duration; // in ms, converted from the musical_notes.h unit which has 64parts to a beat, factoring in the current tempo in beats-per-minute
65 // float intensity; // aka volume [0,1] TODO: not used at the moment; pwm drivers can't handle it
66 // uint8_t timbre; // range: [0,100] TODO: this currently kept track of globally, should we do this per tone instead?
67} musical_tone_t;
68
69// public interface
70
71/**
72 * @brief one-time initialization called by quantum/quantum.c
73 * @details usually done lazy, when some tones are to be played
74 *
75 * @post audio system (and hardware) initialized and ready to play tones
76 */
77void audio_init(void);
78void audio_startup(void);
79
80/**
81 * @brief en-/disable audio output, save this choice to the eeprom
82 */
49void audio_toggle(void); 83void audio_toggle(void);
84/**
85 * @brief enable audio output, save this choice to the eeprom
86 */
50void audio_on(void); 87void audio_on(void);
88/**
89 * @brief disable audio output, save this choice to the eeprom
90 */
51void audio_off(void); 91void audio_off(void);
92/**
93 * @brief query the if audio output is enabled
94 */
95bool audio_is_on(void);
52 96
53// Vibrato rate functions 97/**
98 * @brief start playback of a tone with the given frequency and duration
99 *
100 * @details starts the playback of a given note, which is automatically stopped
101 * at the the end of its duration = fire&forget
102 *
103 * @param[in] pitch frequency of the tone be played
104 * @param[in] duration in milliseconds, use 'audio_duration_to_ms' to convert
105 * from the musical_notes.h unit to ms
106 */
107void audio_play_note(float pitch, uint16_t duration);
108// TODO: audio_play_note(float pitch, uint16_t duration, float intensity, float timbre);
109// audio_play_note_with_instrument ifdef AUDIO_ENABLE_VOICES
54 110
55#ifdef VIBRATO_ENABLE 111/**
112 * @brief start playback of a tone with the given frequency
113 *
114 * @details the 'frequency' is put on-top the internal stack of active tones,
115 * as a new tone with indefinite duration. this tone is played by
116 * the hardware until a call to 'audio_stop_tone'.
117 * should a tone with that frequency already be active, its entry
118 * is put on the top of said internal stack - so no duplicate
119 * entries are kept.
120 * 'hardware_start' is called upon the first note.
121 *
122 * @param[in] pitch frequency of the tone be played
123 */
124void audio_play_tone(float pitch);
56 125
57void set_vibrato_rate(float rate); 126/**
58void increase_vibrato_rate(float change); 127 * @brief stop a given tone/frequency
59void decrease_vibrato_rate(float change); 128 *
129 * @details removes a tone matching the given frequency from the internal
130 * playback stack
131 * the hardware is stopped in case this was the last/only frequency
132 * being played.
133 *
134 * @param[in] pitch tone/frequency to be stopped
135 */
136void audio_stop_tone(float pitch);
60 137
61# ifdef VIBRATO_STRENGTH_ENABLE 138/**
139 * @brief play a melody
140 *
141 * @details starts playback of a melody passed in from a SONG definition - an
142 * array of {pitch, duration} float-tuples
143 *
144 * @param[in] np note-pointer to the SONG array
145 * @param[in] n_count number of MUSICAL_NOTES of the SONG
146 * @param[in] n_repeat false for onetime, true for looped playback
147 */
148void audio_play_melody(float (*np)[][2], uint16_t n_count, bool n_repeat);
62 149
63void set_vibrato_strength(float strength); 150/**
64void increase_vibrato_strength(float change); 151 * @brief play a short tone of a specific frequency to emulate a 'click'
65void decrease_vibrato_strength(float change); 152 *
153 * @details constructs a two-note melody (one pause plus a note) and plays it through
154 * audio_play_melody. very short durations might not quite work due to
155 * hardware limitations (DAC: added pulses from zero-crossing feature;...)
156 *
157 * @param[in] delay in milliseconds, length for the pause before the pulses, can be zero
158 * @param[in] pitch
159 * @param[in] duration in milliseconds, length of the 'click'
160 */
161void audio_play_click(uint16_t delay, float pitch, uint16_t duration);
66 162
67# endif 163/**
164 * @brief stops all playback
165 *
166 * @details stops playback of both a melody as well as single tones, resetting
167 * the internal state
168 */
169void audio_stop_all(void);
68 170
69#endif 171/**
172 * @brief query if one/multiple tones are playing
173 */
174bool audio_is_playing_note(void);
70 175
71// Polyphony functions 176/**
177 * @brief query if a melody/SONG is playing
178 */
179bool audio_is_playing_melody(void);
72 180
73void set_polyphony_rate(float rate); 181// These macros are used to allow audio_play_melody to play an array of indeterminate
74void enable_polyphony(void); 182// length. This works around the limitation of C's sizeof operation on pointers.
75void disable_polyphony(void); 183// The global float array for the song must be used here.
76void increase_polyphony_rate(float change); 184#define NOTE_ARRAY_SIZE(x) ((int16_t)(sizeof(x) / (sizeof(x[0]))))
77void decrease_polyphony_rate(float change);
78 185
79void set_timbre(float timbre); 186/**
80void set_tempo(uint8_t tempo); 187 * @brief convenience macro, to play a melody/SONG once
188 */
189#define PLAY_SONG(note_array) audio_play_melody(&note_array, NOTE_ARRAY_SIZE((note_array)), false)
190// TODO: a 'song' is a melody plus singing/vocals -> PLAY_MELODY
191/**
192 * @brief convenience macro, to play a melody/SONG in a loop, until stopped by 'audio_stop_all'
193 */
194#define PLAY_LOOP(note_array) audio_play_melody(&note_array, NOTE_ARRAY_SIZE((note_array)), true)
81 195
82void increase_tempo(uint8_t tempo_change); 196// Tone-Multiplexing functions
83void decrease_tempo(uint8_t tempo_change); 197// this feature only makes sense for hardware setups which can't do proper
198// audio-wave synthesis = have no DAC and need to use PWM for tone generation
199#ifdef AUDIO_ENABLE_TONE_MULTIPLEXING
200# ifndef AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT
201# define AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT 0
202// 0=off, good starting value is 4; the lower the value the higher the cpu-load
203# endif
204void audio_set_tone_multiplexing_rate(uint16_t rate);
205void audio_enable_tone_multiplexing(void);
206void audio_disable_tone_multiplexing(void);
207void audio_increase_tone_multiplexing_rate(uint16_t change);
208void audio_decrease_tone_multiplexing_rate(uint16_t change);
209#endif
210
211// Tempo functions
212
213void audio_set_tempo(uint8_t tempo);
214void audio_increase_tempo(uint8_t tempo_change);
215void audio_decrease_tempo(uint8_t tempo_change);
216
217// conversion macros, from 64parts-to-a-beat to milliseconds and back
218uint16_t audio_duration_to_ms(uint16_t duration_bpm);
219uint16_t audio_ms_to_duration(uint16_t duration_ms);
84 220
85void audio_init(void);
86void audio_startup(void); 221void audio_startup(void);
87 222
88#ifdef PWM_AUDIO 223// hardware interface
89void play_sample(uint8_t* s, uint16_t l, bool r);
90#endif
91void play_note(float freq, int vol);
92void stop_note(float freq);
93void stop_all_notes(void);
94void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat);
95 224
96#define SCALE \ 225// implementation in the driver_avr/arm_* respective parts
97 (int8_t[]) { 0 + (12 * 0), 2 + (12 * 0), 4 + (12 * 0), 5 + (12 * 0), 7 + (12 * 0), 9 + (12 * 0), 11 + (12 * 0), 0 + (12 * 1), 2 + (12 * 1), 4 + (12 * 1), 5 + (12 * 1), 7 + (12 * 1), 9 + (12 * 1), 11 + (12 * 1), 0 + (12 * 2), 2 + (12 * 2), 4 + (12 * 2), 5 + (12 * 2), 7 + (12 * 2), 9 + (12 * 2), 11 + (12 * 2), 0 + (12 * 3), 2 + (12 * 3), 4 + (12 * 3), 5 + (12 * 3), 7 + (12 * 3), 9 + (12 * 3), 11 + (12 * 3), 0 + (12 * 4), 2 + (12 * 4), 4 + (12 * 4), 5 + (12 * 4), 7 + (12 * 4), 9 + (12 * 4), 11 + (12 * 4), } 226void audio_driver_initialize(void);
227void audio_driver_start(void);
228void audio_driver_stop(void);
98 229
99// These macros are used to allow play_notes to play an array of indeterminate 230/**
100// length. This works around the limitation of C's sizeof operation on pointers. 231 * @brief get the number of currently active tones
101// The global float array for the song must be used here. 232 * @return number, 0=none active
102#define NOTE_ARRAY_SIZE(x) ((int16_t)(sizeof(x) / (sizeof(x[0])))) 233 */
103#define PLAY_SONG(note_array) play_notes(&note_array, NOTE_ARRAY_SIZE((note_array)), false) 234uint8_t audio_get_number_of_active_tones(void);
104#define PLAY_LOOP(note_array) play_notes(&note_array, NOTE_ARRAY_SIZE((note_array)), true) 235
236/**
237 * @brief access to the raw/unprocessed frequency for a specific tone
238 * @details each active tone has a frequency associated with it, which
239 * the internal state keeps track of, and is usually influenced
240 * by various effects
241 * @param[in] tone_index, ranging from 0 to number_of_active_tones-1, with the
242 * first being the most recent and each increment yielding the next
243 * older one
244 * @return a positive frequency, in Hz; or zero if the tone is a pause
245 */
246float audio_get_frequency(uint8_t tone_index);
247
248/**
249 * @brief calculate and return the frequency for the requested tone
250 * @details effects like glissando, vibrato, ... are post-processed onto the
251 * each active tones 'base'-frequency; this function returns the
252 * post-processed result.
253 * @param[in] tone_index, ranging from 0 to number_of_active_tones-1, with the
254 * first being the most recent and each increment yielding the next
255 * older one
256 * @return a positive frequency, in Hz; or zero if the tone is a pause
257 */
258float audio_get_processed_frequency(uint8_t tone_index);
259
260/**
261 * @brief update audio internal state: currently playing and active tones,...
262 * @details This function is intended to be called by the audio-hardware
263 * specific implementation on a somewhat regular basis while a SONG
264 * or notes (pitch+duration) are playing to 'advance' the internal
265 * state (current playing notes, position in the melody, ...)
266 *
267 * @return true if something changed in the currently active tones, which the
268 * hardware might need to react to
269 */
270bool audio_update_state(void);
271
272// legacy and back-warts compatibility stuff
273
274#define is_audio_on() audio_is_on()
275#define is_playing_notes() audio_is_playing_melody()
276#define is_playing_note() audio_is_playing_note()
277#define stop_all_notes() audio_stop_all()
278#define stop_note(f) audio_stop_tone(f)
279#define play_note(f, v) audio_play_tone(f)
105 280
106bool is_playing_notes(void); 281#define set_timbre(t) voice_set_timbre(t)
282#define set_tempo(t) audio_set_tempo(t)
283#define increase_tempo(t) audio_increase_tempo(t)
284#define decrease_tempo(t) audio_decrease_tempo(t)
285// vibrato functions are not used in any keyboards
diff --git a/quantum/audio/audio_avr.c b/quantum/audio/audio_avr.c
deleted file mode 100644
index 1bac43bb4..000000000
--- a/quantum/audio/audio_avr.c
+++ /dev/null
@@ -1,812 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <stdio.h>
18#include <string.h>
19//#include <math.h>
20#if defined(__AVR__)
21# include <avr/pgmspace.h>
22# include <avr/interrupt.h>
23# include <avr/io.h>
24#endif
25#include "print.h"
26#include "audio.h"
27#include "keymap.h"
28#include "wait.h"
29
30#include "eeconfig.h"
31
32#define CPU_PRESCALER 8
33
34// -----------------------------------------------------------------------------
35// Timer Abstractions
36// -----------------------------------------------------------------------------
37
38// Currently we support timers 1 and 3 used at the sime time, channels A-C,
39// pins PB5, PB6, PB7, PC4, PC5, and PC6
40#if defined(C6_AUDIO)
41# define CPIN_AUDIO
42# define CPIN_SET_DIRECTION DDRC |= _BV(PORTC6);
43# define INIT_AUDIO_COUNTER_3 TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
44# define ENABLE_AUDIO_COUNTER_3_ISR TIMSK3 |= _BV(OCIE3A)
45# define DISABLE_AUDIO_COUNTER_3_ISR TIMSK3 &= ~_BV(OCIE3A)
46# define ENABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A |= _BV(COM3A1);
47# define DISABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
48# define TIMER_3_PERIOD ICR3
49# define TIMER_3_DUTY_CYCLE OCR3A
50# define TIMER3_AUDIO_vect TIMER3_COMPA_vect
51#endif
52#if defined(C5_AUDIO)
53# define CPIN_AUDIO
54# define CPIN_SET_DIRECTION DDRC |= _BV(PORTC5);
55# define INIT_AUDIO_COUNTER_3 TCCR3A = (0 << COM3B1) | (0 << COM3B0) | (1 << WGM31) | (0 << WGM30);
56# define ENABLE_AUDIO_COUNTER_3_ISR TIMSK3 |= _BV(OCIE3B)
57# define DISABLE_AUDIO_COUNTER_3_ISR TIMSK3 &= ~_BV(OCIE3B)
58# define ENABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A |= _BV(COM3B1);
59# define DISABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A &= ~(_BV(COM3B1) | _BV(COM3B0));
60# define TIMER_3_PERIOD ICR3
61# define TIMER_3_DUTY_CYCLE OCR3B
62# define TIMER3_AUDIO_vect TIMER3_COMPB_vect
63#endif
64#if defined(C4_AUDIO)
65# define CPIN_AUDIO
66# define CPIN_SET_DIRECTION DDRC |= _BV(PORTC4);
67# define INIT_AUDIO_COUNTER_3 TCCR3A = (0 << COM3C1) | (0 << COM3C0) | (1 << WGM31) | (0 << WGM30);
68# define ENABLE_AUDIO_COUNTER_3_ISR TIMSK3 |= _BV(OCIE3C)
69# define DISABLE_AUDIO_COUNTER_3_ISR TIMSK3 &= ~_BV(OCIE3C)
70# define ENABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A |= _BV(COM3C1);
71# define DISABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A &= ~(_BV(COM3C1) | _BV(COM3C0));
72# define TIMER_3_PERIOD ICR3
73# define TIMER_3_DUTY_CYCLE OCR3C
74# define TIMER3_AUDIO_vect TIMER3_COMPC_vect
75#endif
76
77#if defined(B5_AUDIO)
78# define BPIN_AUDIO
79# define BPIN_SET_DIRECTION DDRB |= _BV(PORTB5);
80# define INIT_AUDIO_COUNTER_1 TCCR1A = (0 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (0 << WGM10);
81# define ENABLE_AUDIO_COUNTER_1_ISR TIMSK1 |= _BV(OCIE1A)
82# define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1A)
83# define ENABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A |= _BV(COM1A1);
84# define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1A1) | _BV(COM1A0));
85# define TIMER_1_PERIOD ICR1
86# define TIMER_1_DUTY_CYCLE OCR1A
87# define TIMER1_AUDIO_vect TIMER1_COMPA_vect
88#endif
89#if defined(B6_AUDIO)
90# define BPIN_AUDIO
91# define BPIN_SET_DIRECTION DDRB |= _BV(PORTB6);
92# define INIT_AUDIO_COUNTER_1 TCCR1A = (0 << COM1B1) | (0 << COM1B0) | (1 << WGM11) | (0 << WGM10);
93# define ENABLE_AUDIO_COUNTER_1_ISR TIMSK1 |= _BV(OCIE1B)
94# define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1B)
95# define ENABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A |= _BV(COM1B1);
96# define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1B1) | _BV(COM1B0));
97# define TIMER_1_PERIOD ICR1
98# define TIMER_1_DUTY_CYCLE OCR1B
99# define TIMER1_AUDIO_vect TIMER1_COMPB_vect
100#endif
101#if defined(B7_AUDIO)
102# define BPIN_AUDIO
103# define BPIN_SET_DIRECTION DDRB |= _BV(PORTB7);
104# define INIT_AUDIO_COUNTER_1 TCCR1A = (0 << COM1C1) | (0 << COM1C0) | (1 << WGM11) | (0 << WGM10);
105# define ENABLE_AUDIO_COUNTER_1_ISR TIMSK1 |= _BV(OCIE1C)
106# define DISABLE_AUDIO_COUNTER_1_ISR TIMSK1 &= ~_BV(OCIE1C)
107# define ENABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A |= _BV(COM1C1);
108# define DISABLE_AUDIO_COUNTER_1_OUTPUT TCCR1A &= ~(_BV(COM1C1) | _BV(COM1C0));
109# define TIMER_1_PERIOD ICR1
110# define TIMER_1_DUTY_CYCLE OCR1C
111# define TIMER1_AUDIO_vect TIMER1_COMPC_vect
112#endif
113
114#if !defined(BPIN_AUDIO) && !defined(CPIN_AUDIO)
115# error "Audio feature enabled, but no suitable pin selected - see docs/feature_audio.md under the AVR settings for available options."
116#endif
117
118// -----------------------------------------------------------------------------
119
120int voices = 0;
121int voice_place = 0;
122float frequency = 0;
123float frequency_alt = 0;
124int volume = 0;
125long position = 0;
126
127float frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
128int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
129bool sliding = false;
130
131float place = 0;
132
133uint8_t* sample;
134uint16_t sample_length = 0;
135
136bool playing_notes = false;
137bool playing_note = false;
138float note_frequency = 0;
139float note_length = 0;
140uint8_t note_tempo = TEMPO_DEFAULT;
141float note_timbre = TIMBRE_DEFAULT;
142uint16_t note_position = 0;
143float (*notes_pointer)[][2];
144uint16_t notes_count;
145bool notes_repeat;
146bool note_resting = false;
147
148uint16_t current_note = 0;
149uint8_t rest_counter = 0;
150
151#ifdef VIBRATO_ENABLE
152float vibrato_counter = 0;
153float vibrato_strength = .5;
154float vibrato_rate = 0.125;
155#endif
156
157float polyphony_rate = 0;
158
159static bool audio_initialized = false;
160
161audio_config_t audio_config;
162
163uint16_t envelope_index = 0;
164bool glissando = true;
165
166#ifndef STARTUP_SONG
167# define STARTUP_SONG SONG(STARTUP_SOUND)
168#endif
169#ifndef AUDIO_ON_SONG
170# define AUDIO_ON_SONG SONG(AUDIO_ON_SOUND)
171#endif
172#ifndef AUDIO_OFF_SONG
173# define AUDIO_OFF_SONG SONG(AUDIO_OFF_SOUND)
174#endif
175float startup_song[][2] = STARTUP_SONG;
176float audio_on_song[][2] = AUDIO_ON_SONG;
177float audio_off_song[][2] = AUDIO_OFF_SONG;
178
179void audio_init() {
180 // Check EEPROM
181 if (!eeconfig_is_enabled()) {
182 eeconfig_init();
183 }
184 audio_config.raw = eeconfig_read_audio();
185
186 if (!audio_initialized) {
187// Set audio ports as output
188#ifdef CPIN_AUDIO
189 CPIN_SET_DIRECTION
190 DISABLE_AUDIO_COUNTER_3_ISR;
191#endif
192#ifdef BPIN_AUDIO
193 BPIN_SET_DIRECTION
194 DISABLE_AUDIO_COUNTER_1_ISR;
195#endif
196
197// TCCR3A / TCCR3B: Timer/Counter #3 Control Registers TCCR3A/TCCR3B, TCCR1A/TCCR1B
198// Compare Output Mode (COM3An and COM1An) = 0b00 = Normal port operation
199// OC3A -- PC6
200// OC3B -- PC5
201// OC3C -- PC4
202// OC1A -- PB5
203// OC1B -- PB6
204// OC1C -- PB7
205
206// Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14. Period = ICR3, Duty Cycle OCR3A)
207// OCR3A - PC6
208// OCR3B - PC5
209// OCR3C - PC4
210// OCR1A - PB5
211// OCR1B - PB6
212// OCR1C - PB7
213
214// Clock Select (CS3n) = 0b010 = Clock / 8
215#ifdef CPIN_AUDIO
216 INIT_AUDIO_COUNTER_3
217 TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
218 TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER));
219 TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre);
220#endif
221#ifdef BPIN_AUDIO
222 INIT_AUDIO_COUNTER_1
223 TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10);
224 TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER));
225 TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre);
226#endif
227
228 audio_initialized = true;
229 }
230}
231
232void audio_startup() {
233 if (audio_config.enable) {
234 PLAY_SONG(startup_song);
235 }
236}
237
238void stop_all_notes() {
239 dprintf("audio stop all notes");
240
241 if (!audio_initialized) {
242 audio_init();
243 }
244 voices = 0;
245
246#ifdef CPIN_AUDIO
247 DISABLE_AUDIO_COUNTER_3_ISR;
248 DISABLE_AUDIO_COUNTER_3_OUTPUT;
249#endif
250
251#ifdef BPIN_AUDIO
252 DISABLE_AUDIO_COUNTER_1_ISR;
253 DISABLE_AUDIO_COUNTER_1_OUTPUT;
254#endif
255
256 playing_notes = false;
257 playing_note = false;
258 frequency = 0;
259 frequency_alt = 0;
260 volume = 0;
261
262 for (uint8_t i = 0; i < 8; i++) {
263 frequencies[i] = 0;
264 volumes[i] = 0;
265 }
266}
267
268void stop_note(float freq) {
269 dprintf("audio stop note freq=%d", (int)freq);
270
271 if (playing_note) {
272 if (!audio_initialized) {
273 audio_init();
274 }
275 for (int i = 7; i >= 0; i--) {
276 if (frequencies[i] == freq) {
277 frequencies[i] = 0;
278 volumes[i] = 0;
279 for (int j = i; (j < 7); j++) {
280 frequencies[j] = frequencies[j + 1];
281 frequencies[j + 1] = 0;
282 volumes[j] = volumes[j + 1];
283 volumes[j + 1] = 0;
284 }
285 break;
286 }
287 }
288 voices--;
289 if (voices < 0) voices = 0;
290 if (voice_place >= voices) {
291 voice_place = 0;
292 }
293 if (voices == 0) {
294#ifdef CPIN_AUDIO
295 DISABLE_AUDIO_COUNTER_3_ISR;
296 DISABLE_AUDIO_COUNTER_3_OUTPUT;
297#endif
298#ifdef BPIN_AUDIO
299 DISABLE_AUDIO_COUNTER_1_ISR;
300 DISABLE_AUDIO_COUNTER_1_OUTPUT;
301#endif
302 frequency = 0;
303 frequency_alt = 0;
304 volume = 0;
305 playing_note = false;
306 }
307 }
308}
309
310#ifdef VIBRATO_ENABLE
311
312float mod(float a, int b) {
313 float r = fmod(a, b);
314 return r < 0 ? r + b : r;
315}
316
317float vibrato(float average_freq) {
318# ifdef VIBRATO_STRENGTH_ENABLE
319 float vibrated_freq = average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength);
320# else
321 float vibrated_freq = average_freq * vibrato_lut[(int)vibrato_counter];
322# endif
323 vibrato_counter = mod((vibrato_counter + vibrato_rate * (1.0 + 440.0 / average_freq)), VIBRATO_LUT_LENGTH);
324 return vibrated_freq;
325}
326
327#endif
328
329#ifdef CPIN_AUDIO
330ISR(TIMER3_AUDIO_vect) {
331 float freq;
332
333 if (playing_note) {
334 if (voices > 0) {
335# ifdef BPIN_AUDIO
336 float freq_alt = 0;
337 if (voices > 1) {
338 if (polyphony_rate == 0) {
339 if (glissando) {
340 if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440 / frequencies[voices - 2] / 12 / 2)) {
341 frequency_alt = frequency_alt * pow(2, 440 / frequency_alt / 12 / 2);
342 } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440 / frequencies[voices - 2] / 12 / 2)) {
343 frequency_alt = frequency_alt * pow(2, -440 / frequency_alt / 12 / 2);
344 } else {
345 frequency_alt = frequencies[voices - 2];
346 }
347 } else {
348 frequency_alt = frequencies[voices - 2];
349 }
350
351# ifdef VIBRATO_ENABLE
352 if (vibrato_strength > 0) {
353 freq_alt = vibrato(frequency_alt);
354 } else {
355 freq_alt = frequency_alt;
356 }
357# else
358 freq_alt = frequency_alt;
359# endif
360 }
361
362 if (envelope_index < 65535) {
363 envelope_index++;
364 }
365
366 freq_alt = voice_envelope(freq_alt);
367
368 if (freq_alt < 30.517578125) {
369 freq_alt = 30.52;
370 }
371
372 TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq_alt * CPU_PRESCALER));
373 TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq_alt * CPU_PRESCALER)) * note_timbre);
374 }
375# endif
376
377 if (polyphony_rate > 0) {
378 if (voices > 1) {
379 voice_place %= voices;
380 if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) {
381 voice_place = (voice_place + 1) % voices;
382 place = 0.0;
383 }
384 }
385
386# ifdef VIBRATO_ENABLE
387 if (vibrato_strength > 0) {
388 freq = vibrato(frequencies[voice_place]);
389 } else {
390 freq = frequencies[voice_place];
391 }
392# else
393 freq = frequencies[voice_place];
394# endif
395 } else {
396 if (glissando) {
397 if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440 / frequencies[voices - 1] / 12 / 2)) {
398 frequency = frequency * pow(2, 440 / frequency / 12 / 2);
399 } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440 / frequencies[voices - 1] / 12 / 2)) {
400 frequency = frequency * pow(2, -440 / frequency / 12 / 2);
401 } else {
402 frequency = frequencies[voices - 1];
403 }
404 } else {
405 frequency = frequencies[voices - 1];
406 }
407
408# ifdef VIBRATO_ENABLE
409 if (vibrato_strength > 0) {
410 freq = vibrato(frequency);
411 } else {
412 freq = frequency;
413 }
414# else
415 freq = frequency;
416# endif
417 }
418
419 if (envelope_index < 65535) {
420 envelope_index++;
421 }
422
423 freq = voice_envelope(freq);
424
425 if (freq < 30.517578125) {
426 freq = 30.52;
427 }
428
429 TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
430 TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre);
431 }
432 }
433
434 if (playing_notes) {
435 if (note_frequency > 0) {
436# ifdef VIBRATO_ENABLE
437 if (vibrato_strength > 0) {
438 freq = vibrato(note_frequency);
439 } else {
440 freq = note_frequency;
441 }
442# else
443 freq = note_frequency;
444# endif
445
446 if (envelope_index < 65535) {
447 envelope_index++;
448 }
449 freq = voice_envelope(freq);
450
451 TIMER_3_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
452 TIMER_3_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre);
453 } else {
454 TIMER_3_PERIOD = 0;
455 TIMER_3_DUTY_CYCLE = 0;
456 }
457
458 note_position++;
459 bool end_of_note = false;
460 if (TIMER_3_PERIOD > 0) {
461 if (!note_resting)
462 end_of_note = (note_position >= (note_length / TIMER_3_PERIOD * 0xFFFF - 1));
463 else
464 end_of_note = (note_position >= (note_length));
465 } else {
466 end_of_note = (note_position >= (note_length));
467 }
468
469 if (end_of_note) {
470 current_note++;
471 if (current_note >= notes_count) {
472 if (notes_repeat) {
473 current_note = 0;
474 } else {
475 DISABLE_AUDIO_COUNTER_3_ISR;
476 DISABLE_AUDIO_COUNTER_3_OUTPUT;
477 playing_notes = false;
478 return;
479 }
480 }
481 if (!note_resting) {
482 note_resting = true;
483 current_note--;
484 if ((*notes_pointer)[current_note][0] == (*notes_pointer)[current_note + 1][0]) {
485 note_frequency = 0;
486 note_length = 1;
487 } else {
488 note_frequency = (*notes_pointer)[current_note][0];
489 note_length = 1;
490 }
491 } else {
492 note_resting = false;
493 envelope_index = 0;
494 note_frequency = (*notes_pointer)[current_note][0];
495 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
496 }
497
498 note_position = 0;
499 }
500 }
501
502 if (!audio_config.enable) {
503 playing_notes = false;
504 playing_note = false;
505 }
506}
507#endif
508
509#ifdef BPIN_AUDIO
510ISR(TIMER1_AUDIO_vect) {
511# if defined(BPIN_AUDIO) && !defined(CPIN_AUDIO)
512 float freq = 0;
513
514 if (playing_note) {
515 if (voices > 0) {
516 if (polyphony_rate > 0) {
517 if (voices > 1) {
518 voice_place %= voices;
519 if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) {
520 voice_place = (voice_place + 1) % voices;
521 place = 0.0;
522 }
523 }
524
525# ifdef VIBRATO_ENABLE
526 if (vibrato_strength > 0) {
527 freq = vibrato(frequencies[voice_place]);
528 } else {
529 freq = frequencies[voice_place];
530 }
531# else
532 freq = frequencies[voice_place];
533# endif
534 } else {
535 if (glissando) {
536 if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440 / frequencies[voices - 1] / 12 / 2)) {
537 frequency = frequency * pow(2, 440 / frequency / 12 / 2);
538 } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440 / frequencies[voices - 1] / 12 / 2)) {
539 frequency = frequency * pow(2, -440 / frequency / 12 / 2);
540 } else {
541 frequency = frequencies[voices - 1];
542 }
543 } else {
544 frequency = frequencies[voices - 1];
545 }
546
547# ifdef VIBRATO_ENABLE
548 if (vibrato_strength > 0) {
549 freq = vibrato(frequency);
550 } else {
551 freq = frequency;
552 }
553# else
554 freq = frequency;
555# endif
556 }
557
558 if (envelope_index < 65535) {
559 envelope_index++;
560 }
561
562 freq = voice_envelope(freq);
563
564 if (freq < 30.517578125) {
565 freq = 30.52;
566 }
567
568 TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
569 TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre);
570 }
571 }
572
573 if (playing_notes) {
574 if (note_frequency > 0) {
575# ifdef VIBRATO_ENABLE
576 if (vibrato_strength > 0) {
577 freq = vibrato(note_frequency);
578 } else {
579 freq = note_frequency;
580 }
581# else
582 freq = note_frequency;
583# endif
584
585 if (envelope_index < 65535) {
586 envelope_index++;
587 }
588 freq = voice_envelope(freq);
589
590 TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
591 TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre);
592 } else {
593 TIMER_1_PERIOD = 0;
594 TIMER_1_DUTY_CYCLE = 0;
595 }
596
597 note_position++;
598 bool end_of_note = false;
599 if (TIMER_1_PERIOD > 0) {
600 if (!note_resting)
601 end_of_note = (note_position >= (note_length / TIMER_1_PERIOD * 0xFFFF - 1));
602 else
603 end_of_note = (note_position >= (note_length));
604 } else {
605 end_of_note = (note_position >= (note_length));
606 }
607
608 if (end_of_note) {
609 current_note++;
610 if (current_note >= notes_count) {
611 if (notes_repeat) {
612 current_note = 0;
613 } else {
614 DISABLE_AUDIO_COUNTER_1_ISR;
615 DISABLE_AUDIO_COUNTER_1_OUTPUT;
616 playing_notes = false;
617 return;
618 }
619 }
620 if (!note_resting) {
621 note_resting = true;
622 current_note--;
623 if ((*notes_pointer)[current_note][0] == (*notes_pointer)[current_note + 1][0]) {
624 note_frequency = 0;
625 note_length = 1;
626 } else {
627 note_frequency = (*notes_pointer)[current_note][0];
628 note_length = 1;
629 }
630 } else {
631 note_resting = false;
632 envelope_index = 0;
633 note_frequency = (*notes_pointer)[current_note][0];
634 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
635 }
636
637 note_position = 0;
638 }
639 }
640
641 if (!audio_config.enable) {
642 playing_notes = false;
643 playing_note = false;
644 }
645# endif
646}
647#endif
648
649void play_note(float freq, int vol) {
650 dprintf("audio play note freq=%d vol=%d", (int)freq, vol);
651
652 if (!audio_initialized) {
653 audio_init();
654 }
655
656 if (audio_config.enable && voices < 8) {
657#ifdef CPIN_AUDIO
658 DISABLE_AUDIO_COUNTER_3_ISR;
659#endif
660#ifdef BPIN_AUDIO
661 DISABLE_AUDIO_COUNTER_1_ISR;
662#endif
663
664 // Cancel notes if notes are playing
665 if (playing_notes) stop_all_notes();
666
667 playing_note = true;
668
669 envelope_index = 0;
670
671 if (freq > 0) {
672 frequencies[voices] = freq;
673 volumes[voices] = vol;
674 voices++;
675 }
676
677#ifdef CPIN_AUDIO
678 ENABLE_AUDIO_COUNTER_3_ISR;
679 ENABLE_AUDIO_COUNTER_3_OUTPUT;
680#endif
681#ifdef BPIN_AUDIO
682# ifdef CPIN_AUDIO
683 if (voices > 1) {
684 ENABLE_AUDIO_COUNTER_1_ISR;
685 ENABLE_AUDIO_COUNTER_1_OUTPUT;
686 }
687# else
688 ENABLE_AUDIO_COUNTER_1_ISR;
689 ENABLE_AUDIO_COUNTER_1_OUTPUT;
690# endif
691#endif
692 }
693}
694
695void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat) {
696 if (!audio_initialized) {
697 audio_init();
698 }
699
700 if (audio_config.enable) {
701#ifdef CPIN_AUDIO
702 DISABLE_AUDIO_COUNTER_3_ISR;
703#endif
704#ifdef BPIN_AUDIO
705 DISABLE_AUDIO_COUNTER_1_ISR;
706#endif
707
708 // Cancel note if a note is playing
709 if (playing_note) stop_all_notes();
710
711 playing_notes = true;
712
713 notes_pointer = np;
714 notes_count = n_count;
715 notes_repeat = n_repeat;
716
717 place = 0;
718 current_note = 0;
719
720 note_frequency = (*notes_pointer)[current_note][0];
721 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
722 note_position = 0;
723
724#ifdef CPIN_AUDIO
725 ENABLE_AUDIO_COUNTER_3_ISR;
726 ENABLE_AUDIO_COUNTER_3_OUTPUT;
727#endif
728#ifdef BPIN_AUDIO
729# ifndef CPIN_AUDIO
730 ENABLE_AUDIO_COUNTER_1_ISR;
731 ENABLE_AUDIO_COUNTER_1_OUTPUT;
732# endif
733#endif
734 }
735}
736
737bool is_playing_notes(void) { return playing_notes; }
738
739bool is_audio_on(void) { return (audio_config.enable != 0); }
740
741void audio_toggle(void) {
742 audio_config.enable ^= 1;
743 eeconfig_update_audio(audio_config.raw);
744 if (audio_config.enable) audio_on_user();
745}
746
747void audio_on(void) {
748 audio_config.enable = 1;
749 eeconfig_update_audio(audio_config.raw);
750 audio_on_user();
751 PLAY_SONG(audio_on_song);
752}
753
754void audio_off(void) {
755 PLAY_SONG(audio_off_song);
756 wait_ms(100);
757 stop_all_notes();
758 audio_config.enable = 0;
759 eeconfig_update_audio(audio_config.raw);
760}
761
762#ifdef VIBRATO_ENABLE
763
764// Vibrato rate functions
765
766void set_vibrato_rate(float rate) { vibrato_rate = rate; }
767
768void increase_vibrato_rate(float change) { vibrato_rate *= change; }
769
770void decrease_vibrato_rate(float change) { vibrato_rate /= change; }
771
772# ifdef VIBRATO_STRENGTH_ENABLE
773
774void set_vibrato_strength(float strength) { vibrato_strength = strength; }
775
776void increase_vibrato_strength(float change) { vibrato_strength *= change; }
777
778void decrease_vibrato_strength(float change) { vibrato_strength /= change; }
779
780# endif /* VIBRATO_STRENGTH_ENABLE */
781
782#endif /* VIBRATO_ENABLE */
783
784// Polyphony functions
785
786void set_polyphony_rate(float rate) { polyphony_rate = rate; }
787
788void enable_polyphony() { polyphony_rate = 5; }
789
790void disable_polyphony() { polyphony_rate = 0; }
791
792void increase_polyphony_rate(float change) { polyphony_rate *= change; }
793
794void decrease_polyphony_rate(float change) { polyphony_rate /= change; }
795
796// Timbre function
797
798void set_timbre(float timbre) { note_timbre = timbre; }
799
800// Tempo functions
801
802void set_tempo(uint8_t tempo) { note_tempo = tempo; }
803
804void decrease_tempo(uint8_t tempo_change) { note_tempo += tempo_change; }
805
806void increase_tempo(uint8_t tempo_change) {
807 if (note_tempo - tempo_change < 10) {
808 note_tempo = 10;
809 } else {
810 note_tempo -= tempo_change;
811 }
812}
diff --git a/quantum/audio/audio_chibios.c b/quantum/audio/audio_chibios.c
deleted file mode 100644
index b267e5746..000000000
--- a/quantum/audio/audio_chibios.c
+++ /dev/null
@@ -1,721 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "audio.h"
18#include <ch.h>
19#include <hal.h>
20
21#include <string.h>
22#include "print.h"
23#include "keymap.h"
24
25#include "eeconfig.h"
26
27// -----------------------------------------------------------------------------
28
29int voices = 0;
30int voice_place = 0;
31float frequency = 0;
32float frequency_alt = 0;
33int volume = 0;
34long position = 0;
35
36float frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
37int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
38bool sliding = false;
39
40float place = 0;
41
42uint8_t *sample;
43uint16_t sample_length = 0;
44
45bool playing_notes = false;
46bool playing_note = false;
47float note_frequency = 0;
48float note_length = 0;
49uint8_t note_tempo = TEMPO_DEFAULT;
50float note_timbre = TIMBRE_DEFAULT;
51uint16_t note_position = 0;
52float (*notes_pointer)[][2];
53uint16_t notes_count;
54bool notes_repeat;
55bool note_resting = false;
56
57uint16_t current_note = 0;
58uint8_t rest_counter = 0;
59
60#ifdef VIBRATO_ENABLE
61float vibrato_counter = 0;
62float vibrato_strength = .5;
63float vibrato_rate = 0.125;
64#endif
65
66float polyphony_rate = 0;
67
68static bool audio_initialized = false;
69
70audio_config_t audio_config;
71
72uint16_t envelope_index = 0;
73bool glissando = true;
74
75#ifndef STARTUP_SONG
76# define STARTUP_SONG SONG(STARTUP_SOUND)
77#endif
78float startup_song[][2] = STARTUP_SONG;
79
80static void gpt_cb8(GPTDriver *gptp);
81
82#define DAC_BUFFER_SIZE 100
83#ifndef DAC_SAMPLE_MAX
84# define DAC_SAMPLE_MAX 65535U
85#endif
86
87#define START_CHANNEL_1() \
88 gptStart(&GPTD6, &gpt6cfg1); \
89 gptStartContinuous(&GPTD6, 2U); \
90 palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG)
91#define START_CHANNEL_2() \
92 gptStart(&GPTD7, &gpt7cfg1); \
93 gptStartContinuous(&GPTD7, 2U); \
94 palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG)
95#define STOP_CHANNEL_1() \
96 gptStopTimer(&GPTD6); \
97 palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); \
98 palSetPad(GPIOA, 4)
99#define STOP_CHANNEL_2() \
100 gptStopTimer(&GPTD7); \
101 palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); \
102 palSetPad(GPIOA, 5)
103#define RESTART_CHANNEL_1() \
104 STOP_CHANNEL_1(); \
105 START_CHANNEL_1()
106#define RESTART_CHANNEL_2() \
107 STOP_CHANNEL_2(); \
108 START_CHANNEL_2()
109#define UPDATE_CHANNEL_1_FREQ(freq) \
110 gpt6cfg1.frequency = freq * DAC_BUFFER_SIZE; \
111 RESTART_CHANNEL_1()
112#define UPDATE_CHANNEL_2_FREQ(freq) \
113 gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \
114 RESTART_CHANNEL_2()
115#define GET_CHANNEL_1_FREQ (uint16_t)(gpt6cfg1.frequency * DAC_BUFFER_SIZE)
116#define GET_CHANNEL_2_FREQ (uint16_t)(gpt7cfg1.frequency * DAC_BUFFER_SIZE)
117
118/*
119 * GPT6 configuration.
120 */
121// static const GPTConfig gpt6cfg1 = {
122// .frequency = 1000000U,
123// .callback = NULL,
124// .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
125// .dier = 0U
126// };
127
128GPTConfig gpt6cfg1 = {.frequency = 440U * DAC_BUFFER_SIZE,
129 .callback = NULL,
130 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
131 .dier = 0U};
132
133GPTConfig gpt7cfg1 = {.frequency = 440U * DAC_BUFFER_SIZE,
134 .callback = NULL,
135 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
136 .dier = 0U};
137
138GPTConfig gpt8cfg1 = {.frequency = 10,
139 .callback = gpt_cb8,
140 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
141 .dier = 0U};
142
143/*
144 * DAC test buffer (sine wave).
145 */
146// static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = {
147// 2047, 2082, 2118, 2154, 2189, 2225, 2260, 2296, 2331, 2367, 2402, 2437,
148// 2472, 2507, 2542, 2576, 2611, 2645, 2679, 2713, 2747, 2780, 2813, 2846,
149// 2879, 2912, 2944, 2976, 3008, 3039, 3070, 3101, 3131, 3161, 3191, 3221,
150// 3250, 3278, 3307, 3335, 3362, 3389, 3416, 3443, 3468, 3494, 3519, 3544,
151// 3568, 3591, 3615, 3637, 3660, 3681, 3703, 3723, 3744, 3763, 3782, 3801,
152// 3819, 3837, 3854, 3870, 3886, 3902, 3917, 3931, 3944, 3958, 3970, 3982,
153// 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4062, 4068, 4074, 4078,
154// 4082, 4086, 4089, 4091, 4092, 4093, 4094, 4093, 4092, 4091, 4089, 4086,
155// 4082, 4078, 4074, 4068, 4062, 4056, 4049, 4041, 4033, 4024, 4014, 4004,
156// 3993, 3982, 3970, 3958, 3944, 3931, 3917, 3902, 3886, 3870, 3854, 3837,
157// 3819, 3801, 3782, 3763, 3744, 3723, 3703, 3681, 3660, 3637, 3615, 3591,
158// 3568, 3544, 3519, 3494, 3468, 3443, 3416, 3389, 3362, 3335, 3307, 3278,
159// 3250, 3221, 3191, 3161, 3131, 3101, 3070, 3039, 3008, 2976, 2944, 2912,
160// 2879, 2846, 2813, 2780, 2747, 2713, 2679, 2645, 2611, 2576, 2542, 2507,
161// 2472, 2437, 2402, 2367, 2331, 2296, 2260, 2225, 2189, 2154, 2118, 2082,
162// 2047, 2012, 1976, 1940, 1905, 1869, 1834, 1798, 1763, 1727, 1692, 1657,
163// 1622, 1587, 1552, 1518, 1483, 1449, 1415, 1381, 1347, 1314, 1281, 1248,
164// 1215, 1182, 1150, 1118, 1086, 1055, 1024, 993, 963, 933, 903, 873,
165// 844, 816, 787, 759, 732, 705, 678, 651, 626, 600, 575, 550,
166// 526, 503, 479, 457, 434, 413, 391, 371, 350, 331, 312, 293,
167// 275, 257, 240, 224, 208, 192, 177, 163, 150, 136, 124, 112,
168// 101, 90, 80, 70, 61, 53, 45, 38, 32, 26, 20, 16,
169// 12, 8, 5, 3, 2, 1, 0, 1, 2, 3, 5, 8,
170// 12, 16, 20, 26, 32, 38, 45, 53, 61, 70, 80, 90,
171// 101, 112, 124, 136, 150, 163, 177, 192, 208, 224, 240, 257,
172// 275, 293, 312, 331, 350, 371, 391, 413, 434, 457, 479, 503,
173// 526, 550, 575, 600, 626, 651, 678, 705, 732, 759, 787, 816,
174// 844, 873, 903, 933, 963, 993, 1024, 1055, 1086, 1118, 1150, 1182,
175// 1215, 1248, 1281, 1314, 1347, 1381, 1415, 1449, 1483, 1518, 1552, 1587,
176// 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012
177// };
178
179// static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = {
180// 12, 8, 5, 3, 2, 1, 0, 1, 2, 3, 5, 8,
181// 12, 16, 20, 26, 32, 38, 45, 53, 61, 70, 80, 90,
182// 101, 112, 124, 136, 150, 163, 177, 192, 208, 224, 240, 257,
183// 275, 293, 312, 331, 350, 371, 391, 413, 434, 457, 479, 503,
184// 526, 550, 575, 600, 626, 651, 678, 705, 732, 759, 787, 816,
185// 844, 873, 903, 933, 963, 993, 1024, 1055, 1086, 1118, 1150, 1182,
186// 1215, 1248, 1281, 1314, 1347, 1381, 1415, 1449, 1483, 1518, 1552, 1587,
187// 1622, 1657, 1692, 1727, 1763, 1798, 1834, 1869, 1905, 1940, 1976, 2012,
188// 2047, 2082, 2118, 2154, 2189, 2225, 2260, 2296, 2331, 2367, 2402, 2437,
189// 2472, 2507, 2542, 2576, 2611, 2645, 2679, 2713, 2747, 2780, 2813, 2846,
190// 2879, 2912, 2944, 2976, 3008, 3039, 3070, 3101, 3131, 3161, 3191, 3221,
191// 3250, 3278, 3307, 3335, 3362, 3389, 3416, 3443, 3468, 3494, 3519, 3544,
192// 3568, 3591, 3615, 3637, 3660, 3681, 3703, 3723, 3744, 3763, 3782, 3801,
193// 3819, 3837, 3854, 3870, 3886, 3902, 3917, 3931, 3944, 3958, 3970, 3982,
194// 3993, 4004, 4014, 4024, 4033, 4041, 4049, 4056, 4062, 4068, 4074, 4078,
195// 4082, 4086, 4089, 4091, 4092, 4093, 4094, 4093, 4092, 4091, 4089, 4086,
196// 4082, 4078, 4074, 4068, 4062, 4056, 4049, 4041, 4033, 4024, 4014, 4004,
197// 3993, 3982, 3970, 3958, 3944, 3931, 3917, 3902, 3886, 3870, 3854, 3837,
198// 3819, 3801, 3782, 3763, 3744, 3723, 3703, 3681, 3660, 3637, 3615, 3591,
199// 3568, 3544, 3519, 3494, 3468, 3443, 3416, 3389, 3362, 3335, 3307, 3278,
200// 3250, 3221, 3191, 3161, 3131, 3101, 3070, 3039, 3008, 2976, 2944, 2912,
201// 2879, 2846, 2813, 2780, 2747, 2713, 2679, 2645, 2611, 2576, 2542, 2507,
202// 2472, 2437, 2402, 2367, 2331, 2296, 2260, 2225, 2189, 2154, 2118, 2082,
203// 2047, 2012, 1976, 1940, 1905, 1869, 1834, 1798, 1763, 1727, 1692, 1657,
204// 1622, 1587, 1552, 1518, 1483, 1449, 1415, 1381, 1347, 1314, 1281, 1248,
205// 1215, 1182, 1150, 1118, 1086, 1055, 1024, 993, 963, 933, 903, 873,
206// 844, 816, 787, 759, 732, 705, 678, 651, 626, 600, 575, 550,
207// 526, 503, 479, 457, 434, 413, 391, 371, 350, 331, 312, 293,
208// 275, 257, 240, 224, 208, 192, 177, 163, 150, 136, 124, 112,
209// 101, 90, 80, 70, 61, 53, 45, 38, 32, 26, 20, 16
210// };
211
212// squarewave
213static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = {
214 // First half is max, second half is 0
215 [0 ... DAC_BUFFER_SIZE / 2 - 1] = DAC_SAMPLE_MAX,
216 [DAC_BUFFER_SIZE / 2 ... DAC_BUFFER_SIZE - 1] = 0,
217};
218
219// squarewave
220static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = {
221 // opposite of dac_buffer above
222 [0 ... DAC_BUFFER_SIZE / 2 - 1] = 0,
223 [DAC_BUFFER_SIZE / 2 ... DAC_BUFFER_SIZE - 1] = DAC_SAMPLE_MAX,
224};
225
226/*
227 * DAC streaming callback.
228 */
229size_t nz = 0;
230static void end_cb1(DACDriver *dacp) {
231 (void)dacp;
232
233 nz++;
234 if ((nz % 1000) == 0) {
235 // palTogglePad(GPIOD, GPIOD_LED3);
236 }
237}
238
239/*
240 * DAC error callback.
241 */
242static void error_cb1(DACDriver *dacp, dacerror_t err) {
243 (void)dacp;
244 (void)err;
245
246 chSysHalt("DAC failure");
247}
248
249static const DACConfig dac1cfg1 = {.init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT};
250
251static const DACConversionGroup dacgrpcfg1 = {.num_channels = 1U, .end_cb = end_cb1, .error_cb = error_cb1, .trigger = DAC_TRG(0)};
252
253static const DACConfig dac1cfg2 = {.init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT};
254
255static const DACConversionGroup dacgrpcfg2 = {.num_channels = 1U, .end_cb = end_cb1, .error_cb = error_cb1, .trigger = DAC_TRG(0)};
256
257void audio_init() {
258 if (audio_initialized) {
259 return;
260 }
261
262// Check EEPROM
263#ifdef EEPROM_ENABLE
264 if (!eeconfig_is_enabled()) {
265 eeconfig_init();
266 }
267 audio_config.raw = eeconfig_read_audio();
268#else // ARM EEPROM
269 audio_config.enable = true;
270# ifdef AUDIO_CLICKY_ON
271 audio_config.clicky_enable = true;
272# endif
273#endif // ARM EEPROM
274
275 /*
276 * Starting DAC1 driver, setting up the output pin as analog as suggested
277 * by the Reference Manual.
278 */
279 palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
280 palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
281 dacStart(&DACD1, &dac1cfg1);
282 dacStart(&DACD2, &dac1cfg2);
283
284 /*
285 * Start the note timer
286 */
287 gptStart(&GPTD8, &gpt8cfg1);
288 gptStartContinuous(&GPTD8, 2U);
289
290 /*
291 * Starting GPT6/7 driver, it is used for triggering the DAC.
292 */
293 START_CHANNEL_1();
294 START_CHANNEL_2();
295
296 /*
297 * Starting a continuous conversion.
298 */
299 dacStartConversion(&DACD1, &dacgrpcfg1, (dacsample_t *)dac_buffer, DAC_BUFFER_SIZE);
300 dacStartConversion(&DACD2, &dacgrpcfg2, (dacsample_t *)dac_buffer_2, DAC_BUFFER_SIZE);
301
302 audio_initialized = true;
303
304 stop_all_notes();
305}
306
307void audio_startup() {
308 if (audio_config.enable) {
309 PLAY_SONG(startup_song);
310 }
311}
312
313void stop_all_notes() {
314 dprintf("audio stop all notes");
315
316 if (!audio_initialized) {
317 audio_init();
318 }
319 voices = 0;
320
321 gptStopTimer(&GPTD6);
322 gptStopTimer(&GPTD7);
323 gptStopTimer(&GPTD8);
324
325 playing_notes = false;
326 playing_note = false;
327 frequency = 0;
328 frequency_alt = 0;
329 volume = 0;
330
331 for (uint8_t i = 0; i < 8; i++) {
332 frequencies[i] = 0;
333 volumes[i] = 0;
334 }
335}
336
337void stop_note(float freq) {
338 dprintf("audio stop note freq=%d", (int)freq);
339
340 if (playing_note) {
341 if (!audio_initialized) {
342 audio_init();
343 }
344 for (int i = 7; i >= 0; i--) {
345 if (frequencies[i] == freq) {
346 frequencies[i] = 0;
347 volumes[i] = 0;
348 for (int j = i; (j < 7); j++) {
349 frequencies[j] = frequencies[j + 1];
350 frequencies[j + 1] = 0;
351 volumes[j] = volumes[j + 1];
352 volumes[j + 1] = 0;
353 }
354 break;
355 }
356 }
357 voices--;
358 if (voices < 0) {
359 voices = 0;
360 }
361 if (voice_place >= voices) {
362 voice_place = 0;
363 }
364 if (voices == 0) {
365 STOP_CHANNEL_1();
366 STOP_CHANNEL_2();
367 gptStopTimer(&GPTD8);
368 frequency = 0;
369 frequency_alt = 0;
370 volume = 0;
371 playing_note = false;
372 }
373 }
374}
375
376#ifdef VIBRATO_ENABLE
377
378float mod(float a, int b) {
379 float r = fmod(a, b);
380 return r < 0 ? r + b : r;
381}
382
383float vibrato(float average_freq) {
384# ifdef VIBRATO_STRENGTH_ENABLE
385 float vibrated_freq = average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength);
386# else
387 float vibrated_freq = average_freq * vibrato_lut[(int)vibrato_counter];
388# endif
389 vibrato_counter = mod((vibrato_counter + vibrato_rate * (1.0 + 440.0 / average_freq)), VIBRATO_LUT_LENGTH);
390 return vibrated_freq;
391}
392
393#endif
394
395static void gpt_cb8(GPTDriver *gptp) {
396 float freq;
397
398 if (playing_note) {
399 if (voices > 0) {
400 float freq_alt = 0;
401 if (voices > 1) {
402 if (polyphony_rate == 0) {
403 if (glissando) {
404 if (frequency_alt != 0 && frequency_alt < frequencies[voices - 2] && frequency_alt < frequencies[voices - 2] * pow(2, -440 / frequencies[voices - 2] / 12 / 2)) {
405 frequency_alt = frequency_alt * pow(2, 440 / frequency_alt / 12 / 2);
406 } else if (frequency_alt != 0 && frequency_alt > frequencies[voices - 2] && frequency_alt > frequencies[voices - 2] * pow(2, 440 / frequencies[voices - 2] / 12 / 2)) {
407 frequency_alt = frequency_alt * pow(2, -440 / frequency_alt / 12 / 2);
408 } else {
409 frequency_alt = frequencies[voices - 2];
410 }
411 } else {
412 frequency_alt = frequencies[voices - 2];
413 }
414
415#ifdef VIBRATO_ENABLE
416 if (vibrato_strength > 0) {
417 freq_alt = vibrato(frequency_alt);
418 } else {
419 freq_alt = frequency_alt;
420 }
421#else
422 freq_alt = frequency_alt;
423#endif
424 }
425
426 if (envelope_index < 65535) {
427 envelope_index++;
428 }
429
430 freq_alt = voice_envelope(freq_alt);
431
432 if (freq_alt < 30.517578125) {
433 freq_alt = 30.52;
434 }
435
436 if (GET_CHANNEL_2_FREQ != (uint16_t)freq_alt) {
437 UPDATE_CHANNEL_2_FREQ(freq_alt);
438 } else {
439 RESTART_CHANNEL_2();
440 }
441 // note_timbre;
442 }
443
444 if (polyphony_rate > 0) {
445 if (voices > 1) {
446 voice_place %= voices;
447 if (place++ > (frequencies[voice_place] / polyphony_rate)) {
448 voice_place = (voice_place + 1) % voices;
449 place = 0.0;
450 }
451 }
452
453#ifdef VIBRATO_ENABLE
454 if (vibrato_strength > 0) {
455 freq = vibrato(frequencies[voice_place]);
456 } else {
457 freq = frequencies[voice_place];
458 }
459#else
460 freq = frequencies[voice_place];
461#endif
462 } else {
463 if (glissando) {
464 if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440 / frequencies[voices - 1] / 12 / 2)) {
465 frequency = frequency * pow(2, 440 / frequency / 12 / 2);
466 } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440 / frequencies[voices - 1] / 12 / 2)) {
467 frequency = frequency * pow(2, -440 / frequency / 12 / 2);
468 } else {
469 frequency = frequencies[voices - 1];
470 }
471 } else {
472 frequency = frequencies[voices - 1];
473 }
474
475#ifdef VIBRATO_ENABLE
476 if (vibrato_strength > 0) {
477 freq = vibrato(frequency);
478 } else {
479 freq = frequency;
480 }
481#else
482 freq = frequency;
483#endif
484 }
485
486 if (envelope_index < 65535) {
487 envelope_index++;
488 }
489
490 freq = voice_envelope(freq);
491
492 if (freq < 30.517578125) {
493 freq = 30.52;
494 }
495
496 if (GET_CHANNEL_1_FREQ != (uint16_t)freq) {
497 UPDATE_CHANNEL_1_FREQ(freq);
498 } else {
499 RESTART_CHANNEL_1();
500 }
501 // note_timbre;
502 }
503 }
504
505 if (playing_notes) {
506 if (note_frequency > 0) {
507#ifdef VIBRATO_ENABLE
508 if (vibrato_strength > 0) {
509 freq = vibrato(note_frequency);
510 } else {
511 freq = note_frequency;
512 }
513#else
514 freq = note_frequency;
515#endif
516
517 if (envelope_index < 65535) {
518 envelope_index++;
519 }
520 freq = voice_envelope(freq);
521
522 if (GET_CHANNEL_1_FREQ != (uint16_t)freq) {
523 UPDATE_CHANNEL_1_FREQ(freq);
524 UPDATE_CHANNEL_2_FREQ(freq);
525 }
526 // note_timbre;
527 } else {
528 // gptStopTimer(&GPTD6);
529 // gptStopTimer(&GPTD7);
530 }
531
532 note_position++;
533 bool end_of_note = false;
534 if (GET_CHANNEL_1_FREQ > 0) {
535 if (!note_resting)
536 end_of_note = (note_position >= (note_length * 8 - 1));
537 else
538 end_of_note = (note_position >= (note_length * 8));
539 } else {
540 end_of_note = (note_position >= (note_length * 8));
541 }
542
543 if (end_of_note) {
544 current_note++;
545 if (current_note >= notes_count) {
546 if (notes_repeat) {
547 current_note = 0;
548 } else {
549 STOP_CHANNEL_1();
550 STOP_CHANNEL_2();
551 // gptStopTimer(&GPTD8);
552 playing_notes = false;
553 return;
554 }
555 }
556 if (!note_resting) {
557 note_resting = true;
558 current_note--;
559 if ((*notes_pointer)[current_note][0] == (*notes_pointer)[current_note + 1][0]) {
560 note_frequency = 0;
561 note_length = 1;
562 } else {
563 note_frequency = (*notes_pointer)[current_note][0];
564 note_length = 1;
565 }
566 } else {
567 note_resting = false;
568 envelope_index = 0;
569 note_frequency = (*notes_pointer)[current_note][0];
570 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
571 }
572
573 note_position = 0;
574 }
575 }
576
577 if (!audio_config.enable) {
578 playing_notes = false;
579 playing_note = false;
580 }
581}
582
583void play_note(float freq, int vol) {
584 dprintf("audio play note freq=%d vol=%d", (int)freq, vol);
585
586 if (!audio_initialized) {
587 audio_init();
588 }
589
590 if (audio_config.enable && voices < 8) {
591 // Cancel notes if notes are playing
592 if (playing_notes) {
593 stop_all_notes();
594 }
595
596 playing_note = true;
597
598 envelope_index = 0;
599
600 if (freq > 0) {
601 frequencies[voices] = freq;
602 volumes[voices] = vol;
603 voices++;
604 }
605
606 gptStart(&GPTD8, &gpt8cfg1);
607 gptStartContinuous(&GPTD8, 2U);
608 RESTART_CHANNEL_1();
609 RESTART_CHANNEL_2();
610 }
611}
612
613void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat) {
614 if (!audio_initialized) {
615 audio_init();
616 }
617
618 if (audio_config.enable) {
619 // Cancel note if a note is playing
620 if (playing_note) {
621 stop_all_notes();
622 }
623
624 playing_notes = true;
625
626 notes_pointer = np;
627 notes_count = n_count;
628 notes_repeat = n_repeat;
629
630 place = 0;
631 current_note = 0;
632
633 note_frequency = (*notes_pointer)[current_note][0];
634 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
635 note_position = 0;
636
637 gptStart(&GPTD8, &gpt8cfg1);
638 gptStartContinuous(&GPTD8, 2U);
639 RESTART_CHANNEL_1();
640 RESTART_CHANNEL_2();
641 }
642}
643
644bool is_playing_notes(void) { return playing_notes; }
645
646bool is_audio_on(void) { return (audio_config.enable != 0); }
647
648void audio_toggle(void) {
649 if (audio_config.enable) {
650 stop_all_notes();
651 }
652 audio_config.enable ^= 1;
653 eeconfig_update_audio(audio_config.raw);
654 if (audio_config.enable) {
655 audio_on_user();
656 }
657}
658
659void audio_on(void) {
660 audio_config.enable = 1;
661 eeconfig_update_audio(audio_config.raw);
662 audio_on_user();
663}
664
665void audio_off(void) {
666 stop_all_notes();
667 audio_config.enable = 0;
668 eeconfig_update_audio(audio_config.raw);
669}
670
671#ifdef VIBRATO_ENABLE
672
673// Vibrato rate functions
674
675void set_vibrato_rate(float rate) { vibrato_rate = rate; }
676
677void increase_vibrato_rate(float change) { vibrato_rate *= change; }
678
679void decrease_vibrato_rate(float change) { vibrato_rate /= change; }
680
681# ifdef VIBRATO_STRENGTH_ENABLE
682
683void set_vibrato_strength(float strength) { vibrato_strength = strength; }
684
685void increase_vibrato_strength(float change) { vibrato_strength *= change; }
686
687void decrease_vibrato_strength(float change) { vibrato_strength /= change; }
688
689# endif /* VIBRATO_STRENGTH_ENABLE */
690
691#endif /* VIBRATO_ENABLE */
692
693// Polyphony functions
694
695void set_polyphony_rate(float rate) { polyphony_rate = rate; }
696
697void enable_polyphony() { polyphony_rate = 5; }
698
699void disable_polyphony() { polyphony_rate = 0; }
700
701void increase_polyphony_rate(float change) { polyphony_rate *= change; }
702
703void decrease_polyphony_rate(float change) { polyphony_rate /= change; }
704
705// Timbre function
706
707void set_timbre(float timbre) { note_timbre = timbre; }
708
709// Tempo functions
710
711void set_tempo(uint8_t tempo) { note_tempo = tempo; }
712
713void decrease_tempo(uint8_t tempo_change) { note_tempo += tempo_change; }
714
715void increase_tempo(uint8_t tempo_change) {
716 if (note_tempo - tempo_change < 10) {
717 note_tempo = 10;
718 } else {
719 note_tempo -= tempo_change;
720 }
721}
diff --git a/quantum/audio/audio_pwm.c b/quantum/audio/audio_pwm.c
deleted file mode 100644
index d93ac4bb4..000000000
--- a/quantum/audio/audio_pwm.c
+++ /dev/null
@@ -1,606 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include <stdio.h>
17#include <string.h>
18//#include <math.h>
19#include <avr/pgmspace.h>
20#include <avr/interrupt.h>
21#include <avr/io.h>
22#include "print.h"
23#include "audio.h"
24#include "keymap.h"
25
26#include "eeconfig.h"
27
28#define PI 3.14159265
29
30#define CPU_PRESCALER 8
31
32#ifndef STARTUP_SONG
33# define STARTUP_SONG SONG(STARTUP_SOUND)
34#endif
35float startup_song[][2] = STARTUP_SONG;
36
37// Timer Abstractions
38
39// TIMSK3 - Timer/Counter #3 Interrupt Mask Register
40// Turn on/off 3A interputs, stopping/enabling the ISR calls
41#define ENABLE_AUDIO_COUNTER_3_ISR TIMSK3 |= _BV(OCIE3A)
42#define DISABLE_AUDIO_COUNTER_3_ISR TIMSK3 &= ~_BV(OCIE3A)
43
44// TCCR3A: Timer/Counter #3 Control Register
45// Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
46#define ENABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A |= _BV(COM3A1);
47#define DISABLE_AUDIO_COUNTER_3_OUTPUT TCCR3A &= ~(_BV(COM3A1) | _BV(COM3A0));
48
49#define NOTE_PERIOD ICR3
50#define NOTE_DUTY_CYCLE OCR3A
51
52#ifdef PWM_AUDIO
53# include "wave.h"
54# define SAMPLE_DIVIDER 39
55# define SAMPLE_RATE (2000000.0 / SAMPLE_DIVIDER / 2048)
56// Resistor value of 1/ (2 * PI * 10nF * (2000000 hertz / SAMPLE_DIVIDER / 10)) for 10nF cap
57
58float places[8] = {0, 0, 0, 0, 0, 0, 0, 0};
59uint16_t place_int = 0;
60bool repeat = true;
61#endif
62
63void delay_us(int count) {
64 while (count--) {
65 _delay_us(1);
66 }
67}
68
69int voices = 0;
70int voice_place = 0;
71float frequency = 0;
72int volume = 0;
73long position = 0;
74
75float frequencies[8] = {0, 0, 0, 0, 0, 0, 0, 0};
76int volumes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
77bool sliding = false;
78
79float place = 0;
80
81uint8_t* sample;
82uint16_t sample_length = 0;
83// float freq = 0;
84
85bool playing_notes = false;
86bool playing_note = false;
87float note_frequency = 0;
88float note_length = 0;
89uint8_t note_tempo = TEMPO_DEFAULT;
90float note_timbre = TIMBRE_DEFAULT;
91uint16_t note_position = 0;
92float (*notes_pointer)[][2];
93uint16_t notes_count;
94bool notes_repeat;
95float notes_rest;
96bool note_resting = false;
97
98uint16_t current_note = 0;
99uint8_t rest_counter = 0;
100
101#ifdef VIBRATO_ENABLE
102float vibrato_counter = 0;
103float vibrato_strength = .5;
104float vibrato_rate = 0.125;
105#endif
106
107float polyphony_rate = 0;
108
109static bool audio_initialized = false;
110
111audio_config_t audio_config;
112
113uint16_t envelope_index = 0;
114
115void audio_init() {
116 // Check EEPROM
117 if (!eeconfig_is_enabled()) {
118 eeconfig_init();
119 }
120 audio_config.raw = eeconfig_read_audio();
121
122#ifdef PWM_AUDIO
123
124 PLLFRQ = _BV(PDIV2);
125 PLLCSR = _BV(PLLE);
126 while (!(PLLCSR & _BV(PLOCK)))
127 ;
128 PLLFRQ |= _BV(PLLTM0); /* PCK 48MHz */
129
130 /* Init a fast PWM on Timer4 */
131 TCCR4A = _BV(COM4A0) | _BV(PWM4A); /* Clear OC4A on Compare Match */
132 TCCR4B = _BV(CS40); /* No prescaling => f = PCK/256 = 187500Hz */
133 OCR4A = 0;
134
135 /* Enable the OC4A output */
136 DDRC |= _BV(PORTC6);
137
138 DISABLE_AUDIO_COUNTER_3_ISR; // Turn off 3A interputs
139
140 TCCR3A = 0x0; // Options not needed
141 TCCR3B = _BV(CS31) | _BV(CS30) | _BV(WGM32); // 64th prescaling and CTC
142 OCR3A = SAMPLE_DIVIDER - 1; // Correct count/compare, related to sample playback
143
144#else
145
146 // Set port PC6 (OC3A and /OC4A) as output
147 DDRC |= _BV(PORTC6);
148
149 DISABLE_AUDIO_COUNTER_3_ISR;
150
151 // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers
152 // Compare Output Mode (COM3An) = 0b00 = Normal port operation, OC3A disconnected from PC6
153 // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14 (Period = ICR3, Duty Cycle = OCR3A)
154 // Clock Select (CS3n) = 0b010 = Clock / 8
155 TCCR3A = (0 << COM3A1) | (0 << COM3A0) | (1 << WGM31) | (0 << WGM30);
156 TCCR3B = (1 << WGM33) | (1 << WGM32) | (0 << CS32) | (1 << CS31) | (0 << CS30);
157
158#endif
159
160 audio_initialized = true;
161}
162
163void audio_startup() {
164 if (audio_config.enable) {
165 PLAY_SONG(startup_song);
166 }
167}
168
169void stop_all_notes() {
170 if (!audio_initialized) {
171 audio_init();
172 }
173 voices = 0;
174#ifdef PWM_AUDIO
175 DISABLE_AUDIO_COUNTER_3_ISR;
176#else
177 DISABLE_AUDIO_COUNTER_3_ISR;
178 DISABLE_AUDIO_COUNTER_3_OUTPUT;
179#endif
180
181 playing_notes = false;
182 playing_note = false;
183 frequency = 0;
184 volume = 0;
185
186 for (uint8_t i = 0; i < 8; i++) {
187 frequencies[i] = 0;
188 volumes[i] = 0;
189 }
190}
191
192void stop_note(float freq) {
193 if (playing_note) {
194 if (!audio_initialized) {
195 audio_init();
196 }
197#ifdef PWM_AUDIO
198 freq = freq / SAMPLE_RATE;
199#endif
200 for (int i = 7; i >= 0; i--) {
201 if (frequencies[i] == freq) {
202 frequencies[i] = 0;
203 volumes[i] = 0;
204 for (int j = i; (j < 7); j++) {
205 frequencies[j] = frequencies[j + 1];
206 frequencies[j + 1] = 0;
207 volumes[j] = volumes[j + 1];
208 volumes[j + 1] = 0;
209 }
210 break;
211 }
212 }
213 voices--;
214 if (voices < 0) voices = 0;
215 if (voice_place >= voices) {
216 voice_place = 0;
217 }
218 if (voices == 0) {
219#ifdef PWM_AUDIO
220 DISABLE_AUDIO_COUNTER_3_ISR;
221#else
222 DISABLE_AUDIO_COUNTER_3_ISR;
223 DISABLE_AUDIO_COUNTER_3_OUTPUT;
224#endif
225 frequency = 0;
226 volume = 0;
227 playing_note = false;
228 }
229 }
230}
231
232#ifdef VIBRATO_ENABLE
233
234float mod(float a, int b) {
235 float r = fmod(a, b);
236 return r < 0 ? r + b : r;
237}
238
239float vibrato(float average_freq) {
240# ifdef VIBRATO_STRENGTH_ENABLE
241 float vibrated_freq = average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength);
242# else
243 float vibrated_freq = average_freq * vibrato_lut[(int)vibrato_counter];
244# endif
245 vibrato_counter = mod((vibrato_counter + vibrato_rate * (1.0 + 440.0 / average_freq)), VIBRATO_LUT_LENGTH);
246 return vibrated_freq;
247}
248
249#endif
250
251ISR(TIMER3_COMPA_vect) {
252 if (playing_note) {
253#ifdef PWM_AUDIO
254 if (voices == 1) {
255 // SINE
256 OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 2;
257
258 // SQUARE
259 // if (((int)place) >= 1024){
260 // OCR4A = 0xFF >> 2;
261 // } else {
262 // OCR4A = 0x00;
263 // }
264
265 // SAWTOOTH
266 // OCR4A = (int)place / 4;
267
268 // TRIANGLE
269 // if (((int)place) >= 1024) {
270 // OCR4A = (int)place / 2;
271 // } else {
272 // OCR4A = 2048 - (int)place / 2;
273 // }
274
275 place += frequency;
276
277 if (place >= SINE_LENGTH) place -= SINE_LENGTH;
278
279 } else {
280 int sum = 0;
281 for (int i = 0; i < voices; i++) {
282 // SINE
283 sum += pgm_read_byte(&sinewave[(uint16_t)places[i]]) >> 2;
284
285 // SQUARE
286 // if (((int)places[i]) >= 1024){
287 // sum += 0xFF >> 2;
288 // } else {
289 // sum += 0x00;
290 // }
291
292 places[i] += frequencies[i];
293
294 if (places[i] >= SINE_LENGTH) places[i] -= SINE_LENGTH;
295 }
296 OCR4A = sum;
297 }
298#else
299 if (voices > 0) {
300 float freq;
301 if (polyphony_rate > 0) {
302 if (voices > 1) {
303 voice_place %= voices;
304 if (place++ > (frequencies[voice_place] / polyphony_rate / CPU_PRESCALER)) {
305 voice_place = (voice_place + 1) % voices;
306 place = 0.0;
307 }
308 }
309# ifdef VIBRATO_ENABLE
310 if (vibrato_strength > 0) {
311 freq = vibrato(frequencies[voice_place]);
312 } else {
313# else
314 {
315# endif
316 freq = frequencies[voice_place];
317 }
318 } else {
319 if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440 / frequencies[voices - 1] / 12 / 2)) {
320 frequency = frequency * pow(2, 440 / frequency / 12 / 2);
321 } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440 / frequencies[voices - 1] / 12 / 2)) {
322 frequency = frequency * pow(2, -440 / frequency / 12 / 2);
323 } else {
324 frequency = frequencies[voices - 1];
325 }
326
327# ifdef VIBRATO_ENABLE
328 if (vibrato_strength > 0) {
329 freq = vibrato(frequency);
330 } else {
331# else
332 {
333# endif
334 freq = frequency;
335 }
336 }
337
338 if (envelope_index < 65535) {
339 envelope_index++;
340 }
341 freq = voice_envelope(freq);
342
343 if (freq < 30.517578125) freq = 30.52;
344 NOTE_PERIOD = (int)(((double)F_CPU) / (freq * CPU_PRESCALER)); // Set max to the period
345 NOTE_DUTY_CYCLE = (int)((((double)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); // Set compare to half the period
346 }
347#endif
348 }
349
350 // SAMPLE
351 // OCR4A = pgm_read_byte(&sample[(uint16_t)place_int]);
352
353 // place_int++;
354
355 // if (place_int >= sample_length)
356 // if (repeat)
357 // place_int -= sample_length;
358 // else
359 // DISABLE_AUDIO_COUNTER_3_ISR;
360
361 if (playing_notes) {
362#ifdef PWM_AUDIO
363 OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 0;
364
365 place += note_frequency;
366 if (place >= SINE_LENGTH) place -= SINE_LENGTH;
367#else
368 if (note_frequency > 0) {
369 float freq;
370
371# ifdef VIBRATO_ENABLE
372 if (vibrato_strength > 0) {
373 freq = vibrato(note_frequency);
374 } else {
375# else
376 {
377# endif
378 freq = note_frequency;
379 }
380
381 if (envelope_index < 65535) {
382 envelope_index++;
383 }
384 freq = voice_envelope(freq);
385
386 NOTE_PERIOD = (int)(((double)F_CPU) / (freq * CPU_PRESCALER)); // Set max to the period
387 NOTE_DUTY_CYCLE = (int)((((double)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre); // Set compare to half the period
388 } else {
389 NOTE_PERIOD = 0;
390 NOTE_DUTY_CYCLE = 0;
391 }
392#endif
393
394 note_position++;
395 bool end_of_note = false;
396 if (NOTE_PERIOD > 0)
397 end_of_note = (note_position >= (note_length / NOTE_PERIOD * 0xFFFF));
398 else
399 end_of_note = (note_position >= (note_length * 0x7FF));
400 if (end_of_note) {
401 current_note++;
402 if (current_note >= notes_count) {
403 if (notes_repeat) {
404 current_note = 0;
405 } else {
406#ifdef PWM_AUDIO
407 DISABLE_AUDIO_COUNTER_3_ISR;
408#else
409 DISABLE_AUDIO_COUNTER_3_ISR;
410 DISABLE_AUDIO_COUNTER_3_OUTPUT;
411#endif
412 playing_notes = false;
413 return;
414 }
415 }
416 if (!note_resting && (notes_rest > 0)) {
417 note_resting = true;
418 note_frequency = 0;
419 note_length = notes_rest;
420 current_note--;
421 } else {
422 note_resting = false;
423#ifdef PWM_AUDIO
424 note_frequency = (*notes_pointer)[current_note][0] / SAMPLE_RATE;
425 note_length = (*notes_pointer)[current_note][1] * (((float)note_tempo) / 100);
426#else
427 envelope_index = 0;
428 note_frequency = (*notes_pointer)[current_note][0];
429 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
430#endif
431 }
432 note_position = 0;
433 }
434 }
435
436 if (!audio_config.enable) {
437 playing_notes = false;
438 playing_note = false;
439 }
440}
441
442void play_note(float freq, int vol) {
443 if (!audio_initialized) {
444 audio_init();
445 }
446
447 if (audio_config.enable && voices < 8) {
448 DISABLE_AUDIO_COUNTER_3_ISR;
449
450 // Cancel notes if notes are playing
451 if (playing_notes) stop_all_notes();
452
453 playing_note = true;
454
455 envelope_index = 0;
456
457#ifdef PWM_AUDIO
458 freq = freq / SAMPLE_RATE;
459#endif
460 if (freq > 0) {
461 frequencies[voices] = freq;
462 volumes[voices] = vol;
463 voices++;
464 }
465
466#ifdef PWM_AUDIO
467 ENABLE_AUDIO_COUNTER_3_ISR;
468#else
469 ENABLE_AUDIO_COUNTER_3_ISR;
470 ENABLE_AUDIO_COUNTER_3_OUTPUT;
471#endif
472 }
473}
474
475void play_notes(float (*np)[][2], uint16_t n_count, bool n_repeat, float n_rest) {
476 if (!audio_initialized) {
477 audio_init();
478 }
479
480 if (audio_config.enable) {
481 DISABLE_AUDIO_COUNTER_3_ISR;
482
483 // Cancel note if a note is playing
484 if (playing_note) stop_all_notes();
485
486 playing_notes = true;
487
488 notes_pointer = np;
489 notes_count = n_count;
490 notes_repeat = n_repeat;
491 notes_rest = n_rest;
492
493 place = 0;
494 current_note = 0;
495
496#ifdef PWM_AUDIO
497 note_frequency = (*notes_pointer)[current_note][0] / SAMPLE_RATE;
498 note_length = (*notes_pointer)[current_note][1] * (((float)note_tempo) / 100);
499#else
500 note_frequency = (*notes_pointer)[current_note][0];
501 note_length = ((*notes_pointer)[current_note][1] / 4) * (((float)note_tempo) / 100);
502#endif
503 note_position = 0;
504
505#ifdef PWM_AUDIO
506 ENABLE_AUDIO_COUNTER_3_ISR;
507#else
508 ENABLE_AUDIO_COUNTER_3_ISR;
509 ENABLE_AUDIO_COUNTER_3_OUTPUT;
510#endif
511 }
512}
513
514#ifdef PWM_AUDIO
515void play_sample(uint8_t* s, uint16_t l, bool r) {
516 if (!audio_initialized) {
517 audio_init();
518 }
519
520 if (audio_config.enable) {
521 DISABLE_AUDIO_COUNTER_3_ISR;
522 stop_all_notes();
523 place_int = 0;
524 sample = s;
525 sample_length = l;
526 repeat = r;
527
528 ENABLE_AUDIO_COUNTER_3_ISR;
529 }
530}
531#endif
532
533void audio_toggle(void) {
534 audio_config.enable ^= 1;
535 eeconfig_update_audio(audio_config.raw);
536}
537
538void audio_on(void) {
539 audio_config.enable = 1;
540 eeconfig_update_audio(audio_config.raw);
541}
542
543void audio_off(void) {
544 audio_config.enable = 0;
545 eeconfig_update_audio(audio_config.raw);
546}
547
548#ifdef VIBRATO_ENABLE
549
550// Vibrato rate functions
551
552void set_vibrato_rate(float rate) { vibrato_rate = rate; }
553
554void increase_vibrato_rate(float change) { vibrato_rate *= change; }
555
556void decrease_vibrato_rate(float change) { vibrato_rate /= change; }
557
558# ifdef VIBRATO_STRENGTH_ENABLE
559
560void set_vibrato_strength(float strength) { vibrato_strength = strength; }
561
562void increase_vibrato_strength(float change) { vibrato_strength *= change; }
563
564void decrease_vibrato_strength(float change) { vibrato_strength /= change; }
565
566# endif /* VIBRATO_STRENGTH_ENABLE */
567
568#endif /* VIBRATO_ENABLE */
569
570// Polyphony functions
571
572void set_polyphony_rate(float rate) { polyphony_rate = rate; }
573
574void enable_polyphony() { polyphony_rate = 5; }
575
576void disable_polyphony() { polyphony_rate = 0; }
577
578void increase_polyphony_rate(float change) { polyphony_rate *= change; }
579
580void decrease_polyphony_rate(float change) { polyphony_rate /= change; }
581
582// Timbre function
583
584void set_timbre(float timbre) { note_timbre = timbre; }
585
586// Tempo functions
587
588void set_tempo(uint8_t tempo) { note_tempo = tempo; }
589
590void decrease_tempo(uint8_t tempo_change) { note_tempo += tempo_change; }
591
592void increase_tempo(uint8_t tempo_change) {
593 if (note_tempo - tempo_change < 10) {
594 note_tempo = 10;
595 } else {
596 note_tempo -= tempo_change;
597 }
598}
599
600//------------------------------------------------------------------------------
601// Override these functions in your keymap file to play different tunes on
602// startup and bootloader jump
603__attribute__((weak)) void play_startup_tone() {}
604
605__attribute__((weak)) void play_goodbye_tone() {}
606//------------------------------------------------------------------------------
diff --git a/quantum/audio/driver_avr_pwm.h b/quantum/audio/driver_avr_pwm.h
new file mode 100644
index 000000000..d6eb3571d
--- /dev/null
+++ b/quantum/audio/driver_avr_pwm.h
@@ -0,0 +1,17 @@
1/* Copyright 2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
diff --git a/quantum/audio/driver_avr_pwm_hardware.c b/quantum/audio/driver_avr_pwm_hardware.c
new file mode 100644
index 000000000..492b9bfb0
--- /dev/null
+++ b/quantum/audio/driver_avr_pwm_hardware.c
@@ -0,0 +1,322 @@
1/* Copyright 2016 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#if defined(__AVR__)
19# include <avr/pgmspace.h>
20# include <avr/interrupt.h>
21# include <avr/io.h>
22#endif
23
24#include "audio.h"
25
26extern bool playing_note;
27extern bool playing_melody;
28extern uint8_t note_timbre;
29
30#define CPU_PRESCALER 8
31
32/*
33 Audio Driver: PWM
34
35 drive up to two speakers through the AVR PWM hardware-peripheral, using timer1 and/or timer3 on Atmega32U4.
36
37 the primary channel_1 can be connected to either pin PC4 PC5 or PC6 (the later being used by most AVR based keyboards) with a PMW signal generated by timer3
38 and an optional secondary channel_2 on either pin PB5, PB6 or PB7, with a PWM signal from timer1
39
40 alternatively, the PWM pins on PORTB can be used as only/primary speaker
41*/
42
43#if defined(AUDIO_PIN) && (AUDIO_PIN != C4) && (AUDIO_PIN != C5) && (AUDIO_PIN != C6) && (AUDIO_PIN != B5) && (AUDIO_PIN != B6) && (AUDIO_PIN != B7)
44# error "Audio feature enabled, but no suitable pin selected as AUDIO_PIN - see docs/feature_audio under the AVR settings for available options."
45#endif
46
47#if (AUDIO_PIN == C4) || (AUDIO_PIN == C5) || (AUDIO_PIN == C6)
48# define AUDIO1_PIN_SET
49# define AUDIO1_TIMSKx TIMSK3
50# define AUDIO1_TCCRxA TCCR3A
51# define AUDIO1_TCCRxB TCCR3B
52# define AUDIO1_ICRx ICR3
53# define AUDIO1_WGMx0 WGM30
54# define AUDIO1_WGMx1 WGM31
55# define AUDIO1_WGMx2 WGM32
56# define AUDIO1_WGMx3 WGM33
57# define AUDIO1_CSx0 CS30
58# define AUDIO1_CSx1 CS31
59# define AUDIO1_CSx2 CS32
60
61# if (AUDIO_PIN == C6)
62# define AUDIO1_COMxy0 COM3A0
63# define AUDIO1_COMxy1 COM3A1
64# define AUDIO1_OCIExy OCIE3A
65# define AUDIO1_OCRxy OCR3A
66# define AUDIO1_PIN C6
67# define AUDIO1_TIMERx_COMPy_vect TIMER3_COMPA_vect
68# elif (AUDIO_PIN == C5)
69# define AUDIO1_COMxy0 COM3B0
70# define AUDIO1_COMxy1 COM3B1
71# define AUDIO1_OCIExy OCIE3B
72# define AUDIO1_OCRxy OCR3B
73# define AUDIO1_PIN C5
74# define AUDIO1_TIMERx_COMPy_vect TIMER3_COMPB_vect
75# elif (AUDIO_PIN == C4)
76# define AUDIO1_COMxy0 COM3C0
77# define AUDIO1_COMxy1 COM3C1
78# define AUDIO1_OCIExy OCIE3C
79# define AUDIO1_OCRxy OCR3C
80# define AUDIO1_PIN C4
81# define AUDIO1_TIMERx_COMPy_vect TIMER3_COMPC_vect
82# endif
83#endif
84
85#if defined(AUDIO_PIN) && defined(AUDIO_PIN_ALT) && (AUDIO_PIN == AUDIO_PIN_ALT)
86# error "Audio feature: AUDIO_PIN and AUDIO_PIN_ALT on the same pin makes no sense."
87#endif
88
89#if ((AUDIO_PIN == B5) && ((AUDIO_PIN_ALT == B6) || (AUDIO_PIN_ALT == B7))) || ((AUDIO_PIN == B6) && ((AUDIO_PIN_ALT == B5) || (AUDIO_PIN_ALT == B7))) || ((AUDIO_PIN == B7) && ((AUDIO_PIN_ALT == B5) || (AUDIO_PIN_ALT == B6)))
90# error "Audio feature: PORTB as AUDIO_PIN and AUDIO_PIN_ALT at the same time is not supported."
91#endif
92
93#if defined(AUDIO_PIN_ALT) && (AUDIO_PIN_ALT != B5) && (AUDIO_PIN_ALT != B6) && (AUDIO_PIN_ALT != B7)
94# error "Audio feature: the pin selected as AUDIO_PIN_ALT is not supported."
95#endif
96
97#if (AUDIO_PIN == B5) || (AUDIO_PIN == B6) || (AUDIO_PIN == B7) || (AUDIO_PIN_ALT == B5) || (AUDIO_PIN_ALT == B6) || (AUDIO_PIN_ALT == B7)
98# define AUDIO2_PIN_SET
99# define AUDIO2_TIMSKx TIMSK1
100# define AUDIO2_TCCRxA TCCR1A
101# define AUDIO2_TCCRxB TCCR1B
102# define AUDIO2_ICRx ICR1
103# define AUDIO2_WGMx0 WGM10
104# define AUDIO2_WGMx1 WGM11
105# define AUDIO2_WGMx2 WGM12
106# define AUDIO2_WGMx3 WGM13
107# define AUDIO2_CSx0 CS10
108# define AUDIO2_CSx1 CS11
109# define AUDIO2_CSx2 CS12
110
111# if (AUDIO_PIN == B5) || (AUDIO_PIN_ALT == B5)
112# define AUDIO2_COMxy0 COM1A0
113# define AUDIO2_COMxy1 COM1A1
114# define AUDIO2_OCIExy OCIE1A
115# define AUDIO2_OCRxy OCR1A
116# define AUDIO2_PIN B5
117# define AUDIO2_TIMERx_COMPy_vect TIMER1_COMPA_vect
118# elif (AUDIO_PIN == B6) || (AUDIO_PIN_ALT == B6)
119# define AUDIO2_COMxy0 COM1B0
120# define AUDIO2_COMxy1 COM1B1
121# define AUDIO2_OCIExy OCIE1B
122# define AUDIO2_OCRxy OCR1B
123# define AUDIO2_PIN B6
124# define AUDIO2_TIMERx_COMPy_vect TIMER1_COMPB_vect
125# elif (AUDIO_PIN == B7) || (AUDIO_PIN_ALT == B7)
126# define AUDIO2_COMxy0 COM1C0
127# define AUDIO2_COMxy1 COM1C1
128# define AUDIO2_OCIExy OCIE1C
129# define AUDIO2_OCRxy OCR1C
130# define AUDIO2_PIN B7
131# define AUDIO2_TIMERx_COMPy_vect TIMER1_COMPC_vect
132# endif
133#endif
134
135// C6 seems to be the assumed default by many existing keyboard - but sill warn the user
136#if !defined(AUDIO1_PIN_SET) && !defined(AUDIO2_PIN_SET)
137# pragma message "Audio feature enabled, but no suitable pin selected - see docs/feature_audio under the AVR settings for available options. Don't expect to hear anything... :-)"
138// TODO: make this an error - go through the breaking-change-process and change all keyboards to the new define
139#endif
140// -----------------------------------------------------------------------------
141
142#ifdef AUDIO1_PIN_SET
143static float channel_1_frequency = 0.0f;
144void channel_1_set_frequency(float freq) {
145 if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0
146 {
147 // disable the output, but keep the pwm-ISR going (with the previous
148 // frequency) so the audio-state keeps getting updated
149 // Note: setting the duty-cycle 0 is not possible on non-inverting PWM mode - see the AVR data-sheet
150 AUDIO1_TCCRxA &= ~(_BV(AUDIO1_COMxy1) | _BV(AUDIO1_COMxy0));
151 return;
152 } else {
153 AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode
154 }
155
156 channel_1_frequency = freq;
157
158 // set pwm period
159 AUDIO1_ICRx = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
160 // and duty cycle
161 AUDIO1_OCRxy = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre / 100);
162}
163
164void channel_1_start(void) {
165 // enable timer-counter ISR
166 AUDIO1_TIMSKx |= _BV(AUDIO1_OCIExy);
167 // enable timer-counter output
168 AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1);
169}
170
171void channel_1_stop(void) {
172 // disable timer-counter ISR
173 AUDIO1_TIMSKx &= ~_BV(AUDIO1_OCIExy);
174 // disable timer-counter output
175 AUDIO1_TCCRxA &= ~(_BV(AUDIO1_COMxy1) | _BV(AUDIO1_COMxy0));
176}
177#endif
178
179#ifdef AUDIO2_PIN_SET
180static float channel_2_frequency = 0.0f;
181void channel_2_set_frequency(float freq) {
182 if (freq == 0.0f) {
183 AUDIO2_TCCRxA &= ~(_BV(AUDIO2_COMxy1) | _BV(AUDIO2_COMxy0));
184 return;
185 } else {
186 AUDIO2_TCCRxA |= _BV(AUDIO2_COMxy1);
187 }
188
189 channel_2_frequency = freq;
190
191 AUDIO2_ICRx = (uint16_t)(((float)F_CPU) / (freq * CPU_PRESCALER));
192 AUDIO2_OCRxy = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre / 100);
193}
194
195float channel_2_get_frequency(void) { return channel_2_frequency; }
196
197void channel_2_start(void) {
198 AUDIO2_TIMSKx |= _BV(AUDIO2_OCIExy);
199 AUDIO2_TCCRxA |= _BV(AUDIO2_COMxy1);
200}
201
202void channel_2_stop(void) {
203 AUDIO2_TIMSKx &= ~_BV(AUDIO2_OCIExy);
204 AUDIO2_TCCRxA &= ~(_BV(AUDIO2_COMxy1) | _BV(AUDIO2_COMxy0));
205}
206#endif
207
208void audio_driver_initialize() {
209#ifdef AUDIO1_PIN_SET
210 channel_1_stop();
211 setPinOutput(AUDIO1_PIN);
212#endif
213
214#ifdef AUDIO2_PIN_SET
215 channel_2_stop();
216 setPinOutput(AUDIO2_PIN);
217#endif
218
219 // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers TCCR3A/TCCR3B, TCCR1A/TCCR1B
220 // Compare Output Mode (COM3An and COM1An) = 0b00 = Normal port operation
221 // OC3A -- PC6
222 // OC3B -- PC5
223 // OC3C -- PC4
224 // OC1A -- PB5
225 // OC1B -- PB6
226 // OC1C -- PB7
227
228 // Waveform Generation Mode (WGM3n) = 0b1110 = Fast PWM Mode 14. Period = ICR3, Duty Cycle OCR3A)
229 // OCR3A - PC6
230 // OCR3B - PC5
231 // OCR3C - PC4
232 // OCR1A - PB5
233 // OCR1B - PB6
234 // OCR1C - PB7
235
236 // Clock Select (CS3n) = 0b010 = Clock / 8
237#ifdef AUDIO1_PIN_SET
238 // initialize timer-counter
239 AUDIO1_TCCRxA = (0 << AUDIO1_COMxy1) | (0 << AUDIO1_COMxy0) | (1 << AUDIO1_WGMx1) | (0 << AUDIO1_WGMx0);
240 AUDIO1_TCCRxB = (1 << AUDIO1_WGMx3) | (1 << AUDIO1_WGMx2) | (0 << AUDIO1_CSx2) | (1 << AUDIO1_CSx1) | (0 << AUDIO1_CSx0);
241#endif
242
243#ifdef AUDIO2_PIN_SET
244 AUDIO2_TCCRxA = (0 << AUDIO2_COMxy1) | (0 << AUDIO2_COMxy0) | (1 << AUDIO2_WGMx1) | (0 << AUDIO2_WGMx0);
245 AUDIO2_TCCRxB = (1 << AUDIO2_WGMx3) | (1 << AUDIO2_WGMx2) | (0 << AUDIO2_CSx2) | (1 << AUDIO2_CSx1) | (0 << AUDIO2_CSx0);
246#endif
247}
248
249void audio_driver_stop() {
250#ifdef AUDIO1_PIN_SET
251 channel_1_stop();
252#endif
253
254#ifdef AUDIO2_PIN_SET
255 channel_2_stop();
256#endif
257}
258
259void audio_driver_start(void) {
260#ifdef AUDIO1_PIN_SET
261 channel_1_start();
262 if (playing_note) {
263 channel_1_set_frequency(audio_get_processed_frequency(0));
264 }
265#endif
266
267#if !defined(AUDIO1_PIN_SET) && defined(AUDIO2_PIN_SET)
268 channel_2_start();
269 if (playing_note) {
270 channel_2_set_frequency(audio_get_processed_frequency(0));
271 }
272#endif
273}
274
275static volatile uint32_t isr_counter = 0;
276#ifdef AUDIO1_PIN_SET
277ISR(AUDIO1_TIMERx_COMPy_vect) {
278 isr_counter++;
279 if (isr_counter < channel_1_frequency / (CPU_PRESCALER * 8)) return;
280
281 isr_counter = 0;
282 bool state_changed = audio_update_state();
283
284 if (!playing_note && !playing_melody) {
285 channel_1_stop();
286# ifdef AUDIO2_PIN_SET
287 channel_2_stop();
288# endif
289 return;
290 }
291
292 if (state_changed) {
293 channel_1_set_frequency(audio_get_processed_frequency(0));
294# ifdef AUDIO2_PIN_SET
295 if (audio_get_number_of_active_tones() > 1) {
296 channel_2_set_frequency(audio_get_processed_frequency(1));
297 } else {
298 channel_2_stop();
299 }
300# endif
301 }
302}
303#endif
304
305#if !defined(AUDIO1_PIN_SET) && defined(AUDIO2_PIN_SET)
306ISR(AUDIO2_TIMERx_COMPy_vect) {
307 isr_counter++;
308 if (isr_counter < channel_2_frequency / (CPU_PRESCALER * 8)) return;
309
310 isr_counter = 0;
311 bool state_changed = audio_update_state();
312
313 if (!playing_note && !playing_melody) {
314 channel_2_stop();
315 return;
316 }
317
318 if (state_changed) {
319 channel_2_set_frequency(audio_get_processed_frequency(0));
320 }
321}
322#endif
diff --git a/quantum/audio/driver_chibios_dac.h b/quantum/audio/driver_chibios_dac.h
new file mode 100644
index 000000000..07cd622ea
--- /dev/null
+++ b/quantum/audio/driver_chibios_dac.h
@@ -0,0 +1,126 @@
1/* Copyright 2019 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#ifndef A4
20# define A4 PAL_LINE(GPIOA, 4)
21#endif
22#ifndef A5
23# define A5 PAL_LINE(GPIOA, 5)
24#endif
25
26/**
27 * Size of the dac_buffer arrays. All must be the same size.
28 */
29#define AUDIO_DAC_BUFFER_SIZE 256U
30
31/**
32 * Highest value allowed sample value.
33
34 * since the DAC is limited to 12 bit, the absolute max is 0xfff = 4095U;
35 * lower values adjust the peak-voltage aka volume down.
36 * adjusting this value has only an effect on a sample-buffer whose values are
37 * are NOT pregenerated - see square-wave
38 */
39#ifndef AUDIO_DAC_SAMPLE_MAX
40# define AUDIO_DAC_SAMPLE_MAX 4095U
41#endif
42
43#if !defined(AUDIO_DAC_SAMPLE_RATE) && !defined(AUDIO_MAX_SIMULTANEOUS_TONES) && !defined(AUDIO_DAC_QUALITY_VERY_LOW) && !defined(AUDIO_DAC_QUALITY_LOW) && !defined(AUDIO_DAC_QUALITY_HIGH) && !defined(AUDIO_DAC_QUALITY_VERY_HIGH)
44# define AUDIO_DAC_QUALITY_SANE_MINIMUM
45#endif
46
47/**
48 * These presets allow you to quickly switch between quality settings for
49 * the DAC. The sample rate and maximum number of simultaneous tones roughly
50 * has an inverse relationship - slightly higher sample rates may be possible.
51 *
52 * NOTE: a high sample-rate results in a higher cpu-load, which might lead to
53 * (audible) discontinuities and/or starve other processes of cpu-time
54 * (like RGB-led back-lighting, ...)
55 */
56#ifdef AUDIO_DAC_QUALITY_VERY_LOW
57# define AUDIO_DAC_SAMPLE_RATE 11025U
58# define AUDIO_MAX_SIMULTANEOUS_TONES 8
59#endif
60
61#ifdef AUDIO_DAC_QUALITY_LOW
62# define AUDIO_DAC_SAMPLE_RATE 22050U
63# define AUDIO_MAX_SIMULTANEOUS_TONES 4
64#endif
65
66#ifdef AUDIO_DAC_QUALITY_HIGH
67# define AUDIO_DAC_SAMPLE_RATE 44100U
68# define AUDIO_MAX_SIMULTANEOUS_TONES 2
69#endif
70
71#ifdef AUDIO_DAC_QUALITY_VERY_HIGH
72# define AUDIO_DAC_SAMPLE_RATE 88200U
73# define AUDIO_MAX_SIMULTANEOUS_TONES 1
74#endif
75
76#ifdef AUDIO_DAC_QUALITY_SANE_MINIMUM
77/* a sane-minimum config: with a trade-off between cpu-load and tone-range
78 *
79 * the (currently) highest defined note is NOTE_B8 with 7902Hz; if we now
80 * aim for an even even multiple of the buffer-size, we end up with:
81 * ( roundUptoPow2(highest note / AUDIO_DAC_BUFFER_SIZE) * nyquist-rate * AUDIO_DAC_BUFFER_SIZE)
82 * 7902/256 = 30.867 * 2 * 256 ~= 16384
83 * which works out (but the 'scope shows some sampling artifacts with lower harmonics :-P)
84 */
85# define AUDIO_DAC_SAMPLE_RATE 16384U
86# define AUDIO_MAX_SIMULTANEOUS_TONES 8
87#endif
88
89/**
90 * Effective bit-rate of the DAC. 44.1khz is the standard for most audio - any
91 * lower will sacrifice perceptible audio quality. Any higher will limit the
92 * number of simultaneous tones. In most situations, a tenth (1/10) of the
93 * sample rate is where notes become unbearable.
94 */
95#ifndef AUDIO_DAC_SAMPLE_RATE
96# define AUDIO_DAC_SAMPLE_RATE 44100U
97#endif
98
99/**
100 * The number of tones that can be played simultaneously. If too high a value
101 * is used here, the keyboard will freeze and glitch-out when that many tones
102 * are being played.
103 */
104#ifndef AUDIO_MAX_SIMULTANEOUS_TONES
105# define AUDIO_MAX_SIMULTANEOUS_TONES 2
106#endif
107
108/**
109 * The default value of the DAC when not playing anything. Certain hardware
110 * setups may require a high (AUDIO_DAC_SAMPLE_MAX) or low (0) value here.
111 * Since multiple added sine waves tend to oscillate around the midpoint,
112 * and possibly never/rarely reach either 0 of MAX, 1/2 MAX can be a
113 * reasonable default value.
114 */
115#ifndef AUDIO_DAC_OFF_VALUE
116# define AUDIO_DAC_OFF_VALUE AUDIO_DAC_SAMPLE_MAX / 2
117#endif
118
119#if AUDIO_DAC_OFF_VALUE > AUDIO_DAC_SAMPLE_MAX
120# error "AUDIO_DAC: OFF_VALUE may not be larger than SAMPLE_MAX"
121#endif
122
123/**
124 *user overridable sample generation/processing
125 */
126uint16_t dac_value_generate(void);
diff --git a/quantum/audio/driver_chibios_dac_additive.c b/quantum/audio/driver_chibios_dac_additive.c
new file mode 100644
index 000000000..db304adb8
--- /dev/null
+++ b/quantum/audio/driver_chibios_dac_additive.c
@@ -0,0 +1,335 @@
1/* Copyright 2016-2019 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "audio.h"
19#include <ch.h>
20#include <hal.h>
21
22/*
23 Audio Driver: DAC
24
25 which utilizes the dac unit many STM32 are equipped with, to output a modulated waveform from samples stored in the dac_buffer_* array who are passed to the hardware through DMA
26
27 it is also possible to have a custom sample-LUT by implementing/overriding 'dac_value_generate'
28
29 this driver allows for multiple simultaneous tones to be played through one single channel by doing additive wave-synthesis
30*/
31
32#if !defined(AUDIO_PIN)
33# error "Audio feature enabled, but no suitable pin selected as AUDIO_PIN - see docs/feature_audio under 'ARM (DAC additive)' for available options."
34#endif
35#if defined(AUDIO_PIN_ALT) && !defined(AUDIO_PIN_ALT_AS_NEGATIVE)
36# pragma message "Audio feature: AUDIO_PIN_ALT set, but not AUDIO_PIN_ALT_AS_NEGATIVE - pin will be left unused; audio might still work though."
37#endif
38
39#if !defined(AUDIO_PIN_ALT)
40// no ALT pin defined is valid, but the c-ifs below need some value set
41# define AUDIO_PIN_ALT PAL_NOLINE
42#endif
43
44#if !defined(AUDIO_DAC_SAMPLE_WAVEFORM_SINE) && !defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE) && !defined(AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE) && !defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID)
45# define AUDIO_DAC_SAMPLE_WAVEFORM_SINE
46#endif
47
48#ifdef AUDIO_DAC_SAMPLE_WAVEFORM_SINE
49/* one full sine wave over [0,2*pi], but shifted up one amplitude and left pi/4; for the samples to start at 0
50 */
51static const dacsample_t dac_buffer_sine[AUDIO_DAC_BUFFER_SIZE] = {
52 // 256 values, max 4095
53 0x0, 0x1, 0x2, 0x6, 0xa, 0xf, 0x16, 0x1e, 0x27, 0x32, 0x3d, 0x4a, 0x58, 0x67, 0x78, 0x89, 0x9c, 0xb0, 0xc5, 0xdb, 0xf2, 0x10a, 0x123, 0x13e, 0x159, 0x175, 0x193, 0x1b1, 0x1d1, 0x1f1, 0x212, 0x235, 0x258, 0x27c, 0x2a0, 0x2c6, 0x2ed, 0x314, 0x33c, 0x365, 0x38e, 0x3b8, 0x3e3, 0x40e, 0x43a, 0x467, 0x494, 0x4c2, 0x4f0, 0x51f, 0x54e, 0x57d, 0x5ad, 0x5dd, 0x60e, 0x63f, 0x670, 0x6a1, 0x6d3, 0x705, 0x737, 0x769, 0x79b, 0x7cd, 0x800, 0x832, 0x864, 0x896, 0x8c8, 0x8fa, 0x92c, 0x95e, 0x98f, 0x9c0, 0x9f1, 0xa22, 0xa52, 0xa82, 0xab1, 0xae0, 0xb0f, 0xb3d, 0xb6b, 0xb98, 0xbc5, 0xbf1, 0xc1c, 0xc47, 0xc71, 0xc9a, 0xcc3, 0xceb, 0xd12, 0xd39, 0xd5f, 0xd83, 0xda7, 0xdca, 0xded, 0xe0e, 0xe2e, 0xe4e, 0xe6c, 0xe8a, 0xea6, 0xec1, 0xedc, 0xef5, 0xf0d, 0xf24, 0xf3a, 0xf4f, 0xf63, 0xf76, 0xf87, 0xf98, 0xfa7, 0xfb5, 0xfc2, 0xfcd, 0xfd8, 0xfe1, 0xfe9, 0xff0, 0xff5, 0xff9, 0xffd, 0xffe,
54 0xfff, 0xffe, 0xffd, 0xff9, 0xff5, 0xff0, 0xfe9, 0xfe1, 0xfd8, 0xfcd, 0xfc2, 0xfb5, 0xfa7, 0xf98, 0xf87, 0xf76, 0xf63, 0xf4f, 0xf3a, 0xf24, 0xf0d, 0xef5, 0xedc, 0xec1, 0xea6, 0xe8a, 0xe6c, 0xe4e, 0xe2e, 0xe0e, 0xded, 0xdca, 0xda7, 0xd83, 0xd5f, 0xd39, 0xd12, 0xceb, 0xcc3, 0xc9a, 0xc71, 0xc47, 0xc1c, 0xbf1, 0xbc5, 0xb98, 0xb6b, 0xb3d, 0xb0f, 0xae0, 0xab1, 0xa82, 0xa52, 0xa22, 0x9f1, 0x9c0, 0x98f, 0x95e, 0x92c, 0x8fa, 0x8c8, 0x896, 0x864, 0x832, 0x800, 0x7cd, 0x79b, 0x769, 0x737, 0x705, 0x6d3, 0x6a1, 0x670, 0x63f, 0x60e, 0x5dd, 0x5ad, 0x57d, 0x54e, 0x51f, 0x4f0, 0x4c2, 0x494, 0x467, 0x43a, 0x40e, 0x3e3, 0x3b8, 0x38e, 0x365, 0x33c, 0x314, 0x2ed, 0x2c6, 0x2a0, 0x27c, 0x258, 0x235, 0x212, 0x1f1, 0x1d1, 0x1b1, 0x193, 0x175, 0x159, 0x13e, 0x123, 0x10a, 0xf2, 0xdb, 0xc5, 0xb0, 0x9c, 0x89, 0x78, 0x67, 0x58, 0x4a, 0x3d, 0x32, 0x27, 0x1e, 0x16, 0xf, 0xa, 0x6, 0x2, 0x1};
55#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SINE
56#ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE
57static const dacsample_t dac_buffer_triangle[AUDIO_DAC_BUFFER_SIZE] = {
58 // 256 values, max 4095
59 0x0, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0, 0xe0, 0x100, 0x120, 0x140, 0x160, 0x180, 0x1a0, 0x1c0, 0x1e0, 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0x3c0, 0x3e0, 0x400, 0x420, 0x440, 0x460, 0x480, 0x4a0, 0x4c0, 0x4e0, 0x500, 0x520, 0x540, 0x560, 0x580, 0x5a0, 0x5c0, 0x5e0, 0x600, 0x620, 0x640, 0x660, 0x680, 0x6a0, 0x6c0, 0x6e0, 0x700, 0x720, 0x740, 0x760, 0x780, 0x7a0, 0x7c0, 0x7e0, 0x800, 0x81f, 0x83f, 0x85f, 0x87f, 0x89f, 0x8bf, 0x8df, 0x8ff, 0x91f, 0x93f, 0x95f, 0x97f, 0x99f, 0x9bf, 0x9df, 0x9ff, 0xa1f, 0xa3f, 0xa5f, 0xa7f, 0xa9f, 0xabf, 0xadf, 0xaff, 0xb1f, 0xb3f, 0xb5f, 0xb7f, 0xb9f, 0xbbf, 0xbdf, 0xbff, 0xc1f, 0xc3f, 0xc5f, 0xc7f, 0xc9f, 0xcbf, 0xcdf, 0xcff, 0xd1f, 0xd3f, 0xd5f, 0xd7f, 0xd9f, 0xdbf, 0xddf, 0xdff, 0xe1f, 0xe3f, 0xe5f, 0xe7f, 0xe9f, 0xebf, 0xedf, 0xeff, 0xf1f, 0xf3f, 0xf5f, 0xf7f, 0xf9f, 0xfbf, 0xfdf,
60 0xfff, 0xfdf, 0xfbf, 0xf9f, 0xf7f, 0xf5f, 0xf3f, 0xf1f, 0xeff, 0xedf, 0xebf, 0xe9f, 0xe7f, 0xe5f, 0xe3f, 0xe1f, 0xdff, 0xddf, 0xdbf, 0xd9f, 0xd7f, 0xd5f, 0xd3f, 0xd1f, 0xcff, 0xcdf, 0xcbf, 0xc9f, 0xc7f, 0xc5f, 0xc3f, 0xc1f, 0xbff, 0xbdf, 0xbbf, 0xb9f, 0xb7f, 0xb5f, 0xb3f, 0xb1f, 0xaff, 0xadf, 0xabf, 0xa9f, 0xa7f, 0xa5f, 0xa3f, 0xa1f, 0x9ff, 0x9df, 0x9bf, 0x99f, 0x97f, 0x95f, 0x93f, 0x91f, 0x8ff, 0x8df, 0x8bf, 0x89f, 0x87f, 0x85f, 0x83f, 0x81f, 0x800, 0x7e0, 0x7c0, 0x7a0, 0x780, 0x760, 0x740, 0x720, 0x700, 0x6e0, 0x6c0, 0x6a0, 0x680, 0x660, 0x640, 0x620, 0x600, 0x5e0, 0x5c0, 0x5a0, 0x580, 0x560, 0x540, 0x520, 0x500, 0x4e0, 0x4c0, 0x4a0, 0x480, 0x460, 0x440, 0x420, 0x400, 0x3e0, 0x3c0, 0x3a0, 0x380, 0x360, 0x340, 0x320, 0x300, 0x2e0, 0x2c0, 0x2a0, 0x280, 0x260, 0x240, 0x220, 0x200, 0x1e0, 0x1c0, 0x1a0, 0x180, 0x160, 0x140, 0x120, 0x100, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20};
61#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE
62#ifdef AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE
63static const dacsample_t dac_buffer_square[AUDIO_DAC_BUFFER_SIZE] = {
64 [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = 0, // first and
65 [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = AUDIO_DAC_SAMPLE_MAX, // second half
66};
67#endif // AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE
68/*
69// four steps: 0, 1/3, 2/3 and 1
70static const dacsample_t dac_buffer_staircase[AUDIO_DAC_BUFFER_SIZE] = {
71 [0 ... AUDIO_DAC_BUFFER_SIZE/3 -1 ] = 0,
72 [AUDIO_DAC_BUFFER_SIZE / 4 ... AUDIO_DAC_BUFFER_SIZE / 2 -1 ] = AUDIO_DAC_SAMPLE_MAX / 3,
73 [AUDIO_DAC_BUFFER_SIZE / 2 ... 3 * AUDIO_DAC_BUFFER_SIZE / 4 -1 ] = 2 * AUDIO_DAC_SAMPLE_MAX / 3,
74 [3 * AUDIO_DAC_BUFFER_SIZE / 4 ... AUDIO_DAC_BUFFER_SIZE -1 ] = AUDIO_DAC_SAMPLE_MAX,
75}
76*/
77#ifdef AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID
78static const dacsample_t dac_buffer_trapezoid[AUDIO_DAC_BUFFER_SIZE] = {0x0, 0x1f, 0x7f, 0xdf, 0x13f, 0x19f, 0x1ff, 0x25f, 0x2bf, 0x31f, 0x37f, 0x3df, 0x43f, 0x49f, 0x4ff, 0x55f, 0x5bf, 0x61f, 0x67f, 0x6df, 0x73f, 0x79f, 0x7ff, 0x85f, 0x8bf, 0x91f, 0x97f, 0x9df, 0xa3f, 0xa9f, 0xaff, 0xb5f, 0xbbf, 0xc1f, 0xc7f, 0xcdf, 0xd3f, 0xd9f, 0xdff, 0xe5f, 0xebf, 0xf1f, 0xf7f, 0xfdf, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff, 0xfff,
79 0xfff, 0xfdf, 0xf7f, 0xf1f, 0xebf, 0xe5f, 0xdff, 0xd9f, 0xd3f, 0xcdf, 0xc7f, 0xc1f, 0xbbf, 0xb5f, 0xaff, 0xa9f, 0xa3f, 0x9df, 0x97f, 0x91f, 0x8bf, 0x85f, 0x7ff, 0x79f, 0x73f, 0x6df, 0x67f, 0x61f, 0x5bf, 0x55f, 0x4ff, 0x49f, 0x43f, 0x3df, 0x37f, 0x31f, 0x2bf, 0x25f, 0x1ff, 0x19f, 0x13f, 0xdf, 0x7f, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
80#endif // AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID
81
82static dacsample_t dac_buffer_empty[AUDIO_DAC_BUFFER_SIZE] = {AUDIO_DAC_OFF_VALUE};
83
84/* keep track of the sample position for for each frequency */
85static float dac_if[AUDIO_MAX_SIMULTANEOUS_TONES] = {0.0};
86
87static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0, 0};
88static uint8_t active_tones_snapshot_length = 0;
89
90typedef enum {
91 OUTPUT_SHOULD_START,
92 OUTPUT_RUN_NORMALLY,
93 // path 1: wait for zero, then change/update active tones
94 OUTPUT_TONES_CHANGED,
95 OUTPUT_REACHED_ZERO_BEFORE_TONE_CHANGE,
96 // path 2: hardware should stop, wait for zero then turn output off = stop the timer
97 OUTPUT_SHOULD_STOP,
98 OUTPUT_REACHED_ZERO_BEFORE_OFF,
99 OUTPUT_OFF,
100 OUTPUT_OFF_1,
101 OUTPUT_OFF_2, // trailing off: giving the DAC two more conversion cycles until the AUDIO_DAC_OFF_VALUE reaches the output, then turn the timer off, which leaves the output at that level
102 number_of_output_states
103} output_states_t;
104output_states_t state = OUTPUT_OFF_2;
105
106/**
107 * Generation of the waveform being passed to the callback. Declared weak so users
108 * can override it with their own wave-forms/noises.
109 */
110__attribute__((weak)) uint16_t dac_value_generate(void) {
111 // DAC is running/asking for values but snapshot length is zero -> must be playing a pause
112 if (active_tones_snapshot_length == 0) {
113 return AUDIO_DAC_OFF_VALUE;
114 }
115
116 /* doing additive wave synthesis over all currently playing tones = adding up
117 * sine-wave-samples for each frequency, scaled by the number of active tones
118 */
119 uint16_t value = 0;
120 float frequency = 0.0f;
121
122 for (uint8_t i = 0; i < active_tones_snapshot_length; i++) {
123 /* Note: a user implementation does not have to rely on the active_tones_snapshot, but
124 * could directly query the active frequencies through audio_get_processed_frequency */
125 frequency = active_tones_snapshot[i];
126
127 dac_if[i] = dac_if[i] + ((frequency * AUDIO_DAC_BUFFER_SIZE) / AUDIO_DAC_SAMPLE_RATE) * 2 / 3;
128 /*Note: the 2/3 are necessary to get the correct frequencies on the
129 * DAC output (as measured with an oscilloscope), since the gpt
130 * timer runs with 3*AUDIO_DAC_SAMPLE_RATE; and the DAC callback
131 * is called twice per conversion.*/
132
133 dac_if[i] = fmod(dac_if[i], AUDIO_DAC_BUFFER_SIZE);
134
135 // Wavetable generation/lookup
136 uint16_t dac_i = (uint16_t)dac_if[i];
137
138#if defined(AUDIO_DAC_SAMPLE_WAVEFORM_SINE)
139 value += dac_buffer_sine[dac_i] / active_tones_snapshot_length;
140#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRIANGLE)
141 value += dac_buffer_triangle[dac_i] / active_tones_snapshot_length;
142#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_TRAPEZOID)
143 value += dac_buffer_trapezoid[dac_i] / active_tones_snapshot_length;
144#elif defined(AUDIO_DAC_SAMPLE_WAVEFORM_SQUARE)
145 value += dac_buffer_square[dac_i] / active_tones_snapshot_length;
146#endif
147 /*
148 // SINE
149 value += dac_buffer_sine[dac_i] / active_tones_snapshot_length / 3;
150 // TRIANGLE
151 value += dac_buffer_triangle[dac_i] / active_tones_snapshot_length / 3;
152 // SQUARE
153 value += dac_buffer_square[dac_i] / active_tones_snapshot_length / 3;
154 //NOTE: combination of these three wave-forms is more exemplary - and doesn't sound particularly good :-P
155 */
156
157 // STAIRS (mostly usefully as test-pattern)
158 // value_avg = dac_buffer_staircase[dac_i] / active_tones_snapshot_length;
159 }
160
161 return value;
162}
163
164/**
165 * DAC streaming callback. Does all of the main computing for playing songs.
166 *
167 * Note: chibios calls this CB twice: during the 'half buffer event', and the 'full buffer event'.
168 */
169static void dac_end(DACDriver *dacp) {
170 dacsample_t *sample_p = (dacp)->samples;
171
172 // work on the other half of the buffer
173 if (dacIsBufferComplete(dacp)) {
174 sample_p += AUDIO_DAC_BUFFER_SIZE / 2; // 'half_index'
175 }
176
177 for (uint8_t s = 0; s < AUDIO_DAC_BUFFER_SIZE / 2; s++) {
178 if (OUTPUT_OFF <= state) {
179 sample_p[s] = AUDIO_DAC_OFF_VALUE;
180 continue;
181 } else {
182 sample_p[s] = dac_value_generate();
183 }
184
185 /* zero crossing (or approach, whereas zero == DAC_OFF_VALUE, which can be configured to anything from 0 to DAC_SAMPLE_MAX)
186 * ============================*=*========================== AUDIO_DAC_SAMPLE_MAX
187 * * *
188 * * *
189 * ---------------------------------------------------------
190 * * * } AUDIO_DAC_SAMPLE_MAX/100
191 * --------------------------------------------------------- AUDIO_DAC_OFF_VALUE
192 * * * } AUDIO_DAC_SAMPLE_MAX/100
193 * ---------------------------------------------------------
194 * *
195 * * *
196 * * *
197 * =====*=*================================================= 0x0
198 */
199 if (((sample_p[s] + (AUDIO_DAC_SAMPLE_MAX / 100)) > AUDIO_DAC_OFF_VALUE) && // value approaches from below
200 (sample_p[s] < (AUDIO_DAC_OFF_VALUE + (AUDIO_DAC_SAMPLE_MAX / 100))) // or above
201 ) {
202 if ((OUTPUT_SHOULD_START == state) && (active_tones_snapshot_length > 0)) {
203 state = OUTPUT_RUN_NORMALLY;
204 } else if (OUTPUT_TONES_CHANGED == state) {
205 state = OUTPUT_REACHED_ZERO_BEFORE_TONE_CHANGE;
206 } else if (OUTPUT_SHOULD_STOP == state) {
207 state = OUTPUT_REACHED_ZERO_BEFORE_OFF;
208 }
209 }
210
211 // still 'ramping up', reset the output to OFF_VALUE until the generated values reach that value, to do a smooth handover
212 if (OUTPUT_SHOULD_START == state) {
213 sample_p[s] = AUDIO_DAC_OFF_VALUE;
214 }
215
216 if ((OUTPUT_SHOULD_START == state) || (OUTPUT_REACHED_ZERO_BEFORE_OFF == state) || (OUTPUT_REACHED_ZERO_BEFORE_TONE_CHANGE == state)) {
217 uint8_t active_tones = MIN(AUDIO_MAX_SIMULTANEOUS_TONES, audio_get_number_of_active_tones());
218 active_tones_snapshot_length = 0;
219 // update the snapshot - once, and only on occasion that something changed;
220 // -> saves cpu cycles (?)
221 for (uint8_t i = 0; i < active_tones; i++) {
222 float freq = audio_get_processed_frequency(i);
223 if (freq > 0) { // disregard 'rest' notes, with valid frequency 0.0f; which would only lower the resulting waveform volume during the additive synthesis step
224 active_tones_snapshot[active_tones_snapshot_length++] = freq;
225 }
226 }
227
228 if ((0 == active_tones_snapshot_length) && (OUTPUT_REACHED_ZERO_BEFORE_OFF == state)) {
229 state = OUTPUT_OFF;
230 }
231 if (OUTPUT_REACHED_ZERO_BEFORE_TONE_CHANGE == state) {
232 state = OUTPUT_RUN_NORMALLY;
233 }
234 }
235 }
236
237 // update audio internal state (note position, current_note, ...)
238 if (audio_update_state()) {
239 if (OUTPUT_SHOULD_STOP != state) {
240 state = OUTPUT_TONES_CHANGED;
241 }
242 }
243
244 if (OUTPUT_OFF <= state) {
245 if (OUTPUT_OFF_2 == state) {
246 // stopping timer6 = stopping the DAC at whatever value it is currently pushing to the output = AUDIO_DAC_OFF_VALUE
247 gptStopTimer(&GPTD6);
248 } else {
249 state++;
250 }
251 }
252}
253
254static void dac_error(DACDriver *dacp, dacerror_t err) {
255 (void)dacp;
256 (void)err;
257
258 chSysHalt("DAC failure. halp");
259}
260
261static const GPTConfig gpt6cfg1 = {.frequency = AUDIO_DAC_SAMPLE_RATE * 3,
262 .callback = NULL,
263 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
264 .dier = 0U};
265
266static const DACConfig dac_conf = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT};
267
268/**
269 * @note The DAC_TRG(0) here selects the Timer 6 TRGO event, which is triggered
270 * on the rising edge after 3 APB1 clock cycles, causing our gpt6cfg1.frequency
271 * to be a third of what we expect.
272 *
273 * Here are all the values for DAC_TRG (TSEL in the ref manual)
274 * TIM15_TRGO 0b011
275 * TIM2_TRGO 0b100
276 * TIM3_TRGO 0b001
277 * TIM6_TRGO 0b000
278 * TIM7_TRGO 0b010
279 * EXTI9 0b110
280 * SWTRIG 0b111
281 */
282static const DACConversionGroup dac_conv_cfg = {.num_channels = 1U, .end_cb = dac_end, .error_cb = dac_error, .trigger = DAC_TRG(0b000)};
283
284void audio_driver_initialize() {
285 if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) {
286 palSetLineMode(A4, PAL_MODE_INPUT_ANALOG);
287 dacStart(&DACD1, &dac_conf);
288 }
289 if ((AUDIO_PIN == A5) || (AUDIO_PIN_ALT == A5)) {
290 palSetLineMode(A5, PAL_MODE_INPUT_ANALOG);
291 dacStart(&DACD2, &dac_conf);
292 }
293
294 /* enable the output buffer, to directly drive external loads with no additional circuitry
295 *
296 * see: AN4566 Application note: Extending the DAC performance of STM32 microcontrollers
297 * Note: Buffer-Off bit -> has to be set 0 to enable the output buffer
298 * Note: enabling the output buffer imparts an additional dc-offset of a couple mV
299 *
300 * this is done here, reaching directly into the stm32 registers since chibios has not implemented BOFF handling yet
301 * (see: chibios/os/hal/ports/STM32/todo.txt '- BOFF handling in DACv1.'
302 */
303 DACD1.params->dac->CR &= ~DAC_CR_BOFF1;
304 DACD2.params->dac->CR &= ~DAC_CR_BOFF2;
305
306 if (AUDIO_PIN == A4) {
307 dacStartConversion(&DACD1, &dac_conv_cfg, dac_buffer_empty, AUDIO_DAC_BUFFER_SIZE);
308 } else if (AUDIO_PIN == A5) {
309 dacStartConversion(&DACD2, &dac_conv_cfg, dac_buffer_empty, AUDIO_DAC_BUFFER_SIZE);
310 }
311
312 // no inverted/out-of-phase waveform (yet?), only pulling AUDIO_PIN_ALT to AUDIO_DAC_OFF_VALUE
313#if defined(AUDIO_PIN_ALT_AS_NEGATIVE)
314 if (AUDIO_PIN_ALT == A4) {
315 dacPutChannelX(&DACD1, 0, AUDIO_DAC_OFF_VALUE);
316 } else if (AUDIO_PIN_ALT == A5) {
317 dacPutChannelX(&DACD2, 0, AUDIO_DAC_OFF_VALUE);
318 }
319#endif
320
321 gptStart(&GPTD6, &gpt6cfg1);
322}
323
324void audio_driver_stop(void) { state = OUTPUT_SHOULD_STOP; }
325
326void audio_driver_start(void) {
327 gptStartContinuous(&GPTD6, 2U);
328
329 for (uint8_t i = 0; i < AUDIO_MAX_SIMULTANEOUS_TONES; i++) {
330 dac_if[i] = 0.0f;
331 active_tones_snapshot[i] = 0.0f;
332 }
333 active_tones_snapshot_length = 0;
334 state = OUTPUT_SHOULD_START;
335}
diff --git a/quantum/audio/driver_chibios_dac_basic.c b/quantum/audio/driver_chibios_dac_basic.c
new file mode 100644
index 000000000..9a1c9a8c1
--- /dev/null
+++ b/quantum/audio/driver_chibios_dac_basic.c
@@ -0,0 +1,245 @@
1/* Copyright 2016-2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "audio.h"
19#include "ch.h"
20#include "hal.h"
21
22/*
23 Audio Driver: DAC
24
25 which utilizes both channels of the DAC unit many STM32 are equipped with to output a modulated square-wave, from precomputed samples stored in a buffer, which is passed to the hardware through DMA
26
27 this driver can either be used to drive to separate speakers, wired to A4+Gnd and A5+Gnd, which allows two tones to be played simultaneously
28 OR
29 one speaker wired to A4+A5 with the AUDIO_PIN_ALT_AS_NEGATIVE define set - see docs/feature_audio
30
31*/
32
33#if !defined(AUDIO_PIN)
34# pragma message "Audio feature enabled, but no suitable pin selected as AUDIO_PIN - see docs/feature_audio under 'ARM (DAC basic)' for available options."
35// TODO: make this an 'error' instead; go through a breaking change, and add AUDIO_PIN A5 to all keyboards currently using AUDIO on STM32 based boards? - for now: set the define here
36# define AUDIO_PIN A5
37#endif
38// check configuration for ONE speaker, connected to both DAC pins
39#if defined(AUDIO_PIN_ALT_AS_NEGATIVE) && !defined(AUDIO_PIN_ALT)
40# error "Audio feature: AUDIO_PIN_ALT_AS_NEGATIVE set, but no pin configured as AUDIO_PIN_ALT"
41#endif
42
43#ifndef AUDIO_PIN_ALT
44// no ALT pin defined is valid, but the c-ifs below need some value set
45# define AUDIO_PIN_ALT -1
46#endif
47
48#if !defined(AUDIO_STATE_TIMER)
49# define AUDIO_STATE_TIMER GPTD8
50#endif
51
52// square-wave
53static const dacsample_t dac_buffer_1[AUDIO_DAC_BUFFER_SIZE] = {
54 // First half is max, second half is 0
55 [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = AUDIO_DAC_SAMPLE_MAX,
56 [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = 0,
57};
58
59// square-wave
60static const dacsample_t dac_buffer_2[AUDIO_DAC_BUFFER_SIZE] = {
61 // opposite of dac_buffer above
62 [0 ... AUDIO_DAC_BUFFER_SIZE / 2 - 1] = 0,
63 [AUDIO_DAC_BUFFER_SIZE / 2 ... AUDIO_DAC_BUFFER_SIZE - 1] = AUDIO_DAC_SAMPLE_MAX,
64};
65
66GPTConfig gpt6cfg1 = {.frequency = AUDIO_DAC_SAMPLE_RATE,
67 .callback = NULL,
68 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
69 .dier = 0U};
70GPTConfig gpt7cfg1 = {.frequency = AUDIO_DAC_SAMPLE_RATE,
71 .callback = NULL,
72 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
73 .dier = 0U};
74
75static void gpt_audio_state_cb(GPTDriver *gptp);
76GPTConfig gptStateUpdateCfg = {.frequency = 10,
77 .callback = gpt_audio_state_cb,
78 .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
79 .dier = 0U};
80
81static const DACConfig dac_conf_ch1 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT};
82static const DACConfig dac_conf_ch2 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT};
83
84/**
85 * @note The DAC_TRG(0) here selects the Timer 6 TRGO event, which is triggered
86 * on the rising edge after 3 APB1 clock cycles, causing our gpt6cfg1.frequency
87 * to be a third of what we expect.
88 *
89 * Here are all the values for DAC_TRG (TSEL in the ref manual)
90 * TIM15_TRGO 0b011
91 * TIM2_TRGO 0b100
92 * TIM3_TRGO 0b001
93 * TIM6_TRGO 0b000
94 * TIM7_TRGO 0b010
95 * EXTI9 0b110
96 * SWTRIG 0b111
97 */
98static const DACConversionGroup dac_conv_grp_ch1 = {.num_channels = 1U, .trigger = DAC_TRG(0b000)};
99static const DACConversionGroup dac_conv_grp_ch2 = {.num_channels = 1U, .trigger = DAC_TRG(0b010)};
100
101void channel_1_start(void) {
102 gptStart(&GPTD6, &gpt6cfg1);
103 gptStartContinuous(&GPTD6, 2U);
104 palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
105}
106
107void channel_1_stop(void) {
108 gptStopTimer(&GPTD6);
109 palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL);
110 palSetPad(GPIOA, 4);
111}
112
113static float channel_1_frequency = 0.0f;
114void channel_1_set_frequency(float freq) {
115 channel_1_frequency = freq;
116
117 channel_1_stop();
118 if (freq <= 0.0) // a pause/rest has freq=0
119 return;
120
121 gpt6cfg1.frequency = 2 * freq * AUDIO_DAC_BUFFER_SIZE;
122 channel_1_start();
123}
124float channel_1_get_frequency(void) { return channel_1_frequency; }
125
126void channel_2_start(void) {
127 gptStart(&GPTD7, &gpt7cfg1);
128 gptStartContinuous(&GPTD7, 2U);
129 palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
130}
131
132void channel_2_stop(void) {
133 gptStopTimer(&GPTD7);
134 palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); \
135 palSetPad(GPIOA, 5);
136}
137
138static float channel_2_frequency = 0.0f;
139void channel_2_set_frequency(float freq) {
140 channel_2_frequency = freq;
141
142 channel_2_stop();
143 if (freq <= 0.0) // a pause/rest has freq=0
144 return;
145
146 gpt7cfg1.frequency = 2 * freq * AUDIO_DAC_BUFFER_SIZE;
147 channel_2_start();
148}
149float channel_2_get_frequency(void) { return channel_2_frequency; }
150
151static void gpt_audio_state_cb(GPTDriver *gptp) {
152 if (audio_update_state()) {
153#if defined(AUDIO_PIN_ALT_AS_NEGATIVE)
154 // one piezo/speaker connected to both audio pins, the generated square-waves are inverted
155 channel_1_set_frequency(audio_get_processed_frequency(0));
156 channel_2_set_frequency(audio_get_processed_frequency(0));
157
158#else // two separate audio outputs/speakers
159 // primary speaker on A4, optional secondary on A5
160 if (AUDIO_PIN == A4) {
161 channel_1_set_frequency(audio_get_processed_frequency(0));
162 if (AUDIO_PIN_ALT == A5) {
163 if (audio_get_number_of_active_tones() > 1) {
164 channel_2_set_frequency(audio_get_processed_frequency(1));
165 } else {
166 channel_2_stop();
167 }
168 }
169 }
170
171 // primary speaker on A5, optional secondary on A4
172 if (AUDIO_PIN == A5) {
173 channel_2_set_frequency(audio_get_processed_frequency(0));
174 if (AUDIO_PIN_ALT == A4) {
175 if (audio_get_number_of_active_tones() > 1) {
176 channel_1_set_frequency(audio_get_processed_frequency(1));
177 } else {
178 channel_1_stop();
179 }
180 }
181 }
182#endif
183 }
184}
185
186void audio_driver_initialize() {
187 if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) {
188 palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG);
189 dacStart(&DACD1, &dac_conf_ch1);
190
191 // initial setup of the dac-triggering timer is still required, even
192 // though it gets reconfigured and restarted later on
193 gptStart(&GPTD6, &gpt6cfg1);
194 }
195
196 if ((AUDIO_PIN == A5) || (AUDIO_PIN_ALT == A5)) {
197 palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG);
198 dacStart(&DACD2, &dac_conf_ch2);
199
200 gptStart(&GPTD7, &gpt7cfg1);
201 }
202
203 /* enable the output buffer, to directly drive external loads with no additional circuitry
204 *
205 * see: AN4566 Application note: Extending the DAC performance of STM32 microcontrollers
206 * Note: Buffer-Off bit -> has to be set 0 to enable the output buffer
207 * Note: enabling the output buffer imparts an additional dc-offset of a couple mV
208 *
209 * this is done here, reaching directly into the stm32 registers since chibios has not implemented BOFF handling yet
210 * (see: chibios/os/hal/ports/STM32/todo.txt '- BOFF handling in DACv1.'
211 */
212 DACD1.params->dac->CR &= ~DAC_CR_BOFF1;
213 DACD2.params->dac->CR &= ~DAC_CR_BOFF2;
214
215 // start state-updater
216 gptStart(&AUDIO_STATE_TIMER, &gptStateUpdateCfg);
217}
218
219void audio_driver_stop(void) {
220 if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) {
221 gptStopTimer(&GPTD6);
222
223 // stop the ongoing conversion and put the output in a known state
224 dacStopConversion(&DACD1);
225 dacPutChannelX(&DACD1, 0, AUDIO_DAC_OFF_VALUE);
226 }
227
228 if ((AUDIO_PIN == A5) || (AUDIO_PIN_ALT == A5)) {
229 gptStopTimer(&GPTD7);
230
231 dacStopConversion(&DACD2);
232 dacPutChannelX(&DACD2, 0, AUDIO_DAC_OFF_VALUE);
233 }
234 gptStopTimer(&AUDIO_STATE_TIMER);
235}
236
237void audio_driver_start(void) {
238 if ((AUDIO_PIN == A4) || (AUDIO_PIN_ALT == A4)) {
239 dacStartConversion(&DACD1, &dac_conv_grp_ch1, (dacsample_t *)dac_buffer_1, AUDIO_DAC_BUFFER_SIZE);
240 }
241 if ((AUDIO_PIN == A5) || (AUDIO_PIN_ALT == A5)) {
242 dacStartConversion(&DACD2, &dac_conv_grp_ch2, (dacsample_t *)dac_buffer_2, AUDIO_DAC_BUFFER_SIZE);
243 }
244 gptStartContinuous(&AUDIO_STATE_TIMER, 2U);
245}
diff --git a/quantum/audio/driver_chibios_pwm.h b/quantum/audio/driver_chibios_pwm.h
new file mode 100644
index 000000000..86cab916e
--- /dev/null
+++ b/quantum/audio/driver_chibios_pwm.h
@@ -0,0 +1,40 @@
1/* Copyright 2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#if !defined(AUDIO_PWM_DRIVER)
20// NOTE: Timer2 seems to be used otherwise in QMK, otherwise we could default to A5 (= TIM2_CH1, with PWMD2 and alternate-function(1))
21# define AUDIO_PWM_DRIVER PWMD1
22#endif
23
24#if !defined(AUDIO_PWM_CHANNEL)
25// NOTE: sticking to the STM data-sheet numbering: TIMxCH1 to TIMxCH4
26// default: STM32F303CC PA8+TIM1_CH1 -> 1
27# define AUDIO_PWM_CHANNEL 1
28#endif
29
30#if !defined(AUDIO_PWM_PAL_MODE)
31// pin-alternate function: see the data-sheet for which pin needs what AF to connect to TIMx_CHy
32// default: STM32F303CC PA8+TIM1_CH1 -> 6
33# define AUDIO_PWM_PAL_MODE 6
34#endif
35
36#if !defined(AUDIO_STATE_TIMER)
37// timer used to trigger updates in the audio-system, configured/enabled in chibios mcuconf.
38// Tim6 is the default for "larger" STMs, smaller ones might not have this one (enabled) and need to switch to a different one (e.g.: STM32F103 has only Tim1-Tim4)
39# define AUDIO_STATE_TIMER GPTD6
40#endif
diff --git a/quantum/audio/driver_chibios_pwm_hardware.c b/quantum/audio/driver_chibios_pwm_hardware.c
new file mode 100644
index 000000000..3c7d89b29
--- /dev/null
+++ b/quantum/audio/driver_chibios_pwm_hardware.c
@@ -0,0 +1,144 @@
1/* Copyright 2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19Audio Driver: PWM
20
21the duty-cycle is always kept at 50%, and the pwm-period is adjusted to match the frequency of a note to be played back.
22
23this driver uses the chibios-PWM system to produce a square-wave on specific output pins that are connected to the PWM hardware.
24The hardware directly toggles the pin via its alternate function. see your MCUs data-sheet for which pin can be driven by what timer - looking for TIMx_CHy and the corresponding alternate function.
25
26 */
27
28#include "audio.h"
29#include "ch.h"
30#include "hal.h"
31
32#if !defined(AUDIO_PIN)
33# error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings"
34#endif
35
36extern bool playing_note;
37extern bool playing_melody;
38extern uint8_t note_timbre;
39
40static PWMConfig pwmCFG = {
41 .frequency = 100000, /* PWM clock frequency */
42 // CHIBIOS-BUG? can't set the initial period to <2, or the pwm (hard or software) takes ~130ms with .frequency=500000 for a pwmChangePeriod to take effect; with no output=silence in the meantime
43 .period = 2, /* initial PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
44 .callback = NULL, /* no callback, the hardware directly toggles the pin */
45 .channels =
46 {
47#if AUDIO_PWM_CHANNEL == 4
48 {PWM_OUTPUT_DISABLED, NULL}, /* channel 0 -> TIMx_CH1 */
49 {PWM_OUTPUT_DISABLED, NULL}, /* channel 1 -> TIMx_CH2 */
50 {PWM_OUTPUT_DISABLED, NULL}, /* channel 2 -> TIMx_CH3 */
51 {PWM_OUTPUT_ACTIVE_HIGH, NULL} /* channel 3 -> TIMx_CH4 */
52#elif AUDIO_PWM_CHANNEL == 3
53 {PWM_OUTPUT_DISABLED, NULL},
54 {PWM_OUTPUT_DISABLED, NULL},
55 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH3 */
56 {PWM_OUTPUT_DISABLED, NULL}
57#elif AUDIO_PWM_CHANNEL == 2
58 {PWM_OUTPUT_DISABLED, NULL},
59 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH2 */
60 {PWM_OUTPUT_DISABLED, NULL},
61 {PWM_OUTPUT_DISABLED, NULL}
62#else /*fallback to CH1 */
63 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* TIMx_CH1 */
64 {PWM_OUTPUT_DISABLED, NULL},
65 {PWM_OUTPUT_DISABLED, NULL},
66 {PWM_OUTPUT_DISABLED, NULL}
67#endif
68 },
69};
70
71static float channel_1_frequency = 0.0f;
72void channel_1_set_frequency(float freq) {
73 channel_1_frequency = freq;
74
75 if (freq <= 0.0) // a pause/rest has freq=0
76 return;
77
78 pwmcnt_t period = (pwmCFG.frequency / freq);
79 pwmChangePeriod(&AUDIO_PWM_DRIVER, period);
80 pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1,
81 // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH
82 PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100));
83}
84
85float channel_1_get_frequency(void) { return channel_1_frequency; }
86
87void channel_1_start(void) {
88 pwmStop(&AUDIO_PWM_DRIVER);
89 pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG);
90}
91
92void channel_1_stop(void) { pwmStop(&AUDIO_PWM_DRIVER); }
93
94static void gpt_callback(GPTDriver *gptp);
95GPTConfig gptCFG = {
96 /* a whole note is one beat, which is - per definition in musical_notes.h - set to 64
97 the longest note is BREAVE_DOT=128+64=192, the shortest SIXTEENTH=4
98 the tempo (which might vary!) is in bpm (beats per minute)
99 therefore: if the timer ticks away at .frequency = (60*64)Hz,
100 and the .interval counts from 64 downwards - audio_update_state is
101 called just often enough to not miss any notes
102 */
103 .frequency = 60 * 64,
104 .callback = gpt_callback,
105};
106
107void audio_driver_initialize(void) {
108 pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG);
109
110 // connect the AUDIO_PIN to the PWM hardware
111#if defined(USE_GPIOV1) // STM32F103C8
112 palSetLineMode(AUDIO_PIN, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
113#else // GPIOv2 (or GPIOv3 for f4xx, which is the same/compatible at this command)
114 palSetLineMode(AUDIO_PIN, PAL_STM32_MODE_ALTERNATE | PAL_STM32_ALTERNATE(AUDIO_PWM_PAL_MODE));
115#endif
116
117 gptStart(&AUDIO_STATE_TIMER, &gptCFG);
118}
119
120void audio_driver_start(void) {
121 channel_1_stop();
122 channel_1_start();
123
124 if (playing_note || playing_melody) {
125 gptStartContinuous(&AUDIO_STATE_TIMER, 64);
126 }
127}
128
129void audio_driver_stop(void) {
130 channel_1_stop();
131 gptStopTimer(&AUDIO_STATE_TIMER);
132}
133
134/* a regular timer task, that checks the note to be currently played
135 * and updates the pwm to output that frequency
136 */
137static void gpt_callback(GPTDriver *gptp) {
138 float freq; // TODO: freq_alt
139
140 if (audio_update_state()) {
141 freq = audio_get_processed_frequency(0); // freq_alt would be index=1
142 channel_1_set_frequency(freq);
143 }
144}
diff --git a/quantum/audio/driver_chibios_pwm_software.c b/quantum/audio/driver_chibios_pwm_software.c
new file mode 100644
index 000000000..15c3e98b6
--- /dev/null
+++ b/quantum/audio/driver_chibios_pwm_software.c
@@ -0,0 +1,164 @@
1/* Copyright 2020 Jack Humbert
2 * Copyright 2020 JohSchneider
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19Audio Driver: PWM
20
21the duty-cycle is always kept at 50%, and the pwm-period is adjusted to match the frequency of a note to be played back.
22
23this driver uses the chibios-PWM system to produce a square-wave on any given output pin in software
24- a pwm callback is used to set/clear the configured pin.
25
26 */
27#include "audio.h"
28#include "ch.h"
29#include "hal.h"
30
31#if !defined(AUDIO_PIN)
32# error "Audio feature enabled, but no pin selected - see docs/feature_audio under the ARM PWM settings"
33#endif
34extern bool playing_note;
35extern bool playing_melody;
36extern uint8_t note_timbre;
37
38static void pwm_audio_period_callback(PWMDriver *pwmp);
39static void pwm_audio_channel_interrupt_callback(PWMDriver *pwmp);
40
41static PWMConfig pwmCFG = {
42 .frequency = 100000, /* PWM clock frequency */
43 // CHIBIOS-BUG? can't set the initial period to <2, or the pwm (hard or software) takes ~130ms with .frequency=500000 for a pwmChangePeriod to take effect; with no output=silence in the meantime
44 .period = 2, /* initial PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
45 .callback = pwm_audio_period_callback,
46 .channels =
47 {
48 // software-PWM just needs another callback on any channel
49 {PWM_OUTPUT_ACTIVE_HIGH, pwm_audio_channel_interrupt_callback}, /* channel 0 -> TIMx_CH1 */
50 {PWM_OUTPUT_DISABLED, NULL}, /* channel 1 -> TIMx_CH2 */
51 {PWM_OUTPUT_DISABLED, NULL}, /* channel 2 -> TIMx_CH3 */
52 {PWM_OUTPUT_DISABLED, NULL} /* channel 3 -> TIMx_CH4 */
53 },
54};
55
56static float channel_1_frequency = 0.0f;
57void channel_1_set_frequency(float freq) {
58 channel_1_frequency = freq;
59
60 if (freq <= 0.0) // a pause/rest has freq=0
61 return;
62
63 pwmcnt_t period = (pwmCFG.frequency / freq);
64 pwmChangePeriod(&AUDIO_PWM_DRIVER, period);
65
66 pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1,
67 // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH
68 PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100));
69}
70
71float channel_1_get_frequency(void) { return channel_1_frequency; }
72
73void channel_1_start(void) {
74 pwmStop(&AUDIO_PWM_DRIVER);
75 pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG);
76
77 pwmEnablePeriodicNotification(&AUDIO_PWM_DRIVER);
78 pwmEnableChannelNotification(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1);
79}
80
81void channel_1_stop(void) {
82 pwmStop(&AUDIO_PWM_DRIVER);
83
84 palClearLine(AUDIO_PIN); // leave the line low, after last note was played
85
86#if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE)
87 palClearLine(AUDIO_PIN_ALT); // leave the line low, after last note was played
88#endif
89}
90
91// generate a PWM signal on any pin, not necessarily the one connected to the timer
92static void pwm_audio_period_callback(PWMDriver *pwmp) {
93 (void)pwmp;
94 palClearLine(AUDIO_PIN);
95
96#if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE)
97 palSetLine(AUDIO_PIN_ALT);
98#endif
99}
100static void pwm_audio_channel_interrupt_callback(PWMDriver *pwmp) {
101 (void)pwmp;
102 if (channel_1_frequency > 0) {
103 palSetLine(AUDIO_PIN); // generate a PWM signal on any pin, not necessarily the one connected to the timer
104#if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE)
105 palClearLine(AUDIO_PIN_ALT);
106#endif
107 }
108}
109
110static void gpt_callback(GPTDriver *gptp);
111GPTConfig gptCFG = {
112 /* a whole note is one beat, which is - per definition in musical_notes.h - set to 64
113 the longest note is BREAVE_DOT=128+64=192, the shortest SIXTEENTH=4
114 the tempo (which might vary!) is in bpm (beats per minute)
115 therefore: if the timer ticks away at .frequency = (60*64)Hz,
116 and the .interval counts from 64 downwards - audio_update_state is
117 called just often enough to not miss anything
118 */
119 .frequency = 60 * 64,
120 .callback = gpt_callback,
121};
122
123void audio_driver_initialize(void) {
124 pwmStart(&AUDIO_PWM_DRIVER, &pwmCFG);
125
126 palSetLineMode(AUDIO_PIN, PAL_MODE_OUTPUT_PUSHPULL);
127 palClearLine(AUDIO_PIN);
128
129#if defined(AUDIO_PIN_ALT) && defined(AUDIO_PIN_ALT_AS_NEGATIVE)
130 palSetLineMode(AUDIO_PIN_ALT, PAL_MODE_OUTPUT_PUSHPULL);
131 palClearLine(AUDIO_PIN_ALT);
132#endif
133
134 pwmEnablePeriodicNotification(&AUDIO_PWM_DRIVER); // enable pwm callbacks
135 pwmEnableChannelNotification(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1);
136
137 gptStart(&AUDIO_STATE_TIMER, &gptCFG);
138}
139
140void audio_driver_start(void) {
141 channel_1_stop();
142 channel_1_start();
143
144 if (playing_note || playing_melody) {
145 gptStartContinuous(&AUDIO_STATE_TIMER, 64);
146 }
147}
148
149void audio_driver_stop(void) {
150 channel_1_stop();
151 gptStopTimer(&AUDIO_STATE_TIMER);
152}
153
154/* a regular timer task, that checks the note to be currently played
155 * and updates the pwm to output that frequency
156 */
157static void gpt_callback(GPTDriver *gptp) {
158 float freq; // TODO: freq_alt
159
160 if (audio_update_state()) {
161 freq = audio_get_processed_frequency(0); // freq_alt would be index=1
162 channel_1_set_frequency(freq);
163 }
164}
diff --git a/quantum/audio/musical_notes.h b/quantum/audio/musical_notes.h
index 0ba572c34..ddd7d374f 100644
--- a/quantum/audio/musical_notes.h
+++ b/quantum/audio/musical_notes.h
@@ -1,4 +1,5 @@
1/* Copyright 2016 Jack Humbert 1/* Copyright 2016 Jack Humbert
2 * Copyright 2020 JohSchneider
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -13,12 +14,11 @@
13 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 16 */
16
17#pragma once 17#pragma once
18 18
19// Tempo Placeholder
20#ifndef TEMPO_DEFAULT 19#ifndef TEMPO_DEFAULT
21# define TEMPO_DEFAULT 100 20# define TEMPO_DEFAULT 120
21// in beats-per-minute
22#endif 22#endif
23 23
24#define SONG(notes...) \ 24#define SONG(notes...) \
@@ -27,12 +27,14 @@
27// Note Types 27// Note Types
28#define MUSICAL_NOTE(note, duration) \ 28#define MUSICAL_NOTE(note, duration) \
29 { (NOTE##note), duration } 29 { (NOTE##note), duration }
30
30#define BREVE_NOTE(note) MUSICAL_NOTE(note, 128) 31#define BREVE_NOTE(note) MUSICAL_NOTE(note, 128)
31#define WHOLE_NOTE(note) MUSICAL_NOTE(note, 64) 32#define WHOLE_NOTE(note) MUSICAL_NOTE(note, 64)
32#define HALF_NOTE(note) MUSICAL_NOTE(note, 32) 33#define HALF_NOTE(note) MUSICAL_NOTE(note, 32)
33#define QUARTER_NOTE(note) MUSICAL_NOTE(note, 16) 34#define QUARTER_NOTE(note) MUSICAL_NOTE(note, 16)
34#define EIGHTH_NOTE(note) MUSICAL_NOTE(note, 8) 35#define EIGHTH_NOTE(note) MUSICAL_NOTE(note, 8)
35#define SIXTEENTH_NOTE(note) MUSICAL_NOTE(note, 4) 36#define SIXTEENTH_NOTE(note) MUSICAL_NOTE(note, 4)
37#define THIRTYSECOND_NOTE(note) MUSICAL_NOTE(note, 2)
36 38
37#define BREVE_DOT_NOTE(note) MUSICAL_NOTE(note, 128 + 64) 39#define BREVE_DOT_NOTE(note) MUSICAL_NOTE(note, 128 + 64)
38#define WHOLE_DOT_NOTE(note) MUSICAL_NOTE(note, 64 + 32) 40#define WHOLE_DOT_NOTE(note) MUSICAL_NOTE(note, 64 + 32)
@@ -40,6 +42,9 @@
40#define QUARTER_DOT_NOTE(note) MUSICAL_NOTE(note, 16 + 8) 42#define QUARTER_DOT_NOTE(note) MUSICAL_NOTE(note, 16 + 8)
41#define EIGHTH_DOT_NOTE(note) MUSICAL_NOTE(note, 8 + 4) 43#define EIGHTH_DOT_NOTE(note) MUSICAL_NOTE(note, 8 + 4)
42#define SIXTEENTH_DOT_NOTE(note) MUSICAL_NOTE(note, 4 + 2) 44#define SIXTEENTH_DOT_NOTE(note) MUSICAL_NOTE(note, 4 + 2)
45#define THIRTYSECOND_DOT_NOTE(note) MUSICAL_NOTE(note, 2 + 1)
46// duration of 64 units == one beat == one whole note
47// with a tempo of 60bpm this comes to a length of one second
43 48
44// Note Type Shortcuts 49// Note Type Shortcuts
45#define M__NOTE(note, duration) MUSICAL_NOTE(note, duration) 50#define M__NOTE(note, duration) MUSICAL_NOTE(note, duration)
@@ -49,56 +54,52 @@
49#define Q__NOTE(n) QUARTER_NOTE(n) 54#define Q__NOTE(n) QUARTER_NOTE(n)
50#define E__NOTE(n) EIGHTH_NOTE(n) 55#define E__NOTE(n) EIGHTH_NOTE(n)
51#define S__NOTE(n) SIXTEENTH_NOTE(n) 56#define S__NOTE(n) SIXTEENTH_NOTE(n)
57#define T__NOTE(n) THIRTYSECOND_NOTE(n)
52#define BD_NOTE(n) BREVE_DOT_NOTE(n) 58#define BD_NOTE(n) BREVE_DOT_NOTE(n)
53#define WD_NOTE(n) WHOLE_DOT_NOTE(n) 59#define WD_NOTE(n) WHOLE_DOT_NOTE(n)
54#define HD_NOTE(n) HALF_DOT_NOTE(n) 60#define HD_NOTE(n) HALF_DOT_NOTE(n)
55#define QD_NOTE(n) QUARTER_DOT_NOTE(n) 61#define QD_NOTE(n) QUARTER_DOT_NOTE(n)
56#define ED_NOTE(n) EIGHTH_DOT_NOTE(n) 62#define ED_NOTE(n) EIGHTH_DOT_NOTE(n)
57#define SD_NOTE(n) SIXTEENTH_DOT_NOTE(n) 63#define SD_NOTE(n) SIXTEENTH_DOT_NOTE(n)
64#define TD_NOTE(n) THIRTYSECOND_DOT_NOTE(n)
58 65
59// Note Timbre 66// Note Timbre
60// Changes how the notes sound 67// Changes how the notes sound
61#define TIMBRE_12 0.125f 68#define TIMBRE_12 12
62#define TIMBRE_25 0.250f 69#define TIMBRE_25 25
63#define TIMBRE_50 0.500f 70#define TIMBRE_50 50
64#define TIMBRE_75 0.750f 71#define TIMBRE_75 75
65#ifndef TIMBRE_DEFAULT 72#ifndef TIMBRE_DEFAULT
66# define TIMBRE_DEFAULT TIMBRE_50 73# define TIMBRE_DEFAULT TIMBRE_50
67#endif 74#endif
68// Notes - # = Octave
69 75
70#ifdef __arm__ 76// Notes - # = Octave
71# define NOTE_REST 1.00f
72#else
73# define NOTE_REST 0.00f
74#endif
75 77
76/* These notes are currently bugged 78#define NOTE_REST 0.00f
77#define NOTE_C0 16.35f
78#define NOTE_CS0 17.32f
79#define NOTE_D0 18.35f
80#define NOTE_DS0 19.45f
81#define NOTE_E0 20.60f
82#define NOTE_F0 21.83f
83#define NOTE_FS0 23.12f
84#define NOTE_G0 24.50f
85#define NOTE_GS0 25.96f
86#define NOTE_A0 27.50f
87#define NOTE_AS0 29.14f
88#define NOTE_B0 30.87f
89#define NOTE_C1 32.70f
90#define NOTE_CS1 34.65f
91#define NOTE_D1 36.71f
92#define NOTE_DS1 38.89f
93#define NOTE_E1 41.20f
94#define NOTE_F1 43.65f
95#define NOTE_FS1 46.25f
96#define NOTE_G1 49.00f
97#define NOTE_GS1 51.91f
98#define NOTE_A1 55.00f
99#define NOTE_AS1 58.27f
100*/
101 79
80#define NOTE_C0 16.35f
81#define NOTE_CS0 17.32f
82#define NOTE_D0 18.35f
83#define NOTE_DS0 19.45f
84#define NOTE_E0 20.60f
85#define NOTE_F0 21.83f
86#define NOTE_FS0 23.12f
87#define NOTE_G0 24.50f
88#define NOTE_GS0 25.96f
89#define NOTE_A0 27.50f
90#define NOTE_AS0 29.14f
91#define NOTE_B0 30.87f
92#define NOTE_C1 32.70f
93#define NOTE_CS1 34.65f
94#define NOTE_D1 36.71f
95#define NOTE_DS1 38.89f
96#define NOTE_E1 41.20f
97#define NOTE_F1 43.65f
98#define NOTE_FS1 46.25f
99#define NOTE_G1 49.00f
100#define NOTE_GS1 51.91f
101#define NOTE_A1 55.00f
102#define NOTE_AS1 58.27f
102#define NOTE_B1 61.74f 103#define NOTE_B1 61.74f
103#define NOTE_C2 65.41f 104#define NOTE_C2 65.41f
104#define NOTE_CS2 69.30f 105#define NOTE_CS2 69.30f
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c
index 1592618be..8988d827e 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -1,4 +1,5 @@
1/* Copyright 2016 Jack Humbert 1/* Copyright 2016 Jack Humbert
2 * Copyright 2020 JohSchneider
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -17,13 +18,19 @@
17#include "audio.h" 18#include "audio.h"
18#include <stdlib.h> 19#include <stdlib.h>
19 20
20// these are imported from audio.c 21uint8_t note_timbre = TIMBRE_DEFAULT;
21extern uint16_t envelope_index; 22bool glissando = false;
22extern float note_timbre; 23bool vibrato = false;
23extern float polyphony_rate; 24float vibrato_strength = 0.5;
24extern bool glissando; 25float vibrato_rate = 0.125;
25 26
27uint16_t voices_timer = 0;
28
29#ifdef AUDIO_VOICE_DEFAULT
30voice_type voice = AUDIO_VOICE_DEFAULT;
31#else
26voice_type voice = default_voice; 32voice_type voice = default_voice;
33#endif
27 34
28void set_voice(voice_type v) { voice = v; } 35void set_voice(voice_type v) { voice = v; }
29 36
@@ -31,22 +38,54 @@ void voice_iterate() { voice = (voice + 1) % number_of_voices; }
31 38
32void voice_deiterate() { voice = (voice - 1 + number_of_voices) % number_of_voices; } 39void voice_deiterate() { voice = (voice - 1 + number_of_voices) % number_of_voices; }
33 40
41#ifdef AUDIO_VOICES
42float mod(float a, int b) {
43 float r = fmod(a, b);
44 return r < 0 ? r + b : r;
45}
46
47// Effect: 'vibrate' a given target frequency slightly above/below its initial value
48float voice_add_vibrato(float average_freq) {
49 float vibrato_counter = mod(timer_read() / (100 * vibrato_rate), VIBRATO_LUT_LENGTH);
50
51 return average_freq * pow(vibrato_lut[(int)vibrato_counter], vibrato_strength);
52}
53
54// Effect: 'slides' the 'frequency' from the starting-point, to the target frequency
55float voice_add_glissando(float from_freq, float to_freq) {
56 if (to_freq != 0 && from_freq < to_freq && from_freq < to_freq * pow(2, -440 / to_freq / 12 / 2)) {
57 return from_freq * pow(2, 440 / from_freq / 12 / 2);
58 } else if (to_freq != 0 && from_freq > to_freq && from_freq > to_freq * pow(2, 440 / to_freq / 12 / 2)) {
59 return from_freq * pow(2, -440 / from_freq / 12 / 2);
60 } else {
61 return to_freq;
62 }
63}
64#endif
65
34float voice_envelope(float frequency) { 66float voice_envelope(float frequency) {
35 // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz 67 // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz
36 __attribute__((unused)) uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency)); 68// __attribute__((unused)) uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency));
69#ifdef AUDIO_VOICES
70 uint16_t envelope_index = timer_elapsed(voices_timer); // TODO: multiply in some factor?
71 uint16_t compensated_index = envelope_index / 100; // TODO: correct factor would be?
72#endif
37 73
38 switch (voice) { 74 switch (voice) {
39 case default_voice: 75 case default_voice:
40 glissando = false; 76 glissando = false;
41 note_timbre = TIMBRE_50; 77 // note_timbre = TIMBRE_50; //Note: leave the user the possibility to adjust the timbre with 'audio_set_timbre'
42 polyphony_rate = 0;
43 break; 78 break;
44 79
45#ifdef AUDIO_VOICES 80#ifdef AUDIO_VOICES
46 81
82 case vibrating:
83 glissando = false;
84 vibrato = true;
85 break;
86
47 case something: 87 case something:
48 glissando = false; 88 glissando = false;
49 polyphony_rate = 0;
50 switch (compensated_index) { 89 switch (compensated_index) {
51 case 0 ... 9: 90 case 0 ... 9:
52 note_timbre = TIMBRE_12; 91 note_timbre = TIMBRE_12;
@@ -57,24 +96,23 @@ float voice_envelope(float frequency) {
57 break; 96 break;
58 97
59 case 20 ... 200: 98 case 20 ... 200:
60 note_timbre = .125 + .125; 99 note_timbre = 12 + 12;
61 break; 100 break;
62 101
63 default: 102 default:
64 note_timbre = .125; 103 note_timbre = 12;
65 break; 104 break;
66 } 105 }
67 break; 106 break;
68 107
69 case drums: 108 case drums:
70 glissando = false; 109 glissando = false;
71 polyphony_rate = 0;
72 // switch (compensated_index) { 110 // switch (compensated_index) {
73 // case 0 ... 10: 111 // case 0 ... 10:
74 // note_timbre = 0.5; 112 // note_timbre = 50;
75 // break; 113 // break;
76 // case 11 ... 20: 114 // case 11 ... 20:
77 // note_timbre = 0.5 * (21 - compensated_index) / 10; 115 // note_timbre = 50 * (21 - compensated_index) / 10;
78 // break; 116 // break;
79 // default: 117 // default:
80 // note_timbre = 0; 118 // note_timbre = 0;
@@ -88,10 +126,10 @@ float voice_envelope(float frequency) {
88 frequency = (rand() % (int)(40)) + 60; 126 frequency = (rand() % (int)(40)) + 60;
89 switch (envelope_index) { 127 switch (envelope_index) {
90 case 0 ... 10: 128 case 0 ... 10:
91 note_timbre = 0.5; 129 note_timbre = 50;
92 break; 130 break;
93 case 11 ... 20: 131 case 11 ... 20:
94 note_timbre = 0.5 * (21 - envelope_index) / 10; 132 note_timbre = 50 * (21 - envelope_index) / 10;
95 break; 133 break;
96 default: 134 default:
97 note_timbre = 0; 135 note_timbre = 0;
@@ -103,10 +141,10 @@ float voice_envelope(float frequency) {
103 frequency = (rand() % (int)(1000)) + 1000; 141 frequency = (rand() % (int)(1000)) + 1000;
104 switch (envelope_index) { 142 switch (envelope_index) {
105 case 0 ... 5: 143 case 0 ... 5:
106 note_timbre = 0.5; 144 note_timbre = 50;
107 break; 145 break;
108 case 6 ... 20: 146 case 6 ... 20:
109 note_timbre = 0.5 * (21 - envelope_index) / 15; 147 note_timbre = 50 * (21 - envelope_index) / 15;
110 break; 148 break;
111 default: 149 default:
112 note_timbre = 0; 150 note_timbre = 0;
@@ -118,10 +156,10 @@ float voice_envelope(float frequency) {
118 frequency = (rand() % (int)(2000)) + 3000; 156 frequency = (rand() % (int)(2000)) + 3000;
119 switch (envelope_index) { 157 switch (envelope_index) {
120 case 0 ... 15: 158 case 0 ... 15:
121 note_timbre = 0.5; 159 note_timbre = 50;
122 break; 160 break;
123 case 16 ... 20: 161 case 16 ... 20:
124 note_timbre = 0.5 * (21 - envelope_index) / 5; 162 note_timbre = 50 * (21 - envelope_index) / 5;
125 break; 163 break;
126 default: 164 default:
127 note_timbre = 0; 165 note_timbre = 0;
@@ -133,10 +171,10 @@ float voice_envelope(float frequency) {
133 frequency = (rand() % (int)(2000)) + 3000; 171 frequency = (rand() % (int)(2000)) + 3000;
134 switch (envelope_index) { 172 switch (envelope_index) {
135 case 0 ... 35: 173 case 0 ... 35:
136 note_timbre = 0.5; 174 note_timbre = 50;
137 break; 175 break;
138 case 36 ... 50: 176 case 36 ... 50:
139 note_timbre = 0.5 * (51 - envelope_index) / 15; 177 note_timbre = 50 * (51 - envelope_index) / 15;
140 break; 178 break;
141 default: 179 default:
142 note_timbre = 0; 180 note_timbre = 0;
@@ -145,8 +183,7 @@ float voice_envelope(float frequency) {
145 } 183 }
146 break; 184 break;
147 case butts_fader: 185 case butts_fader:
148 glissando = true; 186 glissando = true;
149 polyphony_rate = 0;
150 switch (compensated_index) { 187 switch (compensated_index) {
151 case 0 ... 9: 188 case 0 ... 9:
152 frequency = frequency / 4; 189 frequency = frequency / 4;
@@ -159,7 +196,7 @@ float voice_envelope(float frequency) {
159 break; 196 break;
160 197
161 case 20 ... 200: 198 case 20 ... 200:
162 note_timbre = .125 - pow(((float)compensated_index - 20) / (200 - 20), 2) * .125; 199 note_timbre = 12 - (uint8_t)(pow(((float)compensated_index - 20) / (200 - 20), 2) * 12.5);
163 break; 200 break;
164 201
165 default: 202 default:
@@ -169,7 +206,6 @@ float voice_envelope(float frequency) {
169 break; 206 break;
170 207
171 // case octave_crunch: 208 // case octave_crunch:
172 // polyphony_rate = 0;
173 // switch (compensated_index) { 209 // switch (compensated_index) {
174 // case 0 ... 9: 210 // case 0 ... 9:
175 // case 20 ... 24: 211 // case 20 ... 24:
@@ -187,14 +223,13 @@ float voice_envelope(float frequency) {
187 223
188 // default: 224 // default:
189 // note_timbre = TIMBRE_12; 225 // note_timbre = TIMBRE_12;
190 // break; 226 // break;
191 // } 227 // }
192 // break; 228 // break;
193 229
194 case duty_osc: 230 case duty_osc:
195 // This slows the loop down a substantial amount, so higher notes may freeze 231 // This slows the loop down a substantial amount, so higher notes may freeze
196 glissando = true; 232 glissando = true;
197 polyphony_rate = 0;
198 switch (compensated_index) { 233 switch (compensated_index) {
199 default: 234 default:
200# define OCS_SPEED 10 235# define OCS_SPEED 10
@@ -202,38 +237,36 @@ float voice_envelope(float frequency) {
202 // sine wave is slow 237 // sine wave is slow
203 // note_timbre = (sin((float)compensated_index/10000*OCS_SPEED) * OCS_AMP / 2) + .5; 238 // note_timbre = (sin((float)compensated_index/10000*OCS_SPEED) * OCS_AMP / 2) + .5;
204 // triangle wave is a bit faster 239 // triangle wave is a bit faster
205 note_timbre = (float)abs((compensated_index * OCS_SPEED % 3000) - 1500) * (OCS_AMP / 1500) + (1 - OCS_AMP) / 2; 240 note_timbre = (uint8_t)abs((compensated_index * OCS_SPEED % 3000) - 1500) * (OCS_AMP / 1500) + (1 - OCS_AMP) / 2;
206 break; 241 break;
207 } 242 }
208 break; 243 break;
209 244
210 case duty_octave_down: 245 case duty_octave_down:
211 glissando = true; 246 glissando = true;
212 polyphony_rate = 0; 247 note_timbre = (uint8_t)(100 * (envelope_index % 2) * .125 + .375 * 2);
213 note_timbre = (envelope_index % 2) * .125 + .375 * 2; 248 if ((envelope_index % 4) == 0) note_timbre = 50;
214 if ((envelope_index % 4) == 0) note_timbre = 0.5;
215 if ((envelope_index % 8) == 0) note_timbre = 0; 249 if ((envelope_index % 8) == 0) note_timbre = 0;
216 break; 250 break;
217 case delayed_vibrato: 251 case delayed_vibrato:
218 glissando = true; 252 glissando = true;
219 polyphony_rate = 0; 253 note_timbre = TIMBRE_50;
220 note_timbre = TIMBRE_50;
221# define VOICE_VIBRATO_DELAY 150 254# define VOICE_VIBRATO_DELAY 150
222# define VOICE_VIBRATO_SPEED 50 255# define VOICE_VIBRATO_SPEED 50
223 switch (compensated_index) { 256 switch (compensated_index) {
224 case 0 ... VOICE_VIBRATO_DELAY: 257 case 0 ... VOICE_VIBRATO_DELAY:
225 break; 258 break;
226 default: 259 default:
260 // TODO: merge/replace with voice_add_vibrato above
227 frequency = frequency * vibrato_lut[(int)fmod((((float)compensated_index - (VOICE_VIBRATO_DELAY + 1)) / 1000 * VOICE_VIBRATO_SPEED), VIBRATO_LUT_LENGTH)]; 261 frequency = frequency * vibrato_lut[(int)fmod((((float)compensated_index - (VOICE_VIBRATO_DELAY + 1)) / 1000 * VOICE_VIBRATO_SPEED), VIBRATO_LUT_LENGTH)];
228 break; 262 break;
229 } 263 }
230 break; 264 break;
231 // case delayed_vibrato_octave: 265 // case delayed_vibrato_octave:
232 // polyphony_rate = 0;
233 // if ((envelope_index % 2) == 1) { 266 // if ((envelope_index % 2) == 1) {
234 // note_timbre = 0.55; 267 // note_timbre = 55;
235 // } else { 268 // } else {
236 // note_timbre = 0.45; 269 // note_timbre = 45;
237 // } 270 // }
238 // #define VOICE_VIBRATO_DELAY 150 271 // #define VOICE_VIBRATO_DELAY 150
239 // #define VOICE_VIBRATO_SPEED 50 272 // #define VOICE_VIBRATO_SPEED 50
@@ -246,35 +279,64 @@ float voice_envelope(float frequency) {
246 // } 279 // }
247 // break; 280 // break;
248 // case duty_fifth_down: 281 // case duty_fifth_down:
249 // note_timbre = 0.5; 282 // note_timbre = TIMBRE_50;
250 // if ((envelope_index % 3) == 0) 283 // if ((envelope_index % 3) == 0)
251 // note_timbre = 0.75; 284 // note_timbre = TIMBRE_75;
252 // break; 285 // break;
253 // case duty_fourth_down: 286 // case duty_fourth_down:
254 // note_timbre = 0.0; 287 // note_timbre = 0;
255 // if ((envelope_index % 12) == 0) 288 // if ((envelope_index % 12) == 0)
256 // note_timbre = 0.75; 289 // note_timbre = TIMBRE_75;
257 // if (((envelope_index % 12) % 4) != 1) 290 // if (((envelope_index % 12) % 4) != 1)
258 // note_timbre = 0.75; 291 // note_timbre = TIMBRE_75;
259 // break; 292 // break;
260 // case duty_third_down: 293 // case duty_third_down:
261 // note_timbre = 0.5; 294 // note_timbre = TIMBRE_50;
262 // if ((envelope_index % 5) == 0) 295 // if ((envelope_index % 5) == 0)
263 // note_timbre = 0.75; 296 // note_timbre = TIMBRE_75;
264 // break; 297 // break;
265 // case duty_fifth_third_down: 298 // case duty_fifth_third_down:
266 // note_timbre = 0.5; 299 // note_timbre = TIMBRE_50;
267 // if ((envelope_index % 5) == 0) 300 // if ((envelope_index % 5) == 0)
268 // note_timbre = 0.75; 301 // note_timbre = TIMBRE_75;
269 // if ((envelope_index % 3) == 0) 302 // if ((envelope_index % 3) == 0)
270 // note_timbre = 0.25; 303 // note_timbre = TIMBRE_25;
271 // break; 304 // break;
272 305
273#endif 306#endif // AUDIO_VOICES
274 307
275 default: 308 default:
276 break; 309 break;
277 } 310 }
278 311
312#ifdef AUDIO_VOICES
313 if (vibrato && (vibrato_strength > 0)) {
314 frequency = voice_add_vibrato(frequency);
315 }
316
317 if (glissando) {
318 // TODO: where to keep track of the start-frequency?
319 // frequency = voice_add_glissando(??, frequency);
320 }
321#endif // AUDIO_VOICES
322
279 return frequency; 323 return frequency;
280} 324}
325
326// Vibrato functions
327
328void voice_set_vibrato_rate(float rate) { vibrato_rate = rate; }
329void voice_increase_vibrato_rate(float change) { vibrato_rate *= change; }
330void voice_decrease_vibrato_rate(float change) { vibrato_rate /= change; }
331void voice_set_vibrato_strength(float strength) { vibrato_strength = strength; }
332void voice_increase_vibrato_strength(float change) { vibrato_strength *= change; }
333void voice_decrease_vibrato_strength(float change) { vibrato_strength /= change; }
334
335// Timbre functions
336
337void voice_set_timbre(uint8_t timbre) {
338 if ((timbre > 0) && (timbre < 100)) {
339 note_timbre = timbre;
340 }
341}
342uint8_t voice_get_timbre(void) { return note_timbre; }
diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h
index abafa2b40..578350d33 100644
--- a/quantum/audio/voices.h
+++ b/quantum/audio/voices.h
@@ -1,4 +1,5 @@
1/* Copyright 2016 Jack Humbert 1/* Copyright 2016 Jack Humbert
2 * Copyright 2020 JohSchneider
2 * 3 *
3 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
@@ -13,7 +14,6 @@
13 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 16 */
16
17#pragma once 17#pragma once
18 18
19#include <stdint.h> 19#include <stdint.h>
@@ -29,6 +29,7 @@ float voice_envelope(float frequency);
29typedef enum { 29typedef enum {
30 default_voice, 30 default_voice,
31#ifdef AUDIO_VOICES 31#ifdef AUDIO_VOICES
32 vibrating,
32 something, 33 something,
33 drums, 34 drums,
34 butts_fader, 35 butts_fader,
@@ -48,3 +49,21 @@ typedef enum {
48void set_voice(voice_type v); 49void set_voice(voice_type v);
49void voice_iterate(void); 50void voice_iterate(void);
50void voice_deiterate(void); 51void voice_deiterate(void);
52
53// Vibrato functions
54void voice_set_vibrato_rate(float rate);
55void voice_increase_vibrato_rate(float change);
56void voice_decrease_vibrato_rate(float change);
57void voice_set_vibrato_strength(float strength);
58void voice_increase_vibrato_strength(float change);
59void voice_decrease_vibrato_strength(float change);
60
61// Timbre functions
62/**
63 * @brief set the global timbre for tones to be played
64 * @note: only applies to pwm implementations - where it adjusts the duty-cycle
65 * @note: using any instrument from voices.[ch] other than 'default' may override the set value
66 * @param[in]: timbre: valid range is (0,100)
67 */
68void voice_set_timbre(uint8_t timbre);
69uint8_t voice_get_timbre(void);
diff --git a/quantum/audio/wave.h b/quantum/audio/wave.h
deleted file mode 100644
index 48210a944..000000000
--- a/quantum/audio/wave.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/* Copyright 2016 Jack Humbert
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <avr/io.h>
18#include <avr/interrupt.h>
19#include <avr/pgmspace.h>
20
21#define SINE_LENGTH 2048
22
23const uint8_t sinewave[] PROGMEM = // 2048 values
24 {0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x82, 0x82, 0x83, 0x83, 0x83, 0x84, 0x84, 0x85, 0x85, 0x85, 0x86, 0x86, 0x87, 0x87, 0x87, 0x88, 0x88, 0x88, 0x89, 0x89, 0x8a, 0x8a, 0x8a, 0x8b, 0x8b, 0x8c, 0x8c, 0x8c, 0x8d, 0x8d, 0x8e, 0x8e, 0x8e, 0x8f, 0x8f, 0x8f, 0x90, 0x90, 0x91, 0x91, 0x91, 0x92, 0x92, 0x93, 0x93, 0x93, 0x94, 0x94, 0x95, 0x95, 0x95, 0x96, 0x96, 0x96, 0x97, 0x97, 0x98, 0x98, 0x98, 0x99, 0x99, 0x9a, 0x9a, 0x9a, 0x9b, 0x9b, 0x9b, 0x9c, 0x9c, 0x9d, 0x9d, 0x9d, 0x9e, 0x9e, 0x9e, 0x9f, 0x9f, 0xa0, 0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa2, 0xa2, 0xa3, 0xa3, 0xa3, 0xa4, 0xa4, 0xa5, 0xa5, 0xa5, 0xa6, 0xa6, 0xa6, 0xa7, 0xa7, 0xa7, 0xa8, 0xa8, 0xa9, 0xa9, 0xa9, 0xaa, 0xaa, 0xaa, 0xab, 0xab, 0xac, 0xac, 0xac, 0xad, 0xad, 0xad, 0xae, 0xae, 0xae, 0xaf, 0xaf, 0xb0, 0xb0, 0xb0, 0xb1, 0xb1, 0xb1, 0xb2, 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb4, 0xb4, 0xb5, 0xb5, 0xb5, 0xb6, 0xb6, 0xb6, 0xb7, 0xb7, 0xb7, 0xb8, 0xb8, 0xb8, 0xb9, 0xb9, 0xba, 0xba, 0xba, 0xbb,
25 0xbb, 0xbb, 0xbc, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbe, 0xbe, 0xbe, 0xbf, 0xbf, 0xbf, 0xc0, 0xc0, 0xc0, 0xc1, 0xc1, 0xc1, 0xc2, 0xc2, 0xc2, 0xc3, 0xc3, 0xc3, 0xc4, 0xc4, 0xc4, 0xc5, 0xc5, 0xc5, 0xc6, 0xc6, 0xc6, 0xc7, 0xc7, 0xc7, 0xc8, 0xc8, 0xc8, 0xc9, 0xc9, 0xc9, 0xca, 0xca, 0xca, 0xcb, 0xcb, 0xcb, 0xcb, 0xcc, 0xcc, 0xcc, 0xcd, 0xcd, 0xcd, 0xce, 0xce, 0xce, 0xcf, 0xcf, 0xcf, 0xcf, 0xd0, 0xd0, 0xd0, 0xd1, 0xd1, 0xd1, 0xd2, 0xd2, 0xd2, 0xd2, 0xd3, 0xd3, 0xd3, 0xd4, 0xd4, 0xd4, 0xd5, 0xd5, 0xd5, 0xd5, 0xd6, 0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd7, 0xd8, 0xd8, 0xd8, 0xd9, 0xd9, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xda, 0xdb, 0xdb, 0xdb, 0xdc, 0xdc, 0xdc, 0xdc, 0xdd, 0xdd, 0xdd, 0xdd, 0xde, 0xde, 0xde, 0xde, 0xdf, 0xdf, 0xdf, 0xe0, 0xe0, 0xe0, 0xe0, 0xe1, 0xe1, 0xe1, 0xe1, 0xe2, 0xe2, 0xe2, 0xe2, 0xe3, 0xe3, 0xe3, 0xe3, 0xe4, 0xe4, 0xe4, 0xe4, 0xe4, 0xe5, 0xe5, 0xe5, 0xe5, 0xe6, 0xe6, 0xe6, 0xe6, 0xe7, 0xe7, 0xe7, 0xe7, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8,
26 0xe9, 0xe9, 0xe9, 0xe9, 0xea, 0xea, 0xea, 0xea, 0xea, 0xeb, 0xeb, 0xeb, 0xeb, 0xeb, 0xec, 0xec, 0xec, 0xec, 0xec, 0xed, 0xed, 0xed, 0xed, 0xed, 0xee, 0xee, 0xee, 0xee, 0xee, 0xef, 0xef, 0xef, 0xef, 0xef, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
27 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xfa, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7, 0xf7,
28 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf6, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf5, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xef, 0xef, 0xef, 0xef, 0xef, 0xee, 0xee, 0xee, 0xee, 0xee, 0xed, 0xed, 0xed, 0xed, 0xed, 0xec, 0xec, 0xec, 0xec, 0xec, 0xeb, 0xeb, 0xeb, 0xeb, 0xeb, 0xea, 0xea, 0xea, 0xea, 0xea, 0xe9, 0xe9, 0xe9, 0xe9, 0xe8, 0xe8, 0xe8, 0xe8, 0xe8, 0xe7, 0xe7, 0xe7, 0xe7, 0xe6, 0xe6, 0xe6, 0xe6, 0xe5, 0xe5, 0xe5, 0xe5, 0xe4, 0xe4, 0xe4, 0xe4, 0xe4, 0xe3, 0xe3, 0xe3, 0xe3, 0xe2, 0xe2, 0xe2, 0xe2, 0xe1, 0xe1, 0xe1, 0xe1, 0xe0, 0xe0, 0xe0, 0xe0, 0xdf, 0xdf, 0xdf, 0xde, 0xde, 0xde, 0xde, 0xdd, 0xdd, 0xdd, 0xdd, 0xdc, 0xdc, 0xdc, 0xdc, 0xdb, 0xdb, 0xdb, 0xda, 0xda, 0xda, 0xda, 0xd9, 0xd9, 0xd9, 0xd9, 0xd8, 0xd8, 0xd8, 0xd7, 0xd7, 0xd7, 0xd7, 0xd6, 0xd6, 0xd6, 0xd5, 0xd5, 0xd5, 0xd5, 0xd4, 0xd4, 0xd4,
29 0xd3, 0xd3, 0xd3, 0xd2, 0xd2, 0xd2, 0xd2, 0xd1, 0xd1, 0xd1, 0xd0, 0xd0, 0xd0, 0xcf, 0xcf, 0xcf, 0xcf, 0xce, 0xce, 0xce, 0xcd, 0xcd, 0xcd, 0xcc, 0xcc, 0xcc, 0xcb, 0xcb, 0xcb, 0xcb, 0xca, 0xca, 0xca, 0xc9, 0xc9, 0xc9, 0xc8, 0xc8, 0xc8, 0xc7, 0xc7, 0xc7, 0xc6, 0xc6, 0xc6, 0xc5, 0xc5, 0xc5, 0xc4, 0xc4, 0xc4, 0xc3, 0xc3, 0xc3, 0xc2, 0xc2, 0xc2, 0xc1, 0xc1, 0xc1, 0xc0, 0xc0, 0xc0, 0xbf, 0xbf, 0xbf, 0xbe, 0xbe, 0xbe, 0xbd, 0xbd, 0xbd, 0xbc, 0xbc, 0xbc, 0xbb, 0xbb, 0xbb, 0xba, 0xba, 0xba, 0xb9, 0xb9, 0xb8, 0xb8, 0xb8, 0xb7, 0xb7, 0xb7, 0xb6, 0xb6, 0xb6, 0xb5, 0xb5, 0xb5, 0xb4, 0xb4, 0xb4, 0xb3, 0xb3, 0xb2, 0xb2, 0xb2, 0xb1, 0xb1, 0xb1, 0xb0, 0xb0, 0xb0, 0xaf, 0xaf, 0xae, 0xae, 0xae, 0xad, 0xad, 0xad, 0xac, 0xac, 0xac, 0xab, 0xab, 0xaa, 0xaa, 0xaa, 0xa9, 0xa9, 0xa9, 0xa8, 0xa8, 0xa7, 0xa7, 0xa7, 0xa6, 0xa6, 0xa6, 0xa5, 0xa5, 0xa5, 0xa4, 0xa4, 0xa3, 0xa3, 0xa3, 0xa2, 0xa2, 0xa2, 0xa1, 0xa1, 0xa0, 0xa0, 0xa0, 0x9f, 0x9f, 0x9e, 0x9e, 0x9e, 0x9d,
30 0x9d, 0x9d, 0x9c, 0x9c, 0x9b, 0x9b, 0x9b, 0x9a, 0x9a, 0x9a, 0x99, 0x99, 0x98, 0x98, 0x98, 0x97, 0x97, 0x96, 0x96, 0x96, 0x95, 0x95, 0x95, 0x94, 0x94, 0x93, 0x93, 0x93, 0x92, 0x92, 0x91, 0x91, 0x91, 0x90, 0x90, 0x8f, 0x8f, 0x8f, 0x8e, 0x8e, 0x8e, 0x8d, 0x8d, 0x8c, 0x8c, 0x8c, 0x8b, 0x8b, 0x8a, 0x8a, 0x8a, 0x89, 0x89, 0x88, 0x88, 0x88, 0x87, 0x87, 0x87, 0x86, 0x86, 0x85, 0x85, 0x85, 0x84, 0x84, 0x83, 0x83, 0x83, 0x82, 0x82, 0x81, 0x81, 0x81, 0x80, 0x80, 0x80, 0x7f, 0x7f, 0x7e, 0x7e, 0x7e, 0x7d, 0x7d, 0x7c, 0x7c, 0x7c, 0x7b, 0x7b, 0x7a, 0x7a, 0x7a, 0x79, 0x79, 0x78, 0x78, 0x78, 0x77, 0x77, 0x77, 0x76, 0x76, 0x75, 0x75, 0x75, 0x74, 0x74, 0x73, 0x73, 0x73, 0x72, 0x72, 0x71, 0x71, 0x71, 0x70, 0x70, 0x70, 0x6f, 0x6f, 0x6e, 0x6e, 0x6e, 0x6d, 0x6d, 0x6c, 0x6c, 0x6c, 0x6b, 0x6b, 0x6a, 0x6a, 0x6a, 0x69, 0x69, 0x69, 0x68, 0x68, 0x67, 0x67, 0x67, 0x66, 0x66, 0x65, 0x65, 0x65, 0x64, 0x64, 0x64, 0x63, 0x63, 0x62, 0x62, 0x62, 0x61, 0x61, 0x61, 0x60,
31 0x60, 0x5f, 0x5f, 0x5f, 0x5e, 0x5e, 0x5d, 0x5d, 0x5d, 0x5c, 0x5c, 0x5c, 0x5b, 0x5b, 0x5a, 0x5a, 0x5a, 0x59, 0x59, 0x59, 0x58, 0x58, 0x58, 0x57, 0x57, 0x56, 0x56, 0x56, 0x55, 0x55, 0x55, 0x54, 0x54, 0x53, 0x53, 0x53, 0x52, 0x52, 0x52, 0x51, 0x51, 0x51, 0x50, 0x50, 0x4f, 0x4f, 0x4f, 0x4e, 0x4e, 0x4e, 0x4d, 0x4d, 0x4d, 0x4c, 0x4c, 0x4b, 0x4b, 0x4b, 0x4a, 0x4a, 0x4a, 0x49, 0x49, 0x49, 0x48, 0x48, 0x48, 0x47, 0x47, 0x47, 0x46, 0x46, 0x45, 0x45, 0x45, 0x44, 0x44, 0x44, 0x43, 0x43, 0x43, 0x42, 0x42, 0x42, 0x41, 0x41, 0x41, 0x40, 0x40, 0x40, 0x3f, 0x3f, 0x3f, 0x3e, 0x3e, 0x3e, 0x3d, 0x3d, 0x3d, 0x3c, 0x3c, 0x3c, 0x3b, 0x3b, 0x3b, 0x3a, 0x3a, 0x3a, 0x39, 0x39, 0x39, 0x38, 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36, 0x36, 0x35, 0x35, 0x35, 0x34, 0x34, 0x34, 0x34, 0x33, 0x33, 0x33, 0x32, 0x32, 0x32, 0x31, 0x31, 0x31, 0x30, 0x30, 0x30, 0x30, 0x2f, 0x2f, 0x2f, 0x2e, 0x2e, 0x2e, 0x2d, 0x2d, 0x2d, 0x2d, 0x2c, 0x2c, 0x2c, 0x2b, 0x2b, 0x2b, 0x2a, 0x2a,
32 0x2a, 0x2a, 0x29, 0x29, 0x29, 0x28, 0x28, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26, 0x26, 0x26, 0x25, 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23, 0x23, 0x23, 0x23, 0x22, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21, 0x21, 0x20, 0x20, 0x20, 0x1f, 0x1f, 0x1f, 0x1f, 0x1e, 0x1e, 0x1e, 0x1e, 0x1d, 0x1d, 0x1d, 0x1d, 0x1c, 0x1c, 0x1c, 0x1c, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1a, 0x1a, 0x1a, 0x1a, 0x19, 0x19, 0x19, 0x19, 0x18, 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x17, 0x17, 0x16, 0x16, 0x16, 0x16, 0x15, 0x15, 0x15, 0x15, 0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x13, 0x13, 0x13, 0x13, 0x13, 0x12, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x10, 0x10, 0x10, 0x10, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xe, 0xe, 0xe, 0xe, 0xe, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xc, 0xc, 0xc, 0xc, 0xc, 0xc, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x8, 0x8, 0x8, 0x8, 0x8,
33 0x8, 0x8, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1,
34 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x5, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xb, 0xb, 0xb, 0xb, 0xb, 0xb, 0xc, 0xc, 0xc, 0xc, 0xc, 0xc, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xe, 0xe, 0xe, 0xe, 0xe, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17, 0x17,
35 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19, 0x1a, 0x1a, 0x1a, 0x1a, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1d, 0x1e, 0x1e, 0x1e, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x20, 0x20, 0x20, 0x21, 0x21, 0x21, 0x21, 0x22, 0x22, 0x22, 0x22, 0x23, 0x23, 0x23, 0x23, 0x24, 0x24, 0x24, 0x25, 0x25, 0x25, 0x25, 0x26, 0x26, 0x26, 0x26, 0x27, 0x27, 0x27, 0x28, 0x28, 0x28, 0x28, 0x29, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b, 0x2b, 0x2c, 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2e, 0x2f, 0x2f, 0x2f, 0x30, 0x30, 0x30, 0x30, 0x31, 0x31, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x33, 0x34, 0x34, 0x34, 0x34, 0x35, 0x35, 0x35, 0x36, 0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x38, 0x39, 0x39, 0x39, 0x3a, 0x3a, 0x3a, 0x3b, 0x3b, 0x3b, 0x3c, 0x3c, 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3e, 0x3f, 0x3f, 0x3f, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x46,
36 0x46, 0x47, 0x47, 0x47, 0x48, 0x48, 0x48, 0x49, 0x49, 0x49, 0x4a, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f, 0x4f, 0x4f, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52, 0x52, 0x52, 0x53, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x58, 0x58, 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c, 0x5c, 0x5d, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f, 0x5f, 0x60, 0x60, 0x61, 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x64, 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67, 0x67, 0x68, 0x68, 0x69, 0x69, 0x69, 0x6a, 0x6a, 0x6a, 0x6b, 0x6b, 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6e, 0x6f, 0x6f, 0x70, 0x70, 0x70, 0x71, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x73, 0x74, 0x74, 0x75, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77, 0x77, 0x78, 0x78, 0x78, 0x79, 0x79, 0x7a, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x7d, 0x7d, 0x7e, 0x7e, 0x7e, 0x7f, 0x7f};
diff --git a/quantum/backlight/backlight_avr.c b/quantum/backlight/backlight_avr.c
index 2ecdd4f2c..e47192de3 100644
--- a/quantum/backlight/backlight_avr.c
+++ b/quantum/backlight/backlight_avr.c
@@ -126,7 +126,7 @@
126# define COMxx1 COM1B1 126# define COMxx1 COM1B1
127# define OCRxx OCR1B 127# define OCRxx OCR1B
128# endif 128# endif
129#elif !defined(B5_AUDIO) && !defined(B6_AUDIO) && !defined(B7_AUDIO) 129#elif (AUDIO_PIN != B5) && (AUDIO_PIN != B6) && (AUDIO_PIN != B7) && (AUDIO_PIN_ALT != B5) && (AUDIO_PIN_ALT != B6) && (AUDIO_PIN_ALT != B7)
130// Timer 1 is not in use by Audio feature, Backlight can use it 130// Timer 1 is not in use by Audio feature, Backlight can use it
131# pragma message "Using hardware timer 1 with software PWM" 131# pragma message "Using hardware timer 1 with software PWM"
132# define HARDWARE_PWM 132# define HARDWARE_PWM
@@ -145,7 +145,7 @@
145 145
146# define OCIExA OCIE1A 146# define OCIExA OCIE1A
147# define OCRxx OCR1A 147# define OCRxx OCR1A
148#elif !defined(C6_AUDIO) && !defined(C5_AUDIO) && !defined(C4_AUDIO) 148#elif (AUDIO_PIN != C4) && (AUDIO_PIN != C5) && (AUDIO_PIN != C6)
149# pragma message "Using hardware timer 3 with software PWM" 149# pragma message "Using hardware timer 3 with software PWM"
150// Timer 3 is not in use by Audio feature, Backlight can use it 150// Timer 3 is not in use by Audio feature, Backlight can use it
151# define HARDWARE_PWM 151# define HARDWARE_PWM
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 1db3b6d73..caae27741 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -6,3 +6,4 @@ nose2
6flake8 6flake8
7pep8-naming 7pep8-naming
8yapf 8yapf
9wave
diff --git a/users/yanfali/config.h b/users/yanfali/config.h
index 26517a9f6..a39e95c9d 100644
--- a/users/yanfali/config.h
+++ b/users/yanfali/config.h
@@ -2,7 +2,7 @@
2 2
3#ifdef KEYBOARD_evyd13_plain60 3#ifdef KEYBOARD_evyd13_plain60
4 4
5#define B7_AUDIO 5#define AUDIO_PIN B7
6#ifdef AUDIO_ENABLE 6#ifdef AUDIO_ENABLE
7 #define STARTUP_SONG SONG(GUITAR_SOUND) 7 #define STARTUP_SONG SONG(GUITAR_SOUND)
8#endif 8#endif
diff --git a/util/audio_generate_dac_lut.py b/util/audio_generate_dac_lut.py
new file mode 100755
index 000000000..c31ba3d7e
--- /dev/null
+++ b/util/audio_generate_dac_lut.py
@@ -0,0 +1,67 @@
1#!/usr/bin/env python3
2#
3# Copyright 2020 JohSchneider
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18
19AUDIO_DAC_BUFFER_SIZE=256
20AUDIO_DAC_SAMPLE_MAX=4095
21
22def plot(values):
23 for v in values:
24 print('0'* int(v * 80/AUDIO_DAC_SAMPLE_MAX))
25
26def to_lut(values):
27 for v in values:
28 print(hex(int(v)), end=", ")
29
30
31from math import sin, tau, pi
32
33samples=[]
34
35def sampleSine():
36 for s in range(AUDIO_DAC_BUFFER_SIZE):
37 samples.append((sin((s/AUDIO_DAC_BUFFER_SIZE)*tau - pi/2) + 1 )/2* AUDIO_DAC_SAMPLE_MAX)
38
39def sampleTriangle():
40 for s in range(AUDIO_DAC_BUFFER_SIZE):
41 if s < AUDIO_DAC_BUFFER_SIZE/2:
42 samples.append(s/(AUDIO_DAC_BUFFER_SIZE/2) * AUDIO_DAC_SAMPLE_MAX)
43 else:
44 samples.append(AUDIO_DAC_SAMPLE_MAX - (s-AUDIO_DAC_BUFFER_SIZE/2)/(AUDIO_DAC_BUFFER_SIZE/2) * AUDIO_DAC_SAMPLE_MAX)
45
46#compromise between square and triangle wave,
47def sampleTrapezoidal():
48 for i in range(AUDIO_DAC_BUFFER_SIZE):
49 a=3 #slope/inclination
50 if (i < AUDIO_DAC_BUFFER_SIZE/2):
51 s = a * (i * AUDIO_DAC_SAMPLE_MAX/(AUDIO_DAC_BUFFER_SIZE/2)) + (1-a)*AUDIO_DAC_SAMPLE_MAX/2
52 else:
53 i = i - AUDIO_DAC_BUFFER_SIZE/2
54 s = AUDIO_DAC_SAMPLE_MAX - a * (i * AUDIO_DAC_SAMPLE_MAX/(AUDIO_DAC_BUFFER_SIZE/2)) - (1-a)*AUDIO_DAC_SAMPLE_MAX/2
55
56 if s < 0:
57 s=0
58 if s> AUDIO_DAC_SAMPLE_MAX:
59 s=AUDIO_DAC_SAMPLE_MAX
60 samples.append(s)
61
62
63#sampleSine()
64sampleTrapezoidal()
65#print(samples)
66plot(samples)
67to_lut(samples)
diff --git a/util/sample_parser.py b/util/sample_parser.py
new file mode 100755
index 000000000..70e193aee
--- /dev/null
+++ b/util/sample_parser.py
@@ -0,0 +1,39 @@
1#!/usr/bin/env python3
2#
3# Copyright 2019 Jack Humbert
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18
19import wave, struct, sys
20
21waveFile = wave.open(sys.argv[1], 'r')
22# print(str(waveFile.getparams()))
23# sys.exit()
24
25if (waveFile.getsampwidth() != 2):
26 raise(Exception("This script currently only works with 16bit audio files"))
27
28length = waveFile.getnframes()
29out = "#define DAC_SAMPLE_CUSTOM_LENGTH " + str(length) + "\n\n"
30out += "static const dacsample_t dac_sample_custom[" + str(length) + "] = {"
31for i in range(0,length):
32 if (i % 8 == 0):
33 out += "\n "
34 waveData = waveFile.readframes(1)
35 data = struct.unpack("<h", waveData)
36 out += str(int((int(data[0]) + 0x8000) / 16)) + ", "
37out = out[:-2]
38out += "\n};"
39print(out)
diff --git a/util/wavetable_parser.py b/util/wavetable_parser.py
new file mode 100755
index 000000000..be0f01f7b
--- /dev/null
+++ b/util/wavetable_parser.py
@@ -0,0 +1,40 @@
1#!/usr/bin/env python3
2#
3# Copyright 2019 Jack Humbert
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#
18
19import wave, struct, sys
20
21waveFile = wave.open(sys.argv[1], 'r')
22
23length = waveFile.getnframes()
24out = "#define DAC_WAVETABLE_CUSTOM_LENGTH " + str(int(length / 256)) + "\n\n"
25out += "static const dacsample_t dac_wavetable_custom[" + str(int(length / 256)) + "][256] = {"
26for i in range(0,length):
27 if (i % 8 == 0):
28 out += "\n "
29 if (i % 256 == 0):
30 out = out[:-2]
31 out += "{\n "
32 waveData = waveFile.readframes(1)
33 data = struct.unpack("<h", waveData)
34 out += str(int((int(data[0]) + 0x8000) / 16)) + ", "
35 if (i % 256 == 255):
36 out = out[:-2]
37 out += "\n },"
38out = out[:-1]
39out += "\n};"
40print(out)