├── LICENSE.md ├── README.md ├── lpc.c ├── lpc.h ├── manual.org ├── notes.org ├── revival.org ├── revival ├── fp-info-cache ├── new_worm3-B.SilkS.gbo ├── new_worm3-Back.gbl ├── new_worm3-Edge.Cuts.gm1 ├── new_worm3-F.SilkS.gto ├── new_worm3-Front.gtl ├── new_worm3-bottom.pos ├── new_worm3-top.pos ├── new_worm3.csv ├── new_worm3.drl ├── new_worm3.kicad_pcb ├── new_worm3.kicad_pcb-bak ├── new_worm3.pro ├── new_worm3_panel.kicad_pcb ├── new_worm3_panel.kicad_pcb-bak ├── new_worm3_panel.pro ├── worm001.brd ├── worm001.cmp ├── worm001.net ├── worm001.pdf ├── worm001.pro ├── worm001.sch ├── worm001_panel.brd ├── worm001_panel.pro ├── worm001_panel_revised.brd ├── worm001_panel_revised_reducing.brd ├── worm001_panel_revised_reducing002.brd ├── worm001_revised.brd ├── worm001_revised_reducing.brd ├── worm001_revised_reducing002.brd ├── worm001_revised_reducing003.brd ├── worm001_revised_reducing003.pro └── worm001ana.sch ├── src ├── LPC │ ├── lpc.c │ ├── lpc.h │ ├── lpc_back.c │ ├── lpc_lap.c │ ├── lpc_rev.c │ ├── lpc_say.c │ ├── lpc_split.c │ ├── lpcdump.c │ ├── lpclongread.c │ ├── lpcreader.c │ ├── lpctest.c │ ├── rinner.sh │ ├── runner.sh │ └── runread.sh ├── Makefile ├── Makefile.test ├── RenderTabs.h ├── SamTabs.h ├── adc.c ├── adc.h ├── arm_common_tables.h ├── arm_const_structs.h ├── arm_math.h ├── audio.c ├── audio.h ├── codec.c ├── codec.h ├── core_cm4.h ├── core_cm4_simd.h ├── core_cmFunc.h ├── core_cmInstr.h ├── digitalker.c ├── digitalker.h ├── english2phoneme │ ├── Makefile │ ├── README │ ├── TTS.h │ ├── english.c │ ├── englishold.c │ ├── englishphoneme │ ├── newenglish.c │ ├── parse.c │ ├── phoneme │ ├── phoneme.c │ ├── saynum.c │ └── spellwor.c ├── flash_cmd.gdb ├── forlap.h ├── genparam.c ├── gentable.c ├── i2s.c ├── i2s.h ├── klatt_params ├── klatt_phoneme.c ├── klatt_phoneme.h ├── klatt_vocab.h ├── main.c ├── makingsense.org ├── modetable.org ├── newvotrax.c ├── nvp.c ├── nvp.h ├── nvp_pc.c ├── nvp_vocab.h ├── parwave.c ├── parwave.h ├── phoneme_prob.py ├── phoneme_prob_other.py ├── posture.h ├── postures ├── render.c ├── render.h ├── render_lap.c ├── renderll.h ├── resources.c ├── resources.h ├── rs.h ├── rsynth-2.0-port │ ├── #phtoelm.def# │ ├── Elements.def │ ├── PORTING │ ├── README │ ├── config.h │ ├── darray.c │ ├── darray.c~ │ ├── darray.d │ ├── darray.h │ ├── darray.lst │ ├── def_pars.c │ ├── def_pars.c~ │ ├── def_pars.d │ ├── def_pars.lst │ ├── elements.c │ ├── elements.c~ │ ├── elements.d │ ├── elements.h │ ├── elements.h~ │ ├── elements.lst │ ├── holmes.c │ ├── holmes.c~ │ ├── holmes.d │ ├── holmes.h │ ├── holmes.lst │ ├── nsynth.c │ ├── nsynth.c~ │ ├── nsynth.d │ ├── nsynth.h │ ├── nsynth.lst │ ├── pars.def │ ├── phfeat.h │ ├── phtoelm.c │ ├── phtoelm.c~ │ ├── phtoelm.d │ ├── phtoelm.def │ ├── phtoelm.h │ ├── phtoelm.lst │ ├── say.c │ ├── say.c~ │ ├── say.d │ ├── say.h │ ├── say.lst │ ├── trie.c │ ├── trie.c~ │ ├── trie.d │ ├── trie.h │ ├── trie.lst │ └── useconfig.h ├── rsynth_2005 │ ├── Elements.def │ ├── elements.c │ ├── elements.c~ │ ├── elements.o │ ├── holmes.c │ ├── holmes.c~ │ ├── holmes.o │ ├── opsynth.c │ ├── opsynth.c~ │ ├── opsynth.o │ ├── phfeat.h │ ├── rsynth.h │ └── rsynth.h~ ├── rsynthy_vocab.h ├── sam.c ├── sam.h ├── sam_lap.c ├── saml.h ├── samll.h ├── samplerate.c ├── samplerate.h ├── samvocab.h ├── simpleklatt.c ├── sp0256.c ├── sp0256.h ├── sp0256_lapraw1.c ├── sp0256_lapraw2.c ├── sp0256_test.c ├── sp0256bend.c ├── sp0256lap.c ├── sp0256raw.c ├── sp0256raw1.c ├── sp0256raw2.c ├── sp0256vocab.h ├── startup_stm32f4xx.lst ├── startup_stm32f4xx.s ├── stm32_flash.ld ├── stm32f407.ld ├── stm32f4xx.h ├── stm32f4xx_adc.c ├── stm32f4xx_adc.h ├── stm32f4xx_conf.h ├── stm32f4xx_dma.c ├── stm32f4xx_dma.h ├── stm32f4xx_gpio.c ├── stm32f4xx_gpio.h ├── stm32f4xx_i2c.c ├── stm32f4xx_i2c.h ├── stm32f4xx_it.c ├── stm32f4xx_pwr.c ├── stm32f4xx_pwr.h ├── stm32f4xx_rcc.c ├── stm32f4xx_rcc.h ├── stm32f4xx_spi.c ├── stm32f4xx_spi.h ├── stm32f4xx_tim.c ├── stm32f4xx_tim.h ├── syscalls.c ├── system_stm32f4xx.c ├── system_stm32f4xx.h ├── test.c ├── testwow.c ├── tms5110r.inc ├── tms5110x.c ├── tms5200x.c ├── tms5200x.h ├── vocab_votrax.h ├── vocode.c ├── vocode.h ├── vot.h ├── votrax.c ├── votrax.h ├── wavetable.c ├── wavetable.h └── wavetables.h ├── worm001-Sheet550B4EA0.pdf ├── worm001.brd ├── worm001.cmp ├── worm001.net ├── worm001.pdf ├── worm001.pro ├── worm001.sch ├── worm001_panel.brd ├── worm001_panel.pro ├── worm001_panel_revised.brd ├── worm001_panel_revised_reducing.brd ├── worm001_panel_revised_reducing002.brd ├── worm001_revised.brd ├── worm001_revised_reducing.brd ├── worm001_revised_reducing002.brd ├── worm001_revised_reducing003-SilkS_Front.pdf ├── worm001_revised_reducing003.brd ├── worm001ana.sch └── worm_bom.pdf /README.md: -------------------------------------------------------------------------------- 1 | The WORM was for a long time desirous to speake, but the rule and 2 | or∣der of the Court enjoyned him silence, but now strutting and 3 | swelling, and impatient, of further delay, he broke out thus... [Maier] 4 | -------------------------------------------------------------------------------- /lpc.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: lpc.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: 24/8/09 6 | 7 | Linear Prediction functions written in C. 8 | 9 | \*---------------------------------------------------------------------------*/ 10 | 11 | /* 12 | Copyright (C) 2009-2012 David Rowe 13 | 14 | All rights reserved. 15 | 16 | This program is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU Lesser General Public License version 2.1, as 18 | published by the Free Software Foundation. This program is 19 | distributed in the hope that it will be useful, but WITHOUT ANY 20 | WARRANTY; without even the implied warranty of MERCHANTABILITY or 21 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 22 | License for more details. 23 | 24 | You should have received a copy of the GNU Lesser General Public License 25 | along with this program; if not, see . 26 | */ 27 | 28 | #ifndef __LPC__ 29 | #define __LPC__ 30 | 31 | #define LPC_MAX_ORDER 20 32 | 33 | void pre_emp(float Sn_pre[], float Sn[], float *mem, int Nsam); 34 | void de_emp(float Sn_se[], float Sn[], float *mem, int Nsam); 35 | void hanning_window(float Sn[], float Wn[], int Nsam); 36 | void autocorrelate(float Sn[], float Rn[], int Nsam, int order); 37 | void levinson_durbin(float R[], float lpcs[], int order); 38 | void inverse_filter(float Sn[], float a[], int Nsam, float res[], int order); 39 | void synthesis_filter(float res[], float a[], int Nsam, int order, float Sn_[]); 40 | void find_aks(float Sn[], float a[], int Nsam, int order, float *E); 41 | void weight(float ak[], float gamma, int order, float akw[]); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /revival.org: -------------------------------------------------------------------------------- 1 | For worm renewal we need: BOM, open new panel, pos file(footprint pos?) - cannot open old brd and pos file looks a bit different (no footprint) 2 | 3 | Opened in 5.1 and re-saved so can use latest kicad! 4 | 5 | 6 | Parts which needed fixing from segments and check all footprints against SEG: 7 | Stm32f405 - LQFP64 8 | Wm8731 - otherwise all should match easily and change our 1206 following SEG 9 | 10 | from SEG: 11 | 12 | Part:C40;Part No.:TAJA105M025SNJ; 13 | Part:C22;Part No.:TAJA475M025SNJ; 14 | Part:C8,C14,C16;Part No.:T491A106K010AT7280; 15 | Part:C12,C13,C39;Part No.:TCJA106M020R0150E; 16 | 17 | The package of the part in BOM is 1206(Case A) and the width of the 18 | pins is 1.2mm ,but the width of the pads of the footprint in PCB is 19 | 2.0mm. We advise reducing the pad and the width of the pads be 1.4mm 20 | 21 | 22 | * how to acces brd -> pcbnew update 23 | 24 | - opened in 5.1 the re-saved and now openable in 6 - pulledsrc/tmp 25 | 26 | * new BOM 27 | 28 | - what footprints might need re-working (check against AC and SEG) 29 | 30 | changed L1, 100N, diodes, MCP, 330R, LED, LM(fix) 31 | 32 | 33 | some res but need to update all footprints, and to check ALL orientations 34 | 35 | * new POS/drill/GERBER 36 | 37 | - to be generated 38 | 39 | * new panel for black on gold inversion 40 | -------------------------------------------------------------------------------- /revival/fp-info-cache: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /revival/new_worm3-B.SilkS.gbo: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(6.0.0-rc1-dev-209-g91e3d21d6)* 2 | G04 #@! TF.CreationDate,2022-02-26T20:17:17+01:00* 3 | G04 #@! TF.ProjectId,new_worm3,6E65775F776F726D332E6B696361645F,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Legend,Bot* 6 | G04 #@! TF.FilePolarity,Positive* 7 | %FSLAX46Y46*% 8 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 9 | G04 Created by KiCad (PCBNEW (6.0.0-rc1-dev-209-g91e3d21d6)) date Sat Feb 26 20:17:17 2022* 10 | %MOMM*% 11 | %LPD*% 12 | G01* 13 | G04 APERTURE LIST* 14 | %ADD10C,0.304800*% 15 | G04 APERTURE END LIST* 16 | D10* 17 | X165254940Y-155824282D02* 18 | X164093797Y-155824282D01* 19 | X162497225Y-156598378D02* 20 | X163005225Y-155630759D01* 21 | X163368082Y-156598378D02* 22 | X163368082Y-154566378D01* 23 | X162787511Y-154566378D01* 24 | X162642368Y-154663140D01* 25 | X162569797Y-154759901D01* 26 | X162497225Y-154953425D01* 27 | X162497225Y-155243711D01* 28 | X162569797Y-155437235D01* 29 | X162642368Y-155533997D01* 30 | X162787511Y-155630759D01* 31 | X163368082Y-155630759D01* 32 | X161844082Y-155533997D02* 33 | X161336082Y-155533997D01* 34 | X161118368Y-156598378D02* 35 | X161844082Y-156598378D01* 36 | X161844082Y-154566378D01* 37 | X161118368Y-154566378D01* 38 | X160465225Y-156598378D02* 39 | X160465225Y-154566378D01* 40 | X160102368Y-154566378D01* 41 | X159884654Y-154663140D01* 42 | X159739511Y-154856663D01* 43 | X159666940Y-155050187D01* 44 | X159594368Y-155437235D01* 45 | X159594368Y-155727520D01* 46 | X159666940Y-156114568D01* 47 | X159739511Y-156308092D01* 48 | X159884654Y-156501616D01* 49 | X160102368Y-156598378D01* 50 | X160465225Y-156598378D01* 51 | M02* 52 | -------------------------------------------------------------------------------- /revival/new_worm3-Edge.Cuts.gm1: -------------------------------------------------------------------------------- 1 | G04 #@! TF.GenerationSoftware,KiCad,Pcbnew,(6.0.0-rc1-dev-209-g91e3d21d6)* 2 | G04 #@! TF.CreationDate,2022-02-26T20:17:17+01:00* 3 | G04 #@! TF.ProjectId,new_worm3,6E65775F776F726D332E6B696361645F,rev?* 4 | G04 #@! TF.SameCoordinates,Original* 5 | G04 #@! TF.FileFunction,Profile,NP* 6 | %FSLAX46Y46*% 7 | G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)* 8 | G04 Created by KiCad (PCBNEW (6.0.0-rc1-dev-209-g91e3d21d6)) date Sat Feb 26 20:17:17 2022* 9 | %MOMM*% 10 | %LPD*% 11 | G01* 12 | G04 APERTURE LIST* 13 | %ADD10C,0.381000*% 14 | %ADD11C,0.099060*% 15 | G04 APERTURE END LIST* 16 | D10* 17 | X118348760Y-167248840D02* 18 | X174739300Y-167248840D01* 19 | X174691040Y-58709560D02* 20 | X174691040Y-167139620D01* 21 | X118409720Y-58709560D02* 22 | X174691040Y-58709560D01* 23 | X118364000Y-167386000D02* 24 | X118364000Y-58674000D01* 25 | D11* 26 | X120070033Y-48806100D02* 27 | G75* 28 | G03X120070033Y-48806100I-4233333J0D01* 29 | G01* 30 | X109486700Y-48806100D02* 31 | X122186700Y-48806100D01* 32 | X115836700Y-42456100D02* 33 | X115836700Y-55156100D01* 34 | M02* 35 | -------------------------------------------------------------------------------- /revival/new_worm3-bottom.pos: -------------------------------------------------------------------------------- 1 | ### Module positions - created on Sat Feb 26 20:19:24 2022 ### 2 | ### Printed by Pcbnew version pcbnew (6.0.0-rc1-dev-209-g91e3d21d6) 3 | ## Unit = mm, Angle = deg. 4 | ## Side : bottom 5 | # Ref Val Package PosX PosY Rot Side 6 | ## End 7 | -------------------------------------------------------------------------------- /revival/new_worm3.csv: -------------------------------------------------------------------------------- 1 | "Id";"Designator";"Package";"Quantity";"Designation";"Supplier and ref"; 2 | 1;"audioint1";"SSOP-28_5.3x10.2mm_Pitch0.65mm";1;"AUDIOINT_WM8731";;; 3 | 2;"U14";"LQFP-64_10x10mm_Pitch0.5mm";1;"STM32F405RGT6";;; 4 | 3;"C34,C20,C14,C27";"SMD-1206_Pol1.4mmnew";4;"10u";;; 5 | 4;"C25,C26,C21,C22,C23,C24";"SMD-1206_Pol1.4mmnew";6;"10uF";;; 6 | 5;"C35,C36";"SMD-1206_Pol1.4mmnew";2;"2.2uF";;; 7 | 6;"C38";"SMD-1206_Pol1.4mmnew";1;"4.7uF";;; 8 | 7;"R1";"R_0805";1;"200R";;; 9 | 8;"R2";"R_0805";1;"10K";;; 10 | 9;"R33";"R_0805";1;"1K";;; 11 | 10;"R30,R31";"R_0805";2;"4.7K";;; 12 | 11;"R28";"R_0805";1;"33K";;; 13 | 12;"R27,R32,R34";"R_0805";3;"5.6K";;; 14 | 13;"R24";"R_0805";1;"27K";;; 15 | 14;"R18,R29";"R_0805";2;"39K";;; 16 | 15;"R11,R13,R3,R4,R6";"R_0805";5;"200K";;; 17 | 16;"R9,R10,R14,R15,R17";"R_0805";5;"66.5K";;; 18 | 17;"R26";"R_0805";1;"330R";;; 19 | 18;"C19,C12,C8,C7,C6";"C_0805";5;"1N";;; 20 | 19;"C28,C29";"C_0805";2;"18pF";;; 21 | 20;"C30";"C_0805";1;"22P";;; 22 | 21;"C31";"C_0805";1;"220P";;; 23 | 22;"C11,C10,C9,C5,C4,C3,C1,C2,C33,C32";"C_0805";10;"100N";;; 24 | 23;"R7,R5";"R_0805";2;"100K";;; 25 | 24;"U7";"TO-252-2_Rectifier";1;"LM1117-3.3V";;; 26 | 25;"U8";"TO-252-2_Rectifier";1;"LM1117-5V";;; 27 | 26;"U5";"SOIC-8_3.9x4.9mm_Pitch1.27mm";1;"LME";;; 28 | 27;"U6,U9,U10";"SOIC-8_3.9x4.9mm_Pitch1.27mm";3;"MCP";;; 29 | 28;"D4,D3";"D_SOD-123";2;"DIODE";;; 30 | 29;"D5";"SOT-23";1;"LM4040";;; 31 | 30;"D2";"LED_0805";1;"LED";;; 32 | 31;"L1";"L_0603";1;"INDUCTOR";;; 33 | 32;"C18,C17,C15,C13,C16";"C_0805";5;"100nF";;; 34 | 33;"R8,R12,R16";"SM0805";3;"100K";;; 35 | 34;"P45";"SIL-4";1;"SWD";;; 36 | 35;"RV2,RV1,RV3,RV4,RV5";"RV1";5;"POT";;; 37 | 36;"X1";"Q_49U3HMS";1;"8_MHz";;; 38 | 37;"P1";"PIN_ARRAY_5x2";1;"CONN_5X2";;; 39 | 38;"JACK7,JACK6,JACK5,JACK4,JACK3,OUT,IN!";"ERTHENVAR-JACK";7;"AUDIO-JACKERTHENVAR_ERTHENVAR-JACK";;; 40 | 39;"SIL-1";"SIL-1";1;"Val**";;; 41 | -------------------------------------------------------------------------------- /revival/new_worm3.drl: -------------------------------------------------------------------------------- 1 | M48 2 | ;DRILL file {KiCad (6.0.0-rc1-dev-209-g91e3d21d6)} date Sat Feb 26 20:17:16 2022 3 | ;FORMAT={-:-/ absolute / inch / decimal} 4 | FMAT,2 5 | INCH,TZ 6 | T1C0.0250 7 | T2C0.0320 8 | T3C0.0393 9 | T4C0.0400 10 | T5C0.0590 11 | T6C0.0866 12 | T7C0.0984 13 | % 14 | G90 15 | G05 16 | M72 17 | T1 18 | X4.7894Y-6.0126 19 | X4.8642Y-6.0083 20 | X4.9142Y-5.8169 21 | X4.95Y-5.9839 22 | X4.985Y-4.1098 23 | X4.9949Y-3.885 24 | X4.9949Y-4.635 25 | X4.9965Y-4.4055 26 | X5.0051Y-4.2752 27 | X5.0051Y-4.7902 28 | X5.0181Y-5.9465 29 | X5.0717Y-5.8799 30 | X5.0783Y-5.95 31 | X5.089Y-5.6476 32 | X5.1217Y-5.8232 33 | X5.1346Y-5.9921 34 | X5.1744Y-5.1063 35 | X5.1787Y-5.3701 36 | X5.1811Y-3.1945 37 | X5.1831Y-2.6642 38 | X5.1854Y-4.122 39 | X5.1886Y-4.3846 40 | X5.1976Y-2.8 41 | X5.1976Y-3.9902 42 | X5.1976Y-4.0634 43 | X5.1976Y-4.1791 44 | X5.2031Y-5.4449 45 | X5.2079Y-4.228 46 | X5.2256Y-3.9236 47 | X5.2303Y-4.5091 48 | X5.235Y-5.9799 49 | X5.2469Y-4.128 50 | X5.2469Y-4.3335 51 | X5.2535Y-4.263 52 | X5.265Y-2.8831 53 | X5.2744Y-3.6433 54 | X5.2756Y-4.7783 55 | X5.2823Y-2.4906 56 | X5.2906Y-3.8969 57 | X5.2921Y-5.6921 58 | X5.2933Y-2.6992 59 | X5.2949Y-4.2886 60 | X5.3059Y-4.8335 61 | X5.3063Y-4.9476 62 | X5.3157Y-3.4917 63 | X5.3374Y-2.9295 64 | X5.3374Y-3.7067 65 | X5.3417Y-4.7232 66 | X5.3461Y-6.0118 67 | X5.3516Y-4.2909 68 | X5.3744Y-4.2197 69 | X5.3921Y-3.7555 70 | X5.3945Y-3.8169 71 | X5.3965Y-4.4197 72 | X5.3969Y-3.4858 73 | X5.3988Y-3.8898 74 | X5.4039Y-3.6154 75 | X5.4039Y-5.1559 76 | X5.4142Y-5.9575 77 | X5.4181Y-5.9016 78 | X5.4516Y-4.4614 79 | X5.4579Y-5.5512 80 | X5.4634Y-6.0795 81 | X5.4669Y-4.2945 82 | X5.472Y-5.7921 83 | X5.478Y-5.9575 84 | X5.4811Y-2.6913 85 | X5.4913Y-5.6142 86 | X5.4949Y-2.6217 87 | X5.5079Y-3.8051 88 | X5.5079Y-4.4087 89 | X5.5126Y-6.1354 90 | X5.5287Y-4.3012 91 | X5.535Y-4.261 92 | X5.5421Y-4.7209 93 | X5.5543Y-5.7224 94 | X5.5594Y-5.6409 95 | X5.5614Y-6.0016 96 | X5.565Y-2.8457 97 | X5.589Y-4.848 98 | X5.5953Y-3.4957 99 | X5.6071Y-5.6244 100 | X5.6244Y-3.2724 101 | X5.628Y-6.0709 102 | X5.6319Y-6.0083 103 | X5.6331Y-3.8921 104 | X5.6531Y-5.7642 105 | X5.6587Y-3.4819 106 | X5.6701Y-5.5161 107 | X5.6776Y-4.2106 108 | X5.6783Y-3.5441 109 | X5.7051Y-3.1988 110 | X5.748Y-4.2201 111 | X5.7819Y-3.1744 112 | X5.7882Y-3.8862 113 | X5.7945Y-4.3421 114 | X5.8161Y-3.687 115 | X5.8205Y-5.8067 116 | X5.8295Y-3.7319 117 | X5.8358Y-4.3669 118 | X5.8382Y-2.9752 119 | X5.8413Y-2.9087 120 | X5.8449Y-2.4988 121 | X5.8457Y-4.2106 122 | X5.8476Y-2.8358 123 | X5.8488Y-3.885 124 | X5.8799Y-5.3303 125 | X5.8799Y-5.6909 126 | X5.8831Y-3.5669 127 | X5.9268Y-4.2476 128 | X5.9512Y-5.3217 129 | X5.9531Y-2.8425 130 | X5.9579Y-3.5626 131 | X5.961Y-4.7598 132 | X5.9642Y-2.5201 133 | X5.9669Y-5.178 134 | X5.9685Y-2.4531 135 | X5.9902Y-4.5272 136 | X5.9941Y-4.3114 137 | X6.0059Y-6.0449 138 | X6.0252Y-5.811 139 | X6.0374Y-2.8488 140 | X6.0398Y-5.1925 141 | X6.0413Y-3.5642 142 | X6.0465Y-5.574 143 | X6.0512Y-3.935 144 | X6.0551Y-2.5201 145 | X6.0587Y-4.5299 146 | X6.0618Y-3.2445 147 | X6.0642Y-4.1421 148 | X6.0827Y-4.8134 149 | X6.085Y-3.648 150 | X6.0858Y-4.9791 151 | X6.0858Y-5.3642 152 | X6.0902Y-4.926 153 | X6.0961Y-3.5618 154 | X6.1051Y-2.8402 155 | X6.1091Y-4.113 156 | X6.1094Y-5.7622 157 | X6.1102Y-5.824 158 | X6.1118Y-5.1913 159 | X6.1181Y-3.2933 160 | X6.1402Y-3.6059 161 | X6.1591Y-4.987 162 | X6.1622Y-6.1819 163 | X6.1776Y-2.7929 164 | X6.1776Y-3.3567 165 | X6.1783Y-4.2476 166 | X6.1929Y-3.6543 167 | X6.2012Y-4.861 168 | X6.2091Y-5.628 169 | X6.2118Y-3.8358 170 | X6.213Y-5.4976 171 | X6.2165Y-3.8988 172 | X6.2181Y-4.3539 173 | X6.2217Y-5.5661 174 | X6.2264Y-5.439 175 | X6.2264Y-5.7256 176 | X6.2579Y-4.587 177 | X6.261Y-5.2091 178 | X6.2634Y-3.7138 179 | X6.265Y-2.9402 180 | X6.2681Y-6.0291 181 | X6.2728Y-4.1969 182 | X6.2929Y-4.55 183 | X6.3051Y-3.7642 184 | X6.3071Y-3.9677 185 | X6.3098Y-4.478 186 | X6.324Y-4.252 187 | X6.335Y-2.4886 188 | X6.3406Y-5.9094 189 | X6.3421Y-5.3669 190 | X6.3512Y-5.7461 191 | X6.3571Y-6.011 192 | X6.363Y-3.7591 193 | X6.372Y-5.4031 194 | X6.3795Y-5.3413 195 | X6.3902Y-5.1512 196 | X6.398Y-3.5772 197 | X6.4087Y-3.0799 198 | X6.4902Y-5.7531 199 | X6.4933Y-3.9724 200 | X6.4945Y-5.9555 201 | X6.5118Y-5.522 202 | X6.5189Y-4.122 203 | X6.5413Y-3.2024 204 | X6.561Y-3.8654 205 | X6.5862Y-4.102 206 | X6.6091Y-4.1539 207 | X6.6114Y-3.9417 208 | X6.613Y-5.3012 209 | X6.6256Y-3.2969 210 | X6.6287Y-4.4835 211 | X6.6398Y-3.815 212 | X6.6406Y-4.4055 213 | X6.6465Y-4.7846 214 | X6.6465Y-4.8476 215 | X6.7244Y-4.4071 216 | X6.7472Y-3.7728 217 | X6.776Y-3.5909 218 | X6.8055Y-4.4087 219 | X6.8331Y-4.015 220 | X6.8354Y-3.8059 221 | T2 222 | X5.0449Y-3.0945 223 | X5.1449Y-3.0945 224 | X5.2449Y-3.0945 225 | X5.3449Y-3.0945 226 | X6.061Y-6.3378 227 | T3 228 | X4.9102Y-4.952 229 | X5.0086Y-4.952 230 | X5.107Y-4.952 231 | X4.9102Y-3.7315 232 | X5.0086Y-3.7315 233 | X5.107Y-3.7315 234 | X6.4495Y-4.952 235 | X6.5479Y-4.952 236 | X6.6463Y-4.952 237 | X5.6661Y-3.3654 238 | X5.7645Y-3.3654 239 | X5.8629Y-3.3654 240 | X6.4495Y-3.7315 241 | X6.5479Y-3.7315 242 | X6.6463Y-3.7315 243 | T4 244 | X6.5697Y-5.5949 245 | X6.5697Y-5.6949 246 | X6.5697Y-5.7949 247 | X6.5697Y-5.8949 248 | X6.5697Y-5.9949 249 | X6.6697Y-5.5949 250 | X6.6697Y-5.6949 251 | X6.6697Y-5.7949 252 | X6.6697Y-5.8949 253 | X6.6697Y-5.9949 254 | T5 255 | X5.9173Y-6.2717 256 | X6.4528Y-5.2559 257 | X4.752Y-6.2717 258 | X4.752Y-5.2559 259 | X6.4528Y-6.2717 260 | X5.9173Y-5.0276 261 | X5.5867Y-5.4921 262 | T6 263 | X4.7997Y-4.6693 264 | X5.1987Y-4.6693 265 | X4.7997Y-3.4488 266 | X5.1987Y-3.4488 267 | X6.339Y-4.6693 268 | X6.738Y-4.6693 269 | X5.5556Y-3.0827 270 | X5.9546Y-3.0827 271 | X6.339Y-3.4488 272 | X6.738Y-3.4488 273 | T7 274 | X5.5867Y-6.2717 275 | X5.752Y-6.0788 276 | X5.752Y-6.4016 277 | X6.6181Y-5.126 278 | X6.6181Y-5.4488 279 | X6.7834Y-5.2559 280 | X4.9164Y-6.4646 281 | X4.9173Y-6.1418 282 | X5.0826Y-6.2717 283 | X4.9173Y-5.126 284 | X4.9173Y-5.4488 285 | X5.0826Y-5.2559 286 | X6.6181Y-6.1418 287 | X6.6181Y-6.4646 288 | X6.7834Y-6.2717 289 | X5.5867Y-5.0276 290 | X5.752Y-4.8347 291 | X5.752Y-5.1575 292 | X5.752Y-5.3622 293 | X5.752Y-5.685 294 | X5.9173Y-5.4921 295 | T0 296 | M30 297 | -------------------------------------------------------------------------------- /revival/new_worm3.pro: -------------------------------------------------------------------------------- 1 | update=Mon 28 Mar 2022 21:44:45 CEST 2 | version=1 3 | last_client=pcbnew 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [cvpcb] 9 | version=1 10 | NetIExt=net 11 | [eeschema] 12 | version=1 13 | LibDir= 14 | [eeschema/libraries] 15 | [pcbnew] 16 | version=1 17 | PageLayoutDescrFile= 18 | LastNetListRead= 19 | CopperLayerCount=2 20 | BoardThickness=1.6002 21 | AllowMicroVias=0 22 | AllowBlindVias=0 23 | RequireCourtyardDefinitions=0 24 | ProhibitOverlappingCourtyards=1 25 | MinTrackWidth=0.2032 26 | MinViaDiameter=0.889 27 | MinViaDrill=0.508 28 | MinMicroViaDiameter=0.508 29 | MinMicroViaDrill=0.127 30 | MinHoleToHole=0.25 31 | TrackWidth1=0.24892 32 | TrackWidth2=0.39878 33 | TrackWidth3=0.50038 34 | ViaDiameter1=0.889 35 | ViaDrill1=0.635 36 | dPairWidth1=0.2032 37 | dPairGap1=0.25 38 | dPairViaGap1=0.25 39 | SilkLineWidth=0.381 40 | SilkTextSizeV=1.524 41 | SilkTextSizeH=1.524 42 | SilkTextSizeThickness=0.3048 43 | SilkTextItalic=0 44 | SilkTextUpright=1 45 | CopperLineWidth=0.381 46 | CopperTextSizeV=2.032 47 | CopperTextSizeH=1.524 48 | CopperTextThickness=0.3048 49 | CopperTextItalic=0 50 | CopperTextUpright=1 51 | EdgeCutLineWidth=0.381 52 | CourtyardLineWidth=0.05 53 | OthersLineWidth=0.15 54 | OthersTextSizeV=1 55 | OthersTextSizeH=1 56 | OthersTextSizeThickness=0.15 57 | OthersTextItalic=0 58 | OthersTextUpright=1 59 | SolderMaskClearance=0.05 60 | SolderMaskMinWidth=0.05 61 | SolderPasteClearance=0 62 | SolderPasteRatio=-0 63 | [pcbnew/Layer.F.Cu] 64 | Name=Front 65 | Type=0 66 | Enabled=1 67 | [pcbnew/Layer.In1.Cu] 68 | Name=In1.Cu 69 | Type=0 70 | Enabled=0 71 | [pcbnew/Layer.In2.Cu] 72 | Name=In2.Cu 73 | Type=0 74 | Enabled=0 75 | [pcbnew/Layer.In3.Cu] 76 | Name=In3.Cu 77 | Type=0 78 | Enabled=0 79 | [pcbnew/Layer.In4.Cu] 80 | Name=In4.Cu 81 | Type=0 82 | Enabled=0 83 | [pcbnew/Layer.In5.Cu] 84 | Name=In5.Cu 85 | Type=0 86 | Enabled=0 87 | [pcbnew/Layer.In6.Cu] 88 | Name=In6.Cu 89 | Type=0 90 | Enabled=0 91 | [pcbnew/Layer.In7.Cu] 92 | Name=In7.Cu 93 | Type=0 94 | Enabled=0 95 | [pcbnew/Layer.In8.Cu] 96 | Name=In8.Cu 97 | Type=0 98 | Enabled=0 99 | [pcbnew/Layer.In9.Cu] 100 | Name=In9.Cu 101 | Type=0 102 | Enabled=0 103 | [pcbnew/Layer.In10.Cu] 104 | Name=In10.Cu 105 | Type=0 106 | Enabled=0 107 | [pcbnew/Layer.In11.Cu] 108 | Name=In11.Cu 109 | Type=0 110 | Enabled=0 111 | [pcbnew/Layer.In12.Cu] 112 | Name=In12.Cu 113 | Type=0 114 | Enabled=0 115 | [pcbnew/Layer.In13.Cu] 116 | Name=In13.Cu 117 | Type=0 118 | Enabled=0 119 | [pcbnew/Layer.In14.Cu] 120 | Name=In14.Cu 121 | Type=0 122 | Enabled=0 123 | [pcbnew/Layer.In15.Cu] 124 | Name=In15.Cu 125 | Type=0 126 | Enabled=0 127 | [pcbnew/Layer.In16.Cu] 128 | Name=In16.Cu 129 | Type=0 130 | Enabled=0 131 | [pcbnew/Layer.In17.Cu] 132 | Name=In17.Cu 133 | Type=0 134 | Enabled=0 135 | [pcbnew/Layer.In18.Cu] 136 | Name=In18.Cu 137 | Type=0 138 | Enabled=0 139 | [pcbnew/Layer.In19.Cu] 140 | Name=In19.Cu 141 | Type=0 142 | Enabled=0 143 | [pcbnew/Layer.In20.Cu] 144 | Name=In20.Cu 145 | Type=0 146 | Enabled=0 147 | [pcbnew/Layer.In21.Cu] 148 | Name=In21.Cu 149 | Type=0 150 | Enabled=0 151 | [pcbnew/Layer.In22.Cu] 152 | Name=In22.Cu 153 | Type=0 154 | Enabled=0 155 | [pcbnew/Layer.In23.Cu] 156 | Name=In23.Cu 157 | Type=0 158 | Enabled=0 159 | [pcbnew/Layer.In24.Cu] 160 | Name=In24.Cu 161 | Type=0 162 | Enabled=0 163 | [pcbnew/Layer.In25.Cu] 164 | Name=In25.Cu 165 | Type=0 166 | Enabled=0 167 | [pcbnew/Layer.In26.Cu] 168 | Name=In26.Cu 169 | Type=0 170 | Enabled=0 171 | [pcbnew/Layer.In27.Cu] 172 | Name=In27.Cu 173 | Type=0 174 | Enabled=0 175 | [pcbnew/Layer.In28.Cu] 176 | Name=In28.Cu 177 | Type=0 178 | Enabled=0 179 | [pcbnew/Layer.In29.Cu] 180 | Name=In29.Cu 181 | Type=0 182 | Enabled=0 183 | [pcbnew/Layer.In30.Cu] 184 | Name=In30.Cu 185 | Type=0 186 | Enabled=0 187 | [pcbnew/Layer.B.Cu] 188 | Name=Back 189 | Type=0 190 | Enabled=1 191 | [pcbnew/Layer.B.Adhes] 192 | Enabled=1 193 | [pcbnew/Layer.F.Adhes] 194 | Enabled=1 195 | [pcbnew/Layer.B.Paste] 196 | Enabled=1 197 | [pcbnew/Layer.F.Paste] 198 | Enabled=1 199 | [pcbnew/Layer.B.SilkS] 200 | Enabled=1 201 | [pcbnew/Layer.F.SilkS] 202 | Enabled=1 203 | [pcbnew/Layer.B.Mask] 204 | Enabled=1 205 | [pcbnew/Layer.F.Mask] 206 | Enabled=1 207 | [pcbnew/Layer.Dwgs.User] 208 | Enabled=1 209 | [pcbnew/Layer.Cmts.User] 210 | Enabled=1 211 | [pcbnew/Layer.Eco1.User] 212 | Enabled=1 213 | [pcbnew/Layer.Eco2.User] 214 | Enabled=1 215 | [pcbnew/Layer.Edge.Cuts] 216 | Enabled=1 217 | [pcbnew/Layer.Margin] 218 | Enabled=1 219 | [pcbnew/Layer.B.CrtYd] 220 | Enabled=1 221 | [pcbnew/Layer.F.CrtYd] 222 | Enabled=1 223 | [pcbnew/Layer.B.Fab] 224 | Enabled=1 225 | [pcbnew/Layer.F.Fab] 226 | Enabled=1 227 | [pcbnew/Layer.Rescue] 228 | Enabled=0 229 | [pcbnew/Netclasses] 230 | [pcbnew/Netclasses/Default] 231 | Name=Default 232 | Clearance=0.2 233 | TrackWidth=0.24892 234 | ViaDiameter=0.889 235 | ViaDrill=0.635 236 | uViaDiameter=0.508 237 | uViaDrill=0.127 238 | dPairWidth=0.2032 239 | dPairGap=0.25 240 | dPairViaGap=0.25 241 | -------------------------------------------------------------------------------- /revival/new_worm3_panel.pro: -------------------------------------------------------------------------------- 1 | update=22/05/2015 07:44:53 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | -------------------------------------------------------------------------------- /revival/worm001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/revival/worm001.pdf -------------------------------------------------------------------------------- /revival/worm001.pro: -------------------------------------------------------------------------------- 1 | update=Thu 05 Nov 2015 16:03:47 CET 2 | last_client=eeschema 3 | [cvpcb] 4 | version=1 5 | NetIExt=net 6 | [cvpcb/libraries] 7 | EquName1=devcms 8 | [pcbnew] 9 | version=1 10 | PadDrlX=320 11 | PadDimH=600 12 | PadDimV=600 13 | BoardThickness=630 14 | TxtPcbV=800 15 | TxtPcbH=600 16 | TxtModV=600 17 | TxtModH=600 18 | TxtModW=120 19 | VEgarde=100 20 | DrawLar=150 21 | EdgeLar=150 22 | TxtLar=120 23 | MSegLar=150 24 | LastNetListRead=darkintmod002.net 25 | [pcbnew/libraries] 26 | LibDir= 27 | LibName1=sockets 28 | LibName2=connect 29 | LibName3=discret 30 | LibName4=pin_array 31 | LibName5=divers 32 | LibName6=libcms 33 | LibName7=display 34 | LibName8=led 35 | LibName9=dip_sockets 36 | LibName10=pga_sockets 37 | LibName11=valves 38 | LibName12=/root/newkicad/alps 39 | LibName13=/root/newkicad/LQFP64 40 | LibName14=/root/newkicad/newerfmask 41 | LibName15=/root/newkicad/newmonad 42 | LibName16=/root/newkicad/newmonadboth 43 | LibName17=/root/newkicad/newmonaderdscaled 44 | LibName18=/root/newkicad/newmonadmask 45 | LibName19=/root/newkicad/newmonadscaled 46 | LibName20=/root/newkicad/SOD-123 47 | LibName21=/root/darkint/hardware/iheart-kicad-lib/IHE 48 | LibName22=/root/darkint/hardware/libKiCad/footprint/smd_lqfp 49 | LibName23=Eagle2Kicad/erthenvar 50 | LibName24=LQFP64 51 | [eeschema] 52 | version=1 53 | LibDir= 54 | NetFmt=1 55 | HPGLSpd=20 56 | HPGLDm=15 57 | HPGLNum=1 58 | offX_A4=0 59 | offY_A4=0 60 | offX_A3=0 61 | offY_A3=0 62 | offX_A2=0 63 | offY_A2=0 64 | offX_A1=0 65 | offY_A1=0 66 | offX_A0=0 67 | offY_A0=0 68 | offX_A=0 69 | offY_A=0 70 | offX_B=0 71 | offY_B=0 72 | offX_C=0 73 | offY_C=0 74 | offX_D=0 75 | offY_D=0 76 | offX_E=0 77 | offY_E=0 78 | RptD_X=0 79 | RptD_Y=100 80 | RptLab=1 81 | LabSize=60 82 | [eeschema/libraries] 83 | LibName1=power 84 | LibName2=device 85 | LibName3=transistors 86 | LibName4=conn 87 | LibName5=linear 88 | LibName6=regul 89 | LibName7=74xx 90 | LibName8=cmos4000 91 | LibName9=adc-dac 92 | LibName10=memory 93 | LibName11=xilinx 94 | LibName12=special 95 | LibName13=microcontrollers 96 | LibName14=dsp 97 | LibName15=microchip 98 | LibName16=analog_switches 99 | LibName17=motorola 100 | LibName18=texas 101 | LibName19=intel 102 | LibName20=audio 103 | LibName21=interface 104 | LibName22=digital-audio 105 | LibName23=philips 106 | LibName24=display 107 | LibName25=cypress 108 | LibName26=siliconi 109 | LibName27=opto 110 | LibName28=atmel 111 | LibName29=contrib 112 | LibName30=valves 113 | LibName31=analogSpice 114 | LibName32=analogXSpice 115 | LibName33=convergenceAidSpice 116 | LibName34=converterSpice 117 | LibName35=digitalSpice 118 | LibName36=digitalXSpice 119 | LibName37=linearSpice 120 | LibName38=measurementSpice 121 | LibName39=portSpice 122 | LibName40=sourcesSpice 123 | LibName41=/root/newkicad/darkintmod-cache 124 | -------------------------------------------------------------------------------- /revival/worm001_panel.pro: -------------------------------------------------------------------------------- 1 | update=Tue 03 Nov 2015 21:10:02 CET 2 | last_client=pcbnew 3 | [pcbnew] 4 | version=1 5 | PadDrlX=3701 6 | PadDimH=4724 7 | PadDimV=4724 8 | BoardThickness=630 9 | TxtPcbV=800 10 | TxtPcbH=600 11 | TxtModV=600 12 | TxtModH=600 13 | TxtModW=120 14 | VEgarde=100 15 | DrawLar=150 16 | EdgeLar=8 17 | TxtLar=120 18 | MSegLar=150 19 | LastNetListRead= 20 | [pcbnew/libraries] 21 | LibDir= 22 | LibName1=sockets 23 | LibName2=connect 24 | LibName3=discret 25 | LibName4=pin_array 26 | LibName5=divers 27 | LibName6=libcms 28 | LibName7=display 29 | LibName8=led 30 | LibName9=dip_sockets 31 | LibName10=pga_sockets 32 | LibName11=valves 33 | LibName12=/root/projects/ERD_modules/all/ERD_modules 34 | -------------------------------------------------------------------------------- /revival/worm001_revised_reducing003.pro: -------------------------------------------------------------------------------- 1 | update=22/05/2015 07:44:53 2 | version=1 3 | last_client=kicad 4 | [general] 5 | version=1 6 | RootSch= 7 | BoardNm= 8 | [pcbnew] 9 | version=1 10 | LastNetListRead= 11 | UseCmpFile=1 12 | PadDrill=0.600000000000 13 | PadDrillOvalY=0.600000000000 14 | PadSizeH=1.500000000000 15 | PadSizeV=1.500000000000 16 | PcbTextSizeV=1.500000000000 17 | PcbTextSizeH=1.500000000000 18 | PcbTextThickness=0.300000000000 19 | ModuleTextSizeV=1.000000000000 20 | ModuleTextSizeH=1.000000000000 21 | ModuleTextSizeThickness=0.150000000000 22 | SolderMaskClearance=0.000000000000 23 | SolderMaskMinWidth=0.000000000000 24 | DrawSegmentWidth=0.200000000000 25 | BoardOutlineThickness=0.100000000000 26 | ModuleOutlineThickness=0.150000000000 27 | [cvpcb] 28 | version=1 29 | NetIExt=net 30 | [eeschema] 31 | version=1 32 | LibDir= 33 | [eeschema/libraries] 34 | -------------------------------------------------------------------------------- /src/LPC/lpc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * lpc.h 3 | * 03-26-2015 E. Brombaugh 4 | * borrows heavily from Peter Knight's Talkie library for Arduino 5 | * This code is released under GPLv2 license 6 | */ 7 | 8 | #ifndef _lpc_ 9 | #define _lpc_ 10 | 11 | #include "audio.h" 12 | //#include "stm32f0xx.h" 13 | 14 | void lpc_init(void); 15 | void lpc_newsay(); 16 | uint16_t lpc_get_sample(void); 17 | 18 | void lpc_say(uint8_t* address); 19 | u16 lpc_get_sample(void); 20 | u8 lpc_busy(void); 21 | void lpc_running(); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/LPC/rinner.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | var=$2 4 | while true; do 5 | ./say $1 $var | aplay 6 | echo "\n" 7 | echo $var 8 | sleep 1 9 | var=`expr $var + 1` 10 | done 11 | -------------------------------------------------------------------------------- /src/LPC/runner.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | var=$2 4 | while true; do 5 | ./say $var $1 | aplay 6 | echo "\n" 7 | echo $var 8 | sleep 1 9 | var=`expr $var + 1` 10 | done 11 | -------------------------------------------------------------------------------- /src/LPC/runread.sh: -------------------------------------------------------------------------------- 1 | #bin/bash 2 | 3 | var=$1 4 | while true; do 5 | ./lpcr $var $2 $3 | aplay 6 | echo "\n" 7 | # echo $var 8 | sleep 1 9 | var=`expr $var + 1` 10 | done 11 | 12 | -------------------------------------------------------------------------------- /src/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #TOOL_PREFIX = /opt/ARM/arm-linaro-eabi-4.6 3 | #TOOL_PREFIX = /root/ARM/gcc-arm-none-eabi-4_9-2015q2 4 | #TOOL_PREFIX = /root/gcc-arm-none-eabi-7-2018-q2-update 5 | TOOL_PREFIX = /usr 6 | 7 | PRG_PREFIX = $(TOOL_PREFIX)/bin/arm-none-eabi- 8 | #LIB_PREFIX = $(TOOL_PREFIX)/arm-none-eabi/lib/thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16/ 9 | 10 | # LIB_PREFIX is not used 11 | 12 | CC = $(PRG_PREFIX)gcc 13 | LD = $(PRG_PREFIX)gcc 14 | 15 | rsynth-portDIR = ./rsynth-2.0-port 16 | ttsd= ./english2phoneme 17 | 18 | # Object files 19 | OBJECTS = startup_stm32f4xx.o system_stm32f4xx.o main.o codec.o i2s.o \ 20 | stm32f4xx_tim.o adc.o stm32f4xx_pwr.o\ 21 | stm32f4xx_gpio.o stm32f4xx_i2c.o stm32f4xx_rcc.o \ 22 | stm32f4xx_spi.o stm32f4xx_dma.o stm32f4xx_adc.o \ 23 | syscalls.o resources.o audio.o \ 24 | sp0256.o simpleklatt.o parwave.o sam.o render.o tms5200x.o \ 25 | digitalker.o nvp.o samplerate.o \ 26 | newvotrax.o sp0256bend.o \ 27 | $(ttsd)/parse.o $(ttsd)/saynum.o $(ttsd)/newenglish.o $(ttsd)/phoneme.o $(ttsd)/spellwor.o \ 28 | rsynth_2005/holmes.o rsynth_2005/elements.o rsynth_2005/opsynth.o 29 | 30 | 31 | OBJECTS += \ 32 | $(rsynth-portDIR)/holmes.o \ 33 | $(rsynth-portDIR)/elements.o \ 34 | $(rsynth-portDIR)/nsynth.o \ 35 | $(rsynth-portDIR)/def_pars.o \ 36 | 37 | 38 | # Linker script 39 | LDSCRIPT = stm32_flash.ld 40 | 41 | # -DTESTING option for wavetables... 42 | # we need -Os to keep size in limits 43 | 44 | CFLAGS = -I. -IInclude -Iinc -I./rsynth-2.0-port -I./LPC -std=gnu99 \ 45 | -D'__FPU_PRESENT=1' -DARM_MATH_CM4 \ 46 | -mthumb \ 47 | -mfpu=fpv4-sp-d16 \ 48 | -c -lm -lc -fno-common -Os \ 49 | -mcpu=cortex-m4 \ 50 | -mfloat-abi=hard \ 51 | -fsingle-precision-constant -fsigned-char -Wdouble-promotion -ffunction-sections -fdata-sections 52 | 53 | 54 | AFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -mfloat-abi=hard 55 | #LFLAGS = -Map main.map -nostartfiles -T $(LDSCRIPT) 56 | #LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L/root/CMSIS/FFTEX 57 | #LFLAGS_END = -larm_cortexM4lf_math -Wl,--gc-sections,-Map=myfile.map -lm -lc 58 | 59 | #LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L$(LIB_PREFIX) 60 | #LFLAGS_END = -lm -lc -Wl,--gc-sections,-Map=myfile.map 61 | 62 | LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 63 | #LFLAGS_END = -larm_cortexM4lf_math -ldsplib_lm4f -Wl,--gc-sections,-Map=myfile.map -lm -lc 64 | LFLAGS_END = -Wl,--gc-sections,-Map=myfile.map -lm -lc 65 | 66 | # Executables 67 | ARCH = arm-none-eabi 68 | #CC = $(ARCH)-gcc 69 | #LD = $(ARCH)-ld -v 70 | 71 | OBJCPY = $(PRG_PREFIX)objcopy 72 | OBJDMP = $(PRG_PREFIX)objdump 73 | 74 | AS = $(PRG_PREFIX)as 75 | #OBJCPY = $(ARCH)-objcopy 76 | #OBJDMP = $(ARCH)-objdump 77 | GDB = $(PRG_PREFIX)-gdb 78 | 79 | #CPFLAGS = --output-target=binary -j .text -j .data 80 | CPFLAGS = --output-target=binary 81 | ODFLAGS = -x --syms 82 | 83 | FLASH = st-flash 84 | 85 | # Targets 86 | all: main.bin 87 | 88 | clean: 89 | -rm -f $(OBJECTS) *.lt *.elf *.bin *.map *.dmp 90 | 91 | flash: gdb_flash 92 | 93 | stlink_flash: main.bin 94 | $(FLASH) write main.bin 0x08000000 95 | 96 | gdb_flash: main.elf 97 | $(GDB) -x flash_cmd.gdb -batch 98 | 99 | disassemble: main.elf 100 | $(OBJDMP) -dS main.elf > main.dis 101 | 102 | dist: 103 | tar -c *.h *.c *.s Makefile *.cmd *.cfg openocd_doflash | gzip > darkint.zip 104 | 105 | main.ihex: main.elf 106 | $(OBJCPY) --output-target=ihex main.elf main.ihex 107 | 108 | main.bin: main.elf 109 | $(OBJCPY) $(CPFLAGS) main.elf main.bin 110 | $(OBJDMP) $(ODFLAGS) main.elf > main.dmp 111 | ls -l main.elf main.bin 112 | 113 | main.elf: $(OBJECTS) $(LDSCRIPT) 114 | $(LD) $(LFLAGS) -o main.elf $(OBJECTS) $(LFLAGS_END) 115 | 116 | startup_stm32f4xx.o: startup_stm32f4xx.s 117 | $(AS) $(AFLAGS) startup_stm32f4xx.s -o startup_stm32f4xx.o > startup_stm32f4xx.lst 118 | 119 | %.o: %.c %.h 120 | $(CC) $(CFLAGS) -c -o $@ $< 121 | 122 | -------------------------------------------------------------------------------- /src/Makefile.test: -------------------------------------------------------------------------------- 1 | 2 | 3 | TOOL_PREFIX = /opt/ARM/arm-linaro-eabi-4.6 4 | #TOOL_PREFIX = /root/ARM/gcc-arm-none-eabi-4_9-2015q2 5 | 6 | PRG_PREFIX = $(TOOL_PREFIX)/bin/arm-none-eabi- 7 | LIB_PREFIX = $(TOOL_PREFIX)/arm-none-eabi/lib/thumb/cortex-m4/float-abi-hard/fpuv4-sp-d16/ 8 | 9 | # LIB_PREFIX is not used 10 | 11 | CC = $(PRG_PREFIX)gcc 12 | LD = $(PRG_PREFIX)gcc 13 | 14 | rsynth-portDIR = ./rsynth-2.0-port 15 | ttsd= ./english2phoneme 16 | 17 | # Object files 18 | OBJECTS = startup_stm32f4xx.o system_stm32f4xx.o main.o codec.o i2s.o \ 19 | stm32f4xx_tim.o adc.o stm32f4xx_pwr.o\ 20 | stm32f4xx_gpio.o stm32f4xx_i2c.o stm32f4xx_rcc.o \ 21 | stm32f4xx_spi.o stm32f4xx_dma.o stm32f4xx_adc.o misc.o \ 22 | resources.o syscalls.o audio.o \ 23 | wavetable.o effect.o 24 | 25 | # Linker script 26 | #LDSCRIPT = stm32f407.ld 27 | LDSCRIPT = stm32_flash.ld 28 | 29 | #CFLAGS = -g -ggdb -O2 -mlittle-endian -mthumb -std=gnu99 30 | #CFLAGS += -I. -DARM_MATH_CM4 -D'__FPU_PRESENT=1'-DTEST_PUSHPULL #-DTEST_STRAIGHT #-DPCSIM #-DLACH #-DSUSP #-DTENE #-DTEST_EEG -DTEST_EFFECTS 31 | #CFLAGS += -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -mfloat-abi=hard -Wall 32 | 33 | # LACH is -DTEST option! 34 | 35 | CFLAGS = -I. -IInclude -I/~/CMSIS -Iinc -std=gnu99 \ 36 | -DARM_MATH_CM4 -D'__FPU_PRESENT=1' \ 37 | -mthumb -DTESTING \ 38 | -mfpu=fpv4-sp-d16 \ 39 | -c -lm -lc -fno-common -O2 \ 40 | -mcpu=cortex-m4 \ 41 | -mfloat-abi=hard \ 42 | -fsingle-precision-constant -fsigned-char -Wdouble-promotion 43 | 44 | 45 | AFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -mfloat-abi=hard 46 | #LFLAGS = -Map main.map -nostartfiles -T $(LDSCRIPT) 47 | #LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L/root/CMSIS/FFTEX 48 | #LFLAGS_END = -larm_cortexM4lf_math -Wl,--gc-sections,-Map=myfile.map -lm -lc 49 | 50 | #LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L$(LIB_PREFIX) 51 | #LFLAGS_END = -lm -lc -Wl,--gc-sections,-Map=myfile.map 52 | 53 | 54 | #/root/CMSIS/CMSIS/Lib/ARM/arm_cortexM4lf_math.lib 55 | #LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L/root/ARM/CMSIS_5/CMSIS/Lib -L/root/ARM/CMSIS_5/CMSIS/Lib/GCC 56 | LFLAGS = -T $(LDSCRIPT) -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L/root/CMSIS/CMSIS/Lib/ARM -L/root/CMSIS/CMSIS/Lib/GCC 57 | #LFLAGS_END = -larm_cortexM4lf_math -ldsplib_lm4f -Wl,--gc-sections,-Map=myfile.map -lm -lc 58 | LFLAGS_END = -larm_cortexM4lf_math -Wl,--gc-sections,-Map=myfile.map -lm -lc 59 | 60 | # Executables 61 | ARCH = arm-none-eabi 62 | #CC = $(ARCH)-gcc 63 | #LD = $(ARCH)-ld -v 64 | 65 | OBJCPY = $(PRG_PREFIX)objcopy 66 | OBJDMP = $(PRG_PREFIX)objdump 67 | 68 | AS = $(PRG_PREFIX)as 69 | #OBJCPY = $(ARCH)-objcopy 70 | #OBJDMP = $(ARCH)-objdump 71 | GDB = $(PRG_PREFIX)-gdb 72 | 73 | #CPFLAGS = --output-target=binary -j .text -j .data 74 | CPFLAGS = --output-target=binary 75 | ODFLAGS = -x --syms 76 | 77 | FLASH = st-flash 78 | 79 | # Targets 80 | all: main.bin 81 | 82 | clean: 83 | -rm -f $(OBJECTS) *.lst *.elf *.bin *.map *.dmp 84 | 85 | flash: gdb_flash 86 | 87 | stlink_flash: main.bin 88 | $(FLASH) write main.bin 0x08000000 89 | 90 | gdb_flash: main.elf 91 | $(GDB) -x flash_cmd.gdb -batch 92 | 93 | disassemble: main.elf 94 | $(OBJDMP) -dS main.elf > main.dis 95 | 96 | dist: 97 | tar -c *.h *.c *.s Makefile *.cmd *.cfg openocd_doflash | gzip > darkint.zip 98 | 99 | main.ihex: main.elf 100 | $(OBJCPY) --output-target=ihex main.elf main.ihex 101 | 102 | main.bin: main.elf 103 | $(OBJCPY) $(CPFLAGS) main.elf main.bin 104 | $(OBJDMP) $(ODFLAGS) main.elf > main.dmp 105 | ls -l main.elf main.bin 106 | 107 | main.elf: $(OBJECTS) $(LDSCRIPT) 108 | $(LD) $(LFLAGS) -o main.elf $(OBJECTS) $(LFLAGS_END) 109 | 110 | startup_stm32f4xx.o: startup_stm32f4xx.s 111 | $(AS) $(AFLAGS) startup_stm32f4xx.s -o startup_stm32f4xx.o > startup_stm32f4xx.lst 112 | 113 | %.o: %.c %.h 114 | $(CC) $(CFLAGS) -c -o $@ $< 115 | 116 | -------------------------------------------------------------------------------- /src/adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * adc.h - adc setup 3 | */ 4 | 5 | #ifndef __adc__ 6 | #define __adc__ 7 | 8 | #include "stm32f4xx.h" 9 | #include "stm32f4xx_adc.h" 10 | #include "stm32f4xx_dma.h" 11 | #include "stm32f4xx_gpio.h" 12 | #include "stm32f4xx_rcc.h" 13 | 14 | 15 | void ADC1_Init(uint16_t *ADC_Buffer); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 31. July 2014 5 | * $Revision: V1.4.4 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * audio.h - audio processing routines 3 | */ 4 | 5 | #ifndef __audio__ 6 | #define __audio__ 7 | 8 | //#define ARM_MATH_CM4 9 | 10 | #include "stm32f4xx.h" 11 | #include "arm_math.h" 12 | #include "stdlib.h" 13 | #include "stdint.h" 14 | #include "arm_const_structs.h" 15 | 16 | #define BUFF_LEN 128 // was 128 17 | //#define AUDIO_BUFSZ 58870 // 59392 // was 32768- now 58k samples (x2) // adapted to log_gen.py 18 | #define AUDIO_BUFSZ 32768 // 59392 // was 32768- now 58k samples (x2) // adapted to log_gen.py 19 | //#define AUDIO_BUFSZ 32 // 59392 // was 32768- now 58k samples (x2) // adapted to log_gen.py 20 | enum adcchannel { 21 | MODE_, 22 | SELX_, 23 | SELY_, 24 | SELZ_, 25 | SPEED_ 26 | }; 27 | 28 | 29 | #define MAXED(var, max) \ 30 | if (var > (max)) { \ 31 | var = (max); \ 32 | } 33 | 34 | #define CONSTRAIN(var, min, max) \ 35 | if (var < (min)) { \ 36 | var = (min); \ 37 | } else if (var > (max)) { \ 38 | var = (max); \ 39 | } 40 | 41 | 42 | #ifdef TEST 43 | #define MODE 3 // for pcb=2 44 | #define SELX 0 //3 45 | #define SPEED 2 //0 46 | #define SELY 4 //4 47 | #define SELZ 1 //1 48 | #else 49 | #define MODE 3 // for pcb=2 - speed is at TOP 50 | #define SELX 4 //3 - left 51 | #define SPEED 0 // - right 52 | #define SELY 2 // down left - swopped y-right and speed-now down left 53 | #define SELZ 1 // down right 54 | #endif 55 | 56 | void Audio_Init(void); 57 | void I2S_RX_CallBack(int16_t *src, int16_t *dst, int16_t sz); 58 | 59 | typedef struct extent_ { 60 | uint16_t max; 61 | float maxplus; 62 | } extent; 63 | 64 | typedef unsigned char UINT8; 65 | typedef signed char INT8; 66 | typedef u16 UINT16; 67 | typedef int16_t INT16; 68 | typedef uint32_t UINT32; 69 | typedef int32_t INT32; 70 | 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /src/codec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * codec.h - stm32f405_codec board codec interface routines 3 | * 4 | * Cut from stm32f4_discovery_audio_codec.c 5 | * 6 | */ 7 | 8 | #ifndef __codec__ 9 | #define __codec__ 10 | 11 | #include "stm32f4xx.h" 12 | #include "stm32f4xx_gpio.h" 13 | #include "stm32f4xx_i2c.h" 14 | #include "stm32f4xx_spi.h" 15 | #include "stm32f4xx_rcc.h" 16 | 17 | /* I2C clock speed configuration (in Hz) */ 18 | #define I2C_SPEED 100000 19 | 20 | /* Uncomment defines below to select standard for audio communication between 21 | Codec and I2S peripheral */ 22 | #define I2S_STANDARD_PHILLIPS 23 | /*#define I2S_STANDARD_MSB */ 24 | /* #define I2S_STANDARD_LSB */ 25 | 26 | //#define USE_DEFAULT_TIMEOUT_CALLBACK 27 | 28 | /*----------------------------------- 29 | Hardware Configuration defines parameters 30 | -----------------------------------------*/ 31 | /* I2S peripheral configuration defines */ 32 | #define CODEC_I2S SPI2 33 | #define CODEC_I2S_EXT I2S2ext 34 | #define CODEC_I2S_CLK RCC_APB1Periph_SPI2 35 | #define CODEC_I2S_ADDRESS 0x4000380C 36 | #define CODEC_I2S_EXT_ADDRESS 0x4000340C 37 | #define CODEC_I2S_GPIO_AF GPIO_AF_SPI2 38 | #define CODEC_I2S_IRQ SPI2_IRQn 39 | #define CODEC_I2S_EXT_IRQ SPI2_IRQn 40 | #define CODEC_I2S_GPIO_CLOCK (RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOB) 41 | #define CODEC_I2S_WS_PIN GPIO_Pin_12 42 | #define CODEC_I2S_SCK_PIN GPIO_Pin_13 43 | #define CODEC_I2S_SDI_PIN GPIO_Pin_14 44 | #define CODEC_I2S_SDO_PIN GPIO_Pin_15 45 | #define CODEC_I2S_MCK_PIN GPIO_Pin_6 46 | #define CODEC_I2S_WS_PINSRC GPIO_PinSource12 47 | #define CODEC_I2S_SCK_PINSRC GPIO_PinSource13 48 | #define CODEC_I2S_SDI_PINSRC GPIO_PinSource14 49 | #define CODEC_I2S_SDO_PINSRC GPIO_PinSource15 50 | #define CODEC_I2S_MCK_PINSRC GPIO_PinSource6 51 | #define CODEC_I2S_GPIO GPIOB 52 | #define CODEC_I2S_MCK_GPIO GPIOC 53 | #define AUDIO_I2S_IRQHandler SPI2_IRQHandler 54 | #define AUDIO_I2S_EXT_IRQHandler SPI2_IRQHandler 55 | 56 | 57 | #define AUDIO_MAL_DMA_PERIPH_DATA_SIZE DMA_PeripheralDataSize_HalfWord 58 | #define AUDIO_MAL_DMA_MEM_DATA_SIZE DMA_MemoryDataSize_HalfWord 59 | #define DMA_MAX_SZE 0xFFFF 60 | 61 | /* I2S DMA Stream definitions */ 62 | #define AUDIO_I2S_DMA_CLOCK RCC_AHB1Periph_DMA1 63 | #define AUDIO_I2S_DMA_STREAM DMA1_Stream4 64 | #define AUDIO_I2S_DMA_DREG CODEC_I2S_ADDRESS 65 | #define AUDIO_I2S_DMA_CHANNEL DMA_Channel_0 66 | #define AUDIO_I2S_DMA_IRQ DMA1_Stream4_IRQn 67 | #define AUDIO_I2S_DMA_FLAG_TC DMA_FLAG_TCIF4 68 | #define AUDIO_I2S_DMA_FLAG_HT DMA_FLAG_HTIF4 69 | #define AUDIO_I2S_DMA_FLAG_FE DMA_FLAG_FEIF4 70 | #define AUDIO_I2S_DMA_FLAG_TE DMA_FLAG_TEIF4 71 | #define AUDIO_I2S_DMA_FLAG_DME DMA_FLAG_DMEIF4 72 | #define AUDIO_I2S_EXT_DMA_STREAM DMA1_Stream3 73 | #define AUDIO_I2S_EXT_DMA_DREG CODEC_I2S_EXT_ADDRESS 74 | #define AUDIO_I2S_EXT_DMA_CHANNEL DMA_Channel_3 75 | #define AUDIO_I2S_EXT_DMA_IRQ DMA1_Stream3_IRQn 76 | #define AUDIO_I2S_EXT_DMA_FLAG_TC DMA_FLAG_TCIF3 77 | #define AUDIO_I2S_EXT_DMA_FLAG_HT DMA_FLAG_HTIF3 78 | #define AUDIO_I2S_EXT_DMA_FLAG_FE DMA_FLAG_FEIF3 79 | #define AUDIO_I2S_EXT_DMA_FLAG_TE DMA_FLAG_TEIF3 80 | #define AUDIO_I2S_EXT_DMA_FLAG_DME DMA_FLAG_DMEIF3 81 | 82 | /* I2C peripheral configuration defines (control interface of the audio codec) */ 83 | #define CODEC_I2C I2C2 84 | #define CODEC_I2C_CLK RCC_APB1Periph_I2C2 85 | #define CODEC_I2C_GPIO_CLOCK RCC_AHB1Periph_GPIOB 86 | #define CODEC_I2C_GPIO_AF GPIO_AF_I2C2 87 | #define CODEC_I2C_GPIO GPIOB 88 | #define CODEC_I2C_SCL_PIN GPIO_Pin_10 89 | #define CODEC_I2C_SDA_PIN GPIO_Pin_11 90 | #define CODEC_I2S_SCL_PINSRC GPIO_PinSource10 91 | #define CODEC_I2S_SDA_PINSRC GPIO_PinSource11 92 | 93 | /* Maximum Timeout values for flags and events waiting loops. These timeouts are 94 | not based on accurate values, they just guarantee that the application will 95 | not remain stuck if the I2C communication is corrupted. 96 | You may modify these timeout values depending on CPU frequency and application 97 | conditions (interrupts routines ...). */ 98 | #define CODEC_FLAG_TIMEOUT ((uint32_t)0x1000) 99 | #define CODEC_LONG_TIMEOUT ((uint32_t)(300 * CODEC_FLAG_TIMEOUT)) 100 | 101 | /*----------------------------------- 102 | Audio Codec User defines 103 | -----------------------------------------*/ 104 | /* Codec output DEVICE */ 105 | #define OUTPUT_DEVICE_SPEAKER 1 106 | #define OUTPUT_DEVICE_HEADPHONE 2 107 | #define OUTPUT_DEVICE_BOTH 3 108 | #define OUTPUT_DEVICE_AUTO 4 109 | 110 | /*----------------------------------------------------------------------------*/ 111 | 112 | /* High Layer codec functions */ 113 | uint32_t Codec_Init(uint32_t AudioFreq); 114 | 115 | /* Low layer codec functions */ 116 | void Codec_CtrlInterface_Init(void); 117 | void Codec_AudioInterface_Init(uint32_t AudioFreq); 118 | void Codec_Reset(void); 119 | uint32_t Codec_WriteRegister(uint8_t RegisterAddr, uint16_t RegisterValue); 120 | void Codec_GPIO_Init(void); 121 | 122 | #endif -------------------------------------------------------------------------------- /src/digitalker.h: -------------------------------------------------------------------------------- 1 | void digitalk_init(void); 2 | void digitalk_newsay(); // add extra roms and how we access these 3 | int16_t digitalk_get_sample(); 4 | int16_t digitalk_get_sample_sing(); 5 | int16_t digitalk_get_sample_benddelta(); 6 | int16_t digitalk_get_sample_bendpitchvals(); 7 | -------------------------------------------------------------------------------- /src/english2phoneme/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/english2phoneme/Makefile -------------------------------------------------------------------------------- /src/english2phoneme/README: -------------------------------------------------------------------------------- 1 | Final Version of 2 | ENGLISH TO PHONEME TRANSLATION 3 | 4/15/85 4 | 5 | Here it is one last time. I have fixed all of the bugs I 6 | heard about and added a new feature or two (it now talks 7 | money as well as numbers). I think that this version is 8 | good enough for most purposes. I have proof-read the 9 | phoneme rules (found one bug) and made the program more 10 | "robust". I added protection against the "toupper()" 11 | problem some people had with earlier versions. 12 | 13 | If you make a major addition (like better abbreviation 14 | handling or an exception dictionary) please send me a 15 | copy. As before, this is all public domain and I make 16 | no copyright claims on it. The part derived from the 17 | Naval Research Lab should be public anyway. Sell it 18 | if you can! 19 | 20 | -John A. Wasser 21 | 22 | Work address: 23 | ARPAnet: WASSER%VIKING.DEC@decwrl.ARPA 24 | Usenet: {allegra,Shasta,decvax}!decwrl!dec-rhea!dec-viking!wasser 25 | Easynet: VIKING::WASSER 26 | Telephone: (617)486-2505 27 | USPS: Digital Equipment Corp. 28 | Mail stop: LJO2/E4 29 | 30 Porter Rd 30 | Littleton, MA 01460 31 | 32 | 33 | The files that make up this package are: 34 | 35 | english.c Translation rules. 36 | phoneme.c Translate a single word. 37 | parse.c Split a file into words. 38 | spellwor.c Spell an ASCII character or word. 39 | saynum.c Say a cardinal or ordinal number (long int). 40 | -------------------------------------------------------------------------------- /src/english2phoneme/TTS.h: -------------------------------------------------------------------------------- 1 | //unsigned char text2speech(unsigned char input_len, unsigned char *input, unsigned char *output); 2 | unsigned char text2speechfor256(unsigned char input_len, signed char *input, signed char *output); 3 | unsigned char text2speechforSAM(unsigned char input_len, unsigned char *input, unsigned char *output); 4 | unsigned char text2speechforvotrax(unsigned char input_len, unsigned char *input, unsigned char *output); 5 | unsigned char text2speechforTMS(unsigned char input_len, unsigned char *input, unsigned char *output); 6 | //unsigned char text2speechforklatt(unsigned char input_len, unsigned char *input, unsigned char *output); 7 | -------------------------------------------------------------------------------- /src/english2phoneme/englishphoneme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/english2phoneme/englishphoneme -------------------------------------------------------------------------------- /src/english2phoneme/phoneme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/english2phoneme/phoneme -------------------------------------------------------------------------------- /src/english2phoneme/spellwor.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* Integer code representations of the phoneme spelling of ascii characters. 4 | */ 5 | 6 | // list of integer arrays 7 | 8 | static const char AScii[128][24] __attribute__ ((section (".flash"))) ={ 9 | {32,9,34,41,-1},{26,18,5,37,18,41,-1,11,23,41,-1,30,3,19,10,41,-1},{26,18,5,37,18,41,-1,11,23,41,-1,18,3,20,26,18,41,-1},{3,32,19,41,-1,11,23,41,-1,18,3,20,26,18,41,-1},{3,32,19,41,-1,11,23,41,-1,18,37,4,32,26,31,1,28,11,32},{3,32,20,35,13,37,41,-1},{4,20,41,-1},{17,3,34,41,-1},{17,4,20,26,16,2,26,41,-1},{18,4,17,41,-1},{34,1,32,0,22,0,19,41,-1},{23,10,18,1,20,11,34,41,-1,18,4,17,41,-1},{22,6,37,31,22,0,19,41,-1},{20,4,37,13,39,41,-1,37,0,18,10,32,41,-1},{28,1,22,18,41,-1,14,18,41,-1},{28,1,22,18,41,-1,1,32,41,-1},{19,1,34,0,18,41,-1},{19,1,23,1,26,41,-1,20,5,32,18,37,5,34,41,-1,35,12,32,41,-1},{19,1,23,1,26,41,-1,20,5,32,18,37,5,34,41,-1,18,9,41,-1},{19,1,23,1,26,41,-1,20,5,32,18,37,5,34,41,-1,24,37,0,41,-1},{19,1,23,1,26,41,-1,20,5,32,18,37,5,34,41,-1,22,7,37,41,-1},{32,4,20,41,-1},{26,1,32,20,41,-1},{3,32,19,41,-1,18,3,20,26,18,41,-1,17,34,5,20,41,-1},{20,4,32,26,3,34,41,-1},{3,32,19,41,-1,11,23,41,-1,31,3,26,1,39,41,-1},{26,9,17,26,18,1,18,9,18,41,-1},{3,26,20,2,16,41,-1},{22,13,3,34,19,41,-1,26,0,16,10,4,18,10,41,-1},{21,37,9,16,41,-1,26,0,16,10,4,18,10,41,-1},{37,0,20,6,37,19,41,-1,26,0,16,10,4,18,10,41,-1},{36,9,32,1,18,41,-1,26,0,16,10,4,18,10,41,-1},{26,16,2,26,41,-1},{3,20,26,20,34,4,31,2,28,11,32,41,-1,31,5,37,20,41,-1},{19,12,17,34,41,-1,20,35,7,18,41,-1},{32,9,31,17,10,41,-1,26,13,32,41,-1},{19,5,34,10,41,-1,26,13,32,41,-1},{16,10,26,3,32,18,41,-1},{4,31,16,10,26,4,32,19,41,-1},{20,35,7,18,41,-1},{7,16,3,32,41,-1,16,3,37,3,32,41,-1},{20,34,7,27,41,-1,16,3,37,3,32,41,-1},{4,26,18,3,37,1,26,20,41,-1},{16,34,12,26,41,-1},{20,5,31,31,11,41,-1},{31,1,32,12,26,41,-1},{16,0,37,0,5,19,41,-1},{26,34,4,28,41,-1},{27,1,37,7,41,-1},{35,12,32,41,-1},{18,9,41,-1},{24,37,0,41,-1},{22,7,37,41,-1},{22,13,23,41,-1},{26,1,20,26,41,-1},{26,3,23,11,32,41,-1},{2,18,41,-1},{32,13,32,41,-1},{20,5,34,11,32,41,-1},{26,3,31,1,20,5,34,11,32,41,-1},{34,3,26,41,-1,25,4,32,41,-1},{3,20,35,11,34,41,-1,26,13,32,41,-1},{21,37,2,18,10,41,-1,25,4,32,41,-1},{20,35,3,26,38,11,32,41,-1,31,5,37,20,41,-1},{4,18,41,-1,26,13,32,41,-1},{2,41,-1},{17,0,41,-1},{26,0,41,-1},{19,0,41,-1},{0,41,-1},{3,22,41,-1},{39,0,41,-1,41,-1},{2,18,38,41,-1},{13,41,-1},{39,2,41,-1},{20,2,41,-1},{3,34,41,-1},{3,31,41,-1},{3,32,41,-1},{5,41,-1},{16,0,41,-1},{20,35,41,-1},{5,37,41,-1},{3,27,41,-1},{18,0,41,-1},{12,35,41,-1},{23,0,41,-1},{19,12,17,34,36,9,35,41,-1},{3,20,26,41,-1},{35,13,0,41,-1},{27,0,41,-1},{34,3,22,18,41,-1,17,37,4,20,3,18,41,-1},{17,4,20,26,34,4,28,41,-1},{37,13,18,41,-1,17,37,4,20,3,18,41,-1},{20,4,37,3,18,41,-1},{12,32,19,10,26,20,6,37,41,-1},{4,16,5,26,18,37,5,22,1,41,-1},{2,41,-1},{17,0,41,-1},{26,0,41,-1},{19,0,41,-1},{0,41,-1},{3,22,41,-1},{39,0,41,-1,41,-1},{2,18,38,41,-1},{13,41,-1},{39,2,41,-1},{20,2,41,-1},{3,34,41,-1},{3,31,41,-1},{3,32,41,-1},{5,41,-1},{16,0,41,-1},{20,35,41,-1},{5,37,41,-1},{3,27,41,-1},{18,0,41,-1},{12,35,41,-1},{23,0,41,-1},{19,12,17,34,36,9,35,41,-1},{3,20,26,41,-1},{35,13,0,41,-1},{27,0,41,-1},{34,3,22,18,41,-1,17,37,2,26,41,-1},{23,10,18,1,20,11,34,41,-1,17,5,37,41,-1},{37,13,18,41,-1,17,37,2,26,41,-1},{18,13,34,19,41,-1},{19,3,34,41,-1} 10 | }; 11 | 12 | void outnum(const char* ooo); 13 | 14 | 15 | void say_ascii(character) 16 | int character; 17 | { 18 | // outstring(Ascii[character&0x7F]); 19 | outnum(AScii[character&0x7F]); 20 | } 21 | 22 | void spell_word(word) 23 | char *word; 24 | { 25 | for (word++ ; word[1] != '\0' ; word++) 26 | // outstring(Ascii[(*word)&0x7F]); 27 | outnum(AScii[(*word)&0x7F]); 28 | } 29 | -------------------------------------------------------------------------------- /src/flash_cmd.gdb: -------------------------------------------------------------------------------- 1 | attach_swd 2 | 3 | flash 4 | 5 | quit 6 | -------------------------------------------------------------------------------- /src/forlap.h: -------------------------------------------------------------------------------- 1 | typedef unsigned char uint8_t; 2 | typedef unsigned char UINT8; 3 | typedef unsigned char u8; 4 | typedef signed char INT8; 5 | typedef unsigned short UINT16; 6 | typedef unsigned short u16; 7 | typedef signed short INT16; 8 | typedef unsigned int UINT32; 9 | typedef signed int INT32; 10 | typedef signed int int32_t; 11 | typedef unsigned int uint32_t; 12 | typedef signed short int16_t; 13 | typedef unsigned short uint16_t; 14 | 15 | #include "math.h" 16 | #include "stdio.h" 17 | #include "stdlib.h" 18 | #include "string.h" 19 | 20 | //#define M_PI 3.14159 21 | 22 | #define TRUE 1 23 | #define FALSE 0 24 | 25 | #define MAXED(var, max) \ 26 | if (var > (max)) { \ 27 | var = (max); \ 28 | } 29 | 30 | 31 | float _selx,_sely,_selz; 32 | 33 | //#define float float32_t 34 | -------------------------------------------------------------------------------- /src/genparam.c: -------------------------------------------------------------------------------- 1 | // generating parameters for docs/klatt 2 | 3 | #include 4 | #include 5 | #include "time.h" 6 | 7 | /* 8 | &frame->F0hz10, &frame->AVdb, 0,1 9 | &frame->F1hz, &frame->B1hz, 2,3 10 | &frame->F2hz, &frame->B2hz, 4 11 | &frame->F3hz, &frame->B3hz, 6 12 | &frame->F4hz, &frame->B4hz, 8 13 | &frame->F5hz, &frame->B5hz, 10 14 | &frame->F6hz, &frame->B6hz, 12 15 | &frame->FNZhz, &frame->BNZhz,14 16 | &frame->FNPhz, &frame->BNPhz,16 17 | &frame->ASP, &frame->Kopen,18,19 18 | &frame->Aturb, &frame->TLTdb,20,21 19 | &frame->AF, &frame->Kskew,22,23 20 | &frame->A1, &frame->B1phz, 21 | &frame->A2, &frame->B2phz, 22 | &frame->A3, &frame->B3phz, 23 | &frame->A4, &frame->B4phz, 24 | &frame->A5, &frame->B5phz, 25 | &frame->A6, &frame->B6phz, 26 | &frame->ANP, &frame->AB, 27 | &frame->AVpdb, &frame->Gain0); 28 | 29 | Warning: glottal open period cannot exceed T0, truncated as was 196 T0=132 30 | 31 | // see genparam.c - what are important ones, how they depend on each other esp. F0 and nopen/T0 timings: 32 | 33 | // T0 is 4* the number of samples in one pitch period 34 | 35 | globals->T0 = (40 * globals->samrate) / frame->F0hz10; 36 | 37 | and nopen (=4x Kopen in the frame) cannot be > T0 38 | 39 | // in our test case samrate is 8000 so x40=320,000 / F0hz which starts at 1000 = less than 320 /4 for kopen=80 40 | 41 | // how do we calculate this 42 | 43 | kopen must be < 80000/f0 44 | 45 | */ 46 | 47 | typedef struct 48 | { 49 | int val; 50 | int min; 51 | int max; 52 | } framer; 53 | 54 | // these are constraints see klatt_params 55 | 56 | 57 | int val[40]= {1000, 0, 497, 0, 739, 0, 2772, 0, 3364, 0, 4170, 0, 4000, 0, 0, 0, 200, 40, 0, 40, 0, 20, 0, 0, 53, 44, 79, 70, 52, 95, 44, 56, 34, 80, 0, 80, 0, 0, 27, 70}; 58 | int mins[40]= {200, 0, 200, 40, 550, 40, 1200, 40, 1200, 40, 1200, 40, 1200, 40, 248, 40, 248, 40, 0, 10, 0, 0, 0, 0, 0, 40, 0, 40, 0, 40, 0, 40, 0, 40, 0, 40, 0, 0, 0, 0}; 59 | int maxs[40]= {4000, 70, 1300, 1000, 3000, 1000, 4999, 1000, 4999, 1000, 4999, 1000, 4999, 2000, 528, 1000, 528, 1000, 70, 65, 80, 24, 80, 40, 80, 1000, 80, 1000, 80, 1000, 80, 1000, 80, 1000, 80, 2000, 80, 80, 70, 60}; 60 | 61 | int dir[40]= {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 62 | 63 | void main(void){ 64 | int x,y; 65 | 66 | framer frame[40]; 67 | srand (time(NULL)); 68 | 69 | for (y=0;y<40;y++){ 70 | frame[y].val=val[y]; 71 | dir[y]=rand()%3; 72 | } 73 | 74 | for (x=0;x<2000;x++){ 75 | for (y=0;y<40;y++){ 76 | 77 | // direction change 0,1-back,2-forwards 78 | switch(dir[y]){ 79 | case 0: 80 | // no change 81 | break; 82 | case 1: 83 | // forwards 84 | val[y]+=rand()%((maxs[y]-mins[y])/10); // later do as table 85 | if (val[y]>maxs[y]) dir[y]=2; 86 | if (y==19){ // kopen? 87 | printf("val %d KKK %d\n",val[19],320000/val[0]); 88 | if (val[19]>=(80000/val[0])) dir[19]=2; 89 | } 90 | break; 91 | case 2: 92 | // backwards 93 | val[y]-=rand()%((maxs[y]-mins[y])/10); // later do as table 94 | if (val[y]=AUDIO_BUFSZ) wpos=0; // or ENDING as in audio.c? 20 | } 21 | 22 | // FreePhonemeToWaveData(); 23 | pair r={wav_len,wpos}; 24 | return r; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/klatt_phoneme.h: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | u16 generated; 3 | u16 writepos; 4 | } pair; 5 | 6 | 7 | pair klatt_phoneme(u16 writepos, u8 phoneme); 8 | pair demandVOSIM_SC(u16 writepos,float freq,float cycles,float decay); 9 | u16 runVOSIM_SC(u16 count); 10 | 11 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | // license:GPL-2.0+ 2 | // copyright-holders: Martin Howse 3 | 4 | /* 5 | PATH=~/sat/bin:$PATH 6 | PATH=~/stm32f4/stlink/flash:$PATH 7 | make stlink_flash 8 | */ 9 | 10 | #ifdef TESTING 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "stm32f4xx.h" 16 | #include "codec.h" 17 | #include "i2s.h" 18 | #include "adc.h" 19 | #include "audio.h" 20 | #include "wavetable.h" 21 | #include "wavetables.h" 22 | #else 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "stm32f4xx.h" 28 | #include "codec.h" 29 | #include "i2s.h" 30 | #include "adc.h" 31 | #include "audio.h" 32 | #include "say.h" 33 | #include "klatt_phoneme.h" 34 | #include "nsynth.h" 35 | #include "elements.h" 36 | #include "holmes.h" 37 | #include "sam.h" 38 | #include "sp0256.h" 39 | #include "tms5200x.h" 40 | #include "digitalker.h" 41 | #include "nvp.h" 42 | #include "vot.h" 43 | #include "parwave.h" 44 | #include "samplerate.h" 45 | #endif 46 | 47 | void rsynth_init(long sr, float ms_per_frame); 48 | 49 | /* DMA buffers for I2S */ 50 | __IO int16_t tx_buffer[BUFF_LEN], rx_buffer[BUFF_LEN]; 51 | 52 | /* DMA buffer for ADC & copy */ 53 | __IO uint16_t adc_buffer[5]; 54 | 55 | extern int errno; 56 | 57 | //u8 test_elm[51]={44, 16, 0, 14, 15, 0, 1, 6, 0, 1, 6, 0, 44, 8, 0, 54, 16, 0, 20, 8, 0, 1, 6, 0, 1, 6, 0, 1, 6, 0, 44, 16, 0, 14, 15, 0, 1, 6, 0, 44, 6, 0, 44, 8, 0, 44, 8, 0}; // ELM_LEN in holmes - but why do we need extra 0>// extra what? 58 | 59 | //u8 test_elm[51]={44, 16, 0, 14, 15, 0, 1, 6, 0, 1, 6, 0, 44, 16, 0, 14, 15, 0, 1, 6, 0, 1, 6, 0,44, 16, 0, 14, 15, 0, 1, 6, 0, 1, 6, 0,44, 16, 0, 14, 15, 0, 1, 6, 0, 1, 6, 0}; // ELM_LEN in holmes - but why do we need extra 0>// extra what? - this one doesn;t crackle 60 | 61 | //u8 test_elm[51]={28, 10, 0, 47, 6, 0, 40, 8, 0, 2, 8, 0, 3, 1, 0, 4, 2, 0, 1, 6, 0, 1, 6, 0, 20, 8, 0, 53, 9, 0, 1, 6, 0, 1, 6, 0, 25, 12, 0, 54, 16, 0, 1, 6, 0, 1, 6, 0, 1, 6, 0}; // "help me sir" 62 | 63 | u8 test_elm[51]={44, 8, 0, 54, 16, 0, 20, 8, 0, 1, 6, 0, 1, 6, 0, 25, 12, 0, 2, 8, 0, 3, 1, 0, 4, 2, 0, 53, 9, 0, 8, 8, 0, 9, 1, 0, 10, 4, 0, 46, 7, 0, 22, 8, 0, 1, 6, 0, 1, 6, 0}; // worm speaking = we use ~/rsync2016/projects/ERD_modules/worm/docs/rsynth-2-un/rsynth-2.0 - glitchy 64 | 65 | u8 test_elm_rsynthy[108]={30, 4, 72, 4, 1, 6, 41, 8, 75, 16, 21, 8, 1, 6, 41, 8, 82, 6, 32, 4, 1, 6, 27, 12, 82, 6, 26, 10, 1, 6, 72, 4, 1, 6, 38, 8, 82, 6, 23, 8, 1, 6, 8, 6, 9, 1, 10, 2, 47, 6, 45, 6, 21, 8, 1, 6, 11, 8, 12, 1, 13, 1, 45, 6, 32, 4, 47, 6, 45, 6, 25, 11, 72, 4, 31, 12, 1, 6, 8, 6, 9, 1, 10, 2, 62, 9, 1, 6, 31, 12, 2, 8, 3, 1, 4, 2, 57, 7, 14, 8, 15, 1, 16, 4, 1, 6, 1, 6}; // length 106 and we keep last 1 and 6 as end so... 104 105 66 | 67 | // ./say "The worm was for a long time desirous to speake" > /dev/null 68 | 69 | float exy[240]; 70 | 71 | #ifdef TESTING 72 | extern Wavetable wavtable; 73 | #endif 74 | extern char TTSinarray[17]; 75 | 76 | char TTStester[16]={'w','o','r','m',' ','s', 'p', 'e','e','c','h',' ','w', 'o', 'r', 'm'}; 77 | 78 | extern int16_t audio_buffer[AUDIO_BUFSZ] __attribute__ ((section (".ccmdata"))); 79 | 80 | void main(void) 81 | { 82 | int16_t x; 83 | 84 | #ifdef TESTING 85 | wavetable_init(&wavtable, plaguetable_simplesir, 328); // now last arg as length of table=less than 512 86 | #else 87 | for (x=0;x<16;x++){ 88 | TTSinarray[x]=TTStester[x]; 89 | } 90 | 91 | for (x=0;x<240;x++){ 92 | exy[x]=0.4f; // this is midway when we do invert it.. = 1.0f approx 93 | } 94 | 95 | // fill audio buffer 96 | 97 | for (u16 xx=0;xx. 23 | */ 24 | 25 | #ifndef KLATT_PARWAVE_H 26 | #define KLATT_PARWAVE_H 27 | 28 | /** @brief The type of synthesis model to use. 29 | */ 30 | 31 | 32 | #define NPAR 40 /* Number of control parameters */ 33 | #define MAX_SAM 20000 /* Maximum sample rate */ 34 | #define TRUE 1 35 | #define FALSE 0 36 | 37 | /** @brief The voicing source generator to use for glottal waveforms. 38 | */ 39 | 40 | typedef char flag; 41 | 42 | /** @brief A klatt resonator. 43 | */ 44 | typedef struct 45 | { 46 | float a; 47 | float b; 48 | float c; 49 | float p1; /* value at time period |n-1|. */ 50 | float p2; /* value at time period |n-2| */ 51 | } resonator_t, *resonator_ptr; 52 | 53 | /** @brief Parameters, global data and resonators used by the klatt synthesizer. 54 | */ 55 | typedef struct 56 | { 57 | unsigned char synthesis_model; /* cascade-parallel or all-parallel */ 58 | uint16_t samrate; /* Number of output samples per second */ 59 | uint16_t FLPhz ; /* Frequeny of glottal downsample low-pass filter */ 60 | uint16_t BLPhz ; /* Bandwidth of glottal downsample low-pass filter */ 61 | uint16_t nfcascade; /* Number of formants in cascade vocal tract */ 62 | unsigned char glsource; /* Type of glottal source */ 63 | int16_t f0_flutter; /* Percentage of f0 flutter 0-100 */ 64 | flag quiet_flag; /* set to TRUE for error messages */ 65 | uint16_t nspfr; /* number of samples per frame */ 66 | uint16_t nper; /* Counter for number of samples in a pitch period */ 67 | uint16_t ns; 68 | uint16_t T0; /* Fundamental period in output samples times 4 */ 69 | uint16_t nopen; /* Number of samples in open phase of period */ 70 | uint16_t nmod; /* Position in period to begin noise amp. modul */ 71 | uint16_t nrand; /* Varible used by random number generator */ 72 | float pulse_shape_a; /* Makes waveshape of glottal pulse when open */ 73 | float pulse_shape_b; /* Makes waveshape of glottal pulse when open */ 74 | float onemd; 75 | float decay; 76 | float amp_bypas; /* AB converted to linear gain */ 77 | float amp_voice; /* AVdb converted to linear gain */ 78 | float par_amp_voice; /* AVpdb converted to linear gain */ 79 | float amp_aspir; /* AP converted to linear gain */ 80 | float amp_frica; /* AF converted to linear gain */ 81 | float amp_breth; /* ATURB converted to linear gain */ 82 | float amp_gain0; /* G0 converted to linear gain */ 83 | int16_t num_samples; /* number of glottal samples */ 84 | float sample_factor; /* multiplication factor for glottal samples */ 85 | const int16_t *natural_samples; /* pointer to an array of glottal samples */ 86 | uint16_t original_f0; /* original value of f0 not modified by flutter */ 87 | 88 | resonator_t rnpp; /* internal storage for resonators */ 89 | resonator_t r1p; 90 | resonator_t r2p; 91 | resonator_t r3p; 92 | resonator_t r4p; 93 | resonator_t r5p; 94 | resonator_t r6p; 95 | resonator_t r1c; 96 | resonator_t r2c; 97 | resonator_t r3c; 98 | resonator_t r4c; 99 | resonator_t r5c; 100 | resonator_t r6c; 101 | resonator_t r7c; 102 | resonator_t r8c; 103 | resonator_t rnpc; 104 | resonator_t rnz; 105 | resonator_t rgl; 106 | resonator_t rlp; 107 | resonator_t rout; 108 | } klatt_global_tt, *klatt_global_ptrr; 109 | 110 | /** @brief The audio characteristics of an audio frame. 111 | */ 112 | 113 | void simple_parwave(klatt_global_ptrr,int16_t*); 114 | void simple_parwave_init(klatt_global_ptrr); 115 | void dosimpleklatt(void); 116 | void simpleklatt_init(void); 117 | void single_parwave(klatt_global_ptrr globals, int16_t* frame, u8 newframe, u16 samplenumber,u8 x, int16_t* outgoing); 118 | void dosimpleklattsamples(int16_t* outgoing, u8 size); 119 | void frame_init(klatt_global_ptrr globals, int16_t* frame); 120 | void flutter(klatt_global_ptrr,int16_t*); 121 | 122 | int16_t single_single_parwave(klatt_global_ptrr globals, int16_t *frame); 123 | void simpleklatt_newsay(); 124 | int16_t simpleklatt_get_sample(); 125 | #endif 126 | -------------------------------------------------------------------------------- /src/phoneme_prob.py: -------------------------------------------------------------------------------- 1 | import nltk,random 2 | from nltk.tokenize import RegexpTokenizer 3 | f = open('/root/beddoes_phonemes') 4 | raw = f.read() 5 | 6 | #tokens = nltk.word_tokenize(raw) 7 | 8 | tokenizer = RegexpTokenizer('\//', gaps=True) 9 | tokens=tokenizer.tokenize(raw) 10 | 11 | #Create your bigrams 12 | bgs = nltk.bigrams(tokens) 13 | 14 | #for bg in bgs: 15 | # print bg 16 | 17 | #compute frequency distribution for all the bigrams in the text 18 | #fdist = nltk.FreqDist(bgs) 19 | #fdist = nltk.FreqDist(tokens) 20 | #for k,v in fdist.items(): 21 | # print k,v 22 | 23 | # how many phonemes in KLATT? 69 24 | 25 | #templist=fdist 26 | #templist=sorted(templist, key=int) 27 | #for ff in templist: 28 | # print ff 29 | 30 | #for word, frequency in fdist.most_common(64): 31 | # print('%s;%d' % (word, frequency)).encode('utf-8') 32 | # print ('%s' % word +","), 33 | 34 | def generate_model(cfdist, word, num=15): 35 | for i in range(num): 36 | words = list(cfdist[word]) 37 | word = random.choice(words) 38 | print word, 39 | word = cfdist[word].max() 40 | 41 | 42 | cfd = nltk.ConditionalFreqDist(bgs) # [_bigram-condition] 43 | #print cfd 44 | 45 | generate_model(cfd,'1',1024) 46 | -------------------------------------------------------------------------------- /src/phoneme_prob_other.py: -------------------------------------------------------------------------------- 1 | import nltk,random,sys 2 | from nltk.tokenize import RegexpTokenizer 3 | #f = open('/root/beddoes_phonemes_other_fixed') 4 | #f = open('/root/crash_phonemes') 5 | f = open('/root/ang_phonemes') 6 | raw = f.read() 7 | 8 | #tokens = nltk.word_tokenize(raw) 9 | 10 | #tokenizer = RegexpTokenizer('\//', gaps=True) 11 | #tokens=tokenizer.tokenize(raw) 12 | 13 | #Create your bigrams 14 | bgs = nltk.bigrams(raw) 15 | 16 | #for bg in bgs: 17 | # print bg 18 | 19 | #print bgs 20 | 21 | #compute frequency distribution for all the bigrams in the text 22 | #fdist = nltk.FreqDist(bgs) 23 | #fdist = nltk.FreqDist(tokens) 24 | #for k,v in fdist.items(): 25 | # print k,v 26 | 27 | # how many phonemes in KLATT? 69 28 | 29 | #templist=fdist 30 | #templist=sorted(templist, key=int) 31 | #for ff in templist: 32 | # print ff 33 | 34 | #for word, frequency in fdist.most_common(64): 35 | # print('%s;%d' % (word, frequency)).encode('utf-8') 36 | # print ('%s' % word +","), 37 | 38 | worm=0 39 | 40 | def generate_model(cfdist, word, num=15): 41 | for i in range(num): 42 | words = list(cfdist[word]) 43 | word = random.choice(words) 44 | # word=words[len(words)-10] 45 | # word = cfdist[word].max() 46 | print word, # no space? 47 | sys.stdout.write("") 48 | 49 | 50 | cfd = nltk.ConditionalFreqDist(bgs) # [_bigram-condition] 51 | #print cfd 52 | #print cfd 53 | 54 | for i in range(10240): 55 | generate_model(cfd,'a',128) 56 | print "\n" 57 | -------------------------------------------------------------------------------- /src/render.h: -------------------------------------------------------------------------------- 1 | #ifndef RENDER_H 2 | #define RENDER_H 3 | 4 | void Render(); 5 | void SetMouthThroat(unsigned char mouth, unsigned char throat); 6 | 7 | typedef signed short int16_t; 8 | 9 | unsigned char rendersamsample(int16_t* sample, u8* ending); 10 | int16_t renderframe(void); 11 | void sam_frame_rerun(void); 12 | 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/renderll.h: -------------------------------------------------------------------------------- 1 | #ifndef RENDER_H 2 | #define RENDER_H 3 | 4 | void Render(); 5 | void SetMouthThroat(unsigned char mouth, unsigned char throat); 6 | 7 | typedef signed short int16_t; 8 | 9 | //void rendersamsample(); 10 | unsigned char rendersamsample(int16_t* sample); 11 | void renderframe(void); 12 | void renderupdate(void); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/resources.h: -------------------------------------------------------------------------------- 1 | // for resources.c 2 | 3 | #ifndef RESOURCES_H_ 4 | #define RESOURCES_H_ 5 | 6 | extern const float logspeed[]; 7 | extern const float logpitch[]; 8 | extern const unsigned char mapytoascii[]; 9 | extern const unsigned char mapytoletters[]; 10 | #endif 11 | -------------------------------------------------------------------------------- /src/rs.h: -------------------------------------------------------------------------------- 1 | // for rsynth - 2005 2 | 3 | int16_t rsynth_get_sample(); 4 | void rsynth_newsay(); 5 | 6 | void rsynth_newsay_single(u8 once); 7 | void rsynth_newsay_singlex(); 8 | 9 | void rsynth_newsay_elm(); 10 | 11 | int16_t rsynth_get_sample_sing(); 12 | 13 | int16_t rsynth_get_sample_single(); 14 | 15 | int16_t rsynth_get_sample_elm(); 16 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/#phtoelm.def#: -------------------------------------------------------------------------------- 1 | /* $Id: phtoelm.def,v 1.13 1994/11/08 13:30:50 a904209 Exp a904209 $ 2 | */ 3 | enter(" ","Q",NULL); 4 | enter("p","P","PY","PZ",NULL); 5 | enter("t","T","TY","TZ",NULL); 6 | enter("k","K","KY","KZ",NULL); 7 | enter("b","B","BY","BZ",NULL); 8 | enter("d","D","DY","DZ",NULL); 9 | enter("g","G","GY","GZ",NULL); 10 | enter("m","M",NULL); 11 | enter("n","N",NULL); 12 | enter("N","NG",NULL); 13 | enter("f","F",NULL); 14 | enter("T","TH",NULL); 15 | enter("s","S",NULL); 16 | enter("S","SH",NULL); 17 | enter("h","H",NULL); 18 | enter("v","V","QQ","V",NULL); 19 | enter("D","DH","QQ","DI",NULL); 20 | enter("z","Z","QQ","ZZ",NULL); 21 | enter("Z","ZH","QQ","ZH",NULL); 22 | enter("tS","CH","CI",NULL); 23 | enter("dZ","J","JY","QQ","JY",NULL); 24 | enter("l","L",NULL); 25 | enter("r","R",NULL); 26 | enter("rr","R","QQ","R",NULL); 27 | enter("R","RX",NULL); 28 | enter("w","W",NULL); 29 | enter("x","X",NULL); 30 | enter("%","QQ",NULL); /* stop-ness - not quite glottal stop */ 31 | enter("j","Y",NULL); 32 | enter("I","I",NULL); 33 | enter("e","E",NULL); 34 | enter("&","AA",NULL); 35 | enter("V","U",NULL); 36 | enter("0","O",NULL); 37 | enter("U","OO",NULL); 38 | enter("@","A",NULL); 39 | enter("i","EE",NULL); 40 | enter("3","ER",NULL); 41 | enter("A","AR",NULL); 42 | enter("O","AW",NULL); 43 | enter("u","UU",NULL); 44 | enter("o","OI",NULL); 45 | enter("eI","AI","I",NULL); 46 | enter("aI","IE","I",NULL); 47 | enter("oI","OI","I",NULL); 48 | enter("aU","OU","OV",NULL); 49 | enter("@U","OA","OV",NULL); 50 | enter("I@","IA","IB",NULL); 51 | enter("e@","AIR","IB",NULL); 52 | enter("U@","OOR","IB",NULL); 53 | enter("O@","OR","IB",NULL); 54 | enter("oU","OI","OV",NULL); 55 | 56 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/PORTING: -------------------------------------------------------------------------------- 1 | Hopefully most of unix/compiler variant issues should be handled by configure 2 | process. Thus porting issues should reduce (for UNIX-ish machines at least) 3 | to writing the audio driver. 4 | 5 | The interface to the driver is defined in hplay.h. 6 | There are three routines: 7 | 8 | extern int audio_init PROTO((int argc, char *argv[])); 9 | 10 | Do what ever is necessary to initialize audio. 11 | You can process any command line arguments to influence the 12 | behaviour. Use getargs() function to make this easy. 13 | Where it make sense copy options from other drivers e.g. -r for 14 | sample rate. 15 | 16 | This routine should also define the global variable samp_rate 17 | to define sample rate to the core synth. 18 | 19 | Sample rates in 8 - 12kHz range work best due to as yet unresolved 20 | problems with some of the digital filters. 21 | 22 | extern void audio_play PROTO((int n, short *data)); 23 | 24 | Send a block of 'n' 16 bit signed linear samples to the 25 | audio device. If your device requires uLaw samples (US telephone standard) 26 | then l2u.h defines routines which may help (example is Sun driver). 27 | 28 | extern void audio_term PROTO((void)); 29 | Close down audio device, probably waiting for buffer(s) to empty. 30 | 31 | To test your driver (which should be called xxxxplay.c where xxxx describes 32 | the system/hardware), link it to hplay.c, and "make". 33 | 34 | The brave/experienced might like to obtain and install GNU autoconf-2.0 (or 35 | latter?) and the GNU m4 it needs (m4-1.3 or latter), and try and get the new 36 | driver auto configured. 37 | 38 | When you have written your driver please contact me (nik@tiuk.ti.com) 39 | if you are willing to let others use it. Please let me know the output of 40 | config.guess script to assist in merging into autoconf. 41 | 42 | ------------------------------------------------------------------------ 43 | 44 | Perfomance issues. 45 | 46 | For best speed in parwave.c all arthmetic is done in "float", 47 | but with strict IEEE-754 compliance turned off. 48 | This is fastest because in general for modern RISC processors 49 | (e.g. SPARCs or at least some of them ...) 50 | 51 | - There is no integer multiply hardware 52 | - There IS floating point multiply hardware 53 | - Floating point multiply hardware cannot handle "double" in one pass. 54 | - Some of IEEE-754 options (e.g. denormals) are handled via software traps. 55 | 56 | This may be less true of x86/68xxx machines... 57 | 58 | The computations in parwave.c should dominate the cpu requirements 59 | of the other levels. 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/config.h: -------------------------------------------------------------------------------- 1 | //yama 2 | 3 | /* Define to prevent recursive inclusion -------------------------------------*/ 4 | #ifndef __CONFIG_H 5 | #define __CONFIG_H 6 | 7 | #ifndef NULL 8 | #define NULL (void*)0 9 | #endif 10 | 11 | #define MEM_ALLOC_MAX 16000 12 | 13 | 14 | #endif -------------------------------------------------------------------------------- /src/rsynth-2.0-port/darray.c: -------------------------------------------------------------------------------- 1 | #include 2 | /* darray.c 3 | */ 4 | #ifndef LAP 5 | #include "stm32f4xx.h" 6 | #endif 7 | #include "stdlib.h" 8 | #include 9 | #include 10 | #include 11 | 12 | #include "darray.h" 13 | 14 | void darray_free(darray_t *a) 15 | { 16 | if (a->data) 17 | { 18 | free(a->data); 19 | a->data = NULL; 20 | } 21 | a->items = a->alloc = 0; 22 | } 23 | 24 | /*void *Darray_find(darray_t *a, unsigned int n) 25 | { 26 | if (n >= a->alloc || n >= a->items) 27 | { 28 | unsigned int osize = a->items * a->esize; 29 | unsigned int nsize; 30 | if (!a->esize) 31 | // abort(); 32 | return NULL; 33 | if (n >= a->alloc) 34 | { 35 | unsigned int add = (a->get) ? a->get : 1; 36 | char *ndata = (char *) malloc(nsize = (n + add) * a->esize); 37 | if (ndata) 38 | { 39 | if (osize) 40 | memcpy(ndata, a->data, osize); 41 | if (a->data) 42 | free(a->data); 43 | a->data = ndata; 44 | a->alloc = n + add; 45 | } 46 | else{ 47 | // fprintf(stderr, "memory shortage (Darray_find)\n"); 48 | return NULL; 49 | } 50 | } 51 | else 52 | nsize = (n + 1) * a->esize; 53 | if (n >= a->items) 54 | { 55 | memset(a->data + osize, 0, nsize - osize); 56 | a->items = n + 1; 57 | } 58 | } 59 | return (void *) (a->data + n * a->esize); 60 | } 61 | */ 62 | int darray_delete(darray_t *a, unsigned int n) 63 | { 64 | char *p = (char *) darray_find(a, n); 65 | if (p) 66 | { 67 | if (a->items) 68 | { 69 | a->items--; 70 | while (n++ < a->items) 71 | { 72 | memcpy(p, p + a->esize, a->esize); 73 | p += a->esize; 74 | } 75 | memset(p, 0, a->esize); 76 | return 1; 77 | } 78 | else 79 | return 0; 80 | // abort(); 81 | } 82 | else 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/darray.c~: -------------------------------------------------------------------------------- 1 | #include 2 | /* darray.c 3 | */ 4 | 5 | #include "stm32f4xx.h" 6 | //#include "platform_config.h" 7 | //#include "hw_config.h" 8 | #include "stdlib.h" 9 | #include 10 | #include 11 | #include 12 | 13 | #include "darray.h" 14 | 15 | void darray_free(darray_t *a) 16 | { 17 | if (a->data) 18 | { 19 | free(a->data); 20 | a->data = NULL; 21 | } 22 | a->items = a->alloc = 0; 23 | } 24 | 25 | void *Darray_find(darray_t *a, unsigned int n) 26 | { 27 | if (n >= a->alloc || n >= a->items) 28 | { 29 | unsigned int osize = a->items * a->esize; 30 | unsigned int nsize; 31 | if (!a->esize) 32 | abort(); 33 | if (n >= a->alloc) 34 | { 35 | unsigned int add = (a->get) ? a->get : 1; 36 | char *ndata = (char *) malloc(nsize = (n + add) * a->esize); 37 | if (ndata) 38 | { 39 | if (osize) 40 | memcpy(ndata, a->data, osize); 41 | if (a->data) 42 | free(a->data); 43 | a->data = ndata; 44 | a->alloc = n + add; 45 | } 46 | else{ 47 | // fprintf(stderr, "memory shortage (Darray_find)\n"); 48 | return NULL; 49 | } 50 | } 51 | else 52 | nsize = (n + 1) * a->esize; 53 | if (n >= a->items) 54 | { 55 | memset(a->data + osize, 0, nsize - osize); 56 | a->items = n + 1; 57 | } 58 | } 59 | return (void *) (a->data + n * a->esize); 60 | } 61 | 62 | int darray_delete(darray_t *a, unsigned int n) 63 | { 64 | char *p = (char *) darray_find(a, n); 65 | if (p) 66 | { 67 | if (a->items) 68 | { 69 | a->items--; 70 | while (n++ < a->items) 71 | { 72 | memcpy(p, p + a->esize, a->esize); 73 | p += a->esize; 74 | } 75 | memset(p, 0, a->esize); 76 | return 1; 77 | } 78 | else 79 | abort(); 80 | } 81 | else 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/darray.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/darray.o: lib/rsynth-2.0-port/darray.c \ 2 | lib/rsynth-2.0-port/config.h lib/CMSIS/ST/STM32F4xx/Include/stm32f4xx.h \ 3 | lib/CMSIS/Include/core_cm4.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h \ 6 | lib/CMSIS/Include/core_cmInstr.h lib/CMSIS/Include/core_cmFunc.h \ 7 | lib/CMSIS/Include/core_cm4_simd.h \ 8 | lib/CMSIS/ST/STM32F4xx/Include/system_stm32f4xx.h inc/stm32f4xx_conf.h \ 9 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h \ 10 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h \ 11 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h \ 12 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h \ 13 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h \ 14 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dbgmcu.h \ 15 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h \ 16 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h \ 17 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h \ 18 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h \ 19 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h \ 20 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h \ 21 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h \ 22 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h \ 23 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_iwdg.h \ 24 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h \ 25 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h \ 26 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rng.h \ 27 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h \ 28 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h \ 29 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h \ 30 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h \ 31 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h \ 32 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h \ 33 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_wwdg.h \ 34 | lib/STM32F4xx_StdPeriph_Driver/inc/misc.h inc/platform_config.h \ 35 | inc/hw_config.h \ 36 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 37 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 38 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 39 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 40 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 41 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 42 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 43 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 44 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 45 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 46 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 47 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 48 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 49 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 50 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 51 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 52 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 53 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdlib.h \ 54 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/stdlib.h \ 55 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/alloca.h \ 56 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/string.h \ 57 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/cdefs.h \ 58 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/string.h \ 59 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/inttypes.h \ 60 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdbool.h \ 61 | inc/stm32f4xx_it.h inc/stm32f4xx_conf.h inc/platform_config.h \ 62 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery.h \ 63 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h \ 64 | inc/systick.h inc/uart_support.h inc/monitor.h inc/term_io.h \ 65 | inc/hw_config.h lib/rsynth-2.0-port/darray.h 66 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/darray.h: -------------------------------------------------------------------------------- 1 | /* darray.h 2 | */ 3 | #if !defined(DARRAY_H) 4 | #define DARRAY_H 5 | typedef struct 6 | {char *data; /* the items */ 7 | unsigned items; /* number of slots used */ 8 | unsigned alloc; /* number of slots allocated */ 9 | unsigned short esize; /* size of items */ 10 | unsigned short get; /* number to get */ 11 | } darray_t, *darray_ptr; 12 | 13 | /* return pointer to nth item */ 14 | extern void *Darray_find (darray_t *a,unsigned n); 15 | /* delete nth item */ 16 | extern int darray_delete (darray_t *a,unsigned n); 17 | extern void darray_free (darray_t *a); 18 | 19 | static inline void darray_init(darray_t *a,unsigned size,unsigned get) 20 | { 21 | a->esize = size; 22 | a->get = get; 23 | a->items = a->alloc = 0; 24 | a->data = NULL; 25 | } 26 | 27 | static inline void *darray_find(darray_t *a,unsigned n) 28 | { 29 | if (n < a->alloc && n < a->items) 30 | return (void *) (a->data + n * a->esize); 31 | return Darray_find(a,n); 32 | } 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/def_pars.c: -------------------------------------------------------------------------------- 1 | #include 2 | /* def_pars.c 3 | */ 4 | #include 5 | #include 6 | #include "nsynth.h" 7 | 8 | klatt_global_t klatt_global; 9 | 10 | /* default values for pars array from .doc file */ 11 | klatt_frame_t def_pars = // not a const 12 | { 13 | #include "pars.def" 14 | }; 15 | 16 | 17 | long samp_rate = 32000; 18 | 19 | void klatt_init(void) 20 | { 21 | //double mSec_per_frame = 10; 22 | float mSec_per_frame = 10; // 10? or 8? - leave as 10 23 | // int impulse = 0; 24 | // int impulse = 1; 25 | //int casc = 1; 26 | int casc = 4; // was 6 27 | klatt_global.samrate = samp_rate; 28 | klatt_global.quiet_flag = TRUE; 29 | 30 | // klatt_global.glsource = NATURAL;/// SAMPLE=fixed, NATURAL seems same as IMPULSIVE, TRIANGULAR-loud-leave, WAVETABLE - not implemented? 31 | // we fix this as NATURAL 32 | klatt_global.f0_flutter = 10.0f; 33 | def_pars.TLTdb=0; 34 | def_pars.Kskew=10; // was 10 35 | def_pars.F0hz10=1600;// "Base F0 in 0.1Hz", 36 | 37 | if (casc > 0) 38 | { 39 | klatt_global.synthesis_model = CASCADE_PARALLEL; 40 | klatt_global.nfcascade = casc; 41 | } 42 | else 43 | klatt_global.synthesis_model = ALL_PARALLEL; 44 | 45 | // if (impulse) 46 | // klatt_global.glsource = IMPULSIVE; 47 | 48 | klatt_global.nspfr = (klatt_global.samrate * mSec_per_frame) / 1000; 49 | } 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/def_pars.c~: -------------------------------------------------------------------------------- 1 | #include 2 | /* def_pars.c 3 | */ 4 | #include 5 | #include 6 | #include "nsynth.h" 7 | 8 | klatt_global_t klatt_global; 9 | 10 | /* default values for pars array from .doc file */ 11 | klatt_frame_t def_pars = 12 | { 13 | #include "pars.def" 14 | }; 15 | 16 | 17 | long samp_rate = 32000; 18 | 19 | void init_synth(void) 20 | { 21 | //double mSec_per_frame = 10; 22 | double mSec_per_frame = 8; 23 | //int impulse = 0; 24 | int impulse = 1; 25 | //int casc = 1; 26 | int casc = 2; 27 | klatt_global.samrate = samp_rate; 28 | klatt_global.quiet_flag = TRUE; 29 | klatt_global.glsource = NATURAL; 30 | klatt_global.f0_flutter = 0; 31 | 32 | // klatt_global.quiet_flag, "Quiet - minimal messages", 33 | // impulse, "Impulse glottal source", 34 | // casc, "Number cascade formants", 35 | // klatt_global.f0_flutter, "F0 flutter", 36 | // mSec_per_frame, "mSec per frame", 37 | // def_pars.TLTdb, "Tilt dB", 38 | // def_pars.F0hz10, "Base F0 in 0.1Hz", 39 | 40 | if (casc > 0) 41 | { 42 | klatt_global.synthesis_model = CASCADE_PARALLEL; 43 | klatt_global.nfcascade = casc; 44 | } 45 | else 46 | klatt_global.synthesis_model = ALL_PARALLEL; 47 | 48 | if (impulse) 49 | klatt_global.glsource = IMPULSIVE; 50 | 51 | klatt_global.nspfr = (klatt_global.samrate * mSec_per_frame) / 1000; 52 | } 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/def_pars.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/def_pars.o: lib/rsynth-2.0-port/def_pars.c \ 2 | lib/rsynth-2.0-port/config.h \ 3 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 6 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 7 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 8 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 9 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 10 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 11 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 12 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 13 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 14 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 15 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 16 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 17 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 18 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 19 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 20 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/math.h \ 21 | lib/rsynth-2.0-port/nsynth.h lib/rsynth-2.0-port/pars.def 22 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/elements.c: -------------------------------------------------------------------------------- 1 | #include 2 | /* elements.c 3 | */ 4 | #include 5 | #include 6 | #include "elements.h" 7 | #include "phfeat.h" 8 | 9 | Elm_t Elements[] __attribute__ ((section (".flash"))) = 10 | { 11 | #include "Elements.def" 12 | }; 13 | 14 | unsigned num_Elements = (sizeof(Elements) / sizeof(Elm_t)); 15 | 16 | char *Ep_name[nEparm] = 17 | { 18 | "fn", "f1", "f2", "f3", 19 | "b1", "b2", "b3", "an", 20 | "a1", "a2", "a3", "a4", 21 | "a5", "a6", "ab", "av", 22 | "avc", "asp", "af" 23 | }; 24 | 25 | /* 26 | void main(void){ 27 | unsigned char x; 28 | for (x=0;x 2 | /* elements.c 3 | */ 4 | #include 5 | #include 6 | #include "elements.h" 7 | #include "phfeat.h" 8 | 9 | Elm_t Elements[] = 10 | { 11 | #include "Elements.def" 12 | }; 13 | 14 | unsigned num_Elements = (sizeof(Elements) / sizeof(Elm_t)); 15 | 16 | char *Ep_name[nEparm] = 17 | { 18 | "fn", "f1", "f2", "f3", 19 | "b1", "b2", "b3", "an", 20 | "a1", "a2", "a3", "a4", 21 | "a5", "a6", "ab", "av", 22 | "avc", "asp", "af" 23 | }; 24 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/elements.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/elements.o: lib/rsynth-2.0-port/elements.c \ 2 | lib/rsynth-2.0-port/config.h \ 3 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 6 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 7 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 8 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 9 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 10 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 11 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 12 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 13 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 14 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 15 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 16 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 17 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 18 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 19 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 20 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/math.h \ 21 | lib/rsynth-2.0-port/elements.h lib/rsynth-2.0-port/phfeat.h \ 22 | lib/rsynth-2.0-port/Elements.def 23 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/elements.h: -------------------------------------------------------------------------------- 1 | /* elements.h 2 | */ 3 | typedef struct 4 | {float stdy; 5 | float fixd; 6 | char prop; 7 | char ed; 8 | char id; 9 | } interp_t, *interp_ptr; 10 | 11 | enum Eparm_e 12 | { 13 | fn, f1, f2, f3, b1, b2, b3, an, a1, a2, a3, a4, a5, a6, ab, av, avc, asp, af, 14 | nEparm 15 | }; 16 | 17 | extern char *Ep_name[nEparm]; 18 | 19 | typedef struct Elm_s 20 | { 21 | char *name; 22 | char rk; 23 | char du; 24 | char ud; 25 | unsigned char font; 26 | char *dict; 27 | char *ipa; 28 | long feat; 29 | interp_t p[nEparm]; 30 | } Elm_t, *Elm_ptr; 31 | 32 | extern Elm_t Elements[]; 33 | extern unsigned num_Elements; 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/elements.h~: -------------------------------------------------------------------------------- 1 | /* elements.h 2 | */ 3 | typedef struct 4 | {float stdy; 5 | float fixd; 6 | char prop; 7 | char ed; 8 | char id; 9 | } interp_t, *interp_ptr; 10 | 11 | enum Eparm_e 12 | { 13 | fn, f1, f2, f3, b1, b2, b3, an, a1, a2, a3, a4, a5, a6, ab, av, avc, asp, af, 14 | nEparm 15 | }; 16 | 17 | extern char *Ep_name[nEparm]; 18 | 19 | typedef struct Elm_s 20 | { 21 | char *name; 22 | char rk; 23 | char du; 24 | char ud; 25 | unsigned char font; 26 | char *dict; 27 | char *ipa; 28 | long feat; 29 | interp_t p[nEparm]; 30 | } Elm_t, *Elm_ptr; 31 | 32 | extern Elm_t Elements[]; 33 | extern unsigned num_Elements; 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/holmes.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/holmes.o: lib/rsynth-2.0-port/holmes.c \ 2 | lib/rsynth-2.0-port/config.h \ 3 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 6 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 7 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 8 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 9 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 10 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 11 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 12 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 13 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 14 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 15 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 16 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 17 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 18 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 19 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 20 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/ctype.h \ 21 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/math.h \ 22 | lib/rsynth-2.0-port/nsynth.h lib/rsynth-2.0-port/elements.h \ 23 | lib/rsynth-2.0-port/darray.h lib/rsynth-2.0-port/holmes.h \ 24 | lib/rsynth-2.0-port/phfeat.h 25 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/holmes.h: -------------------------------------------------------------------------------- 1 | /* holmes.h, 2 | */ 3 | u16 run_holmes(u16 klatthead); 4 | unsigned holmes (unsigned nelm,unsigned char *elm,unsigned nsamp, short *samp_base); 5 | void init_holmes(void); 6 | void term_holmes (void); 7 | extern int speed; 8 | void holmesrun(int16_t* outgoing, u8 size); 9 | int16_t klatt_get_sample(void); 10 | void klatt_newsay(void); 11 | int16_t klatt_get_sampleTTS(void); 12 | void klatt_newsayTTS(void); 13 | 14 | int16_t klatt_get_sample_single(void); 15 | int16_t klatt_get_sample_single_sing(void); 16 | void klatt_newsay_single(void); 17 | 18 | int16_t klatt_get_sample_vocab(void); 19 | int16_t klatt_get_sample_vocab_sing(void); 20 | void klatt_newsay_vocab(void); 21 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/nsynth.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/nsynth.o: lib/rsynth-2.0-port/nsynth.c \ 2 | lib/rsynth-2.0-port/config.h lib/CMSIS/ST/STM32F4xx/Include/stm32f4xx.h \ 3 | lib/CMSIS/Include/core_cm4.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h \ 6 | lib/CMSIS/Include/core_cmInstr.h lib/CMSIS/Include/core_cmFunc.h \ 7 | lib/CMSIS/Include/core_cm4_simd.h \ 8 | lib/CMSIS/ST/STM32F4xx/Include/system_stm32f4xx.h inc/stm32f4xx_conf.h \ 9 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h \ 10 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h \ 11 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h \ 12 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h \ 13 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h \ 14 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dbgmcu.h \ 15 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h \ 16 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h \ 17 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h \ 18 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h \ 19 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h \ 20 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h \ 21 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h \ 22 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h \ 23 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_iwdg.h \ 24 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h \ 25 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h \ 26 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rng.h \ 27 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h \ 28 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h \ 29 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h \ 30 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h \ 31 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h \ 32 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h \ 33 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_wwdg.h \ 34 | lib/STM32F4xx_StdPeriph_Driver/inc/misc.h inc/platform_config.h \ 35 | inc/hw_config.h \ 36 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 37 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 38 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 39 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 40 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 41 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 42 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 43 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 44 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 45 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 46 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 47 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 48 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 49 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 50 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 51 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 52 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 53 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdlib.h \ 54 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/stdlib.h \ 55 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/alloca.h \ 56 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/string.h \ 57 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/cdefs.h \ 58 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/string.h \ 59 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/inttypes.h \ 60 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdbool.h \ 61 | inc/stm32f4xx_it.h inc/stm32f4xx_conf.h inc/platform_config.h \ 62 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery.h \ 63 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h \ 64 | inc/systick.h inc/uart_support.h inc/monitor.h inc/term_io.h \ 65 | inc/hw_config.h \ 66 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/math.h \ 67 | lib/rsynth-2.0-port/nsynth.h 68 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/nsynth.h: -------------------------------------------------------------------------------- 1 | /* nsynth.h 2 | */ 3 | #define CASCADE_PARALLEL 1 4 | #define ALL_PARALLEL 2 5 | #define NPAR 40 6 | #define IMPULSIVE 1 7 | #define NATURAL 2 8 | #define SAMPLE 3 9 | #define TRIANGULAR 4 10 | #define WAVETABLE 5 11 | 12 | #ifndef PI 13 | #define PI 3.1415927 14 | #endif 15 | 16 | #ifndef TRUE 17 | #define TRUE 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | typedef struct 25 | { 26 | long F0hz10; /* Voicing fund freq in Hz */ 27 | long AVdb; /* Amp of voicing in dB, 0 to 70 */ 28 | long F1hz; /* First formant freq in Hz, 200 to 1300 */ 29 | long B1hz; /* First formant bw in Hz, 40 to 1000 */ 30 | long F2hz; /* Second formant freq in Hz, 550 to 3000 */ 31 | long B2hz; /* Second formant bw in Hz, 40 to 1000 */ 32 | long F3hz; /* Third formant freq in Hz, 1200 to 4999 */ 33 | long B3hz; /* Third formant bw in Hz, 40 to 1000 */ 34 | long F4hz; /* Fourth formant freq in Hz, 1200 to 4999 */ 35 | long B4hz; /* Fourth formant bw in Hz, 40 to 1000 */ 36 | long F5hz; /* Fifth formant freq in Hz, 1200 to 4999 */ 37 | long B5hz; /* Fifth formant bw in Hz, 40 to 1000 */ 38 | long F6hz; /* Sixth formant freq in Hz, 1200 to 4999 */ 39 | long B6hz; /* Sixth formant bw in Hz, 40 to 2000 */ 40 | long FNZhz; /* Nasal zero freq in Hz, 248 to 528 */ 41 | long BNZhz; /* Nasal zero bw in Hz, 40 to 1000 */ 42 | long FNPhz; /* Nasal pole freq in Hz, 248 to 528 */ 43 | long BNPhz; /* Nasal pole bw in Hz, 40 to 1000 */ 44 | long ASP; /* Amp of aspiration in dB, 0 to 70 */ 45 | long Kopen; /* # of samples in open period, 10 to 65 */ 46 | long Aturb; /* Breathiness in voicing, 0 to 80 */ 47 | long TLTdb; /* Voicing spectral tilt in dB, 0 to 24 */ 48 | long AF; /* Amp of frication in dB, 0 to 80 */ 49 | long Kskew; /* Skewness of alternate periods, 0 to 40 in sample#/2 */ 50 | long A1; /* Amp of par 1st formant in dB, 0 to 80 */ 51 | long B1phz; /* Par. 1st formant bw in Hz, 40 to 1000 */ 52 | long A2; /* Amp of F2 frication in dB, 0 to 80 */ 53 | long B2phz; /* Par. 2nd formant bw in Hz, 40 to 1000 */ 54 | long A3; /* Amp of F3 frication in dB, 0 to 80 */ 55 | long B3phz; /* Par. 3rd formant bw in Hz, 40 to 1000 */ 56 | long A4; /* Amp of F4 frication in dB, 0 to 80 */ 57 | long B4phz; /* Par. 4th formant bw in Hz, 40 to 1000 */ 58 | long A5; /* Amp of F5 frication in dB, 0 to 80 */ 59 | long B5phz; /* Par. 5th formant bw in Hz, 40 to 1000 */ 60 | long A6; /* Amp of F6 (same as r6pa), 0 to 80 */ 61 | long B6phz; /* Par. 6th formant bw in Hz, 40 to 2000 */ 62 | long ANP; /* Amp of par nasal pole in dB, 0 to 80 */ 63 | long AB; /* Amp of bypass fric. in dB, 0 to 80 */ 64 | long AVpdb; /* Amp of voicing, par in dB, 0 to 70 */ 65 | long Gain0; /* Overall gain, 60 dB is unity, 0 to 60 */ 66 | } klatt_frame_t, *klatt_frame_ptr; 67 | 68 | extern klatt_frame_t def_pars; 69 | 70 | typedef struct 71 | { 72 | int synthesis_model; 73 | int quiet_flag; 74 | int f0_flutter; 75 | int outsl; 76 | long samrate; 77 | long nfcascade; 78 | long nspfr; 79 | } klatt_global_t, *klatt_global_ptr; 80 | 81 | extern klatt_global_t klatt_global; 82 | 83 | void initparwave(klatt_global_ptr globals, klatt_frame_ptr frame); 84 | void parwavesample(klatt_global_ptr globals, klatt_frame_ptr frame, short* jwave, unsigned char ns,unsigned char xx); 85 | void parwave(klatt_global_ptr, klatt_frame_ptr pars,short *jwave); 86 | unsigned int new_parwave(klatt_global_ptr globals, klatt_frame_ptr pars,short *jwave, unsigned int klatthead); 87 | void parwave_init (klatt_global_ptr); 88 | void pr_pars (void); 89 | void klatt_init(void); 90 | unsigned int parwavesinglesample(klatt_global_ptr globals, klatt_frame_ptr frame, unsigned char ns); 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/pars.def: -------------------------------------------------------------------------------- 1 | /* $Id: pars.def,v 1.13 1994/11/08 13:30:50 a904209 Exp a904209 $ 2 | */ 3 | 1330, /* F0 long F0hz10; */ 4 | 60, /* AV long AVdb; */ 5 | 500, /* F1 long F1hz; */ 6 | 60, /* BW1 long B1hz; */ 7 | 1500, /* F2 long F2hz; */ 8 | 90, /* BW2 long B2hz; */ 9 | 2800, /* F3 long F3hz; */ 10 | 150, /* BW3 long B3hz; */ 11 | 3250, /* F4 long F4hz; */ 12 | 200, /* BW4 long B4hz; */ 13 | 3700, /* F5 long F5hz; */ 14 | 200, /* BW5 long B5hz; */ 15 | 4990, /* F6 long F6hz; */ 16 | 500, /* BW6 long B6hz; */ 17 | 270, /* Fnz long FNZhz; */ 18 | 100, /* BWnz long BNZhz; */ 19 | 270, /* Fnp long FNPhz; */ 20 | 100, /* BWnp long BNPhz; */ 21 | 0, /* Aasp long ASP; */ 22 | 30, /* Nopn long Kopen; */ 23 | 0, /* Atur long Aturb; */ 24 | 10, /* tilt long TLTdb; */ 25 | 0, /* Afrc long AF; */ 26 | 0, /* skew long Kskew; */ 27 | 0, /* A1 long A1; */ 28 | 80, /* BWp1 long B1phz; */ 29 | 0, /* A2 long A2; */ 30 | 200, /* BWp2 long B2phz; */ 31 | 0, /* A3 long A3; */ 32 | 350, /* BWp3 long B3phz; */ 33 | 0, /* A4 long A4; */ 34 | 500, /* BWp4 long B4phz; */ 35 | 0, /* A5 long A5; */ 36 | 600, /* BWp5 long B5phz; */ 37 | 0, /* A6 long A6; */ 38 | 800, /* BWp6 long B6phz; */ 39 | 0, /* AN long ANP; */ 40 | 0, /* AB long AB; */ 41 | 0, /* AVpa long AVpdb; */ 42 | 62 /* G0 long Gain0; */ 43 | 44 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phfeat.h: -------------------------------------------------------------------------------- 1 | #define alv 0x00000001 2 | #define apr 0x00000002 3 | #define bck 0x00000004 4 | #define blb 0x00000008 5 | #define cnt 0x00000010 6 | #define dnt 0x00000020 7 | #define fnt 0x00000040 8 | #define frc 0x00000080 9 | #define glt 0x00000100 10 | #define hgh 0x00000200 11 | #define lat 0x00000400 12 | #define lbd 0x00000800 13 | #define lbv 0x00001000 14 | #define lmd 0x00002000 15 | #define low 0x00004000 16 | #define mdl 0x00008000 17 | #define nas 0x00010000 18 | #define pal 0x00020000 19 | #define pla 0x00040000 20 | #define rnd 0x00080000 21 | #define rzd 0x00100000 22 | #define smh 0x00200000 23 | #define stp 0x00400000 24 | #define umd 0x00800000 25 | #define unr 0x01000000 26 | #define vcd 0x02000000 27 | #define vel 0x04000000 28 | #define vls 0x08000000 29 | #define vwl 0x10000000 30 | #define Fnames {"alv","apr","bck","blb","cnt","dnt","fnt","frc", \ 31 | "glt","hgh","lat","lbd","lbv","lmd","low","mdl", \ 32 | "nas","pal","pla","rnd","rzd","smh","stp","umd", \ 33 | "unr","vcd","vel","vls","vwl",NULL} 34 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phtoelm.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* phtoelm.c 4 | */ 5 | 6 | #ifndef LAP 7 | #include "stm32f4xx.h" 8 | #else 9 | #include "forlap.h" 10 | #endif 11 | 12 | #include "stdlib.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "elements.h" 23 | #include "phfeat.h" 24 | #include "darray.h" 25 | #include "trie.h" 26 | #include "phtoelm.h" 27 | //#include "hplay.h" 28 | #include "holmes.h" 29 | #include "nsynth.h" 30 | 31 | 32 | 33 | trie_ptr phtoelm = NULL; 34 | 35 | static Elm_ptr find_elm (char *s); 36 | 37 | static Elm_ptr find_elm(char *s) 38 | { 39 | Elm_ptr e = Elements; 40 | while (e < Elements + num_Elements) 41 | { 42 | if (!strcmp(s, e->name)) 43 | { 44 | return e; 45 | } 46 | e++; 47 | } 48 | return NULL; 49 | } 50 | 51 | static void enter(char *p,...) 52 | { 53 | va_list ap; 54 | 55 | char *s; 56 | char buf[20]; 57 | char *x = buf + 1; 58 | 59 | va_start(ap, p); 60 | 61 | //printf("-- p %s\n", p); 62 | 63 | //while ((s = va_arg(ap, char *))) 64 | while (1) 65 | { 66 | s = va_arg(ap, char *); 67 | if(s==NULL) break; 68 | //printf("-- va_arg %s\n", s); 69 | 70 | Elm_ptr e = find_elm(s); 71 | if (e) 72 | { 73 | //printf("---- Find %s\n", s); 74 | 75 | *x++ = (e - Elements); 76 | } 77 | else 78 | { 79 | // fprintf(stderr, "Cannot find %s\n", s); 80 | } 81 | } 82 | va_end(ap); 83 | buf[0] = (x - buf) - 1; 84 | x = malloc(buf[0] + 1); 85 | if(x){ 86 | memcpy(x, buf, buf[0] + 1); 87 | trie_insert(&phtoelm, p, x); 88 | }else{ 89 | // fprintf(stderr, "memory shortage (enter)\n"); 90 | } 91 | } 92 | 93 | static void enter_phonemes (void) 94 | { 95 | #include "phtoelm.def" 96 | } 97 | 98 | int phone_append(darray_ptr p, int ch) 99 | { 100 | char *s = (char *) darray_find(p, p->items); 101 | *s = ch; 102 | return ch; 103 | } 104 | 105 | //yama #if 0 106 | #if 1 107 | #define StressDur(e,s) ((e->ud + (e->du - e->ud) * s / 3)*speed) 108 | #else 109 | #define StressDur(e,s) (s,((e->du + e->ud)/2)*speed) 110 | #endif 111 | 112 | unsigned int phone_to_elm(char *phone, int n, darray_ptr elm) 113 | { 114 | int stress = 0; 115 | char *s = phone; 116 | unsigned t = 0; 117 | char *limit = s + n; 118 | 119 | 120 | if (!phtoelm) 121 | enter_phonemes(); // TODO: init elsewhere? 122 | 123 | while (s < limit && *s) 124 | { 125 | char *e = trie_lookup(&phtoelm, &s); 126 | if (e) 127 | { 128 | int n = *e++; 129 | while (n-- > 0) 130 | { 131 | int x = *e++; 132 | Elm_ptr p = &Elements[x]; 133 | /* This works because only vowels have ud != du, 134 | and we set stress just before a vowel 135 | */ 136 | phone_append(elm, x); 137 | if (!(p->feat & vwl)) 138 | stress = 0; 139 | t += phone_append(elm,StressDur(p,stress)); 140 | phone_append(elm, stress); 141 | } 142 | } 143 | else 144 | { 145 | char ch = *s++; 146 | switch (ch) 147 | { 148 | case '\'': /* Primary stress */ 149 | stress = 3; 150 | break; 151 | case ',': /* Secondary stress */ 152 | stress = 2; 153 | break; 154 | case '+': /* Tertiary stress */ 155 | stress = 1; 156 | break; 157 | case '-': /* hyphen in input */ 158 | break; 159 | default: 160 | // fprintf(stderr, "Ignoring %c in '%.*s'\n", ch, n, phone); 161 | break; 162 | } 163 | } 164 | } 165 | return t; 166 | } 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phtoelm.c~: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* phtoelm.c 4 | */ 5 | 6 | #include "stm32f4xx.h" 7 | #include "platform_config.h" 8 | #include "hw_config.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "elements.h" 16 | #include "phfeat.h" 17 | #include "darray.h" 18 | #include "trie.h" 19 | #include "phtoelm.h" 20 | //#include "hplay.h" 21 | #include "holmes.h" 22 | #include "nsynth.h" 23 | 24 | 25 | 26 | trie_ptr phtoelm = NULL; 27 | 28 | static Elm_ptr find_elm (char *s); 29 | 30 | static Elm_ptr find_elm(char *s) 31 | { 32 | Elm_ptr e = Elements; 33 | while (e < Elements + num_Elements) 34 | { 35 | if (!strcmp(s, e->name)) 36 | { 37 | return e; 38 | } 39 | e++; 40 | } 41 | return NULL; 42 | } 43 | 44 | static void enter(char *p,...) 45 | { 46 | va_list ap; 47 | 48 | char *s; 49 | char buf[20]; 50 | char *x = buf + 1; 51 | 52 | va_start(ap, p); 53 | 54 | //printf("-- p %s\n", p); 55 | 56 | //while ((s = va_arg(ap, char *))) 57 | while (1) 58 | { 59 | s = va_arg(ap, char *); 60 | if(s==NULL) break; 61 | //printf("-- va_arg %s\n", s); 62 | 63 | Elm_ptr e = find_elm(s); 64 | if (e) 65 | { 66 | //printf("---- Find %s\n", s); 67 | 68 | *x++ = (e - Elements); 69 | } 70 | else 71 | { 72 | fprintf(stderr, "Cannot find %s\n", s); 73 | } 74 | } 75 | va_end(ap); 76 | buf[0] = (x - buf) - 1; 77 | x = malloc(buf[0] + 1); 78 | if(x){ 79 | memcpy(x, buf, buf[0] + 1); 80 | trie_insert(&phtoelm, p, x); 81 | }else{ 82 | fprintf(stderr, "memory shortage (enter)\n"); 83 | } 84 | } 85 | 86 | static void enter_phonemes (void) 87 | { 88 | #include "phtoelm.def" 89 | } 90 | 91 | int phone_append(darray_ptr p, int ch) 92 | { 93 | char *s = (char *) darray_find(p, p->items); 94 | *s = ch; 95 | return ch; 96 | } 97 | 98 | //yama #if 0 99 | #if 1 100 | #define StressDur(e,s) ((e->ud + (e->du - e->ud) * s / 3)*speed) 101 | #else 102 | #define StressDur(e,s) (s,((e->du + e->ud)/2)*speed) 103 | #endif 104 | 105 | unsigned int phone_to_elm(char *phone, int n, darray_ptr elm) 106 | { 107 | int stress = 0; 108 | char *s = phone; 109 | unsigned t = 0; 110 | char *limit = s + n; 111 | 112 | 113 | if (!phtoelm) 114 | enter_phonemes(); 115 | 116 | while (s < limit && *s) 117 | { 118 | char *e = trie_lookup(&phtoelm, &s); 119 | if (e) 120 | { 121 | int n = *e++; 122 | while (n-- > 0) 123 | { 124 | int x = *e++; 125 | Elm_ptr p = &Elements[x]; 126 | /* This works because only vowels have ud != du, 127 | and we set stress just before a vowel 128 | */ 129 | phone_append(elm, x); 130 | if (!(p->feat & vwl)) 131 | stress = 0; 132 | t += phone_append(elm,StressDur(p,stress)); 133 | phone_append(elm, stress); 134 | } 135 | } 136 | else 137 | { 138 | char ch = *s++; 139 | switch (ch) 140 | { 141 | case '\'': /* Primary stress */ 142 | stress = 3; 143 | break; 144 | case ',': /* Secondary stress */ 145 | stress = 2; 146 | break; 147 | case '+': /* Tertiary stress */ 148 | stress = 1; 149 | break; 150 | case '-': /* hyphen in input */ 151 | break; 152 | default: 153 | fprintf(stderr, "Ignoring %c in '%.*s'\n", ch, n, phone); 154 | break; 155 | } 156 | } 157 | } 158 | return t; 159 | } 160 | 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phtoelm.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/phtoelm.o: lib/rsynth-2.0-port/phtoelm.c \ 2 | lib/rsynth-2.0-port/config.h lib/CMSIS/ST/STM32F4xx/Include/stm32f4xx.h \ 3 | lib/CMSIS/Include/core_cm4.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h \ 6 | lib/CMSIS/Include/core_cmInstr.h lib/CMSIS/Include/core_cmFunc.h \ 7 | lib/CMSIS/Include/core_cm4_simd.h \ 8 | lib/CMSIS/ST/STM32F4xx/Include/system_stm32f4xx.h inc/stm32f4xx_conf.h \ 9 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h \ 10 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h \ 11 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h \ 12 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h \ 13 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h \ 14 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dbgmcu.h \ 15 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h \ 16 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h \ 17 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h \ 18 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h \ 19 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h \ 20 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h \ 21 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h \ 22 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h \ 23 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_iwdg.h \ 24 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h \ 25 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h \ 26 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rng.h \ 27 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h \ 28 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h \ 29 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h \ 30 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h \ 31 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h \ 32 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h \ 33 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_wwdg.h \ 34 | lib/STM32F4xx_StdPeriph_Driver/inc/misc.h inc/platform_config.h \ 35 | inc/hw_config.h \ 36 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 37 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 38 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 39 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 40 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 41 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 42 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 43 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 44 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 45 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 46 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 47 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 48 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 49 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 50 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 51 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 52 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 53 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdlib.h \ 54 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/stdlib.h \ 55 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/alloca.h \ 56 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/string.h \ 57 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/cdefs.h \ 58 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/string.h \ 59 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/inttypes.h \ 60 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdbool.h \ 61 | inc/stm32f4xx_it.h inc/stm32f4xx_conf.h inc/platform_config.h \ 62 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery.h \ 63 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h \ 64 | inc/systick.h inc/uart_support.h inc/monitor.h inc/term_io.h \ 65 | inc/hw_config.h \ 66 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/ctype.h \ 67 | lib/rsynth-2.0-port/useconfig.h lib/rsynth-2.0-port/elements.h \ 68 | lib/rsynth-2.0-port/phfeat.h lib/rsynth-2.0-port/darray.h \ 69 | lib/rsynth-2.0-port/trie.h lib/rsynth-2.0-port/phtoelm.h \ 70 | lib/rsynth-2.0-port/holmes.h lib/rsynth-2.0-port/nsynth.h \ 71 | lib/rsynth-2.0-port/phtoelm.def 72 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phtoelm.def: -------------------------------------------------------------------------------- 1 | /* $Id: phtoelm.def,v 1.13 1994/11/08 13:30:50 a904209 Exp a904209 $ 2 | */ 3 | 4 | ////////////////////////////// 5 | // YEES 2011/11/28 // 6 | ////////////////////////////// 7 | 8 | enter(" ","Q",NULL); 9 | enter("p","P","PY","PZ",NULL); 10 | enter("t","T","TY","TZ",NULL); 11 | enter("k","K","KY","KZ",NULL); 12 | enter("b","B","BY","BZ",NULL); 13 | enter("d","D","DY","DZ",NULL); 14 | enter("g","G","GY","GZ",NULL); 15 | enter("m","M",NULL); 16 | enter("n","N",NULL); 17 | enter("N","NG",NULL); 18 | enter("f","F",NULL); 19 | enter("T","TH",NULL); 20 | enter("s","S",NULL); 21 | enter("S","SH",NULL); 22 | enter("h","H",NULL); 23 | enter("H","H",NULL); 24 | enter("v","V","QQ","V",NULL); 25 | enter("D","DH","QQ","DI",NULL); 26 | enter("z","Z","QQ","ZZ",NULL); 27 | enter("Z","ZH","QQ","ZH",NULL); 28 | enter("tS","CH","CI",NULL); 29 | enter("CH","CH","CI",NULL); 30 | enter("dZ","J","JY","QQ","JY",NULL); 31 | enter("j","J","JY","QQ","JY",NULL); 32 | enter("l","L",NULL); 33 | enter("r","R",NULL); 34 | enter("rr","R","QQ","R",NULL); 35 | enter("R","RX",NULL); 36 | enter("w","W",NULL); 37 | enter("W","W",NULL); 38 | enter("X","X",NULL); 39 | enter("%","QQ",NULL); /* stop-ness - not quite glottal stop */ 40 | enter("Y","Y",NULL); 41 | enter("I","I",NULL); 42 | enter("IH","IB",NULL); 43 | enter("E","E",NULL); 44 | enter("EH","EE",NULL); 45 | enter("&","AA",NULL); 46 | enter("V","U",NULL); 47 | enter("0","O",NULL); 48 | enter("U","OO",NULL); 49 | enter("@","A",NULL); 50 | enter("i","EE",NULL); 51 | enter("3","ER",NULL); 52 | enter("A","AR",NULL); 53 | enter("AX","A",NULL); 54 | enter("AH","AA",NULL); 55 | enter("O","AW",NULL); 56 | enter("OH","OO",NULL); 57 | enter("UH","UU",NULL); 58 | enter("u","UU",NULL); 59 | enter("o","OI",NULL); 60 | enter("eI","AI","I",NULL); 61 | enter("aI","IE","I",NULL); 62 | enter("oI","OI","I",NULL); 63 | enter("aU","OU","OV",NULL); 64 | enter("OW","OO",NULL); 65 | enter("@U","OA","OV",NULL); 66 | enter("I@","IA","IB",NULL); 67 | enter("e@","AIR","IB",NULL); 68 | enter("U@","OOR","IB",NULL); 69 | enter("O@","OR","IB",NULL); 70 | enter("oU","OI","OV",NULL); 71 | 72 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/phtoelm.h: -------------------------------------------------------------------------------- 1 | /* phtoelm.h 2 | */ 3 | extern int phone_append (darray_ptr p,int ch); 4 | unsigned phone_to_elm (char *s, int n, darray_ptr elm); 5 | 6 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/say.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* $Id: say.c,v 1.13 1994/11/08 13:30:50 a904209 Exp a904209 $ 4 | $Log: say.c,v $ 5 | * Revision 1.13 1994/11/08 13:30:50 a904209 6 | * 2.0 release 7 | * 8 | * Revision 1.12 1994/11/04 13:32:31 a904209 9 | * 1.99.1 - Change configure stuff 10 | * 11 | * Revision 1.11 1994/11/02 10:55:31 a904209 12 | * Add autoconf. Tested on SunOS/Solaris 13 | * 14 | * Revision 1.10 1994/10/04 17:12:50 a904209 15 | * 3rd pre-release 16 | * 17 | * Revision 1.9 1994/10/04 09:08:27 a904209 18 | * Next Patch merge 19 | * 20 | * Revision 1.8 1994/10/03 08:41:47 a904209 21 | * 2nd pre-release 22 | * 23 | * Revision 1.7 1994/09/19 15:48:29 a904209 24 | * Split hplay.c, gdbm dictionary, start of f0 contour, netaudio and HP ports 25 | * 26 | * Revision 1.6 1994/04/15 16:47:37 a904209 27 | * Edits for Solaris2.3 (aka SunOs 5.3) 28 | * 29 | * Revision 1.5 1994/02/24 15:03:05 a904209 30 | * Added contributed linux, NeXT and SGI ports. 31 | * 32 | * Revision 1.4 93/11/18 16:29:06 a904209 33 | * Migrated nsyth.c towards Jon's scheme - merge still incomplete 34 | * 35 | * Revision 1.3 93/11/16 14:32:44 a904209 36 | * Added RCS Ids, partial merge of Jon's new klatt/parwave 37 | * 38 | * Revision 1.3 93/11/16 14:00:58 a904209 39 | * Add IDs and merge Jon's klatt sources - incomplete 40 | * 41 | */ 42 | extern char *Revision; 43 | 44 | #ifndef LAP 45 | #include "stm32f4xx.h" 46 | #else 47 | #include "forlap.h" 48 | #endif 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include "nsynth.h" 54 | #include "darray.h" 55 | #include "holmes.h" 56 | #include "phtoelm.h" 57 | #include "elements.h" 58 | #include "say.h" 59 | 60 | 61 | //short *pWavBuffer; 62 | //int16_t pWavBuffer[10240] __attribute__ ((section (".ccmdata"))); 63 | 64 | darray_t wav_elm; 65 | unsigned short wav_len; 66 | 67 | #define StressDur(e,s) ((e->ud + (e->du - e->ud) * s / 3)*speed) 68 | 69 | 70 | // test TTS into phonemeToWave with new holmes 71 | 72 | // so TTSnewsay generates TTS list - fixed now - which then generates list of elements (wav_elm), of length wav_elm.items 73 | 74 | // PhonemeToWaveData(eng2phonemeOUT-array from xlate, eng2phonemeOUT_ptr=length, 0); 75 | 76 | // UNUSED? 77 | 78 | void PhonemeToWaveData(char *phone, int len) 79 | { 80 | unsigned frames; 81 | int i, j; 82 | darray_init(&wav_elm, sizeof(char), len); // where is wav_elm and how long is it? 83 | frames = phone_to_elm(phone, len, &wav_elm); 84 | } 85 | 86 | void PhonemeToWaveDataxxx(u8 phone, int len, int verbose) // len here is 1 // this is for single phoneme? 87 | { 88 | unsigned int frames; //int16_t *pwav; 89 | unsigned char intern[9]; 90 | intern[0]=phone; // phoneme 91 | 92 | Elm_ptr p = &Elements[phone]; 93 | intern[1]=StressDur(p,1); // duration 94 | intern[2]=0; // stress - 0/1/2/3 - set by phoneme as additional possible 95 | 96 | // intern[3]=24; 97 | // intern[4]=15; 98 | // intern[5]=0; 99 | 100 | // darray_init(&wav_elm, sizeof(char), len); // char=2 101 | 102 | frames=intern[1]; // add the durs - how long is a frame in samples? 256 samples... 103 | 104 | 105 | // frames = phone_to_elm(phone, len, &wav_elm); 106 | 107 | unsigned max_samples = frames * klatt_global.nspfr; 108 | 109 | // wav_len = holmes( wav_elm.items, 110 | // (unsigned char *) darray_find(&wav_elm, 0), 111 | // max_samples, pWavBuffer ); 112 | 113 | // wav_len = holmes(3, 114 | // intern, 115 | // max_samples, pWavBuffer ); 116 | 117 | // } 118 | // darray_free(&wav_elm); 119 | 120 | } 121 | 122 | 123 | 124 | void FreePhonemeToWaveData(void) 125 | { 126 | /* if(pWavBuffer){ 127 | free(pWavBuffer); 128 | pWavBuffer = NULL; 129 | } 130 | */ 131 | darray_free(&wav_elm); 132 | } 133 | 134 | 135 | 136 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/say.c~: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* $Id: say.c,v 1.13 1994/11/08 13:30:50 a904209 Exp a904209 $ 4 | $Log: say.c,v $ 5 | * Revision 1.13 1994/11/08 13:30:50 a904209 6 | * 2.0 release 7 | * 8 | * Revision 1.12 1994/11/04 13:32:31 a904209 9 | * 1.99.1 - Change configure stuff 10 | * 11 | * Revision 1.11 1994/11/02 10:55:31 a904209 12 | * Add autoconf. Tested on SunOS/Solaris 13 | * 14 | * Revision 1.10 1994/10/04 17:12:50 a904209 15 | * 3rd pre-release 16 | * 17 | * Revision 1.9 1994/10/04 09:08:27 a904209 18 | * Next Patch merge 19 | * 20 | * Revision 1.8 1994/10/03 08:41:47 a904209 21 | * 2nd pre-release 22 | * 23 | * Revision 1.7 1994/09/19 15:48:29 a904209 24 | * Split hplay.c, gdbm dictionary, start of f0 contour, netaudio and HP ports 25 | * 26 | * Revision 1.6 1994/04/15 16:47:37 a904209 27 | * Edits for Solaris2.3 (aka SunOs 5.3) 28 | * 29 | * Revision 1.5 1994/02/24 15:03:05 a904209 30 | * Added contributed linux, NeXT and SGI ports. 31 | * 32 | * Revision 1.4 93/11/18 16:29:06 a904209 33 | * Migrated nsyth.c towards Jon's scheme - merge still incomplete 34 | * 35 | * Revision 1.3 93/11/16 14:32:44 a904209 36 | * Added RCS Ids, partial merge of Jon's new klatt/parwave 37 | * 38 | * Revision 1.3 93/11/16 14:00:58 a904209 39 | * Add IDs and merge Jon's klatt sources - incomplete 40 | * 41 | */ 42 | extern char *Revision; 43 | 44 | #include "stm32f4xx.h" 45 | //#include "platform_config.h" 46 | //#include "hw_config.h" 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include "nsynth.h" 53 | #include "darray.h" 54 | #include "holmes.h" 55 | #include "phtoelm.h" 56 | #include "say.h" 57 | 58 | 59 | 60 | 61 | 62 | short *pWavBuffer; 63 | darray_t wav_elm; 64 | unsigned short wav_len; 65 | 66 | void PhonemeToWaveData(char *phone, int len, int verbose) 67 | { 68 | unsigned frames; 69 | 70 | int i, j; 71 | 72 | darray_init(&wav_elm, sizeof(char), len); 73 | 74 | if((frames = phone_to_elm(phone, len, &wav_elm))){ 75 | 76 | unsigned max_samples = frames * klatt_global.nspfr; 77 | if (verbose){ 78 | printf("max_samples = %d\n", max_samples); 79 | } 80 | 81 | pWavBuffer = (short *) malloc(sizeof(short) * max_samples); 82 | 83 | if (verbose){ 84 | printf("%.*s\n", len, phone); 85 | } 86 | 87 | if (pWavBuffer){ 88 | wav_len = holmes( wav_elm.items, 89 | (unsigned char *) darray_find(&wav_elm, 0), 90 | max_samples, pWavBuffer ); 91 | 92 | if (verbose){ 93 | printf("wav_len = %d\n", wav_len); 94 | 95 | j = wav_len; 96 | if(j>256) j = 256; 97 | for(i=0;i 2 | /* trie.c 3 | */ 4 | 5 | #include "stm32f4xx.h" 6 | //#include "platform_config.h" 7 | //#include "hw_config.h" 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "trie.h" 13 | 14 | #include 15 | 16 | struct trie_s 17 | { 18 | struct trie_s *otherwise; 19 | struct trie_s *more; 20 | void *value; 21 | char ch; 22 | }; 23 | 24 | void trie_insert(trie_ptr *r, char *s, void *value) 25 | { 26 | trie_ptr p = NULL; 27 | char ch; 28 | while ((ch = *s++)) 29 | { 30 | while ((p = *r)) 31 | { 32 | if (p->ch == ch) 33 | break; 34 | else 35 | r = &p->otherwise; 36 | } 37 | if (!p) 38 | { 39 | p = (trie_ptr) malloc(sizeof(*p)); 40 | if(p){ 41 | memset(p, 0, sizeof(*p)); 42 | p->ch = ch; 43 | *r = p; 44 | }else{ 45 | // fprintf(stderr, "memory shortage (trie_insert)\n"); 46 | } 47 | } 48 | r = &p->more; 49 | } 50 | p->value = value; 51 | } 52 | 53 | void *trie_lookup(trie_ptr *r, char **sp) 54 | { 55 | char *s = *sp; 56 | char *value = NULL; 57 | char ch; 58 | 59 | //printf("----------------- trie_lookup BEGIN\n"); 60 | 61 | while ((ch = *s)) 62 | { 63 | //printf("ch=%c\n", (int)ch); 64 | 65 | trie_ptr *l = r; 66 | trie_ptr p; 67 | while ((p = *l)) 68 | { 69 | //printf("p->ch=%c\n", p->ch); 70 | 71 | if (p->ch == ch){ 72 | //printf("found ch=%c\n", (int)ch); 73 | break; 74 | }else{ 75 | l = &p->otherwise; 76 | } 77 | } 78 | 79 | if (p) 80 | { 81 | *l = p->otherwise; 82 | p->otherwise = *r; 83 | *r = p; 84 | r = &p->more; 85 | value = (char *) p->value; 86 | s++; 87 | } 88 | else 89 | break; 90 | } 91 | *sp = s; 92 | 93 | //printf("----------------- trie_lookup END\n"); 94 | 95 | return value; 96 | } 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/trie.c~: -------------------------------------------------------------------------------- 1 | #include 2 | /* trie.c 3 | */ 4 | 5 | #include "stm32f4xx.h" 6 | //#include "platform_config.h" 7 | //#include "hw_config.h" 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "trie.h" 13 | 14 | #include 15 | 16 | struct trie_s 17 | { 18 | struct trie_s *otherwise; 19 | struct trie_s *more; 20 | void *value; 21 | char ch; 22 | }; 23 | 24 | void trie_insert(trie_ptr *r, char *s, void *value) 25 | { 26 | trie_ptr p = NULL; 27 | char ch; 28 | while ((ch = *s++)) 29 | { 30 | while ((p = *r)) 31 | { 32 | if (p->ch == ch) 33 | break; 34 | else 35 | r = &p->otherwise; 36 | } 37 | if (!p) 38 | { 39 | p = (trie_ptr) malloc(sizeof(*p)); 40 | if(p){ 41 | memset(p, 0, sizeof(*p)); 42 | p->ch = ch; 43 | *r = p; 44 | }else{ 45 | fprintf(stderr, "memory shortage (trie_insert)\n"); 46 | } 47 | } 48 | r = &p->more; 49 | } 50 | p->value = value; 51 | } 52 | 53 | void *trie_lookup(trie_ptr *r, char **sp) 54 | { 55 | char *s = *sp; 56 | char *value = NULL; 57 | char ch; 58 | 59 | //printf("----------------- trie_lookup BEGIN\n"); 60 | 61 | while ((ch = *s)) 62 | { 63 | //printf("ch=%c\n", (int)ch); 64 | 65 | trie_ptr *l = r; 66 | trie_ptr p; 67 | while ((p = *l)) 68 | { 69 | //printf("p->ch=%c\n", p->ch); 70 | 71 | if (p->ch == ch){ 72 | //printf("found ch=%c\n", (int)ch); 73 | break; 74 | }else{ 75 | l = &p->otherwise; 76 | } 77 | } 78 | 79 | if (p) 80 | { 81 | *l = p->otherwise; 82 | p->otherwise = *r; 83 | *r = p; 84 | r = &p->more; 85 | value = (char *) p->value; 86 | s++; 87 | } 88 | else 89 | break; 90 | } 91 | *sp = s; 92 | 93 | //printf("----------------- trie_lookup END\n"); 94 | 95 | return value; 96 | } 97 | 98 | 99 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/trie.d: -------------------------------------------------------------------------------- 1 | lib/rsynth-2.0-port/trie.o: lib/rsynth-2.0-port/trie.c \ 2 | lib/rsynth-2.0-port/config.h lib/CMSIS/ST/STM32F4xx/Include/stm32f4xx.h \ 3 | lib/CMSIS/Include/core_cm4.h \ 4 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint.h \ 5 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdint-gcc.h \ 6 | lib/CMSIS/Include/core_cmInstr.h lib/CMSIS/Include/core_cmFunc.h \ 7 | lib/CMSIS/Include/core_cm4_simd.h \ 8 | lib/CMSIS/ST/STM32F4xx/Include/system_stm32f4xx.h inc/stm32f4xx_conf.h \ 9 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_adc.h \ 10 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_can.h \ 11 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h \ 12 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_cryp.h \ 13 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dac.h \ 14 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dbgmcu.h \ 15 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dcmi.h \ 16 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma.h \ 17 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_exti.h \ 18 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h \ 19 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_fsmc.h \ 20 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_hash.h \ 21 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h \ 22 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_i2c.h \ 23 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_iwdg.h \ 24 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_pwr.h \ 25 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h \ 26 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rng.h \ 27 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rtc.h \ 28 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_sdio.h \ 29 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_spi.h \ 30 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_syscfg.h \ 31 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h \ 32 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_usart.h \ 33 | lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_wwdg.h \ 34 | lib/STM32F4xx_StdPeriph_Driver/inc/misc.h inc/platform_config.h \ 35 | inc/hw_config.h \ 36 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdio.h \ 37 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 38 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/newlib.h \ 39 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/config.h \ 40 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/ieeefp.h \ 41 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/features.h \ 42 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stddef.h \ 43 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdarg.h \ 44 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/reent.h \ 45 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/_ansi.h \ 46 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/_types.h \ 47 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_types.h \ 48 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/_default_types.h \ 49 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/lock.h \ 50 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/types.h \ 51 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/types.h \ 52 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/stdio.h \ 53 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/stdlib.h \ 54 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/machine/stdlib.h \ 55 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/alloca.h \ 56 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/string.h \ 57 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/cdefs.h \ 58 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/sys/string.h \ 59 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/inttypes.h \ 60 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/include/stdbool.h \ 61 | inc/stm32f4xx_it.h inc/stm32f4xx_conf.h inc/platform_config.h \ 62 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery.h \ 63 | lib/Utilities/STM32F4-Discovery/stm32f4_discovery_audio_codec.h \ 64 | inc/systick.h inc/uart_support.h inc/monitor.h inc/term_io.h \ 65 | inc/hw_config.h lib/rsynth-2.0-port/trie.h \ 66 | /opt/ARM/arm-linaro-eabi-4.6/lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/include/ctype.h 67 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/trie.h: -------------------------------------------------------------------------------- 1 | /* trie.h 2 | */ 3 | typedef struct trie_s *trie_ptr; 4 | 5 | extern void trie_insert (trie_ptr *r,char *s,void *value); 6 | extern void *trie_lookup (trie_ptr *r,char **sp); 7 | -------------------------------------------------------------------------------- /src/rsynth-2.0-port/useconfig.h: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_SYS_TYPES_H 2 | #include 3 | #endif 4 | 5 | #if STDC_HEADERS 6 | #include 7 | #include 8 | #include 9 | #else 10 | #ifndef HAVE_STRCHR 11 | #define strchr index 12 | #define strrchr rindex 13 | #endif 14 | char *strchr (), *strrchr (); 15 | #ifndef HAVE_MEMCPY 16 | #define memcpy(d, s, n) bcopy ((s), (d), (n)) 17 | #endif 18 | #ifdef HAVE_MALLOC_H 19 | #include 20 | #endif 21 | #endif /* STDC_HEADERS */ 22 | 23 | #if HAVE_UNISTD_H 24 | #include 25 | #endif 26 | 27 | #if HAVE_LIBC_H 28 | /* From NeXT stuff */ 29 | #include 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /src/rsynth_2005/elements.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1994,2001-2003 Nick Ing-Simmons. All rights reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library 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 GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 17 | MA 02111-1307, USA 18 | 19 | */ 20 | #include 21 | #include "stm32f4xx.h" 22 | #include 23 | #include 24 | #include "rsynth.h" 25 | #include "phfeat.h" 26 | 27 | Elm_t Elementz[] __attribute__ ((section (".flash"))) = { 28 | #include "Elements.def" 29 | }; 30 | 31 | unsigned num_Elementz = (sizeof(Elementz) / sizeof(Elm_t)); 32 | 33 | char *Ep_namez[nEparm] = { 34 | "fn", "f1", "f2", "f3", 35 | "b1", "b2", "b3", "pn", 36 | "a2", "a3", "a4", 37 | "a5", "a6", "ab", "av", 38 | "avc", "asp", "af" 39 | }; 40 | 41 | speaker_t pars; 42 | 43 | speaker_t * 44 | rsynth_speaker(float F0Hz, float gain, Elm_t * e) 45 | { 46 | // memset(&pars,-1,sizeof(pars)); 47 | pars.F0Hz = F0Hz; 48 | 49 | /* Quasi fixed parameters */ 50 | pars.Gain0 = gain; 51 | pars.F4hz = 3900; 52 | pars.B4hz = 400; 53 | pars.F5hz = 4700; 54 | pars.B5hz = 150; 55 | pars.F6hz = 4900; 56 | pars.B6hz = 150; 57 | 58 | pars.B4phz = 500; 59 | pars.B5phz = 600; 60 | pars.B6phz = 800; 61 | 62 | pars.BNhz = 500; 63 | 64 | /* Set the _fixed_ nasal pole to nasal zero frequency of the 0th element 65 | (which should NOT be a nasal!) as a typical example of the zero 66 | we wish to cancel 67 | 68 | */ 69 | pars.FNPhz = (long) e->p[fn].stdy; 70 | return &pars; 71 | } 72 | -------------------------------------------------------------------------------- /src/rsynth_2005/elements.c~: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1994,2001-2003 Nick Ing-Simmons. All rights reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library 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 GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 17 | MA 02111-1307, USA 18 | 19 | */ 20 | #include 21 | /* $Id: //depot/rsynth/elements.c#11 $ 22 | */ 23 | char *elements_id = "$Id: //depot/rsynth/elements.c#11 $"; 24 | #include 25 | #include 26 | #include "rsynth.h" 27 | #include "phfeat.h" 28 | 29 | 30 | Elm_t Elements[] = { 31 | #include "Elements.def" 32 | }; 33 | 34 | unsigned num_Elements = (sizeof(Elements) / sizeof(Elm_t)); 35 | 36 | char *Ep_name[nEparm] = { 37 | "fn", "f1", "f2", "f3", 38 | "b1", "b2", "b3", "pn", 39 | "a2", "a3", "a4", 40 | "a5", "a6", "ab", "av", 41 | "avc", "asp", "af" 42 | }; 43 | 44 | speaker_t * 45 | rsynth_speaker(float F0Hz, float gain, Elm_t * e) 46 | { 47 | static speaker_t pars; 48 | // memset(&pars,-1,sizeof(pars)); 49 | pars.F0Hz = F0Hz; 50 | 51 | /* Quasi fixed parameters */ 52 | pars.Gain0 = gain; 53 | pars.F4hz = 3900; 54 | pars.B4hz = 400; 55 | pars.F5hz = 4700; 56 | pars.B5hz = 150; 57 | pars.F6hz = 4900; 58 | pars.B6hz = 150; 59 | 60 | pars.B4phz = 500; 61 | pars.B5phz = 600; 62 | pars.B6phz = 800; 63 | 64 | pars.BNhz = 500; 65 | 66 | /* Set the _fixed_ nasal pole to nasal zero frequency of the 0th element 67 | (which should NOT be a nasal!) as a typical example of the zero 68 | we wish to cancel 69 | 70 | */ 71 | pars.FNPhz = (long) e->p[fn].stdy; 72 | return &pars; 73 | } 74 | -------------------------------------------------------------------------------- /src/rsynth_2005/elements.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/rsynth_2005/elements.o -------------------------------------------------------------------------------- /src/rsynth_2005/holmes.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/rsynth_2005/holmes.o -------------------------------------------------------------------------------- /src/rsynth_2005/opsynth.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/rsynth_2005/opsynth.o -------------------------------------------------------------------------------- /src/rsynth_2005/phfeat.h: -------------------------------------------------------------------------------- 1 | #define unr 0x00000000 2 | #define rnd 0x00000001 3 | #define low 0x00000002 4 | #define lmd 0x00000004 5 | #define mdl 0x00000008 6 | #define smh 0x00000010 7 | #define lax 0x00000020 8 | #define hgh 0x00000040 9 | #define bck 0x00000080 10 | #define cnt 0x00000100 11 | #define fnt 0x00000200 12 | #define vwl 0x00000400 13 | #define dip 0x00000800 14 | #define blb 0x00001000 15 | #define stl 0x00002000 16 | #define vls 0x00004000 17 | #define stp 0x00008000 18 | #define vcd 0x00010000 19 | #define alv 0x00020000 20 | #define vel 0x00040000 21 | #define glt 0x00080000 22 | #define nas 0x00100000 23 | #define tap 0x00200000 24 | #define apr 0x00400000 25 | #define rzd 0x00800000 26 | #define frc 0x01000000 27 | #define lbd 0x02000000 28 | #define dnt 0x04000000 29 | #define pla 0x08000000 30 | #define lat 0x10000000 31 | #define gld 0x20000000 32 | #define lbv 0x40000000 33 | #define pal 0x80000000 34 | -------------------------------------------------------------------------------- /src/rsynth_2005/rsynth.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 1994,2001-2003 Nick Ing-Simmons. All rights reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Library General Public 6 | License as published by the Free Software Foundation; either 7 | version 2 of the License, or (at your option) any later version. 8 | 9 | This library 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 GNU 12 | Library General Public License for more details. 13 | 14 | You should have received a copy of the GNU Library General Public 15 | License along with this library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 17 | MA 02111-1307, USA 18 | 19 | */ 20 | #ifndef RSYNTH_H 21 | #define RSYNTH_H 22 | 23 | 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | 30 | typedef struct 31 | {float stdy; /* steady state value of paramter */ 32 | char prop; /* Percentage of 'stdy' to add to adjacent element */ 33 | char ed; /* External Duration of transition */ 34 | char id; /* Internal Duration of transition */ 35 | char rk; /* Rank of this element for transition dominance */ 36 | } interp_t, *interp_ptr; 37 | 38 | /* 39 | fn Nasal zero freq in Hz, 248 to 528 40 | f1 First formant freq in Hz, 200 to 1300 41 | f2 Second formant freq in Hz, 550 to 3000 42 | f3 Third formant freq in Hz, 1200 to 4999 43 | b1 First formant bw in Hz, 40 to 1000 44 | b2 Second formant bw in Hz, 40 to 1000 45 | b3 Third formant bw in Hz, 40 to 1000 46 | pn Proportion of nasal, 0 to 1 47 | a2 Amp of F2 frication in dB, 0 to 57 48 | a3 Amp of F3 frication in dB, 0 to 50 49 | a4 Amp of F4 frication in dB, 0 to 46 50 | a5 Amp of F5 frication in dB, 0 to 40 51 | a6 Amp of F6 frication in dB, 0 to 43 52 | ab Amp of bypass fric. in dB, 0 to 48 53 | av Amp of voicing in dB, 0 to 70 54 | avc Amp of lf voice, 0 to 60 55 | asp Amp of aspiration in dB, 0 to 34 56 | af Amp of frication in dB, 0 to 60 57 | */ 58 | 59 | enum Eparm_e 60 | { 61 | fn, f1, f2, f3, b1, b2, b3, pn, a2, a3, a4, a5, a6, ab, av, avc, asp, af, 62 | nEparm 63 | }; 64 | 65 | extern char *Ep_namez[nEparm]; 66 | 67 | typedef struct Elm_s 68 | { 69 | char *name; /* name of element */ 70 | char rk; /* Rank of element (obsolete) */ 71 | char du; /* Normal duration */ 72 | char ud; /* Unstressed duration */ 73 | unsigned char *unicode; /* UTF-8 for phonetic symbols */ 74 | char *sampa; /* SAMPA string for phonetic symbol */ 75 | long feat; /* features of the phone */ 76 | interp_t p[nEparm]; /* Table of parameter values */ 77 | } Elm_t, *Elm_ptr; 78 | 79 | extern Elm_t Elementz[]; 80 | extern unsigned num_Elementz; 81 | 82 | typedef struct 83 | { 84 | float Gain0; /* Overall gain, 60 dB is unity, 0 to 60 */ 85 | float F0Hz; /* Typical voicing frequency */ 86 | float F4hz; /* Fourth formant freq in Hz, 1200 to 4999 */ 87 | float B4hz; /* Fourth formant bw in Hz, 40 to 1000 */ 88 | float F5hz; /* Fifth formant freq in Hz, 1200 to 4999 */ 89 | float B5hz; /* Fifth formant bw in Hz, 40 to 1000 */ 90 | float F6hz; /* Sixth formant freq in Hz, 1200 to 4999 */ 91 | float B6hz; /* Sixth formant bw in Hz, 40 to 2000 */ 92 | float FNPhz; /* Nasal pole freq in Hz, 248 to 528 */ 93 | float BNhz; /* Nasal pole/zero bw in Hz, 40 to 1000 */ 94 | float B4phz; /* Par. 4th formant bw in Hz, 40 to 1000 */ 95 | float B5phz; /* Par. 5th formant bw in Hz, 40 to 1000 */ 96 | float B6phz; /* Par. 6th formant bw in Hz, 40 to 2000 */ 97 | } speaker_t; 98 | 99 | 100 | typedef struct rsynth_s rsynth_t; 101 | 102 | int16_t rsynth_frame_single(rsynth_t * rsynth, float F0Hz, float *frame); 103 | 104 | struct rsynth_s 105 | { 106 | long flags; /* Various flag bits */ 107 | long sr; /* sample rate */ 108 | long samples_frame; /* Number of samples in a frame */ 109 | speaker_t *speaker; /* Current speaker (voice) characteristics */ 110 | float *ep; /* Paramters for current frame */ 111 | float speed; /* element duration multiplier */ 112 | float smooth; /* smoothing "filter" coefficent for parameters */ 113 | float testit; 114 | struct rsynth_private *pvt; /* Private data to backend synth */ 115 | }; 116 | 117 | #define RSYNTH_VERBOSE (1L << 0) 118 | #define RSYNTH_ETRACE (1L << 1) 119 | #define RSYNTH_MONOTONE (1L << 2) 120 | #define RSYNTH_F0TRACE (1L << 3) 121 | 122 | speaker_t *rsynth_speaker(float F0Hz, float gain, Elm_t *elements); 123 | 124 | void rsynth_init(long samrate, 125 | float ms_per_frame); 126 | 127 | 128 | 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /src/sam.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/sam.c -------------------------------------------------------------------------------- /src/sam.h: -------------------------------------------------------------------------------- 1 | #ifndef SAM_H 2 | #define SAM_H 3 | 4 | #include "audio.h" 5 | 6 | void SetInput(char *_input); 7 | void SetSpeed(unsigned char _speed); 8 | void SetPitch(unsigned char _pitch); 9 | void SetMouth(unsigned char _mouth); 10 | void SetThroat(unsigned char _throat); 11 | void EnableSingmode(); 12 | void EnableDebug(); 13 | 14 | void sam_init(); 15 | void sam_newsay_banks0(); 16 | void sam_newsay_TTS(); 17 | void sam_newsay_phon(); 18 | void sam_newsay_phonsing(); 19 | void sam_newsay_xy(); 20 | void sam_newsay_param(); 21 | void sam_newsay_banks0fix(void); 22 | 23 | u8 sam_get_sample_banks0(int16_t *newsample); 24 | u8 sam_get_sample_banks1(int16_t *newsample); 25 | u8 sam_get_sample_TTS(int16_t *newsample); 26 | u8 sam_get_sample_TTSs(int16_t *newsample); 27 | u8 sam_get_sample_phon(int16_t *newsample); 28 | u8 sam_get_sample_phons(int16_t *newsample); 29 | u8 sam_get_sample_phonsing(int16_t *newsample); 30 | u8 sam_get_sample_xy(int16_t *newsample); 31 | u8 sam_get_sample_param(int16_t *newsample); 32 | u8 sam_get_sample_bend(int16_t *newsample); 33 | 34 | int16_t sam_get_sample_banks0a(); // wrappingS below!!!! 35 | int16_t sam_get_sample_banks1a(); 36 | int16_t sam_get_sample_TTSa(); 37 | int16_t sam_get_sample_TTSsa(); 38 | int16_t sam_get_sample_phona(); 39 | int16_t sam_get_sample_phonsa(); 40 | int16_t sam_get_sample_phonsinga(); 41 | int16_t sam_get_sample_xya(); 42 | int16_t sam_get_sample_parama(); 43 | int16_t sam_get_sample_benda(); 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /src/sam_lap.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/sam_lap.c -------------------------------------------------------------------------------- /src/saml.h: -------------------------------------------------------------------------------- 1 | #ifndef SAM_H 2 | #define SAM_H 3 | 4 | #include "audio.h" 5 | 6 | /* 7 | typedef unsigned char uint8_t; 8 | typedef unsigned char u8; 9 | typedef signed char int8_t; 10 | typedef unsigned short uint16_t; 11 | typedef unsigned short u16; 12 | typedef unsigned short u16; 13 | typedef signed short int16_t; 14 | typedef unsigned int uint32_t; 15 | typedef signed int int32_t; 16 | */ 17 | 18 | void SetInput(char *_input); 19 | void SetSpeed(unsigned char _speed); 20 | void SetPitch(unsigned char _pitch); 21 | void SetMouth(unsigned char _mouth); 22 | void SetThroat(unsigned char _throat); 23 | void EnableSingmode(); 24 | void EnableDebug(); 25 | 26 | int sam_init(); 27 | u8 sam_newsay(); 28 | int SAMMain(); 29 | int16_t sam_get_sample(); 30 | 31 | //char input[]={"/HAALAOAO MAYN NAAMAEAE IHSTT SAEBAASTTIHAAN \x9b\x9b\0"}; 32 | //unsigned char input[]={"/HAALAOAO \x9b\0"}; 33 | //unsigned char input[]={"AA \x9b\0"}; 34 | //unsigned char input[] = {"GUH5DEHN TAEG\x9b\0"}; 35 | 36 | //unsigned char input[]={"/HEH3LOW2, /HAW AH YUX2 TUXDEY. AY /HOH3P YUX AH FIYLIHNX OW4 KEY.\x9b\0"}; 37 | //unsigned char input[]={"/HEY2, DHIHS IH3Z GREY2T. /HAH /HAH /HAH.AYL BIY5 BAEK.\x9b\0"}; 38 | //unsigned char input[]={"/HAH /HAH /HAH \x9b\0"}; 39 | //unsigned char input[]={"/HAH /HAH /HAH.\x9b\0"}; 40 | //unsigned char input[]={".TUW BIY5Y3,, OHR NAA3T - TUW BIY5IYIY., DHAE4T IHZ DHAH KWEH4SCHAHN.\x9b\0"}; 41 | //unsigned char input[]={"/HEY2, DHIHS \x9b\0"}; 42 | 43 | //unsigned char input[]={" IYIHEHAEAAAHAOOHUHUXERAXIX \x9b\0"}; 44 | //unsigned char input[]={" RLWWYMNNXBDGJZZHVDH \x9b\0"}; 45 | //unsigned char input[]={" SSHFTHPTKCH/H \x9b\0"}; 46 | 47 | //unsigned char input[]={" EYAYOYAWOWUW ULUMUNQ YXWXRXLX/XDX\x9b\0"}; 48 | 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /src/samll.h: -------------------------------------------------------------------------------- 1 | #ifndef SAM_H 2 | #define SAM_H 3 | 4 | //#include "audio.h" 5 | 6 | 7 | typedef unsigned char uint8_t; 8 | typedef unsigned char u8; 9 | typedef signed char int8_t; 10 | typedef unsigned short uint16_t; 11 | typedef unsigned short u16; 12 | typedef unsigned short u16; 13 | typedef signed short int16_t; 14 | typedef unsigned int uint32_t; 15 | typedef signed int int32_t; 16 | 17 | 18 | void SetInput(char *_input); 19 | void SetSpeed(unsigned char _speed); 20 | void SetPitch(unsigned char _pitch); 21 | void SetMouth(unsigned char _mouth); 22 | void SetThroat(unsigned char _throat); 23 | void EnableSingmode(); 24 | void EnableDebug(); 25 | 26 | int sam_init(); 27 | u8 sam_newsay(); 28 | int SAMMain(); 29 | int16_t sam_get_sample(); 30 | 31 | //char input[]={"/HAALAOAO MAYN NAAMAEAE IHSTT SAEBAASTTIHAAN \x9b\x9b\0"}; 32 | //unsigned char input[]={"/HAALAOAO \x9b\0"}; 33 | //unsigned char input[]={"AA \x9b\0"}; 34 | //unsigned char input[] = {"GUH5DEHN TAEG\x9b\0"}; 35 | 36 | //unsigned char input[]={"/HEH3LOW2, /HAW AH YUX2 TUXDEY. AY /HOH3P YUX AH FIYLIHNX OW4 KEY.\x9b\0"}; 37 | //unsigned char input[]={"/HEY2, DHIHS IH3Z GREY2T. /HAH /HAH /HAH.AYL BIY5 BAEK.\x9b\0"}; 38 | //unsigned char input[]={"/HAH /HAH /HAH \x9b\0"}; 39 | //unsigned char input[]={"/HAH /HAH /HAH.\x9b\0"}; 40 | //unsigned char input[]={".TUW BIY5Y3,, OHR NAA3T - TUW BIY5IYIY., DHAE4T IHZ DHAH KWEH4SCHAHN.\x9b\0"}; 41 | //unsigned char input[]={"/HEY2, DHIHS \x9b\0"}; 42 | 43 | //unsigned char input[]={" IYIHEHAEAAAHAOOHUHUXERAXIX \x9b\0"}; 44 | //unsigned char input[]={" RLWWYMNNXBDGJZZHVDH \x9b\0"}; 45 | //unsigned char input[]={" SSHFTHPTKCH/H \x9b\0"}; 46 | 47 | //unsigned char input[]={" EYAYOYAWOWUW ULUMUNQ YXWXRXLX/XDX\x9b\0"}; 48 | 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /src/samplerate.h: -------------------------------------------------------------------------------- 1 | void samplerate_init(); 2 | 3 | //void samplerate(int16_t* in, int16_t* out, float factor, u8 size, int16_t(*getsample)(void), void(*newsay)(void), float sampleratio); 4 | void samplerate_simple(int16_t* out, float factor, u8 size, int16_t(*getsample)(void), void(*newsay)(void), float sampleratio, u8 triggered); 5 | 6 | void samplerate_exy(int16_t* out, float factor, u8 size, int16_t(*getsample)(void), void(*newsay)(void), float sampleratio, u8 extent, u8 triggered); 7 | 8 | void samplerate_simple_exy(int16_t* out, float factor, u8 size, int16_t(*getsample)(void), float sampleratio, u8 extent, u8 triggered); 9 | 10 | void samplerate_simple_exy_trigger(int16_t* out, float factor, u8 size, int16_t(*getsample)(void), void(*newsay)(void), float sampleratio, u8 extent, u8 triggered); 11 | -------------------------------------------------------------------------------- /src/simpleklatt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Martin Howse 3 | * Copyright (C) 2013 Reece H. Dunn 4 | * (c) 1993,94 Jon Iles and Nick Ing-Simmons 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #include "audio.h" 21 | #include "stdlib.h" 22 | #include "stdint.h" 23 | #include 24 | #include "parwave.h" 25 | #include "resources.h" 26 | 27 | /* for default sampled glottal excitation waveform */ 28 | 29 | #define NUMBER_OF_SAMPLES 100 30 | //#define SAMPLE_FACTOR 0.00001 // this is too low - hardcoded in parwave 31 | 32 | static int16_t *iwave; 33 | static int16_t isam; 34 | static int16_t icount; 35 | static int16_t nmspf_def; 36 | static klatt_global_ptrr globals; 37 | // klatt_frame_ptrr frame; 38 | static unsigned char high_byte; 39 | static unsigned char low_byte; 40 | static flag raw_flag; 41 | static flag raw_type; 42 | 43 | static int16_t frame[40]; 44 | extern float exy[240]; 45 | extern float _selx, _sely, _selz; 46 | 47 | static const int16_t natural_samples[NUMBER_OF_SAMPLES]= // unused source 48 | { 49 | -310,-400,530,356,224,89,23,-10,-58,-16,461,599,536,701,770, 50 | 605,497,461,560,404,110,224,131,104,-97,155,278,-154,-1165, 51 | -598,737,125,-592,41,11,-247,-10,65,92,80,-304,71,167,-1,122, 52 | 233,161,-43,278,479,485,407,266,650,134,80,236,68,260,269,179, 53 | 53,140,275,293,296,104,257,152,311,182,263,245,125,314,140,44, 54 | 203,230,-235,-286,23,107,92,-91,38,464,443,176,98,-784,-2449, 55 | -1891,-1045,-1600,-1462,-1384,-1261,-949,-730 56 | }; 57 | 58 | // check parameters: see klattparams - could be good to have contour morphing (snap on trigger) 59 | // param0 is fund freq, param39 is volume 60 | 61 | static const int16_t mins[40] __attribute__ ((section (".flash"))) = {200, 0, 200, 40, 550, 40, 1200, 40, 1200, 40, 1200, 40, 1200, 40, 248, 40, 248, 40, 0, 10, 0, 0, 0, 0, 0, 40, 0, 40, 0, 40, 0, 40, 0, 40, 0, 40, 0, 0, 0, 0}; 62 | 63 | //static const int16_t maxs[40] __attribute__ ((section (".flash"))) = {4000, 70, 1300, 1000, 3000, 1000, 4999, 1000, 4999, 1000, 4999, 1000, 4999, 2000, 528, 1000, 528, 1000, 70, 65, 80, 24, 80, 40, 80, 1000, 80, 1000, 80, 1000, 80, 1000, 80, 1000, 80, 2000, 80, 80, 70, 60}; 64 | 65 | 66 | 67 | static const int16_t range[40] __attribute__ ((section (".flash"))) ={3800, 70, 1100, 960, 2450, 960, 3799, 960, 3799, 960, 3799, 960, 3799, 1960, 280, 960, 280, 960, 40, 55, 40, 20, 40, 40, 80, 960, 80, 960, 80, 960, 80, 960, 80, 960, 80, 1960, 80, 40, 40, 40}; // changed some of range 68 | 69 | // after 280 is nasal bw, asp ampX-reduced, 70 | 71 | static klatt_global_tt globale; 72 | 73 | 74 | void simpleklatt_init(void){ 75 | 76 | // straightwormy=addworm(10.0f,10.0f,100.0f, 100.0f, straightworm); 77 | 78 | globals=&globale; 79 | 80 | // globals = (klatt_global_ptrr)malloc(sizeof(klatt_global_tt)); 81 | // frame = (klatt_frame_ptrr)malloc(sizeof(klatt_frame_tt)); 82 | // framer framezz[40]; 83 | // frame_init(globals,simpleklattset.val); 84 | 85 | globals->synthesis_model = 0; // all_parallel=1 cascade=0 86 | globals->samrate = 16000; 87 | globals->glsource = 1; // 1=impulsive 2=glottal impulse 3=sampled as above =1 88 | globals->natural_samples = natural_samples; 89 | globals->num_samples = NUMBER_OF_SAMPLES; 90 | // globals->sample_factor = (float) SAMPLE_FACTOR; 91 | nmspf_def = 10; 92 | globals->nfcascade = 6; 93 | globals->f0_flutter = 0; // fix this! 94 | 95 | unsigned char y; 96 | 97 | // or this could be 32 for audio.c frame 98 | 99 | globals->nspfr = (globals->samrate * nmspf_def) / 100; // was / 1000// number of samples per frame = 320000 /1000 = 320 100 | simple_parwave_init(globals); 101 | } 102 | 103 | void generate_exy_frame(int16_t* frame){ 104 | unsigned char y; 105 | 106 | for (y=0;y<39;y++){ 107 | frame[y]=mins[y] + (range[y]*(1.0f-exy[y])); 108 | } 109 | frame[39]=42; // FIXED volume - higher if we revert to all parallel 110 | } 111 | 112 | static uint16_t samplenumber=0; 113 | 114 | 115 | int16_t simpleklatt_get_sample(){ 116 | u8 x=0; 117 | int16_t sampel; 118 | 119 | sampel=single_single_parwave(globals, frame); 120 | 121 | samplenumber++; 122 | if (samplenumber>globals->nspfr*_selz*4.0f) { // greater than what???? 320 samples - this can be our selz???? 123 | // end of frame so...???? 124 | samplenumber=0; 125 | simpleklatt_newsay(); 126 | } 127 | return sampel; 128 | } 129 | 130 | void simpleklatt_newsay(){ 131 | // generate the frame from our exy -> frame 132 | generate_exy_frame(frame); 133 | frame_init(globals,frame); 134 | samplenumber=0; 135 | // if (globals->f0_flutter != 0) 136 | // flutter(globals,frame); 137 | globals->ns=0; 138 | } 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/sp0256.h: -------------------------------------------------------------------------------- 1 | #include "stm32f4xx.h" 2 | #include "arm_math.h" 3 | #include "stdlib.h" 4 | #include "stdint.h" 5 | #include "arm_const_structs.h" 6 | 7 | void sp0256_raw_init(void); 8 | void sp0256_initbend(void); 9 | void sp0256_init(void); 10 | 11 | void sp0256_retriggerTTS(void); 12 | 13 | int16_t sp0256_get_sample(void); 14 | void sp0256_newsay(void); 15 | 16 | int16_t sp0256_get_samplebend(void); 17 | void sp0256_newsaybend(void); 18 | 19 | int16_t sp0256_get_sampleTTS(void); 20 | void sp0256_newsayTTS(void); 21 | 22 | int16_t sp0256_get_samplevocabbankone(void); 23 | void sp0256_newsayvocabbankone(u8 reset); 24 | 25 | int16_t sp0256_get_samplevocabbanktwo(void); 26 | void sp0256_newsayvocabbanktwo(u8 reset); 27 | 28 | void sp0256_newsayvocabbankonea(); 29 | void sp0256_newsayvocabbanktwoa(); 30 | 31 | 32 | int16_t sp0256_get_sample1219(void); 33 | void sp0256_newsay1219(void); 34 | 35 | int16_t sp0256_get_sampleraw(void); 36 | int16_t sp0256_get_sample_sing(void); 37 | void sp0256_newsayraw(void); 38 | 39 | int16_t sp0256_get_sample_withLPC(int16_t samp); 40 | -------------------------------------------------------------------------------- /src/startup_stm32f4xx.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/startup_stm32f4xx.lst -------------------------------------------------------------------------------- /src/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/stm32_flash.ld -------------------------------------------------------------------------------- /src/stm32f407.ld: -------------------------------------------------------------------------------- 1 | /* 2 | Linker script for STM32F407 3 | */ 4 | 5 | /* Entry Point */ 6 | ENTRY(Reset_Handler) 7 | 8 | /* Highest address of the user mode stack */ 9 | _estack = 0x2001c000; /* end of 112K RAM */ 10 | 11 | /* Generate a link error if heap and stack don't fit into RAM */ 12 | _Min_Heap_Size = 0; /* required amount of heap */ 13 | _Min_Stack_Size = 0x800; /* required amount of stack */ 14 | 15 | /* Specify the memory areas */ 16 | MEMORY 17 | { 18 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K 19 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K 20 | CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64k 21 | } 22 | 23 | /* Define output sections */ 24 | SECTIONS 25 | { 26 | /* The startup code goes first into FLASH */ 27 | .isr_vector : 28 | { 29 | . = ALIGN(4); 30 | KEEP(*(.isr_vector)) /* Startup code */ 31 | . = ALIGN(4); 32 | } >FLASH 33 | 34 | /* The program code and other data goes into FLASH */ 35 | .text : 36 | { 37 | . = ALIGN(4); 38 | *(.text) /* .text sections (code) */ 39 | *(.text*) /* .text* sections (code) */ 40 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 41 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 42 | *(.glue_7) /* glue arm to thumb code */ 43 | *(.glue_7t) /* glue thumb to arm code */ 44 | *(.eh_frame) 45 | 46 | KEEP (*(.init)) 47 | KEEP (*(.fini)) 48 | 49 | . = ALIGN(4); 50 | _etext = .; /* define a global symbols at end of code */ 51 | } >FLASH 52 | 53 | 54 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 55 | .ARM : { 56 | __exidx_start = .; 57 | *(.ARM.exidx*) 58 | __exidx_end = .; 59 | } >FLASH 60 | 61 | .preinit_array : 62 | { 63 | PROVIDE_HIDDEN (__preinit_array_start = .); 64 | KEEP (*(.preinit_array*)) 65 | PROVIDE_HIDDEN (__preinit_array_end = .); 66 | } >FLASH 67 | .init_array : 68 | { 69 | PROVIDE_HIDDEN (__init_array_start = .); 70 | KEEP (*(SORT(.init_array.*))) 71 | KEEP (*(.init_array*)) 72 | PROVIDE_HIDDEN (__init_array_end = .); 73 | } >FLASH 74 | .fini_array : 75 | { 76 | PROVIDE_HIDDEN (__fini_array_start = .); 77 | KEEP (*(.fini_array*)) 78 | KEEP (*(SORT(.fini_array.*))) 79 | PROVIDE_HIDDEN (__fini_array_end = .); 80 | } >FLASH 81 | 82 | /* used by the startup to initialize data */ 83 | _sidata = .; 84 | 85 | /* Initialized data sections goes into RAM, load LMA copy after code */ 86 | .data : AT ( _sidata ) 87 | { 88 | . = ALIGN(4); 89 | _sdata = .; /* create a global symbol at data start */ 90 | *(.data) /* .data sections */ 91 | *(.data*) /* .data* sections */ 92 | 93 | . = ALIGN(4); 94 | _edata = .; /* define a global symbol at data end */ 95 | } >RAM 96 | 97 | /* Uninitialized data section */ 98 | . = ALIGN(4); 99 | .bss : 100 | { 101 | /* This is used by the startup in order to initialize the .bss secion */ 102 | _sbss = .; /* define a global symbol at bss start */ 103 | __bss_start__ = _sbss; 104 | *(.bss) 105 | *(.bss*) 106 | *(COMMON) 107 | 108 | . = ALIGN(4); 109 | _ebss = .; /* define a global symbol at bss end */ 110 | __bss_end__ = _ebss; 111 | } >RAM 112 | 113 | /* User_heap_stack section, used to check that there is enough RAM left */ 114 | ._user_heap_stack : 115 | { 116 | . = ALIGN(4); 117 | PROVIDE ( end = . ); 118 | PROVIDE ( _end = . ); 119 | . = . + _Min_Heap_Size; 120 | . = . + _Min_Stack_Size; 121 | . = ALIGN(4); 122 | } >RAM 123 | 124 | /* CCM section, vars must be located here explicitly */ 125 | /* Example: int foo __attribute__ ((section (".ccmdata"))); */ 126 | .ccm_data : 127 | { 128 | *(.ccmdata) 129 | *(.ccmdata*) 130 | } >CCM 131 | 132 | .ARM.attributes 0 : { *(.ARM.attributes) } 133 | } 134 | -------------------------------------------------------------------------------- /src/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/stm32f4xx.h -------------------------------------------------------------------------------- /src/stm32f4xx_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Audio_playback_and_record/inc/stm32f40x_conf.h 4 | * @author MCD Application Team 5 | * @version V1.0.0 6 | * @date 28-October-2011 7 | * @brief Library configuration file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F40x_CONF_H 24 | #define __STM32F40x_CONF_H 25 | 26 | #if defined (HSE_VALUE) 27 | /* Redefine the HSE value; it's equal to 8 MHz on the STM32F4-DISCOVERY Kit */ 28 | #undef HSE_VALUE 29 | #define HSE_VALUE ((uint32_t)8000000) 30 | #endif /* HSE_VALUE */ 31 | 32 | /* Includes ------------------------------------------------------------------*/ 33 | /* Uncomment the line below to enable peripheral header file inclusion */ 34 | //#include "stm32f4xx_adc.h" 35 | //#include "stm32f4xx_can.h" 36 | //#include "stm32f4xx_crc.h" 37 | //#include "stm32f4xx_cryp.h" 38 | //#include "stm32f4xx_dac.h" 39 | //#include "stm32f4xx_dbgmcu.h" 40 | //#include "stm32f4xx_dcmi.h" 41 | //#include "stm32f4xx_dma.h" 42 | //#include "stm32f4xx_exti.h" 43 | //#include "stm32f4xx_flash.h" 44 | //#include "stm32f4xx_fsmc.h" 45 | //#include "stm32f4xx_hash.h" 46 | #include "stm32f4xx_gpio.h" 47 | #include "stm32f4xx_i2c.h" 48 | //#include "stm32f4xx_iwdg.h" 49 | //#include "stm32f4xx_pwr.h" 50 | #include "stm32f4xx_rcc.h" 51 | //#include "stm32f4xx_rng.h" 52 | //#include "stm32f4xx_rtc.h" 53 | //#include "stm32f4xx_sdio.h" 54 | #include "stm32f4xx_spi.h" 55 | //#include "stm32f4xx_syscfg.h" 56 | //#include "stm32f4xx_tim.h" 57 | //#include "stm32f4xx_usart.h" 58 | //#include "stm32f4xx_wwdg.h" 59 | //#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ 60 | 61 | /* Exported types ------------------------------------------------------------*/ 62 | /* Exported constants --------------------------------------------------------*/ 63 | 64 | /* If an external clock source is used, then the value of the following define 65 | should be set to the value of the external clock source, else, if no external 66 | clock is used, keep this define commented */ 67 | /*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */ 68 | 69 | 70 | /* Uncomment the line below to expanse the "assert_param" macro in the 71 | Standard Peripheral Library drivers code */ 72 | /* #define USE_FULL_ASSERT 1 */ 73 | 74 | /* Exported macro ------------------------------------------------------------*/ 75 | #ifdef USE_FULL_ASSERT 76 | 77 | /** 78 | * @brief The assert_param macro is used for function's parameters check. 79 | * @param expr: If expr is false, it calls assert_failed function 80 | * which reports the name of the source file and the source 81 | * line number of the call that failed. 82 | * If expr is true, it returns no value. 83 | * @retval None 84 | */ 85 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 86 | /* Exported functions ------------------------------------------------------- */ 87 | void assert_failed(uint8_t* file, uint32_t line); 88 | #else 89 | #define assert_param(expr) ((void)0) 90 | #endif /* USE_FULL_ASSERT */ 91 | 92 | #endif /* __STM32F40x_CONF_H */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /src/stm32f4xx_it.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.c 4 | * @author Xavier Halgand 5 | * @version 6 | * @date 7 | * @brief Main Interrupt Service Routines. 8 | * This file provides template for all exceptions handler and 9 | * peripherals interrupt service routine. 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 14 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 15 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 16 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 17 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 18 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | * 20 | *

© COPYRIGHT 2011 STMicroelectronics

21 | ****************************************************************************** 22 | */ 23 | 24 | /* Includes ------------------------------------------------------------------*/ 25 | #include "main.h" 26 | 27 | /* ---------------------------------------------------------------------------*/ 28 | 29 | extern float f1; 30 | extern __IO uint16_t ADC3ConvertedValue ; 31 | extern __IO uint32_t TimingDelay ; 32 | 33 | /* Private typedef -----------------------------------------------------------*/ 34 | /* Private define ------------------------------------------------------------*/ 35 | /* Private macro -------------------------------------------------------------*/ 36 | /* Private variables ---------------------------------------------------------*/ 37 | 38 | /* Private function prototypes -----------------------------------------------*/ 39 | /* Private functions ---------------------------------------------------------*/ 40 | 41 | /******************************************************************************/ 42 | /* Cortex-M4 Processor Exceptions Handlers */ 43 | /******************************************************************************/ 44 | 45 | /** 46 | * @brief This function handles NMI exception. 47 | * @param None 48 | * @retval None 49 | */ 50 | void NMI_Handler(void) 51 | { 52 | } 53 | 54 | /** 55 | * @brief This function handles Hard Fault exception. 56 | * @param None 57 | * @retval None 58 | */ 59 | void HardFault_Handler(void) 60 | { 61 | /* Go to infinite loop when Hard Fault exception occurs */ 62 | while (1) 63 | { 64 | } 65 | } 66 | 67 | /** 68 | * @brief This function handles Memory Manage exception. 69 | * @param None 70 | * @retval None 71 | */ 72 | void MemManage_Handler(void) 73 | { 74 | /* Go to infinite loop when Memory Manage exception occurs */ 75 | while (1) 76 | { 77 | } 78 | } 79 | 80 | /** 81 | * @brief This function handles Bus Fault exception. 82 | * @param None 83 | * @retval None 84 | */ 85 | void BusFault_Handler(void) 86 | { 87 | /* Go to infinite loop when Bus Fault exception occurs */ 88 | while (1) 89 | { 90 | } 91 | } 92 | 93 | /** 94 | * @brief This function handles Usage Fault exception. 95 | * @param None 96 | * @retval None 97 | */ 98 | void UsageFault_Handler(void) 99 | { 100 | /* Go to infinite loop when Usage Fault exception occurs */ 101 | while (1) 102 | { 103 | } 104 | } 105 | 106 | /** 107 | * @brief This function handles SVCall exception. 108 | * @param None 109 | * @retval None 110 | */ 111 | void SVC_Handler(void) 112 | { 113 | } 114 | 115 | /** 116 | * @brief This function handles Debug Monitor exception. 117 | * @param None 118 | * @retval None 119 | */ 120 | void DebugMon_Handler(void) 121 | { 122 | } 123 | 124 | /** 125 | * @brief This function handles PendSVC exception. 126 | * @param None 127 | * @retval None 128 | */ 129 | void PendSV_Handler(void) 130 | { 131 | } 132 | 133 | /** 134 | * @brief This function handles SysTick Handler. 135 | * @param None 136 | * @retval None 137 | */ 138 | 139 | /******************************************************************************/ 140 | /* STM32F4xx Peripherals Interrupt Handlers */ 141 | /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ 142 | /* available peripheral interrupt handler's name please refer to the startup */ 143 | /* file (startup_stm32f4xx.s). */ 144 | /******************************************************************************/ 145 | /** 146 | * @brief This function handles External line 0 interrupt request. 147 | * @param None 148 | * @retval None 149 | */ 150 | void EXTI0_IRQHandler(void) 151 | { 152 | 153 | } 154 | 155 | /** 156 | * @brief This function handles TIM4 global interrupt request. 157 | * @param None 158 | * @retval None 159 | */ 160 | void TIM4_IRQHandler(void) 161 | { 162 | 163 | } 164 | 165 | 166 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 167 | -------------------------------------------------------------------------------- /src/stm32f4xx_rcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/src/stm32f4xx_rcc.c -------------------------------------------------------------------------------- /src/syscalls.c: -------------------------------------------------------------------------------- 1 | // license:GPL-2.0+ 2 | 3 | 4 | #include 5 | #include 6 | 7 | extern int errno; 8 | 9 | 10 | int _write(int fd, const char *buf, size_t cnt) 11 | { 12 | int i; 13 | 14 | for (i = 0; i < cnt; i++) 15 | // putch(buf[i]); 16 | 17 | return cnt; 18 | } 19 | 20 | 21 | int _getpid(int file) 22 | { 23 | return 1; 24 | } 25 | 26 | int _kill(int file) 27 | { 28 | return 1; 29 | } 30 | 31 | 32 | int _close(int file) { 33 | return 0; 34 | } 35 | 36 | int _fstat(int file, struct stat *st) { 37 | return 0; 38 | } 39 | 40 | int _isatty(int file) { 41 | return 1; 42 | } 43 | 44 | int _lseek(int file, int ptr, int dir) { 45 | return 0; 46 | } 47 | 48 | int _open(const char *name, int flags, int mode) { 49 | return -1; 50 | } 51 | 52 | int _read(int file, char *ptr, int len) { 53 | return 0; 54 | } 55 | 56 | /*int crashfun(void){ 57 | static int inc=0; 58 | return inc++; 59 | }*/ 60 | 61 | /* Register name faking - works in collusion with the linker. */ 62 | register char * stack_ptr asm ("sp"); 63 | 64 | caddr_t _sbrk (struct _reent *r, int incr) // was _sbrk_r 65 | { 66 | extern char end asm ("end"); // Defined by the linker. 67 | static char * heap_end; 68 | char * prev_heap_end; 69 | 70 | 71 | if (heap_end == NULL) 72 | heap_end = & end; 73 | 74 | prev_heap_end = heap_end; 75 | 76 | if (heap_end + incr > stack_ptr) 77 | { 78 | 79 | /*#if 0 80 | extern void abort (void); 81 | 82 | _write (1, "_sbrk: Heap and stack collision\n", 32); 83 | 84 | abort (); 85 | #else*/ 86 | errno = ENOMEM; 87 | 88 | return (caddr_t) -1; 89 | //#endif 90 | } 91 | 92 | heap_end += incr; 93 | 94 | return (caddr_t) prev_heap_end; 95 | } 96 | -------------------------------------------------------------------------------- /src/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.0.0 6 | * @date 30-September-2011 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f4xx_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F4XX_H 34 | #define __SYSTEM_STM32F4XX_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F4xx_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F4xx_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @addtogroup STM32F4xx_System_Exported_Constants 61 | * @{ 62 | */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @addtogroup STM32F4xx_System_Exported_Macros 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @addtogroup STM32F4xx_System_Exported_Functions 77 | * @{ 78 | */ 79 | 80 | extern void SystemInit(void); 81 | extern void SystemCoreClockUpdate(void); 82 | /** 83 | * @} 84 | */ 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /*__SYSTEM_STM32F4XX_H */ 91 | 92 | /** 93 | * @} 94 | */ 95 | 96 | /** 97 | * @} 98 | */ 99 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 100 | -------------------------------------------------------------------------------- /src/testwow.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | char* s1 = "Kill Worluk for double score."; 5 | 6 | // "PAH1I1R", "TRAH2I1Y", "SU1PRE1N", "AWL", "HA2AYL", 7 | // "EH1MPAH1I1R", 8 | 9 | 10 | enum Phonemes { EH3, EH2, EH1, PA0, DT, A1, A2, ZH, AH2, I3, I2, I1, M, N, B, V, CH, SH, Z, AW1, NG, AH1, OO1, OO, L, K, J, H, G, F, D, S, A, AY, Y1, UH3, AH, P, O, I, U, Y, T, R, E, W, AE, AE1, AW2, UH2, UH1, UH, O2, O1, IU, U1, THV, TH, ER, EH, E1, AW, PA1, STOP}; 11 | 12 | unsigned char END=0xFF; 13 | 14 | enum Intonations {I_1 =0x40, I_2 =0x80, I_3 =0xC0}; 15 | 16 | int pp=2; 17 | 18 | static const char *const GorfWordTable[] = 19 | { 20 | "A2AYY1", "A2E1", "UH1GEH1I3N", "AE1EH2M", "AEM", 21 | "AE1EH3ND", "UH1NAH2I1YLA2SHUH2N", "AH2NUHTHER", "AH1NUHTHVRR", 22 | "AH1R", "UHR", "UH1VEH1EH3NNDJER", "BAEEH3D", "BAEEH1D", "BE", 23 | "BEH3EH1N", "BUH1DTTEH2NN", "KUHDEH2T", 24 | "KAE1NUH1T", "KAE1EH3PTI3N", 25 | "KRAH2UH3NI3KUH3O2LZ", "KO1UH3I3E1N", "KO1UH3I3E1NS", 26 | "KERNAH2L", "KAH1NCHEHSNEHS", "DE1FEH1NDER", 27 | "DE1STRO1I1Y", "DE1STRO1I1Y1D", 28 | "DU1UM", "DRAW1S", "EHMPAH2I3YR", "EHND", 29 | "EH1NEH1MY", "EH1SKA1E1P", "FLEHGSHIP", 30 | "FOR", "GUH1LAEKTI1K", 31 | "DJEH2NERUH3L", "GDTO1O1RRFF", "GDTO1RFYA2N", "GDTO1RFE1EH2N", "GDTO1RFYA2NS", 32 | "HAH1HAH1HAH1HAH1", "HUHRDER", 33 | "HAE1EH3V", "HI1TI1NG", "AH1I1Y", "AH1I1Y1", "I1MPAH1SI1BL", 34 | "IN*", "INSERT", "I1S", "LI1V", "LAWNG", "MEE1T", "MUU1V", 35 | "MAH2I1Y", "MAH2I3Y", "NIR", "NEHKST", "NUH3AH2YS", "NO", 36 | "NAH1O1U1W", "PA1", "PLA1AYER", "PRE1PAE1ER", "PRI1SI3NEH3RS", 37 | "PRUH2MOTEH3D", "POO1IUSH", "RO1U1BAH1T", "RO1U1BAH1TS", 38 | "RO1U1BAH1UH3TS", "SEK", "SHIP", "SHAH1UH3T", "SUHM", "SPA2I3YS", "PA0", 39 | "SERVAH2I1Y1VUH3L", "TAK", "THVUH", "THVUH1", 40 | "THUH", "TAH1EH3YM", "TU", "TIUU1", 41 | "UH2NBE1AYTUH3BUH3L", 42 | "WORAYY1EH3R", "WORAYY1EH3RS", "WI1L", 43 | "Y1I3U1", "YIUU1U1", "YI1U1U1", "Y1IUU1U1", "Y1I1U1U1", "YOR", "YU1O1RSEH1LF", 44 | "FO1R", "FO2R", "WIL", "GDTO1RVYA2N", 45 | "KO1UH3I3AYNN", 46 | "UH1TAEEH3K", "BAH2I3Y1T", "KAH1NKER", "DYVAH1U1ER", "DUHST", "GAE1LUH1KSY", "GAH1EH3T", 47 | "PAH1I1R", "TRAH2I1Y", "SU1PRE1N", "AWL", "HA2AYL", 48 | "EH1MPAH1I1R", 49 | 0 50 | }; 51 | 52 | static const char *const PhonemeTable[65] = 53 | { 54 | "EH3","EH2","EH1","PA0","DT" ,"A1" ,"A2" ,"ZH", 55 | "AH2","I3" ,"I2" ,"I1" ,"M" ,"N" ,"B" ,"V", 56 | "CH" ,"SH" ,"Z" ,"AW1","NG" ,"AH1","OO1","OO", 57 | "L" ,"K" ,"J" ,"H" ,"G" ,"F" ,"D" ,"S", 58 | "A" ,"AY" ,"Y1" ,"UH3","AH" ,"P" ,"O" ,"I", 59 | "U" ,"Y" ,"T" ,"R" ,"E" ,"W" ,"AE" ,"AE1", 60 | "AW2","UH2","UH1","UH" ,"O2" ,"O1" ,"IU" ,"U1", 61 | "THV","TH" ,"ER" ,"EH" ,"E1" ,"AW" ,"PA1","STOP", 62 | 0 63 | }; 64 | 65 | 66 | void main(){ 67 | unsigned char p1[] = {I_2|PA0, K, I, I3, L, PA0, W, O, O1, R, L, UH, K, PA0, F, O1, R, D, UH, B, UH3, L, S, K, O, O1, R, PA1, I_2|PA0, END}; 68 | int x; 69 | 70 | char* s26 = "While you developed science, we developed magic."; 71 | unsigned char p26[45] = {W, AH1, EH3, I3, L, Y1, I_1|IU, I_1|U, D, E1, V, EH1, L, UH3, P, T, S, AH1, I3, AY, EH, N, S, PA1, W, E1, Y, D, E1, V, EH1, L, UH3, P, T, M, AE1, EH3, D, J, I1, K, PA1, END}; 72 | 73 | // for (x=0;x<45;x++){ 74 | // printf("0x%X ,",p26[x]); 75 | // } 76 | 77 | //RUN through GorfWordTable look for and print matches: 78 | 79 | for (pp=0;pp<115;pp++){ 80 | int z=0; 81 | printf("const unsigned char gorf%d[] __attribute__ ((section (\".flash\"))) = {",pp); 82 | while(zlongest) { longestx=x; longest=strlen(PhonemeTable[x]);} 89 | } 90 | } 91 | printf("%d, ",longestx); 92 | z+=strlen(PhonemeTable[longestx]); 93 | // if (z>=strlen(GorfWordTable[pp])) break; 94 | } 95 | printf("};\n"); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/tms5200x.h: -------------------------------------------------------------------------------- 1 | int16_t tms_init(); 2 | 3 | int16_t tms_get_sample(); 4 | int16_t tms_get_sample_sing(); 5 | void tms_newsay(); 6 | 7 | int16_t tms_get_sample_TTS(); 8 | void tms_newsay_TTS(); 9 | void tms_retriggerTTS(); 10 | 11 | int16_t tms_get_sample_allphon(); 12 | int16_t tms_get_sample_allphon_sing(); 13 | void tms_newsay_allphon(); 14 | 15 | int16_t tms_get_sample_bendlength(); 16 | 17 | int16_t tms_get_sample_lowbit(); 18 | void tms_newsay_lowbit(); 19 | 20 | int16_t tms_get_sample_raw5100(); 21 | void tms_newsay_raw5100(); 22 | 23 | int16_t tms_get_sample_raw5200(); 24 | void tms_newsay_raw5200(); 25 | 26 | int16_t tms_get_sample_raw5220(); 27 | void tms_newsay_raw5220(); 28 | 29 | int16_t tms_get_sample_5100pitchtablew(); // vocab=0 ADD VOCABS 30 | int16_t tms_get_sample_5100ktablew(); // vocab=0 ADD VOCABS 31 | int16_t tms_get_sample_5200ktablea();// allphon ADD 32 | 33 | void tms_newsay_specific(u8 whichbank); 34 | void tms_newsay_specifica(); // allphons 35 | void tms_newsay_specific5100(); // 0 36 | void tms_newsay_specificx(); // arcadeone for bends 37 | 38 | int16_t tms_get_sample_bend5200a(); // vocab=1 which will change for allphons ADD VOCABS 39 | int16_t tms_get_sample_bend5100w(); // vocab=0 ADD VOCABS 40 | int16_t tms_get_sample_bend5200x(); // vocab=0 ADD VOCABS 41 | 42 | int16_t tms_get_sample_5200pitchtablea(); // vocab=1 which will change for allphons + we have more pitches = 64 - reflect this in audio.c ADD VOCABS 43 | int16_t tms_get_sample_5200pitchtablex(); // vocab=1 which will change for allphons + we have more pitches = 64 - reflect this in audio.c ADD VOCABS 44 | 45 | int16_t tms_get_sample_5100kandpitchtablew(); // for 5100 we have 32+168 in exy= 200 5200 is 232 ADD VOCABS 46 | int16_t tms_get_sample_5200kandpitchtablea(); // for 5100 we have 32+168 in exy= 200 5200 is 232 ADD VOCABS 47 | int16_t tms_get_sample_5200kandpitchtablex(); // for 5100 we have 32+168 in exy= 200 5200 is 232 ADD VOCABS 48 | -------------------------------------------------------------------------------- /src/vocode.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "stm32f4xx.h" 6 | #include "audio.h" 7 | #include "vocode.h" 8 | 9 | const LADSPA_Data decay_table[] = 10 | { 11 | 1/100.0, 12 | 1/100.0, 1/100.0, 1/100.0, 13 | 1/125.0, 1/125.0, 1/125.0, 14 | 1/166.0, 1/166.0, 1/166.0, 15 | 1/200.0, 1/200.0, 1/200.0, 16 | 1/250.0, 1/250.0, 1/250.0 17 | }; 18 | 19 | /* useful macros */ 20 | #undef CLAMP 21 | #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) 22 | 23 | /*****************************************************************************/ 24 | 25 | VocoderInstance* instantiateVocoder(void) { 26 | VocoderInstance* vocoder = (VocoderInstance *)malloc(sizeof(VocoderInstance)); 27 | u8 i, j; 28 | float a; 29 | float c; 30 | // if (vocoder == NULL) 31 | // return NULL; 32 | 33 | vocoder->SampleRate = 32000.0f; 34 | 35 | for (u8 x=0;xbands_out[x].oldval = 0.0f; 37 | } 38 | 39 | /* initialize bandpass information if num_bands control has changed, 40 | or on first run */ 41 | 42 | for(i=0; i < 16; i++) 43 | { 44 | memset(&vocoder->bands_formant[i], 0, sizeof(struct bandpass)); 45 | 46 | a = 16.0 * (float)i/16.0f; // stretch existing bands 47 | 48 | if (a < 4.0) 49 | vocoder->bands_formant[i].freq = 150.0 + 420.0 * a / 4.0; 50 | else 51 | vocoder->bands_formant[i].freq = 600.0 * powf (1.23, a - 4.0); 52 | 53 | c = vocoder->bands_formant[i].freq * 2 * M_PI / vocoder->SampleRate; 54 | vocoder->bands_formant[i].c = c * c; 55 | 56 | vocoder->bands_formant[i].f = 0.4/c; 57 | vocoder->bands_formant[i].att = 58 | 1.0f/(6.0f + ((expf (vocoder->bands_formant[i].freq 59 | / vocoder->SampleRate) - 1.0f) * 10.0f)); 60 | 61 | memcpy(&vocoder->bands_carrier[i], 62 | &vocoder->bands_formant[i], sizeof(struct bandpass)); 63 | vocoder->bands_out[i].decay = decay_table[(int)a]; 64 | 65 | } 66 | 67 | return vocoder; 68 | } 69 | 70 | /*****************************************************************************/ 71 | 72 | /*****************************************************************************/ 73 | 74 | // vocoder_do_bandpasses /*fold00*/ 75 | void vocoder_do_bandpasses(struct bandpass *bands, LADSPA_Data sample, 76 | VocoderInstance *vocoder) 77 | { 78 | u8 i; 79 | for (i=0; i < 16; i++) 80 | { 81 | bands[i].high1 = sample - bands[i].f * bands[i].mid1 - bands[i].low1; 82 | bands[i].mid1 += bands[i].high1 * bands[i].c; 83 | bands[i].low1 += bands[i].mid1; 84 | 85 | bands[i].high2 = bands[i].low1 - bands[i].f * bands[i].mid2 86 | - bands[i].low2; 87 | bands[i].mid2 += bands[i].high2 * bands[i].c; 88 | bands[i].low2 += bands[i].mid2; 89 | bands[i].y = bands[i].high2 * bands[i].att; 90 | } 91 | } 92 | 93 | /* Run a vocoder instance for a block of SampleCount samples. */ 94 | 95 | // TODO: how to swap round channels/bands as would need to compute this first 96 | 97 | void runVocoder(VocoderInstance *vocoder, float *formant, float *carrier, float *out, unsigned int SampleCount) 98 | { 99 | u8 i, j; 100 | // float a; 101 | LADSPA_Data x; 102 | 103 | vocoder->portFormant=formant; 104 | vocoder->portCarrier=carrier; 105 | vocoder->portOutput=out; 106 | 107 | 108 | /////////////////////////////////// 109 | for (i=0; i < SampleCount; i++) 110 | { 111 | vocoder_do_bandpasses (vocoder->bands_carrier, 112 | vocoder->portCarrier[i], vocoder); 113 | vocoder_do_bandpasses (vocoder->bands_formant, 114 | vocoder->portFormant[i], vocoder); 115 | 116 | vocoder->portOutput[i] = 0.0f; 117 | for (j=0; j < 16; j++) 118 | { 119 | vocoder->bands_out[j].oldval = vocoder->bands_out[j].oldval 120 | // + vocoder->bands_formant[j].y; 121 | + (fabsf (vocoder->bands_formant[j].y) - vocoder->bands_out[j].oldval) * vocoder->bands_out[j].decay; 122 | 123 | x = vocoder->bands_carrier[j].y * vocoder->bands_out[j].oldval; 124 | vocoder->portOutput[i] += x; 125 | } 126 | 127 | // store oldvals for each and then compute with morphed offset into this! 128 | 129 | vocoder->portOutput[i] *= 32.0f; 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/vocode.h: -------------------------------------------------------------------------------- 1 | #define MAX_BANDS 16 2 | #define LADSPA_Data float 3 | 4 | 5 | struct bandpass// 44 bytes 6 | { 7 | LADSPA_Data c, f, att; 8 | LADSPA_Data freq; 9 | LADSPA_Data low1, low2; 10 | LADSPA_Data mid1, mid2; 11 | LADSPA_Data high1, high2; 12 | LADSPA_Data y; 13 | }; 14 | 15 | struct bands_out{ 16 | LADSPA_Data decay; 17 | LADSPA_Data oldval; 18 | }; 19 | 20 | /* Instance data for the vocoder plugin */ 21 | typedef struct { //44*16*3=2k! 22 | LADSPA_Data SampleRate; 23 | struct bandpass bands_formant[MAX_BANDS]; /* one structure per band */ 24 | struct bandpass bands_carrier[MAX_BANDS]; /* one structure per band */ 25 | struct bands_out bands_out[MAX_BANDS]; /* one structure per band */ 26 | 27 | /* Ports */ 28 | 29 | LADSPA_Data * portFormant; /* Formant signal port data location */ 30 | LADSPA_Data * portCarrier; /* Carrier signal port data location */ 31 | LADSPA_Data * portOutput; /* Output audio port data location */ 32 | 33 | } VocoderInstance; 34 | 35 | int32_t testvocode(void); 36 | 37 | void runVocoder(VocoderInstance *vocoder, float *formant, float *carrier, float *out, unsigned int SampleCount); 38 | VocoderInstance* instantiateVocoder(void); 39 | -------------------------------------------------------------------------------- /src/vot.h: -------------------------------------------------------------------------------- 1 | void votrax_init(); 2 | 3 | void votrax_newsay(); 4 | int16_t votrax_get_sample(); 5 | 6 | void votrax_newsaygorf(u8 reset); 7 | void votrax_newsaygorfr(); 8 | 9 | int16_t votrax_get_samplegorf(); 10 | 11 | void votrax_newsaywow(u8 reset); 12 | void votrax_newsaywowr(); 13 | int16_t votrax_get_samplewow(); 14 | 15 | void votrax_newsayTTS(); 16 | int16_t votrax_get_sampleTTS(); 17 | 18 | void votrax_newsay_rawparam(); 19 | int16_t votrax_get_sample_rawparam(); 20 | 21 | void votrax_newsay_bend(u8 reset); 22 | void votrax_newsay_bendr(); 23 | int16_t votrax_get_sample_bend(); 24 | 25 | void votrax_newsay_sing(); 26 | int16_t votrax_get_sample_sing(); 27 | 28 | void votrax_newsaywow_bendfilter(u8 reset); 29 | void votrax_newsaywow_bendfilterr(); 30 | int16_t votrax_get_samplewow_bendfilter(); 31 | void votrax_retriggerTTS(); 32 | void votrax_rawparam_newsay(); 33 | -------------------------------------------------------------------------------- /src/wavetable.h: -------------------------------------------------------------------------------- 1 | // license:GPL-2.0+ 2 | // copyright-holders: Martin Howse 3 | 4 | typedef struct { 5 | float FIRData[49], *FIRCoef; 6 | int FIRPtr, numberTaps; 7 | } TRMFIRFilter; 8 | 9 | typedef struct _Wavetable { 10 | TRMFIRFilter *FIRFilter; 11 | const float *wavetable; 12 | float basicIncrement; 13 | float currentPosition; 14 | int16_t length; 15 | } Wavetable; 16 | 17 | void wavetable_init(Wavetable* wavtable, const float *tableitself, int16_t length); // need to declare wavetable struct and and ourtable we use 18 | void dowavetable(float* outgoing, Wavetable *wavetable, float frequency, u8 length); 19 | void dowormwavetable(float* outgoing, Wavetable *wavetable, float frequency, u8 length); 20 | float dosinglewavetable(Wavetable *wavetable, float frequency);// 21 | 22 | void wave_newsay(void); 23 | int16_t wave_get_sample(void); 24 | -------------------------------------------------------------------------------- /worm001-Sheet550B4EA0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/worm001-Sheet550B4EA0.pdf -------------------------------------------------------------------------------- /worm001.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/worm001.pdf -------------------------------------------------------------------------------- /worm001.pro: -------------------------------------------------------------------------------- 1 | update=Thu 05 Nov 2015 16:03:47 CET 2 | last_client=eeschema 3 | [cvpcb] 4 | version=1 5 | NetIExt=net 6 | [cvpcb/libraries] 7 | EquName1=devcms 8 | [pcbnew] 9 | version=1 10 | PadDrlX=320 11 | PadDimH=600 12 | PadDimV=600 13 | BoardThickness=630 14 | TxtPcbV=800 15 | TxtPcbH=600 16 | TxtModV=600 17 | TxtModH=600 18 | TxtModW=120 19 | VEgarde=100 20 | DrawLar=150 21 | EdgeLar=150 22 | TxtLar=120 23 | MSegLar=150 24 | LastNetListRead=darkintmod002.net 25 | [pcbnew/libraries] 26 | LibDir= 27 | LibName1=sockets 28 | LibName2=connect 29 | LibName3=discret 30 | LibName4=pin_array 31 | LibName5=divers 32 | LibName6=libcms 33 | LibName7=display 34 | LibName8=led 35 | LibName9=dip_sockets 36 | LibName10=pga_sockets 37 | LibName11=valves 38 | LibName12=/root/newkicad/alps 39 | LibName13=/root/newkicad/LQFP64 40 | LibName14=/root/newkicad/newerfmask 41 | LibName15=/root/newkicad/newmonad 42 | LibName16=/root/newkicad/newmonadboth 43 | LibName17=/root/newkicad/newmonaderdscaled 44 | LibName18=/root/newkicad/newmonadmask 45 | LibName19=/root/newkicad/newmonadscaled 46 | LibName20=/root/newkicad/SOD-123 47 | LibName21=/root/darkint/hardware/iheart-kicad-lib/IHE 48 | LibName22=/root/darkint/hardware/libKiCad/footprint/smd_lqfp 49 | LibName23=Eagle2Kicad/erthenvar 50 | LibName24=LQFP64 51 | [eeschema] 52 | version=1 53 | LibDir= 54 | NetFmt=1 55 | HPGLSpd=20 56 | HPGLDm=15 57 | HPGLNum=1 58 | offX_A4=0 59 | offY_A4=0 60 | offX_A3=0 61 | offY_A3=0 62 | offX_A2=0 63 | offY_A2=0 64 | offX_A1=0 65 | offY_A1=0 66 | offX_A0=0 67 | offY_A0=0 68 | offX_A=0 69 | offY_A=0 70 | offX_B=0 71 | offY_B=0 72 | offX_C=0 73 | offY_C=0 74 | offX_D=0 75 | offY_D=0 76 | offX_E=0 77 | offY_E=0 78 | RptD_X=0 79 | RptD_Y=100 80 | RptLab=1 81 | LabSize=60 82 | [eeschema/libraries] 83 | LibName1=power 84 | LibName2=device 85 | LibName3=transistors 86 | LibName4=conn 87 | LibName5=linear 88 | LibName6=regul 89 | LibName7=74xx 90 | LibName8=cmos4000 91 | LibName9=adc-dac 92 | LibName10=memory 93 | LibName11=xilinx 94 | LibName12=special 95 | LibName13=microcontrollers 96 | LibName14=dsp 97 | LibName15=microchip 98 | LibName16=analog_switches 99 | LibName17=motorola 100 | LibName18=texas 101 | LibName19=intel 102 | LibName20=audio 103 | LibName21=interface 104 | LibName22=digital-audio 105 | LibName23=philips 106 | LibName24=display 107 | LibName25=cypress 108 | LibName26=siliconi 109 | LibName27=opto 110 | LibName28=atmel 111 | LibName29=contrib 112 | LibName30=valves 113 | LibName31=analogSpice 114 | LibName32=analogXSpice 115 | LibName33=convergenceAidSpice 116 | LibName34=converterSpice 117 | LibName35=digitalSpice 118 | LibName36=digitalXSpice 119 | LibName37=linearSpice 120 | LibName38=measurementSpice 121 | LibName39=portSpice 122 | LibName40=sourcesSpice 123 | LibName41=/root/newkicad/darkintmod-cache 124 | -------------------------------------------------------------------------------- /worm001_panel.pro: -------------------------------------------------------------------------------- 1 | update=Tue 03 Nov 2015 21:10:02 CET 2 | last_client=pcbnew 3 | [pcbnew] 4 | version=1 5 | PadDrlX=3701 6 | PadDimH=4724 7 | PadDimV=4724 8 | BoardThickness=630 9 | TxtPcbV=800 10 | TxtPcbH=600 11 | TxtModV=600 12 | TxtModH=600 13 | TxtModW=120 14 | VEgarde=100 15 | DrawLar=150 16 | EdgeLar=8 17 | TxtLar=120 18 | MSegLar=150 19 | LastNetListRead= 20 | [pcbnew/libraries] 21 | LibDir= 22 | LibName1=sockets 23 | LibName2=connect 24 | LibName3=discret 25 | LibName4=pin_array 26 | LibName5=divers 27 | LibName6=libcms 28 | LibName7=display 29 | LibName8=led 30 | LibName9=dip_sockets 31 | LibName10=pga_sockets 32 | LibName11=valves 33 | LibName12=/root/projects/ERD_modules/all/ERD_modules 34 | -------------------------------------------------------------------------------- /worm001_revised_reducing003-SilkS_Front.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/worm001_revised_reducing003-SilkS_Front.pdf -------------------------------------------------------------------------------- /worm_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microresearch/WORM/1e899db8949e4418e1a96d0ff542eef5fae106b5/worm_bom.pdf --------------------------------------------------------------------------------