├── .gitignore ├── .gitmodules ├── Audio Unit ├── MVS 4 - AU Lab-Info.plist ├── MVS 4 - Logic-Info.plist ├── MVS 4.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── kbob.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── kbob.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── MVS 4 - AU Lab.xcscheme │ │ ├── MVS 4 - Logic.xcscheme │ │ ├── MVS 4.xcscheme │ │ ├── One Note.xcscheme │ │ └── xcschememanagement.plist ├── MVS 4 │ ├── AUPublic │ │ ├── AUBase │ │ │ ├── AUBase.cpp │ │ │ ├── AUBase.h │ │ │ ├── AUDispatch.h │ │ │ ├── AUInputElement.cpp │ │ │ ├── AUInputElement.h │ │ │ ├── AUOutputElement.cpp │ │ │ ├── AUOutputElement.h │ │ │ ├── AUPluginDispatch.cpp │ │ │ ├── AUPluginDispatch.h │ │ │ ├── AUScopeElement.cpp │ │ │ ├── AUScopeElement.h │ │ │ ├── ComponentBase.cpp │ │ │ └── ComponentBase.h │ │ ├── AUInstrumentBase │ │ │ ├── AUInstrumentBase.cpp │ │ │ ├── AUInstrumentBase.h │ │ │ ├── LockFreeFIFO.h │ │ │ ├── MIDIControlHandler.h │ │ │ ├── SynthElement.cpp │ │ │ ├── SynthElement.h │ │ │ ├── SynthEvent.h │ │ │ ├── SynthNote.cpp │ │ │ ├── SynthNote.h │ │ │ ├── SynthNoteList.cpp │ │ │ └── SynthNoteList.h │ │ ├── OtherBases │ │ │ ├── AUMIDIBase.cpp │ │ │ ├── AUMIDIBase.h │ │ │ ├── MusicDeviceBase.cpp │ │ │ └── MusicDeviceBase.h │ │ └── Utility │ │ │ ├── AUBaseHelper.cpp │ │ │ ├── AUBaseHelper.h │ │ │ ├── AUBuffer.cpp │ │ │ ├── AUBuffer.h │ │ │ └── AUMIDIDefs.h │ ├── Amplifier.cpp │ ├── Amplifier.h │ ├── Decimator.cpp │ ├── Decimator.h │ ├── Envelope.cpp │ ├── Envelope.h │ ├── Filter.cpp │ ├── Filter.h │ ├── Info.plist │ ├── LFO.cpp │ ├── LFO.h │ ├── MVS 4_Prefix.pch │ ├── MVS.cpp │ ├── MVS.h │ ├── MVSVersion.h │ ├── Mixer.cpp │ ├── Mixer.h │ ├── ModMatrix.h │ ├── ModWheel.cpp │ ├── ModWheel.h │ ├── NoiseSource.cpp │ ├── NoiseSource.h │ ├── Oscillator.cpp │ ├── Oscillator.h │ ├── ParamSet.cpp │ ├── ParamSet.h │ ├── PublicUtility │ │ ├── CAAUMIDIMap.cpp │ │ ├── CAAUMIDIMap.h │ │ ├── CAAUMIDIMapManager.cpp │ │ ├── CAAUMIDIMapManager.h │ │ ├── CAAtomic.h │ │ ├── CAAtomicStack.h │ │ ├── CAAudioChannelLayout.cpp │ │ ├── CAAudioChannelLayout.h │ │ ├── CAAutoDisposer.h │ │ ├── CABufferList.cpp │ │ ├── CABufferList.h │ │ ├── CAByteOrder.h │ │ ├── CADebugMacros.h │ │ ├── CADebugPrintf.cpp │ │ ├── CADebugPrintf.h │ │ ├── CAException.h │ │ ├── CAHostTimeBase.cpp │ │ ├── CAHostTimeBase.h │ │ ├── CAMath.h │ │ ├── CAMutex.cpp │ │ ├── CAMutex.h │ │ ├── CAReferenceCounted.h │ │ ├── CAStreamBasicDescription.cpp │ │ ├── CAStreamBasicDescription.h │ │ ├── CAThreadSafeList.h │ │ ├── CAVectorUnit.cpp │ │ ├── CAVectorUnit.h │ │ ├── CAVectorUnitTypes.h │ │ ├── CAXException.cpp │ │ └── CAXException.h │ ├── Random.cpp │ └── Random.h ├── One Note │ └── main.cpp ├── UI Mockup │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── MainMenu.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── UI MockupTests │ ├── Info.plist │ └── UI_MockupTests.m ├── ECAD ├── LaenPCBOrder.dru ├── archive │ ├── Duo 1.0.brd │ ├── Duo 1.0.sch │ ├── Envelope 1.0.brd │ ├── Envelope 1.0.sch │ ├── Filter Big 1.0.brd │ ├── Filter Big 1.0.sch │ ├── LFO Small 1.0.brd │ ├── LFO Small 1.0.sch │ ├── Master Volume 1.0.brd │ ├── Master Volume 1.0.sch │ ├── Oscillator 1.0.brd │ └── Oscillator 1.0.sch ├── io_daughterboard │ ├── .gitignore │ ├── Digikey Order.numbers │ ├── Stuffing Guide.rtf │ ├── artwork │ │ └── MVS Logo.xcf │ ├── datasheets │ │ ├── 3.3V Regulator │ │ │ └── Exar-SPX3819M5-L-3-3_TR-datasheet.pdf │ │ ├── Capacitive Touch Connector │ │ │ ├── ER-CON06HT-1.pdf │ │ │ ├── ER-TPC050-1_Drawing.pdf │ │ │ ├── GSL1680.pdf │ │ │ └── en-xf2l.pdf │ │ ├── LCD Backlight Driver │ │ │ ├── FAN5333BSX-Fairchild.pdf │ │ │ ├── MBR0540-Fairchild.pdf │ │ │ └── MM3Z2V4T1-D.PDF │ │ ├── LCD Connector │ │ │ ├── ER-TFT050-3_Datasheet.pdf │ │ │ ├── FH12_05860557855_2d.pdf │ │ │ └── FH12_catalog.pdf │ │ ├── MIDI Level Shifters │ │ │ └── sn74lv1t34.pdf │ │ ├── Master Sockets │ │ │ ├── ssq_th.pdf │ │ │ ├── ssw-1xx-xx-xxx-x-xx-xxx-xx-mkt.pdf │ │ │ └── ssw-d.pdf │ │ ├── Power Barrel jack │ │ │ └── 21mmdcjackDatasheet.pdf │ │ ├── Resistive Touch Controller │ │ │ └── STMPE811.pdf │ │ ├── SPI Buffers │ │ │ └── 74HC_HCT244.pdf │ │ ├── Slave Headers │ │ │ └── ePH.pdf │ │ └── Tactile Buttons │ │ │ ├── 4301x2xxx8x6.pdf │ │ │ ├── IGS-430182043816-rev1.igs │ │ │ └── STEP-430182043816-rev1.stp │ └── pcb │ │ ├── daughterfeet.pretty │ │ ├── B4B-PH-SM4-TB.kicad_mod │ │ ├── B6B-PH-SM4-TB.kicad_mod │ │ ├── BARREL_JACK.kicad_mod │ │ ├── FH12A-40S.kicad_mod │ │ ├── FPC_40.kicad_mod │ │ ├── MVS-logo.kicad_mod │ │ ├── Molex_PicoBlade_53047-0610_06x1.25mm_Straight.kicad_mod │ │ ├── R_0603_HandSoldering_no_paste.kicad_mod │ │ ├── Socket_Strip_Reversed_2x32.kicad_mod │ │ ├── Socket_Strip_Straight_2x32.kicad_mod │ │ ├── WS-TASV.kicad_mod │ │ ├── XF2L-0625.kicad_mod │ │ └── b6b-ph-kl.kicad_mod │ │ ├── fp-lib-table │ │ ├── gui_defaults.par │ │ ├── io_daughterboard-cache.lib │ │ ├── io_daughterboard.kicad_pcb │ │ ├── io_daughterboard.net │ │ ├── io_daughterboard.pro │ │ ├── io_daughterboard.rules │ │ ├── io_daughterboard.sch │ │ └── lib │ │ ├── bored.dcm │ │ └── bored.lib └── modules │ ├── DRILEGEND.CFG │ ├── Duo.brd │ ├── Duo.sch │ ├── Envelope.brd │ ├── Envelope.sch │ ├── Everything.sch │ ├── Filter Big.brd │ ├── Filter Big.sch │ ├── Filter.brd │ ├── Filter.sch │ ├── LFO.brd │ ├── LFO.sch │ ├── Master Volume.brd │ ├── Master Volume.sch │ ├── Oscillator.brd │ ├── Oscillator.sch │ ├── SynthLib.lbr │ ├── disembiggen.py │ ├── embiggen-filter.py │ └── embiggen-normal.py ├── Firmware ├── Master │ ├── Graphics │ │ ├── Color Text Sample.png │ │ ├── Color Text Sample.rtf │ │ ├── Color Text Sample.xcf │ │ ├── compile.py │ │ └── show.py │ ├── reference │ │ ├── MVS 429ZITx.ioc │ │ ├── README.md │ │ ├── STM32F429i-Discovery Pin Mapping.numbers │ │ └── STM32F429i-Discovery Pin Mapping.pdf │ └── src │ │ ├── .gdbinit │ │ ├── Makefile │ │ ├── anim.c │ │ ├── anim.h │ │ ├── button.c │ │ ├── button.h │ │ ├── config.c │ │ ├── config.h │ │ ├── console.c │ │ ├── console.h │ │ ├── delay.c │ │ ├── delay.h │ │ ├── gpio.c │ │ ├── gpio.h │ │ ├── lcd-dma.c │ │ ├── lcd-dma.h │ │ ├── lcd-pwm.c │ │ ├── lcd-pwm.h │ │ ├── main.c │ │ ├── midi-defs.h │ │ ├── midi.c │ │ ├── midi.h │ │ ├── modes.c │ │ ├── modes.h │ │ ├── sdram.c │ │ ├── sdram.h │ │ ├── spi-proto.c │ │ ├── spi-proto.h │ │ ├── spi-responder.c │ │ ├── spi-responder.h │ │ ├── spi.c │ │ ├── spi.h │ │ ├── state.c │ │ ├── state.h │ │ ├── stm32f429i-discovery.ld │ │ ├── systick.c │ │ ├── systick.h │ │ ├── usb-midi.c │ │ └── usb-midi.h ├── Slave │ ├── Slave.ino │ └── stats.txt └── Slave_Test │ └── Slave_Test.ino ├── Front Panel ├── archive │ ├── Lato-Light.ttf │ ├── bob-synth-0.2.zip │ ├── bob-synth-0.3.zip │ ├── bob-synth-0.4.zip │ ├── bob-synth-both-0.1.pdf │ ├── bob-synth-cut-0.2.pdf │ ├── bob-synth-detail-all-0.3.pdf │ ├── bob-synth-detail-all-0.4.pdf │ ├── bob-synth-detail-allvec-0.3.pdf │ ├── bob-synth-detail-allvec-0.4.pdf │ ├── bob-synth-detail-art-0.3.pdf │ ├── bob-synth-detail-art-0.4.pdf │ ├── bob-synth-detail-both-0.1.pdf │ ├── bob-synth-detail-cut-0.3.pdf │ ├── bob-synth-detail-cut-0.4.pdf │ ├── bob-synth-detail-engrave-0.3.pdf │ ├── bob-synth-detail-engrave-0.4.pdf │ ├── bob-synth-detail-somevec-0.3.pdf │ ├── bob-synth-detail-somevec-0.4.pdf │ ├── bob-synth-engrave-0.2.pdf │ ├── bob-synth-full-all-0.3.pdf │ ├── bob-synth-full-all-0.4.pdf │ ├── bob-synth-full-allvec-0.3.pdf │ ├── bob-synth-full-allvec-0.4.pdf │ ├── bob-synth-full-art-0.3.pdf │ ├── bob-synth-full-art-0.4.pdf │ ├── bob-synth-full-cut-0.3.pdf │ ├── bob-synth-full-cut-0.4.pdf │ ├── bob-synth-full-engrave-0.3.pdf │ ├── bob-synth-full-engrave-0.4.pdf │ ├── bob-synth-full-somevec-0.3.pdf │ ├── bob-synth-full-somevec-0.4.pdf │ └── jupiter.ttf ├── render-all ├── synth-dsl.py └── test.py ├── LICENSE ├── MCAD ├── Filter substrate thick.scad ├── Filter substrate.scad ├── LFO substrate thick.scad ├── LFO substrate.scad ├── Noise substrate thick.scad ├── Noise substrate.scad ├── Osc substrate thick.scad ├── Osc substrate.scad ├── assembly.scad ├── endcap.pdf ├── endcaps.py └── endplug.scad ├── README.md ├── datasheets ├── 820.pdf ├── B260009.pdf ├── Matrix_61.gif ├── TL1220.pdf └── WS2812.pdf ├── image ├── Synth Panel.png ├── Synth_Panel.png ├── Synth_Panel_color.png └── assembly.gif └── synth-notes.txt /.gitignore: -------------------------------------------------------------------------------- 1 | Synth Panel.pdf 2 | Synth Pages.pdf 3 | .#* 4 | *.s#? 5 | *.b#? 6 | *.l#? 7 | *.o 8 | *.d 9 | *.elf 10 | *.map 11 | TAGS 12 | .*.lck 13 | *.bin 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Firmware/Master/libopencm3"] 2 | path = Firmware/Master/libopencm3 3 | url = https://github.com/kbob/libopencm3.git 4 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4 - AU Lab-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AudioComponents 6 | 7 | 8 | New item 9 | 10 | New item - 2 11 | 12 | description 13 | Minimum Viable Synth, V4 for AU Lab 14 | factoryFunction 15 | MVSFactory 16 | manufacturer 17 | sbiL 18 | name 19 | MVS 4 - AU Lab 20 | sandboxSafe 21 | 22 | subtype 23 | mvs4 24 | type 25 | aumu 26 | version 27 | 65536 28 | 29 | 30 | CFBundleDevelopmentRegion 31 | en 32 | CFBundleExecutable 33 | $(EXECUTABLE_NAME) 34 | CFBundleIdentifier 35 | $(PRODUCT_BUNDLE_IDENTIFIER) 36 | CFBundleInfoDictionaryVersion 37 | 6.0 38 | CFBundleName 39 | $(PRODUCT_NAME) 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1 46 | NSHumanReadableCopyright 47 | Copyright © 2014 kbobsoft.com. All rights reserved. 48 | 49 | 50 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4 - Logic-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AudioComponents 6 | 7 | 8 | New item 9 | 10 | New item - 2 11 | 12 | description 13 | Minimum Viable Synth, V4 for Logic Pro X 14 | factoryFunction 15 | MVSFactory 16 | manufacturer 17 | sbiL 18 | name 19 | MVS 4 — Logic 20 | sandboxSafe 21 | 22 | subtype 23 | mvL4 24 | type 25 | aumu 26 | version 27 | 65536 28 | 29 | 30 | CFBundleDevelopmentRegion 31 | en 32 | CFBundleExecutable 33 | $(EXECUTABLE_NAME) 34 | CFBundleIdentifier 35 | $(PRODUCT_BUNDLE_IDENTIFIER) 36 | CFBundleInfoDictionaryVersion 37 | 6.0 38 | CFBundleName 39 | $(PRODUCT_NAME) 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1 46 | NSHumanReadableCopyright 47 | Copyright © 2014 kbobsoft.com. All rights reserved. 48 | 49 | 50 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/project.xcworkspace/xcuserdata/kbob.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Audio Unit/MVS 4.xcodeproj/project.xcworkspace/xcuserdata/kbob.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/project.xcworkspace/xcuserdata/kbob.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcschemes/MVS 4 - AU Lab.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcschemes/MVS 4 - Logic.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcschemes/MVS 4.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcschemes/One Note.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4.xcodeproj/xcuserdata/kbob.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MVS 4 - AU Lab.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | MVS 4 - Logic.xcscheme 13 | 14 | orderHint 15 | 2 16 | 17 | MVS 4.xcscheme 18 | 19 | orderHint 20 | 0 21 | 22 | One Note.xcscheme 23 | 24 | orderHint 25 | 1 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 922E75491A6772DA00E1FD3B 31 | 32 | primary 33 | 34 | 35 | 92717B681A19A7DC00B87C38 36 | 37 | primary 38 | 39 | 40 | 92717BE91A1B211600B87C38 41 | 42 | primary 43 | 44 | 45 | 92A723B51A67767B007EF2AF 46 | 47 | primary 48 | 49 | 50 | 92D8C5771A63D29100AFF1D2 51 | 52 | primary 53 | 54 | 55 | 92D8C5891A63D29100AFF1D2 56 | 57 | primary 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/AUBase/AUDispatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: AUDispatch.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __AUDispatch_h__ 48 | #define __AUDispatch_h__ 49 | 50 | 51 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 52 | #include 53 | #else 54 | #include "AudioUnit.h" 55 | #endif 56 | 57 | #if !CA_USE_AUDIO_PLUGIN_ONLY 58 | /*! @function AudioUnitBaseGetParameter */ 59 | OSStatus CMgr_AudioUnitBaseGetParameter( AUBase * This, 60 | AudioUnitParameterID inID, 61 | AudioUnitScope inScope, 62 | AudioUnitElement inElement, 63 | float * outValue); 64 | 65 | /*! @function AudioUnitBaseSetParameter */ 66 | OSStatus CMgr_AudioUnitBaseSetParameter( AUBase * This, 67 | AudioUnitParameterID inID, 68 | AudioUnitScope inScope, 69 | AudioUnitElement inElement, 70 | float inValue, 71 | UInt32 inBufferOffset); 72 | 73 | /*! @function AudioUnitBaseRender */ 74 | OSStatus CMgr_AudioUnitBaseRender( AUBase * This, 75 | AudioUnitRenderActionFlags *ioActionFlags, 76 | const AudioTimeStamp * inTimeStamp, 77 | UInt32 inBusNumber, 78 | UInt32 inNumberFrames, 79 | AudioBufferList * ioData); 80 | #endif 81 | 82 | #endif // __AUDispatch_h__ 83 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/AUBase/AUOutputElement.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | File: AUOutputElement.cpp 3 | Abstract: AUOutputElement.h 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #include "AUOutputElement.h" 48 | #include "AUBase.h" 49 | 50 | AUOutputElement::AUOutputElement(AUBase *audioUnit) : 51 | AUIOElement(audioUnit) 52 | { 53 | AllocateBuffer(); 54 | } 55 | 56 | OSStatus AUOutputElement::SetStreamFormat(const CAStreamBasicDescription &desc) 57 | { 58 | OSStatus result = AUIOElement::SetStreamFormat(desc); // inherited 59 | if (result == AUBase::noErr) 60 | AllocateBuffer(); 61 | return result; 62 | } 63 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/AUBase/AUOutputElement.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: AUOutputElement.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __AUOutput_h__ 48 | #define __AUOutput_h__ 49 | 50 | #include "AUScopeElement.h" 51 | #include "AUBuffer.h" 52 | 53 | /*! @class AUOutputElement */ 54 | class AUOutputElement : public AUIOElement { 55 | public: 56 | /*! @ctor AUOutputElement */ 57 | AUOutputElement(AUBase *audioUnit); 58 | 59 | // AUElement override 60 | /*! @method SetStreamFormat */ 61 | virtual OSStatus SetStreamFormat(const CAStreamBasicDescription &desc); 62 | /*! @method NeedsBufferSpace */ 63 | virtual bool NeedsBufferSpace() const { return true; } 64 | }; 65 | 66 | #endif // __AUOutput_h__ 67 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/AUInstrumentBase/MIDIControlHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: MIDIControlHandler.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __MIDICONTROLHANDLER_H__ 48 | #define __MIDICONTROLHANDLER_H__ 49 | 50 | #include 51 | 52 | /*! Abstract interface base class for classes which handle all incoming MIDI data */ 53 | 54 | class MIDIControlHandler 55 | { 56 | public: 57 | virtual ~MIDIControlHandler() {} 58 | virtual void Reset() = 0; //! Restore all state to defaults 59 | virtual bool SetProgramChange(UInt16 inProgram) = 0; 60 | virtual bool SetPitchWheel(UInt16 inValue) = 0; 61 | virtual bool SetChannelPressure(UInt8 inValue) = 0; 62 | virtual bool SetPolyPressure(UInt8 inKey, UInt8 inValue) = 0; 63 | virtual bool SetController(UInt8 inControllerNumber, UInt8 inValue) = 0; 64 | virtual bool SetSysex(void *inSysexMsg) = 0; 65 | 66 | virtual float GetPitchBend() const = 0; 67 | 68 | /*! Default controller values. These represent MSB values unless indicated in the name */ 69 | 70 | enum 71 | { 72 | kDefault_Midpoint = 0x40, //! Used for all center-null-point controllers 73 | kDefault_Volume = 100, 74 | kDefault_Pan = kDefault_Midpoint, 75 | kDefault_ModWheel = 0, 76 | kDefault_Pitch = kDefault_Midpoint, 77 | kDefault_Expression = 0x7f, 78 | kDefault_ChannelPressure = 0, 79 | kDefault_ReverbSend = 40, 80 | kDefault_ChorusSend = 0, 81 | 82 | kDefault_RPN_LSB = 0x7f, 83 | kDefault_RPN_MSB = 0x7f, 84 | kDefault_PitchBendRange = 2, 85 | kDefault_FineTuning = kDefault_Midpoint, 86 | kDefault_CoarseTuning = kDefault_Midpoint, 87 | kDefault_ModDepthRange = 0, 88 | kDefault_ModDepthRangeLSB = kDefault_Midpoint 89 | }; 90 | }; 91 | 92 | #endif // __MIDICONTROLHANDLER_H__ 93 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/AUInstrumentBase/SynthNoteList.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | File: SynthNoteList.cpp 3 | Abstract: SynthNoteList.h 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #include "SynthNoteList.h" 48 | #include 49 | 50 | void SynthNoteList::SanityCheck() const 51 | { 52 | if (mState >= kNoteState_Unset) { 53 | throw std::runtime_error("SanityCheck: mState is bad"); 54 | } 55 | 56 | if (mHead == NULL) { 57 | if (mTail != NULL) 58 | throw std::runtime_error("SanityCheck: mHead is NULL but not mTail"); 59 | return; 60 | } 61 | if (mTail == NULL) { 62 | throw std::runtime_error("SanityCheck: mTail is NULL but not mHead"); 63 | } 64 | 65 | if (mHead->mPrev) { 66 | throw std::runtime_error("SanityCheck: mHead has a mPrev"); 67 | } 68 | if (mTail->mNext) { 69 | throw std::runtime_error("SanityCheck: mTail has a mNext"); 70 | } 71 | 72 | SynthNote *note = mHead; 73 | while (note) 74 | { 75 | if (note->mState != mState) 76 | throw std::runtime_error("SanityCheck: note in wrong state"); 77 | if (note->mNext) { 78 | if (note->mNext->mPrev != note) 79 | throw std::runtime_error("SanityCheck: bad link 1"); 80 | } else { 81 | if (mTail != note) 82 | throw std::runtime_error("SanityCheck: note->mNext is nil, but mTail != note"); 83 | } 84 | if (note->mPrev) { 85 | if (note->mPrev->mNext != note) 86 | throw std::runtime_error("SanityCheck: bad link 2"); 87 | } else { 88 | if (mHead != note) 89 | throw std::runtime_error("SanityCheck: note->mPrev is nil, but mHead != note"); 90 | } 91 | note = note->mNext; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/AUPublic/Utility/AUBaseHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: AUBaseHelper.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __AUBaseHelper_h__ 48 | #define __AUBaseHelper_h__ 49 | 50 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 51 | #include 52 | #include 53 | #else 54 | #include 55 | #include 56 | #endif 57 | 58 | #include "AUBase.h" 59 | 60 | // helpers for dealing with the file-references dictionary in an AUPreset 61 | OSStatus GetFileRefPath (CFDictionaryRef parent, CFStringRef frKey, CFStringRef * fPath); 62 | 63 | // if fileRefDict is NULL, this call creates one 64 | // if not NULL, then the key value is added to it 65 | CFMutableDictionaryRef CreateFileRefDict (CFStringRef fKey, CFStringRef fPath, CFMutableDictionaryRef fileRefDict); 66 | 67 | int AccessURLAsset(const CFURLRef inURL, int mode); 68 | 69 | #if DEBUG 70 | void PrintAUParamEvent (AudioUnitParameterEvent& event, FILE* f); 71 | #endif 72 | 73 | 74 | 75 | #endif // __AUBaseHelper_h__ -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Amplifier.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Amplifier.cpp 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/31/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include "Amplifier.h" 10 | 11 | Amplifier::Amplifier() 12 | {} 13 | 14 | void Amplifier::initialize(float sample_rate) 15 | {} 16 | 17 | void Amplifier::generate_sum(float const *signal, 18 | float const *gain, 19 | float *out, 20 | size_t count) 21 | { 22 | for (size_t i = 0; i < count; i++) 23 | out[i] += gain[i] * signal[i]; 24 | } 25 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Amplifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // Amplifier.h 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/31/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS_4__Amplifier__ 10 | #define __MVS_4__Amplifier__ 11 | 12 | class Amplifier { 13 | 14 | public: 15 | 16 | Amplifier (); 17 | 18 | void initialize (float sample_rate); 19 | 20 | void generate_sum (float const *signal, 21 | float const *gain, 22 | float *out, 23 | size_t nsamp); 24 | 25 | }; 26 | 27 | #endif /* defined(__MVS_4__Amplifier__) */ 28 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Decimator.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Decimator.cpp 3 | // Sample4X 4 | // 5 | // Created by Bob Miller on 11/26/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include "Decimator.h" 10 | 11 | Decimator::Decimator() 12 | : mKernel(NULL), 13 | mShift(NULL) 14 | {} 15 | 16 | Decimator::~Decimator() 17 | { 18 | delete [] mKernel; 19 | delete [] mShift; 20 | } 21 | 22 | void Decimator::initialize(Float64 decimatedSampleRate, 23 | Float64 passFrequency, 24 | unsigned oversampleRatio) 25 | { 26 | mDecimatedSampleRate = decimatedSampleRate; 27 | mRatio = oversampleRatio; 28 | mOversampleRate = decimatedSampleRate * oversampleRatio; 29 | if (mRatio == 1) 30 | return; // The null decimator 31 | 32 | Float64 NyquistFreq = decimatedSampleRate / 2; 33 | assert(passFrequency < NyquistFreq); 34 | 35 | // See DSP Guide. 36 | Float64 Fc = (NyquistFreq + passFrequency) / 2 / mOversampleRate; 37 | Float64 BW = (NyquistFreq - passFrequency) / mOversampleRate; 38 | int M = ceil(4 / BW); 39 | if (M % 2) M++; 40 | size_t activeKernelSize = M + 1; 41 | size_t inactiveSize = mRatio - activeKernelSize % mRatio; 42 | mKernelSize = activeKernelSize + inactiveSize; 43 | 44 | // DSP Guide uses approx. values. Got these from Wikipedia. 45 | Float64 a0 = 7938. / 18608., a1 = 9240. / 18608., a2 = 1430. / 18608.; 46 | 47 | // Allocate and initialize the FIR filter kernel. 48 | delete [] mKernel; 49 | mKernel = new Float32[mKernelSize]; 50 | Float64 gain = 0; 51 | for (size_t i = 0; i < inactiveSize; i++) 52 | mKernel[i] = 0; 53 | for (int i = 0; i < activeKernelSize; i++) { 54 | Float64 y; 55 | if (i == M/2) 56 | y = 2 * M_PI * Fc; 57 | else 58 | y = (sin(2 * M_PI * Fc * (i - M / 2)) / (i - M / 2) * 59 | (a0 - a1 * cos(2 * M_PI * i/ M) + a2 * cos(4 * M_PI / M))); 60 | gain += y; 61 | mKernel[inactiveSize + i] = y; 62 | } 63 | 64 | // Adjust the kernel for unity gain. 65 | Float32 inv_gain = 1 / gain; 66 | for (size_t i = inactiveSize; i < mKernelSize; i++) 67 | mKernel[i] *= inv_gain; 68 | 69 | // Allocate and clear the shift register. 70 | delete [] mShift; 71 | mShift = new Float32[mKernelSize]; 72 | for (size_t i = 0; i < mKernelSize; i++) 73 | mShift[i] = 0; 74 | mCursor = 0; 75 | } 76 | 77 | // The filter kernel is linear. Coefficients for oldest samples are 78 | // on the left; newest on the right. 79 | // 80 | // The shift register is circular. Oldest samples are at cursor; 81 | // newest are just left of cursor. 82 | // 83 | // We have to do the multiply-accumulate in two pieces. 84 | // 85 | // Kernel 86 | // +------------+----------------+ 87 | // | 0 .. n-c-1 | n-c .. n-1 | 88 | // +------------+----------------+ 89 | // ^ ^ ^ 90 | // 0 n-c n 91 | // 92 | // Shift Register 93 | // +----------------+------------+ 94 | // | n-c .. n-1 | 0 .. n-c-1 | 95 | // +----------------+------------+ 96 | // ^ ^ ^ 97 | // mShift shiftp n 98 | 99 | void Decimator::decimate(Float32 *in, Float32 *out, size_t outCount) 100 | { 101 | if (mRatio == 1) { 102 | for (size_t i = 0; i < outCount; i++) 103 | out[i] = in[i]; 104 | return; 105 | } 106 | 107 | assert(!(mCursor % mRatio)); 108 | assert(mCursor < mKernelSize); 109 | size_t cursor = mCursor; 110 | Float32 *inp = in; 111 | Float32 *shiftp = mShift + cursor; 112 | for (size_t i = 0; i < outCount; i++) { 113 | 114 | // Insert mRatio input samples at cursor. 115 | for (size_t j = 0; j < mRatio; j++) 116 | *shiftp++ = *inp++; 117 | if ((cursor += mRatio) == mKernelSize) { 118 | cursor = 0; 119 | shiftp = mShift; 120 | } 121 | 122 | // Calculate one output sample. 123 | Float64 acc = 0; 124 | size_t size0 = mKernelSize - cursor; 125 | size_t size1 = cursor; 126 | const Float32 *kernel1 = mKernel + size0; 127 | for (size_t j = 0; j < size0; j++) 128 | acc += shiftp[j] * mKernel[j]; 129 | for (size_t j = 0; j < size1; j++) 130 | acc += mShift[j] * kernel1[j]; 131 | out[i] = acc; 132 | } 133 | mCursor = cursor; 134 | } 135 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Decimator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Decimator.h 3 | // Sample4X 4 | // 5 | // Created by Bob Miller on 11/26/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | // Polyphase decimation filter. 10 | // 11 | // Convert an oversampled audio stream to non-oversampled. Uses a 12 | // windowed sinc FIR filter w/ Blackman window to control aliasing. 13 | // Christian Floisand's 'blog explains it very well. 14 | // 15 | // This version has a very simple main processing loop (the decimate 16 | // method) which vectorizes easily. 17 | // 18 | // Refs: 19 | // https://christianfloisand.wordpress.com/2012/12/05/audio-resampling-part-1/ 20 | // https://christianfloisand.wordpress.com/2013/01/28/audio-resampling-part-2/ 21 | // http://www.dspguide.com/ch16.htm 22 | // http://en.wikipedia.org/wiki/Window_function#Blackman_windows 23 | 24 | #ifndef __Sample4X__Decimator__ 25 | #define __Sample4X__Decimator__ 26 | 27 | class Decimator { 28 | 29 | public: 30 | Decimator(); 31 | ~Decimator(); 32 | 33 | void initialize(Float64 decimatedSampleRate, 34 | Float64 passFrequency, 35 | unsigned oversampleRatio); 36 | 37 | Float64 oversampleRate() const { return mOversampleRate; } 38 | int oversampleRatio() const { return mRatio; } 39 | 40 | void decimate(Float32 *in, Float32 *out, size_t outCount); 41 | // N.B., in must have (ratio * outCount) samples. 42 | 43 | private: 44 | Float64 mDecimatedSampleRate; 45 | Float64 mOversampleRate; 46 | int mRatio; // oversample ratio 47 | Float32 *mKernel; 48 | size_t mKernelSize; 49 | Float32 *mShift; // shift register 50 | size_t mCursor; 51 | 52 | }; 53 | 54 | #endif /* defined(__Sample4X__Decimator__) */ 55 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Envelope.h: -------------------------------------------------------------------------------- 1 | // 2 | // Envelope.h 3 | // MVS - Minimum Viable Synth 4 | // 5 | // Created by Bob Miller on 11/16/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS__Envelope__ 10 | #define __MVS__Envelope__ 11 | 12 | class Envelope { 13 | 14 | public: 15 | 16 | enum Type { 17 | Linear, 18 | Exponential 19 | }; 20 | 21 | Envelope (); 22 | void initialize (float sample_rate); 23 | 24 | float amplitude () const; 25 | 26 | void release (); 27 | 28 | size_t generate (Type type, 29 | float const *attack, 30 | float const *decay, 31 | float const *sustain, 32 | float const *release, 33 | float const *amount, 34 | float *out, 35 | size_t count); 36 | 37 | private: 38 | 39 | enum Segment { 40 | Attack, 41 | Decay, 42 | Sustain, 43 | Release, 44 | Done 45 | }; 46 | 47 | float mSampleRate; 48 | float mInverseSampleRate; 49 | Segment mSegment; 50 | size_t mSamplesDone; 51 | float mLevel; 52 | float mAmplitude; 53 | float mAttackDuration; 54 | float mReleaseTime; 55 | 56 | size_t generate_linear (float const *attack, 57 | float const *decay, 58 | float const *sustain, 59 | float const *release, 60 | float const *amount, 61 | float *out, 62 | size_t count); 63 | 64 | size_t generate_exponential (float const *attack, 65 | float const *decay, 66 | float const *sustain, 67 | float const *release, 68 | float const *amount, 69 | float *out, 70 | size_t count); 71 | 72 | }; 73 | 74 | #endif /* defined(__MVS__Envelope__) */ 75 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Filter.h 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 1/1/15. 6 | // Copyright (c) 2015 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS_4__Filter__ 10 | #define __MVS_4__Filter__ 11 | 12 | class Filter { 13 | 14 | public: 15 | 16 | enum Type { 17 | Off, 18 | LowPass, 19 | HighPass, 20 | BandPass, 21 | BandReject 22 | }; 23 | 24 | Filter(); 25 | 26 | void initialize (float sample_rate); 27 | 28 | void generate (Type type, 29 | float const *signal, 30 | float const *cutoff, 31 | float const *resonance, 32 | float const *drive, 33 | float *out, 34 | size_t nsamp); 35 | 36 | private: 37 | 38 | struct LadderStage { 39 | float v; // V - voltage 40 | float dv; // dV/dt 41 | float cv; // clipped V 42 | 43 | LadderStage() 44 | : v(0), dv(0), cv(0) 45 | {} 46 | }; 47 | 48 | float mSampleRate; 49 | float mInv_2Fs; 50 | LadderStage S1, S2, S3, S4; 51 | 52 | void generate_unfiltered (float const *signal, 53 | float *out, 54 | size_t nsamp); 55 | void generate_low_pass (float const *signal, 56 | float const *cutoff, 57 | float const *resonance, 58 | float const *drive, 59 | float *out, 60 | size_t nsamp); 61 | void generate_high_pass (float const *signal, 62 | float const *cutoff, 63 | float const *resonance, 64 | float const *drive, 65 | float *out, 66 | size_t nsamp); 67 | void generate_band_pass (float const *signal, 68 | float const *cutoff, 69 | float const *resonance, 70 | float const *drive, 71 | float *out, 72 | size_t nsamp); 73 | void generate_band_reject (float const *signal, 74 | float const *cutoff, 75 | float const *resonance, 76 | float const *drive, 77 | float *out, 78 | size_t nsamp); 79 | 80 | inline void step_stage (LadderStage& S, 81 | float in, 82 | float pc_2AFs); 83 | 84 | }; 85 | 86 | #endif /* defined(__MVS_4__Filter__) */ 87 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AudioComponents 6 | 7 | 8 | New item 9 | 10 | New item - 2 11 | 12 | description 13 | Minimum Viable Synth, V3 14 | factoryFunction 15 | MVSFactory 16 | manufacturer 17 | sbiL 18 | name 19 | MVS 4 20 | sandboxSafe 21 | 22 | subtype 23 | mvs4 24 | type 25 | aumu 26 | version 27 | 65536 28 | 29 | 30 | CFBundleDevelopmentRegion 31 | en 32 | CFBundleExecutable 33 | $(EXECUTABLE_NAME) 34 | CFBundleIdentifier 35 | $(PRODUCT_BUNDLE_IDENTIFIER) 36 | CFBundleInfoDictionaryVersion 37 | 6.0 38 | CFBundleName 39 | $(PRODUCT_NAME) 40 | CFBundleShortVersionString 41 | 1.0 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1 46 | NSHumanReadableCopyright 47 | Copyright © 2014 kbobsoft.com. All rights reserved. 48 | 49 | 50 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/LFO.h: -------------------------------------------------------------------------------- 1 | // 2 | // LFO.h 3 | // MVS - Low Frequency Oscillator 4 | // 5 | // Created by Bob Miller on 12/20/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS__LFO__ 10 | #define __MVS__LFO__ 11 | 12 | class LFO { 13 | 14 | public: 15 | 16 | enum Waveform { 17 | None, 18 | Triangle, 19 | UpSaw, 20 | DnSaw, 21 | Square, 22 | Random, 23 | SampleHold, 24 | }; 25 | 26 | enum Polarity { 27 | Unipolar, 28 | Bipolar, 29 | }; 30 | 31 | LFO(); 32 | void initialize(double sample_rate); 33 | 34 | void generate(Waveform waveform, 35 | Polarity polarity, 36 | float const *freq, 37 | float const *depth, 38 | float *samples_out, 39 | size_t count); 40 | 41 | private: 42 | 43 | double mSampleRate; 44 | double mInverseSampleRate; 45 | // Waveform mWaveform; 46 | // Polarity mPolarity; 47 | float mPhase; 48 | float mRand0; 49 | float mRand1; 50 | 51 | void generate_none(float const *freq, 52 | float const *depth, 53 | float *samples_out, 54 | size_t count); 55 | 56 | void generate_unipolar_triangle(float const *freq, 57 | float const *depth, 58 | float *samples_out, 59 | size_t count); 60 | 61 | void generate_bipolar_triangle (float const *freq, 62 | float const *depth, 63 | float *samples_out, 64 | size_t count); 65 | 66 | void generate_unipolar_upsaw (float const *freq, 67 | float const *depth, 68 | float *samples_out, 69 | size_t count); 70 | 71 | void generate_bipolar_upsaw (float const *freq, 72 | float const *depth, 73 | float *samples_out, 74 | size_t count); 75 | 76 | void generate_unipolar_dnsaw (float const *freq, 77 | float const *depth, 78 | float *samples_out, 79 | size_t count); 80 | 81 | void generate_bipolar_dnsaw (float const *freq, 82 | float const *depth, 83 | float *samples_out, 84 | size_t count); 85 | 86 | void generate_unipolar_square (float const *freq, 87 | float const *depth, 88 | float *samples_out, 89 | size_t count); 90 | 91 | void generate_bipolar_square (float const *freq, 92 | float const *depth, 93 | float *samples_out, 94 | size_t count); 95 | 96 | void generate_unipolar_random (float const *freq, 97 | float const *depth, 98 | float *samples_out, 99 | size_t count); 100 | 101 | void generate_bipolar_random (float const *freq, 102 | float const *depth, 103 | float *samples_out, 104 | size_t count); 105 | 106 | void generate_unipolar_samphold(float const *freq, 107 | float const *depth, 108 | float *samples_out, 109 | size_t count); 110 | 111 | void generate_bipolar_samphold (float const *freq, 112 | float const *depth, 113 | float *samples_out, 114 | size_t count); 115 | 116 | }; 117 | 118 | #endif /* defined(__MVS__LFO__) */ 119 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/MVS 4_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files. 3 | // 4 | 5 | #include 6 | #include 7 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/MVSVersion.h: -------------------------------------------------------------------------------- 1 | #ifndef __MVSVersion__ 2 | #define __MVSVersion__ 3 | 4 | #ifdef DEBUG 5 | #define kMVSVersion 0xFFFFFFFF 6 | #else 7 | #define kMVSVersion 0x00010000 8 | #endif 9 | 10 | #endif /* __MVSVersion__ */ 11 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Mixer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Mixer.cpp 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/24/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include "Mixer.h" 10 | 11 | Mixer::Mixer() 12 | {} 13 | 14 | void Mixer::initialize(float sample_rate) 15 | {} 16 | 17 | void Mixer::generate(Operator op, 18 | float const *src1, float const *src1_level, 19 | float const *src2, float const *src2_level, 20 | float const *src3, float const *src3_level, 21 | float *out, 22 | size_t nsamp) 23 | { 24 | switch (op) { 25 | 26 | case Mix: 27 | case HardSync: 28 | generate_mix (src1, src1_level, 29 | src2, src2_level, 30 | src3, src3_level, 31 | out, nsamp); 32 | break; 33 | 34 | case RingMod: 35 | generate_ringmod(src1, src1_level, 36 | src2, src2_level, 37 | src3, src3_level, 38 | out, nsamp); 39 | break; 40 | } 41 | } 42 | 43 | void Mixer::generate_mix(float const *src1, float const *src1_level, 44 | float const *src2, float const *src2_level, 45 | float const *src3, float const *src3_level, 46 | float *out, 47 | size_t nsamp) 48 | { 49 | for (size_t i = 0; i < nsamp; i++) 50 | out[i] = src1_level[i] * src1[i] + 51 | src2_level[i] * src2[i] + 52 | src3_level[i] * src3[i]; 53 | } 54 | 55 | void Mixer::generate_ringmod(float const *src1, float const *src1_level, 56 | float const *src2, float const *src2_level, 57 | float const *src3, float const *src3_level, 58 | float *out, 59 | size_t nsamp) 60 | { 61 | for (size_t i = 0; i < nsamp; i++) 62 | out[i] = src1_level[i] * src1[i] * src2[i] + 63 | src3_level[i] * src3[i]; 64 | } 65 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Mixer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Mixer.h 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/24/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS_4__Mixer__ 10 | #define __MVS_4__Mixer__ 11 | 12 | class Mixer { 13 | 14 | public: 15 | 16 | enum Operator { 17 | Mix, 18 | RingMod, 19 | HardSync 20 | }; 21 | 22 | Mixer(); 23 | void initialize(float sample_rate); 24 | 25 | void generate (Operator op, 26 | float const *src1, float const *src1_level, 27 | float const *src2, float const *src2_level, 28 | float const *src3, float const *src3_level, 29 | float *out, 30 | size_t nsamp); 31 | 32 | private: 33 | 34 | void generate_mix (float const *src1, float const *src1_level, 35 | float const *src2, float const *src2_level, 36 | float const *src3, float const *src3_level, 37 | float *out, 38 | size_t nsamp); 39 | 40 | void generate_ringmod (float const *src1, float const *src1_level, 41 | float const *src2, float const *src2_level, 42 | float const *src3, float const *src3_level, 43 | float *out, 44 | size_t nsamp); 45 | 46 | }; 47 | 48 | #endif /* defined(__MVS_4__Mixer__) */ 49 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/ModWheel.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ModWheel.cpp 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/20/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include "ModWheel.h" 10 | 11 | const float decay_time = 0.005; // seconds. MIDI messages take 3 ms minimum. 12 | 13 | ModWheel::ModWheel() 14 | {} 15 | 16 | void ModWheel::initialize(double sample_rate) 17 | { 18 | mSampleRate = sample_rate; 19 | mDecay = 1 / (decay_time * sample_rate); 20 | mIntTarget = 0; 21 | mTarget = 0; 22 | mActual = 0; 23 | mLSBSeen = false; 24 | } 25 | 26 | void ModWheel::set_raw_MSB(uint8_t value) 27 | { 28 | const uint16_t LSB_mask = (1 << 7) - (1 << 0); 29 | const uint16_t MSB_mask = (1 << 14) - (1 << 7); 30 | 31 | if (mLSBSeen) 32 | mIntTarget = (mIntTarget & ~MSB_mask) | (value << 7 & MSB_mask); 33 | else 34 | mIntTarget = (value & LSB_mask) | (value << 7 & MSB_mask); 35 | mTarget = mIntTarget / (float)((1 << 14) - 1); 36 | } 37 | 38 | void ModWheel::set_raw_LSB(uint8_t value) 39 | { 40 | const uint16_t LSB_mask = (1 << 7) - (1 << 0); 41 | 42 | mIntTarget = (mIntTarget & ~LSB_mask) | (value & LSB_mask); 43 | mTarget = mIntTarget / (float)((1 << 14) - 1); 44 | mLSBSeen = true; 45 | } 46 | 47 | void ModWheel::generate(float *samples_out, size_t count) 48 | { 49 | const float decay = mDecay; 50 | const float non_decay = 1.0 - decay; 51 | const float target = mTarget; 52 | float actual = mActual; 53 | for (size_t i = 0; i < count; i++) 54 | samples_out[i] = actual = non_decay * actual + decay * target; 55 | mActual = actual; 56 | } 57 | 58 | void ModWheel::generate_scaled(float scale, float *samples_out, size_t count) 59 | { 60 | const float decay = mDecay; 61 | const float non_decay = 1.0 - decay; 62 | const float target = mTarget; 63 | float actual = mActual; 64 | for (size_t i = 0; i < count; i++) { 65 | actual = non_decay * actual + decay * target; 66 | samples_out[i] = scale * actual; 67 | } 68 | mActual = actual; 69 | } -------------------------------------------------------------------------------- /Audio Unit/MVS 4/ModWheel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ModWheel.h 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/20/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS_4__ModWheel__ 10 | #define __MVS_4__ModWheel__ 11 | 12 | // Fill a buffer with smoothed Modulation Wheel values. 13 | 14 | class ModWheel { 15 | 16 | public: 17 | 18 | ModWheel(); 19 | void initialize(double sample_rate); 20 | 21 | void set_raw_MSB(uint8_t value); 22 | void set_raw_LSB(uint8_t value); 23 | 24 | void generate(float *samples_out, size_t count); 25 | void generate_scaled(float scale, float *samples_out, size_t count); 26 | 27 | private: 28 | 29 | float mSampleRate; 30 | float mDecay; 31 | uint16_t mIntTarget; 32 | float mTarget; 33 | float mActual; 34 | bool mLSBSeen; 35 | 36 | }; 37 | 38 | #endif /* defined(__MVS_4__ModWheel__) */ 39 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/NoiseSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // NoiseSource.h 3 | // MVS 4 | // 5 | // Created by Bob Miller on 12/3/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS__NoiseSource__ 10 | #define __MVS__NoiseSource__ 11 | 12 | class NoiseSource { 13 | 14 | public: 15 | 16 | enum Type { 17 | White, 18 | Pink, 19 | Red 20 | }; 21 | 22 | NoiseSource(); 23 | 24 | void initialize(double sampleRate); 25 | void generate(Type type, float *out, size_t n); 26 | 27 | private: 28 | 29 | // White state 30 | uint32_t seed; 31 | 32 | // Pink state 33 | enum { Nf = 5 }; 34 | float pink_xm1[Nf]; 35 | float pink_ym1[Nf]; 36 | float pink_a0[Nf], pink_a1[Nf], pink_b1[Nf]; 37 | float pink_gain; 38 | 39 | // Red state (e.g., Alabama) 40 | float red_ym1; 41 | float red_gain; 42 | float red_a0, red_b1; 43 | 44 | inline float frandom(); 45 | inline uint32_t cartaRandom(); 46 | 47 | }; 48 | 49 | #endif /* defined(__MVS__NoiseSource__) */ 50 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/ParamSet.h: -------------------------------------------------------------------------------- 1 | // 2 | // ParamSet.h 3 | // MVS 4 | // 5 | // Created by Bob Miller on 12/16/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS__ParamSet__ 10 | #define __MVS__ParamSet__ 11 | 12 | #include 13 | 14 | struct ValueStringMap { 15 | int value; 16 | const char *string; 17 | }; 18 | 19 | // - - - - - - - - - - - - - - - - - - - - - - - - 20 | 21 | class Param { 22 | 23 | public: 24 | 25 | // Initialization 26 | Param& name (const char *); 27 | Param& min_max (float, float); 28 | virtual Param& default_value (float); 29 | Param& value_string (int value, const char *string); 30 | Param& value_strings (const ValueStringMap *); 31 | Param& units (AudioUnitParameterUnit); 32 | Param& flag (UInt32); 33 | Param& assigns_mod (int modulator); 34 | 35 | // Get/Set 36 | virtual float get_value () const = 0; 37 | virtual OSStatus set_value (float new_value) = 0; 38 | 39 | protected: 40 | 41 | Param(); 42 | virtual ~Param(); 43 | 44 | typedef std::vector ValueStrings; 45 | 46 | ValueStrings mValueStrings; 47 | 48 | private: 49 | 50 | friend class ParamSet; 51 | friend class EnumParamBase; 52 | 53 | int mIndex; 54 | int mModIndex; 55 | AudioUnitParameterInfo mInfo; 56 | 57 | Param(const Param&); // disallow copy/assign 58 | void operator = (const Param&); 59 | 60 | }; 61 | 62 | // - - - - - - - - - - - - - - - - - - - - - - - - 63 | 64 | class FloatParam : public Param { 65 | 66 | public: 67 | 68 | FloatParam (); 69 | 70 | operator float () const { return mFloatValue; } 71 | 72 | virtual float get_value () const; 73 | virtual OSStatus set_value (float new_value); 74 | 75 | private: 76 | 77 | float mFloatValue; 78 | 79 | }; 80 | 81 | class EnumParamBase : public Param { 82 | 83 | public: 84 | 85 | virtual Param& default_value (float); 86 | 87 | virtual float get_value () const; 88 | virtual OSStatus set_value (float new_value); 89 | 90 | protected: 91 | 92 | friend class ParamSet; 93 | 94 | EnumParamBase (); 95 | 96 | int mUnmappedValue; 97 | int mMappedValue; 98 | }; 99 | 100 | template class EnumParam : public EnumParamBase { 101 | 102 | public: 103 | 104 | operator E () const { return (E)mMappedValue; } 105 | 106 | }; 107 | 108 | // - - - - - - - - - - - - - - - - - - - - - - - - 109 | 110 | class ParamClump { 111 | 112 | public: 113 | 114 | ParamClump (const char *name, const char *abbrev); 115 | ~ParamClump (); 116 | 117 | const char *name () const; 118 | const char *abbrev () const; 119 | UInt32 id () const; 120 | 121 | private: 122 | 123 | UInt32 mID; 124 | const char *mName; 125 | const char *mAbbrev; 126 | 127 | }; 128 | 129 | // - - - - - - - - - - - - - - - - - - - - - - - - 130 | 131 | class ParamSet { 132 | 133 | public: 134 | 135 | size_t size() const; 136 | 137 | float param_value (size_t index) const; 138 | const AudioUnitParameterInfo& param_info (size_t index) const; 139 | const CFArrayRef param_value_strings (size_t index) const; 140 | int param_mod_source (size_t index) const; 141 | int param_mod_dest (size_t index) const; 142 | const char *clump_name (UInt32 id) const; 143 | 144 | void set_defaults (); 145 | OSStatus set_param_value (size_t index, float value); 146 | 147 | protected: 148 | 149 | ParamSet(); 150 | 151 | private: 152 | 153 | friend class Param; 154 | friend class ParamClump; 155 | 156 | typedef std::vector ParamVec; 157 | typedef std::vector ClumpVec; 158 | 159 | ParamVec mIndex; 160 | ClumpVec mClumpIndex; 161 | 162 | }; 163 | 164 | #endif /* defined(__MVS__ParamSet__) */ 165 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAAUMIDIMapManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAAUMIDIMapManager.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __CAAUMIDIMapManager_h_ 48 | #define __CAAUMIDIMapManager_h_ 49 | 50 | #include "AUBase.h" 51 | #include "CAAUMIDIMap.h" 52 | #include 53 | #include 54 | 55 | class CAAUMIDIMapManager { 56 | 57 | protected: 58 | 59 | typedef std::vector ParameterMaps; 60 | ParameterMaps mParameterMaps; 61 | 62 | bool hotMapping; 63 | AUParameterMIDIMapping mHotMap; 64 | 65 | public: 66 | 67 | CAAUMIDIMapManager(); 68 | 69 | UInt32 NumMaps(){return static_cast(mParameterMaps.size());} 70 | void GetMaps(AUParameterMIDIMapping* maps); 71 | 72 | int FindParameterIndex(AUParameterMIDIMapping &map); 73 | 74 | void GetHotParameterMap(AUParameterMIDIMapping &outMap); 75 | 76 | void SortedRemoveFromParameterMaps (AUParameterMIDIMapping *maps, UInt32 inNumMaps, bool &outMapDidChange); 77 | OSStatus SortedInsertToParamaterMaps (AUParameterMIDIMapping *maps, UInt32 inNumMaps, AUBase &That); 78 | 79 | void ReplaceAllMaps (AUParameterMIDIMapping* inMappings, UInt32 inNumMaps, AUBase &That); 80 | 81 | bool IsHotMapping(){return hotMapping;} 82 | void SetHotMapping (AUParameterMIDIMapping &inMap){hotMapping = true; mHotMap = inMap; } 83 | 84 | bool HandleHotMapping( UInt8 inStatus, 85 | UInt8 inChannel, 86 | UInt8 inData1, 87 | AUBase &That); 88 | 89 | 90 | bool FindParameterMapEventMatch(UInt8 inStatus, 91 | UInt8 inChannel, 92 | UInt8 inData1, 93 | UInt8 inData2, 94 | UInt32 inBufferOffset, 95 | AUBase& inAUBase); 96 | #if DEBUG 97 | void Print(); 98 | #endif 99 | }; 100 | 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CADebugPrintf.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | File: CADebugPrintf.cpp 3 | Abstract: CADebugPrintf.h 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | //================================================================================================== 48 | // Includes 49 | //================================================================================================== 50 | 51 | // Self Include 52 | #include "CADebugPrintf.h" 53 | 54 | #if DEBUG || CoreAudio_Debug 55 | 56 | #if TARGET_OS_WIN32 57 | #include 58 | #include 59 | #include 60 | extern "C" 61 | int CAWin32DebugPrintf(char* inFormat, ...) 62 | { 63 | char theMessage[1024]; 64 | va_list theArguments; 65 | va_start(theArguments, inFormat); 66 | _vsnprintf(theMessage, 1024, inFormat, theArguments); 67 | va_end(theArguments); 68 | OutputDebugString(theMessage); 69 | return 0; 70 | } 71 | #endif 72 | 73 | #if defined(CoreAudio_UseSideFile) 74 | #include 75 | FILE* sDebugPrintfSideFile = NULL; 76 | extern "C" 77 | void OpenDebugPrintfSideFile() 78 | { 79 | if(sDebugPrintfSideFile == NULL) 80 | { 81 | char theFileName[1024]; 82 | snprintf(theFileName, sizeof(theFileName), CoreAudio_UseSideFile, getpid()); 83 | sDebugPrintfSideFile = fopen(theFileName, "a+"); 84 | DebugPrintfRtn(DebugPrintfFileComma "\n------------------------------\n"); 85 | } 86 | } 87 | #endif 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAException.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAException.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #if !defined(__CAException_h__) 48 | #define __CAException_h__ 49 | 50 | //============================================================================= 51 | // Includes 52 | //============================================================================= 53 | 54 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 55 | #include 56 | #else 57 | #include "CoreAudioTypes.h" 58 | #endif 59 | 60 | //============================================================================= 61 | // CAException 62 | //============================================================================= 63 | 64 | class CAException 65 | { 66 | 67 | public: 68 | CAException(OSStatus inError) : mError(inError) {} 69 | CAException(const CAException& inException) : mError(inException.mError) {} 70 | CAException& operator=(const CAException& inException) { mError = inException.mError; return *this; } 71 | ~CAException() {} 72 | 73 | OSStatus GetError() const { return mError; } 74 | 75 | protected: 76 | OSStatus mError; 77 | }; 78 | 79 | #define CATry try{ 80 | #define CACatch } catch(...) {} 81 | #define CASwallowException(inExpression) try { inExpression; } catch(...) {} 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAMath.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAMath.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __CAMath_h__ 48 | #define __CAMath_h__ 49 | 50 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 51 | #include 52 | #else 53 | #include 54 | #endif 55 | 56 | inline bool fiszero(Float64 f) { return (f == 0.); } 57 | inline bool fiszero(Float32 f) { return (f == 0.f); } 58 | 59 | inline bool fnonzero(Float64 f) { return !fiszero(f); } 60 | inline bool fnonzero(Float32 f) { return !fiszero(f); } 61 | 62 | inline bool fequal(const Float64 &a, const Float64 &b) { return a == b; } 63 | inline bool fequal(const Float32 &a, const Float32 &b) { return a == b; } 64 | 65 | inline bool fnotequal(const Float64 &a, const Float64 &b) { return !fequal(a, b); } 66 | inline bool fnotequal(const Float32 &a, const Float32 &b) { return !fequal(a, b); } 67 | 68 | #endif // __CAMath_h__ 69 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAReferenceCounted.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAReferenceCounted.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __CAReferenceCounted_h__ 48 | #define __CAReferenceCounted_h__ 49 | 50 | #include "CAAtomic.h" 51 | 52 | // base class for reference-counted objects 53 | class CAReferenceCounted { 54 | public: 55 | CAReferenceCounted() : mRefCount(1) {} 56 | 57 | void retain() { CAAtomicIncrement32(&mRefCount); } 58 | 59 | void release() 60 | { 61 | SInt32 rc = CAAtomicDecrement32(&mRefCount); 62 | if (rc == 0) { 63 | releaseObject(); 64 | } 65 | } 66 | 67 | 68 | class Retainer { 69 | public: 70 | Retainer(CAReferenceCounted *obj) : mObject(obj) { mObject->retain(); } 71 | ~Retainer() { mObject->release(); } 72 | 73 | private: 74 | CAReferenceCounted * mObject; 75 | }; 76 | 77 | protected: 78 | virtual ~CAReferenceCounted() { } 79 | 80 | virtual void releaseObject () 81 | { 82 | delete this; 83 | } 84 | 85 | #if DEBUG 86 | public: 87 | #endif 88 | SInt32 GetReferenceCount() const { return mRefCount; } 89 | private: 90 | SInt32 mRefCount; 91 | 92 | CAReferenceCounted(const CAReferenceCounted &a); 93 | CAReferenceCounted &operator=(const CAReferenceCounted &a); 94 | }; 95 | 96 | 97 | #endif // __CAReferenceCounted_h__ 98 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAVectorUnit.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAVectorUnit.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __CAVectorUnit_h__ 48 | #define __CAVectorUnit_h__ 49 | 50 | #include 51 | #include "CAVectorUnitTypes.h" 52 | #include 53 | #include 54 | 55 | #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__) 56 | #include 57 | #else 58 | #include "CFBase.h" 59 | #endif 60 | 61 | // Unify checks for vector units. 62 | // Allow setting an environment variable "CA_NoVector" to turn off vectorized code at runtime (very useful for performance testing). 63 | 64 | extern int gCAVectorUnitType; 65 | 66 | #ifdef __cplusplus 67 | extern "C" { 68 | #endif 69 | 70 | extern SInt32 CAVectorUnit_Examine(); // expensive. use GetType() for lazy initialization and caching. 71 | 72 | static inline SInt32 CAVectorUnit_GetType() 73 | { 74 | int x = gCAVectorUnitType; 75 | return (x != kVecUninitialized) ? x : CAVectorUnit_Examine(); 76 | } 77 | 78 | static inline Boolean CAVectorUnit_HasVectorUnit() 79 | { 80 | return CAVectorUnit_GetType() > kVecNone; 81 | } 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | 88 | #ifdef __cplusplus 89 | class CAVectorUnit { 90 | public: 91 | static SInt32 GetVectorUnitType() { return CAVectorUnit_GetType(); } 92 | static bool HasVectorUnit() { return GetVectorUnitType() > kVecNone; } 93 | static bool HasAltivec() { return GetVectorUnitType() == kVecAltivec; } 94 | static bool HasSSE2() { return GetVectorUnitType() >= kVecSSE2; } 95 | static bool HasSSE3() { return GetVectorUnitType() >= kVecSSE3; } 96 | static bool HasAVX1() { return GetVectorUnitType() >= kVecAVX1; } 97 | static bool HasNeon() { return GetVectorUnitType() == kVecNeon; } 98 | }; 99 | #endif 100 | 101 | #endif // __CAVectorUnit_h__ 102 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAVectorUnitTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAVectorUnitTypes.h 3 | Abstract: Part of CoreAudio Utility Classes 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #ifndef __CAVectorUnitTypes_h__ 48 | #define __CAVectorUnitTypes_h__ 49 | 50 | enum { 51 | kVecUninitialized = -1, 52 | kVecNone = 0, 53 | kVecAltivec = 1, 54 | kVecSSE2 = 100, 55 | kVecSSE3 = 101, 56 | kVecAVX1 = 110, 57 | kVecNeon = 200 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/PublicUtility/CAXException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | File: CAXException.cpp 3 | Abstract: CAXException.h 4 | Version: 1.0.1 5 | 6 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 7 | Inc. ("Apple") in consideration of your agreement to the following 8 | terms, and your use, installation, modification or redistribution of 9 | this Apple software constitutes acceptance of these terms. If you do 10 | not agree with these terms, please do not use, install, modify or 11 | redistribute this Apple software. 12 | 13 | In consideration of your agreement to abide by the following terms, and 14 | subject to these terms, Apple grants you a personal, non-exclusive 15 | license, under Apple's copyrights in this original Apple software (the 16 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 17 | Software, with or without modifications, in source and/or binary forms; 18 | provided that if you redistribute the Apple Software in its entirety and 19 | without modifications, you must retain this notice and the following 20 | text and disclaimers in all such redistributions of the Apple Software. 21 | Neither the name, trademarks, service marks or logos of Apple Inc. may 22 | be used to endorse or promote products derived from the Apple Software 23 | without specific prior written permission from Apple. Except as 24 | expressly stated in this notice, no other rights or licenses, express or 25 | implied, are granted by Apple herein, including but not limited to any 26 | patent rights that may be infringed by your derivative works or by other 27 | works in which the Apple Software may be incorporated. 28 | 29 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 30 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 31 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 32 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 33 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 34 | 35 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 36 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 37 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 38 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 39 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 40 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 41 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 42 | POSSIBILITY OF SUCH DAMAGE. 43 | 44 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 45 | 46 | */ 47 | #include "CAXException.h" 48 | 49 | CAXException::WarningHandler CAXException::sWarningHandler = NULL; 50 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Random.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Random.cpp 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/20/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include "Random.h" 10 | 11 | static uint32_t seed = 1; 12 | 13 | uint32_t carta_random() 14 | { 15 | uint32_t lo = 16807 * (seed & 0xFFFF); 16 | uint32_t hi = 16807 * (seed >> 16); 17 | lo += (hi & 0x7FFF) << 16; 18 | lo += hi >> 15; 19 | if (lo > 0x7FFFFFFF) 20 | lo -= 0x7FFFFFFF; 21 | return seed = lo; 22 | } 23 | 24 | float frandom() 25 | { 26 | return carta_random() * (2.0 / 0x7fffffff) - 1; 27 | } 28 | -------------------------------------------------------------------------------- /Audio Unit/MVS 4/Random.h: -------------------------------------------------------------------------------- 1 | // 2 | // Random.h 3 | // MVS 4 4 | // 5 | // Created by Bob Miller on 12/20/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #ifndef __MVS_4__Random__ 10 | #define __MVS_4__Random__ 11 | 12 | uint32_t carta_random(); // uniform from 0 to 0x7FFFFFFF 13 | 14 | float frandom(); // uniform from -1 to +1. 15 | 16 | #endif /* defined(__MVS_4__Random__) */ 17 | -------------------------------------------------------------------------------- /Audio Unit/One Note/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // One Note 4 | // 5 | // Created by Bob Miller on 11/17/14. 6 | // Copyright (c) 2014 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #include "Envelope.h" 12 | #include "Oscillator.h" 13 | 14 | class OneNote { 15 | 16 | public: 17 | OneNote(); 18 | size_t render(Float32 *outbuf, size_t count); 19 | 20 | private: 21 | Oscillator mOsc1; 22 | Envelope mAmpEnv; 23 | }; 24 | 25 | OneNote::OneNote() 26 | { 27 | mOsc1.initialize(44100.0); 28 | mAmpEnv.initialize(44100.0, 0.6, 0.1, 0.2, 0.1, 0.3, Envelope::Exponential); 29 | } 30 | 31 | size_t OneNote::render(Float32 *outbuf, size_t count) 32 | { 33 | const size_t chunk_size = 512; 34 | size_t note_count; 35 | Float32 ampbuf[chunk_size], osc1buf[chunk_size]; 36 | bool released = false; 37 | for (size_t i = 0; i < count; i++) 38 | outbuf[i] = -0.5; 39 | for (note_count = 0; note_count < count; ) { 40 | size_t chunk_count = count - note_count; 41 | if (chunk_count > chunk_size) 42 | chunk_count = chunk_size; 43 | UInt32 end = mAmpEnv.generate(ampbuf, (UInt32)chunk_count); 44 | if (end != 0xFFFFFFFF) 45 | chunk_count = end; 46 | if (note_count > count / 2 && !released) { 47 | mAmpEnv.release(); 48 | released = true; 49 | } 50 | memset(osc1buf, 0, sizeof osc1buf); 51 | mOsc1.generate(Oscillator::Square, 52 | 440.0 / 44100, 53 | 0.5, 54 | osc1buf, 55 | chunk_count); 56 | for (size_t i = 0; i < chunk_count; i++) 57 | outbuf[note_count + i] = osc1buf[i] * ampbuf[i]; 58 | // for (size_t i = 0; i < chunk_count; i++) 59 | // outbuf[note_count + i] = ampbuf[i]; 60 | // for (size_t i = 0; i < chunk_count; i++) 61 | // outbuf[note_count + i] = osc1buf[i]; 62 | note_count += chunk_count; 63 | if (end != 0xFFFFFFFF) 64 | break; 65 | } 66 | return note_count; 67 | } 68 | 69 | void save_to_foo(Float32 *buf, size_t count) 70 | { 71 | FILE *f = fopen("/tmp/foo", "w"); 72 | // for (size_t i = 0; i < 5000; i++) { 73 | // fprintf(f, "0\n"); 74 | // } 75 | for (size_t i = 0; i < count; i++) { 76 | Float32 x = buf[i]; 77 | if (isnan(x) || isinf(x)) 78 | x = 0; 79 | fprintf(f, "%g\n", x); 80 | 81 | } 82 | fprintf(f, "end\n"); 83 | fclose(f); 84 | } 85 | 86 | int main(int argc, const char * argv[]) { 87 | // insert code here... 88 | std::cout << "Hello, World!\n"; 89 | OneNote a; 90 | size_t count = 44100; 91 | Float32 note[count]; 92 | count = a.render(note, count); 93 | save_to_foo(note, count); 94 | std::cout << "Good bye, World!\n"; 95 | return 0; 96 | } 97 | -------------------------------------------------------------------------------- /Audio Unit/UI Mockup/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // UI Mockup 4 | // 5 | // Created by Bob Miller on 1/12/15. 6 | // Copyright (c) 2015 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Audio Unit/UI Mockup/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // UI Mockup 4 | // 5 | // Created by Bob Miller on 1/12/15. 6 | // Copyright (c) 2015 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @property (weak) IBOutlet NSWindow *window; 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 19 | // Insert code here to initialize your application 20 | } 21 | 22 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Audio Unit/UI Mockup/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /Audio Unit/UI Mockup/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 kbobsoft.com. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Audio Unit/UI Mockup/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // UI Mockup 4 | // 5 | // Created by Bob Miller on 1/12/15. 6 | // Copyright (c) 2015 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /Audio Unit/UI MockupTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Audio Unit/UI MockupTests/UI_MockupTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // UI_MockupTests.m 3 | // UI MockupTests 4 | // 5 | // Created by Bob Miller on 1/12/15. 6 | // Copyright (c) 2015 kbobsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface UI_MockupTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation UI_MockupTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ECAD/LaenPCBOrder.dru: -------------------------------------------------------------------------------- 1 | description[de] = EAGLE Design Rules\n

\nDie Standard-Design-Rules sind so gewählt, dass sie für \ndie meisten Anwendungen passen. Sollte ihre Platine \nbesondere Anforderungen haben, treffen Sie die erforderlichen\nEinstellungen hier und speichern die Design Rules unter \neinem neuen Namen ab. 2 | description[en] = Laen's PCB Order Design Rules\n

\nPlease make sure your boards conform to these design rules. 3 | layerSetup = (1*16) 4 | mtCopper = 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 0.0356mm 5 | mtIsolate = 1.5011mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 0.1499mm 0.2007mm 6 | mdWireWire = 6mil 7 | mdWirePad = 6mil 8 | mdWireVia = 6mil 9 | mdPadPad = 6mil 10 | mdPadVia = 6mil 11 | mdViaVia = 6mil 12 | mdSmdPad = 6mil 13 | mdSmdVia = 6mil 14 | mdSmdSmd = 6mil 15 | mdViaViaSameLayer = 8mil 16 | mnLayersViaInSmd = 2 17 | mdCopperDimension = 15mil 18 | mdDrill = 6mil 19 | mdSmdStop = 0mil 20 | msWidth = 6mil 21 | msDrill = 13mil 22 | msMicroVia = 13mil 23 | msBlindViaRatio = 0.500000 24 | rvPadTop = 0.250000 25 | rvPadInner = 0.250000 26 | rvPadBottom = 0.250000 27 | rvViaOuter = 0.250000 28 | rvViaInner = 0.250000 29 | rvMicroViaOuter = 0.250000 30 | rvMicroViaInner = 0.250000 31 | rlMinPadTop = 7mil 32 | rlMaxPadTop = 20mil 33 | rlMinPadInner = 7mil 34 | rlMaxPadInner = 20mil 35 | rlMinPadBottom = 7mil 36 | rlMaxPadBottom = 20mil 37 | rlMinViaOuter = 7mil 38 | rlMaxViaOuter = 20mil 39 | rlMinViaInner = 7mil 40 | rlMaxViaInner = 20mil 41 | rlMinMicroViaOuter = 4mil 42 | rlMaxMicroViaOuter = 20mil 43 | rlMinMicroViaInner = 4mil 44 | rlMaxMicroViaInner = 20mil 45 | psTop = -1 46 | psBottom = -1 47 | psFirst = -1 48 | psElongationLong = 100 49 | psElongationOffset = 100 50 | mvStopFrame = 1.000000 51 | mvCreamFrame = 0.000000 52 | mlMinStopFrame = 3mil 53 | mlMaxStopFrame = 3mil 54 | mlMinCreamFrame = 0mil 55 | mlMaxCreamFrame = 0mil 56 | mlViaStopLimit = 0mil 57 | srRoundness = 0.000000 58 | srMinRoundness = 0mil 59 | srMaxRoundness = 0mil 60 | slThermalGap = 0.500000 61 | slMinThermalGap = 20mil 62 | slMaxThermalGap = 100mil 63 | slAnnulusIsolate = 20mil 64 | slThermalIsolate = 10mil 65 | slAnnulusRestring = 0 66 | slThermalRestring = 1 67 | slThermalsForVias = 0 68 | checkGrid = 0 69 | checkAngle = 0 70 | checkFont = 1 71 | checkRestrict = 1 72 | useDiameter = 13 73 | maxErrors = 50 74 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/.gitignore: -------------------------------------------------------------------------------- 1 | *-rescue.lib 2 | *.bak 3 | *.bck 4 | *.dsn 5 | *.kicad_pcb-bak 6 | *.kicad_pcb.orig 7 | *.rpt 8 | *.ses 9 | _autosave-* 10 | _saved_*.sch 11 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/Digikey Order.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/Digikey Order.numbers -------------------------------------------------------------------------------- /ECAD/io_daughterboard/Stuffing Guide.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1404\cocoasubrtf470 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww13440\viewh17040\viewkind1 5 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl360\slmult1\pardirnatural\partightenfactor0 6 | 7 | \f0\fs24 \cf0 J1 FPC-40\ 8 | J2 FPC-6\ 9 | L1 10uH\ 10 | User button\ 11 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 12 | \cf0 System\ 13 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl360\slmult1\pardirnatural\partightenfactor0 14 | \cf0 U6 STMPE811\ 15 | U3 U4 U5 74HC244\ 16 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 17 | \cf0 U7 U8 U9\ 18 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl360\slmult1\pardirnatural\partightenfactor0 19 | \cf0 U2 SPX3819\ 20 | U1 FAN533\ 21 | U10 U11 74LV1T34\ 22 | D1 -|<- MBR0540\ 23 | D2 -|<- 24V Zener\ 24 | \ 25 | C10 C11 1\'b5F 0805\ 26 | C13 10nF\ 27 | C14 1\'b5F\ 28 | C15 C16 1nF\ 29 | C1 C2 C3 C4 C5 100nF\ 30 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 31 | \cf0 C6 C7 C8 C9 C12\ 32 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl360\slmult1\pardirnatural\partightenfactor0 33 | \cf0 \ 34 | R13 4.3\ 35 | R14 R28 1M\ 36 | R15 R16 R19 R22 4.7K\ 37 | R25 R31 100\ 38 | R32 R33 R34 R35 100K\ 39 | R1 R2 R3 R4 R5 10K\ 40 | \pard\tx2160\tx2165\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 41 | \cf0 R6 R7 R8 R9 R10\ 42 | R11 R17 R18 R20 R21\ 43 | R23 R24 R26 R27 R29\ 44 | R30\ 45 | } -------------------------------------------------------------------------------- /ECAD/io_daughterboard/artwork/MVS Logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/artwork/MVS Logo.xcf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/3.3V Regulator/Exar-SPX3819M5-L-3-3_TR-datasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/3.3V Regulator/Exar-SPX3819M5-L-3-3_TR-datasheet.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/ER-CON06HT-1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/ER-CON06HT-1.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/ER-TPC050-1_Drawing.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/ER-TPC050-1_Drawing.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/GSL1680.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/GSL1680.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/en-xf2l.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Capacitive Touch Connector/en-xf2l.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Backlight Driver/FAN5333BSX-Fairchild.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Backlight Driver/FAN5333BSX-Fairchild.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Backlight Driver/MBR0540-Fairchild.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Backlight Driver/MBR0540-Fairchild.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Backlight Driver/MM3Z2V4T1-D.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Backlight Driver/MM3Z2V4T1-D.PDF -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Connector/ER-TFT050-3_Datasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Connector/ER-TFT050-3_Datasheet.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Connector/FH12_05860557855_2d.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Connector/FH12_05860557855_2d.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/LCD Connector/FH12_catalog.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/LCD Connector/FH12_catalog.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/MIDI Level Shifters/sn74lv1t34.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/MIDI Level Shifters/sn74lv1t34.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Master Sockets/ssq_th.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Master Sockets/ssq_th.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Master Sockets/ssw-1xx-xx-xxx-x-xx-xxx-xx-mkt.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Master Sockets/ssw-1xx-xx-xxx-x-xx-xxx-xx-mkt.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Master Sockets/ssw-d.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Master Sockets/ssw-d.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Power Barrel jack/21mmdcjackDatasheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Power Barrel jack/21mmdcjackDatasheet.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Resistive Touch Controller/STMPE811.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Resistive Touch Controller/STMPE811.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/SPI Buffers/74HC_HCT244.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/SPI Buffers/74HC_HCT244.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Slave Headers/ePH.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Slave Headers/ePH.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/datasheets/Tactile Buttons/4301x2xxx8x6.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/ECAD/io_daughterboard/datasheets/Tactile Buttons/4301x2xxx8x6.pdf -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/B4B-PH-SM4-TB.kicad_mod: -------------------------------------------------------------------------------- 1 | (module B4B-PH-SM4-TB (layer F.Cu) (tedit 582E4748) 2 | (fp_text reference REF** (at -4.15 -2.775) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value "JST B4B-PH-SM4-TB" (at 0.05 -5.525) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 5.975 3.1) (end 4 3.1) (layer F.SilkS) (width 0.4)) 9 | (fp_line (start -5.975 -1.175) (end -5.975 -1.9) (layer F.SilkS) (width 0.4)) 10 | (fp_line (start 5.975 -1.9) (end 5.975 -1.175) (layer F.SilkS) (width 0.4)) 11 | (fp_line (start -5.975 3.1) (end -4 3.1) (layer F.SilkS) (width 0.4)) 12 | (fp_line (start -5.975 -1.9) (end 5.975 -1.9) (layer F.SilkS) (width 0.4)) 13 | (pad 0 connect rect (at 5.4 0.6) (size 1.6 3) (layers F.Cu F.Mask)) 14 | (pad 4 smd rect (at -3 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 15 | (pad 3 smd rect (at -1 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 16 | (pad 2 smd rect (at 1 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 17 | (pad 1 smd rect (at 3 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 18 | (pad 0 connect rect (at -5.4 0.6) (size 1.6 3) (layers F.Cu F.Mask)) 19 | ) 20 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/B6B-PH-SM4-TB.kicad_mod: -------------------------------------------------------------------------------- 1 | (module B6B-PH-SM4-TB (layer F.Cu) (tedit 582E45DB) 2 | (fp_text reference REF** (at -6.15 -2.775) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value "JST B6B-PH-SM4-TB" (at 0.05 -5.525) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 7.975 3.1) (end 6 3.1) (layer F.SilkS) (width 0.4)) 9 | (fp_line (start -7.975 -1.175) (end -7.975 -1.9) (layer F.SilkS) (width 0.4)) 10 | (fp_line (start 7.975 -1.9) (end 7.975 -1.175) (layer F.SilkS) (width 0.4)) 11 | (fp_line (start -7.975 3.1) (end -6 3.1) (layer F.SilkS) (width 0.4)) 12 | (fp_line (start -7.975 -1.9) (end 7.975 -1.9) (layer F.SilkS) (width 0.4)) 13 | (pad 6 smd rect (at -5 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 14 | (pad 5 smd rect (at -3 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 15 | (pad 0 connect rect (at 7.4 0.6) (size 1.6 3) (layers F.Cu F.Mask)) 16 | (pad 4 smd rect (at -1 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 17 | (pad 3 smd rect (at 1 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 18 | (pad 2 smd rect (at 3 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 19 | (pad 1 smd rect (at 5 2.85) (size 1 5.5) (layers F.Cu F.Paste F.Mask)) 20 | (pad 0 connect rect (at -7.4 0.6) (size 1.6 3) (layers F.Cu F.Mask)) 21 | ) 22 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/BARREL_JACK.kicad_mod: -------------------------------------------------------------------------------- 1 | (module BARREL_JACK (layer F.Cu) (tedit 58573BCC) 2 | (descr "DC Barrel Jack") 3 | (tags "Power Jack") 4 | (fp_text reference CON1 (at -2 6 180) (layer F.SilkS) hide 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value BARREL_JACK (at 0 -5.99948) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_text user "5V DC" (at 13.5 0 90) (layer F.SilkS) 11 | (effects (font (size 1 1) (thickness 0.15))) 12 | ) 13 | (fp_text user + (at 10.5 -5.014776 90) (layer F.SilkS) 14 | (effects (font (size 1 1) (thickness 0.15))) 15 | ) 16 | (fp_text user - (at 10.5 5 90) (layer F.SilkS) 17 | (effects (font (size 1 1) (thickness 0.15))) 18 | ) 19 | (fp_line (start 10.5 1.5) (end 10.5 4) (layer F.SilkS) (width 0.4)) 20 | (fp_line (start 10.5 -0.5) (end 10.5 -4) (layer F.SilkS) (width 0.4)) 21 | (fp_arc (start 10.5 0) (end 11.5 -1) (angle 270) (layer F.SilkS) (width 0.4)) 22 | (fp_circle (center 10.5 0) (end 10.5 0.5) (layer F.SilkS) (width 0.4)) 23 | (fp_line (start -4.0005 -4.50088) (end -4.0005 4.50088) (layer F.SilkS) (width 0.15)) 24 | (fp_line (start -7.50062 -4.50088) (end -7.50062 4.50088) (layer F.SilkS) (width 0.15)) 25 | (fp_line (start -7.50062 4.50088) (end 7.00024 4.50088) (layer F.SilkS) (width 0.15)) 26 | (fp_line (start 7.00024 4.50088) (end 7.00024 -4.50088) (layer F.SilkS) (width 0.15)) 27 | (fp_line (start 7.00024 -4.50088) (end -7.50062 -4.50088) (layer F.SilkS) (width 0.15)) 28 | (pad 1 thru_hole rect (at 6.20014 0) (size 3.50012 3.50012) (drill 1.1) (layers *.Cu *.Mask)) 29 | (pad 2 thru_hole rect (at 0.20066 0) (size 3.50012 3.50012) (drill 1.1) (layers *.Cu *.Mask)) 30 | (pad 3 thru_hole rect (at 3.2004 4.699) (size 3.50012 3.50012) (drill 1.1) (layers *.Cu *.Mask)) 31 | (model Connect.3dshapes/JACK_ALIM.wrl 32 | (at (xyz 0 0 0)) 33 | (scale (xyz 0.75 0.75 0.75)) 34 | (rotate (xyz 0 0 0)) 35 | ) 36 | ) 37 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/Molex_PicoBlade_53047-0610_06x1.25mm_Straight.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Molex_PicoBlade_53047-0610_06x1.25mm_Straight (layer F.Cu) (tedit 58326060) 2 | (descr "Molex PicoBlade, single row, top entry type, through hole, PN:53047-0610") 3 | (tags "connector molex picoblade") 4 | (fp_text reference REF** (at 3.125 2.5) (layer F.Fab) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Molex_PicoBlade_53047-0610_06x1.25mm_Straight (at 3.125 -3.25) (layer F.SilkS) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_circle (center -1.1 0.725) (end -0.9 0.725) (layer F.Fab) (width 0.15)) 11 | (fp_line (start -2 -2.55) (end -2 1.6) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start -2 1.6) (end 8.25 1.6) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start 8.25 1.6) (end 8.25 -2.55) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start 8.25 -2.55) (end -2 -2.55) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.5 -2.075) (end -1.5 1.125) (layer F.Fab) (width 0.15)) 16 | (fp_line (start -1.5 1.125) (end 7.75 1.125) (layer F.Fab) (width 0.15)) 17 | (fp_line (start 7.75 1.125) (end 7.75 -2.075) (layer F.Fab) (width 0.15)) 18 | (fp_line (start 7.75 -2.075) (end -1.5 -2.075) (layer F.Fab) (width 0.15)) 19 | (fp_line (start -1.65 -2.225) (end -1.65 1.275) (layer F.SilkS) (width 0.15)) 20 | (fp_line (start -1.65 1.275) (end 7.9 1.275) (layer F.SilkS) (width 0.15)) 21 | (fp_line (start 7.9 1.275) (end 7.9 -2.225) (layer F.SilkS) (width 0.15)) 22 | (fp_line (start 7.9 -2.225) (end -1.65 -2.225) (layer F.SilkS) (width 0.15)) 23 | (fp_line (start 3.125 0.725) (end -1.1 0.725) (layer F.SilkS) (width 0.15)) 24 | (fp_line (start -1.1 0.725) (end -1.1 0) (layer F.SilkS) (width 0.15)) 25 | (fp_line (start -1.1 0) (end -1.3 0) (layer F.SilkS) (width 0.15)) 26 | (fp_line (start -1.3 0) (end -1.3 -0.8) (layer F.SilkS) (width 0.15)) 27 | (fp_line (start -1.3 -0.8) (end -1.1 -0.8) (layer F.SilkS) (width 0.15)) 28 | (fp_line (start -1.1 -0.8) (end -1.1 -1.675) (layer F.SilkS) (width 0.15)) 29 | (fp_line (start -1.1 -1.675) (end 3.125 -1.675) (layer F.SilkS) (width 0.15)) 30 | (fp_line (start 3.125 0.725) (end 7.35 0.725) (layer F.SilkS) (width 0.15)) 31 | (fp_line (start 7.35 0.725) (end 7.35 0) (layer F.SilkS) (width 0.15)) 32 | (fp_line (start 7.35 0) (end 7.55 0) (layer F.SilkS) (width 0.15)) 33 | (fp_line (start 7.55 0) (end 7.55 -0.8) (layer F.SilkS) (width 0.15)) 34 | (fp_line (start 7.55 -0.8) (end 7.35 -0.8) (layer F.SilkS) (width 0.15)) 35 | (fp_line (start 7.35 -0.8) (end 7.35 -1.675) (layer F.SilkS) (width 0.15)) 36 | (fp_line (start 7.35 -1.675) (end 3.125 -1.675) (layer F.SilkS) (width 0.15)) 37 | (fp_line (start -1.9 1.525) (end -1.9 0.525) (layer F.SilkS) (width 0.15)) 38 | (fp_line (start -1.9 1.525) (end -0.9 1.525) (layer F.SilkS) (width 0.15)) 39 | (pad 1 thru_hole rect (at 0 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 40 | (pad 2 thru_hole circle (at 1.25 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 41 | (pad 3 thru_hole circle (at 2.5 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 42 | (pad 4 thru_hole circle (at 3.75 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 43 | (pad 5 thru_hole circle (at 5 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 44 | (pad 6 thru_hole circle (at 6.25 0) (size 0.85 0.85) (drill 0.5) (layers *.Cu *.Mask)) 45 | (model Connectors_Molex.3dshapes/Molex_PicoBlade_53047-0610.wrl 46 | (at (xyz 0.123031 0 0)) 47 | (scale (xyz 1 1 1)) 48 | (rotate (xyz 0 0 180)) 49 | ) 50 | ) 51 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/R_0603_HandSoldering_no_paste.kicad_mod: -------------------------------------------------------------------------------- 1 | (module R_0603_HandSoldering_no_paste (layer F.Cu) (tedit 583CB79E) 2 | (descr "Resistor SMD 0603, hand soldering") 3 | (tags "resistor 0603") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.9) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value R_0603_HandSoldering (at 0 1.9) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start -0.8 0.4) (end -0.8 -0.4) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 0.8 0.4) (end -0.8 0.4) (layer F.Fab) (width 0.1)) 13 | (fp_line (start 0.8 -0.4) (end 0.8 0.4) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -0.8 -0.4) (end 0.8 -0.4) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -2 -0.8) (end 2 -0.8) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -2 0.8) (end 2 0.8) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -2 -0.8) (end -2 0.8) (layer F.CrtYd) (width 0.05)) 18 | (fp_line (start 2 -0.8) (end 2 0.8) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start 0.5 0.675) (end -0.5 0.675) (layer F.SilkS) (width 0.15)) 20 | (fp_line (start -0.5 -0.675) (end 0.5 -0.675) (layer F.SilkS) (width 0.15)) 21 | (pad 1 smd rect (at -1.1 0) (size 1.2 0.9) (layers F.Cu F.Mask)) 22 | (pad 2 smd rect (at 1.1 0) (size 1.2 0.9) (layers F.Cu F.Mask)) 23 | (model Resistors_SMD.3dshapes/R_0603_HandSoldering.wrl 24 | (at (xyz 0 0 0)) 25 | (scale (xyz 1 1 1)) 26 | (rotate (xyz 0 0 0)) 27 | ) 28 | ) 29 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/WS-TASV.kicad_mod: -------------------------------------------------------------------------------- 1 | (module WS-TASV (layer F.Cu) (tedit 5857448A) 2 | (fp_text reference REF** (at 0 -4) (layer F.Fab) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value WS-TASV (at 0 4) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 3 1) (end 3 -1) (layer F.SilkS) (width 0.4)) 9 | (fp_line (start -3 -1) (end -3 1) (layer F.SilkS) (width 0.4)) 10 | (fp_line (start 3 -3) (end -3 -3) (layer F.SilkS) (width 0.4)) 11 | (fp_line (start -3 3) (end 3 3) (layer F.SilkS) (width 0.4)) 12 | (pad 1 smd rect (at -3.975 -2.25) (size 1.55 1.3) (layers F.Cu F.Paste F.Mask)) 13 | (pad 2 smd rect (at -3.975 2.25) (size 1.55 1.3) (layers F.Cu F.Paste F.Mask)) 14 | (pad 3 smd rect (at 3.975 -2.25) (size 1.55 1.3) (layers F.Cu F.Paste F.Mask)) 15 | (pad 4 smd rect (at 3.975 2.25) (size 1.55 1.3) (layers F.Cu F.Paste F.Mask)) 16 | (model Buttons_Switches_SMD.3dshapes/SW_SPST_PTS645.wrl 17 | (at (xyz 0 0 0)) 18 | (scale (xyz 1 1 1)) 19 | (rotate (xyz 0 0 0)) 20 | ) 21 | ) 22 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/XF2L-0625.kicad_mod: -------------------------------------------------------------------------------- 1 | (module XF2L-0625 (layer F.Cu) (tedit 58433FB4) 2 | (fp_text reference REF** (at 3.8 -1.625) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value XF2L-0625 (at 0 6.5) (layer F.Fab) hide 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -4.5 5.5) (end 4.5 5.5) (layer F.SilkS) (width 0.4)) 9 | (fp_line (start 4.5 5.5) (end 4.5 0) (layer F.SilkS) (width 0.4)) 10 | (fp_line (start 4 5.5) (end -4.5 5.5) (layer F.SilkS) (width 0.4)) 11 | (fp_line (start -4.5 5.5) (end -4.5 0) (layer F.SilkS) (width 0.4)) 12 | (pad 0 smd rect (at 2.79 1.7) (size 2 3) (layers F.Cu F.Paste F.Mask)) 13 | (pad 3 smd rect (at 0.25 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 14 | (pad 1 smd rect (at 1.25 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 15 | (pad 2 smd rect (at 0.75 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 16 | (pad 4 smd rect (at -0.25 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 17 | (pad 5 smd rect (at -0.75 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 18 | (pad 6 smd rect (at -1.25 -0.625 180) (size 0.3 1.25) (layers F.Cu F.Paste F.Mask)) 19 | (pad 0 smd rect (at -2.79 1.7) (size 2 3) (layers F.Cu F.Paste F.Mask)) 20 | ) 21 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/daughterfeet.pretty/b6b-ph-kl.kicad_mod: -------------------------------------------------------------------------------- 1 | (module b6b-ph-kl (layer F.Cu) 2 | (descr "JST PH series connector, B6B-PH-KL") 3 | (fp_text reference JP*** (at 0 -2.99974) (layer F.SilkS) 4 | (effects (font (thickness 0.3048))) 5 | ) 6 | (fp_text value b6b-ph-kl (at 0 4.20116) (layer F.SilkS) 7 | (effects (font (thickness 0.3048))) 8 | ) 9 | (fp_line (start 7.00024 -1.69926) (end -7.00024 -1.69926) (layer F.SilkS) (width 0.381)) 10 | (fp_line (start -7.00024 2.79908) (end 7.00024 2.79908) (layer F.SilkS) (width 0.381)) 11 | (fp_line (start 6.49986 2.30124) (end -6.49986 2.30124) (layer F.SilkS) (width 0.381)) 12 | (fp_line (start 1.89738 2.30124) (end 1.89738 1.80086) (layer F.SilkS) (width 0.381)) 13 | (fp_line (start 1.89738 1.80086) (end 2.0955 1.80086) (layer F.SilkS) (width 0.381)) 14 | (fp_line (start 2.0955 1.80086) (end 2.0955 2.30124) (layer F.SilkS) (width 0.381)) 15 | (fp_line (start 4.09702 1.80086) (end 4.09702 2.30124) (layer F.SilkS) (width 0.381)) 16 | (fp_line (start 3.8989 1.80086) (end 4.09702 1.80086) (layer F.SilkS) (width 0.381)) 17 | (fp_line (start 3.8989 2.30124) (end 3.8989 1.80086) (layer F.SilkS) (width 0.381)) 18 | (fp_line (start -1.90246 1.80086) (end -1.90246 2.30124) (layer F.SilkS) (width 0.381)) 19 | (fp_line (start -2.10058 1.80086) (end -1.90246 1.80086) (layer F.SilkS) (width 0.381)) 20 | (fp_line (start -2.10058 2.30124) (end -2.10058 1.80086) (layer F.SilkS) (width 0.381)) 21 | (fp_line (start -3.90398 1.80086) (end -3.90398 2.30124) (layer F.SilkS) (width 0.381)) 22 | (fp_line (start -4.1021 1.80086) (end -3.90398 1.80086) (layer F.SilkS) (width 0.381)) 23 | (fp_line (start -4.1021 2.30124) (end -4.1021 1.80086) (layer F.SilkS) (width 0.381)) 24 | (fp_line (start -0.1016 2.30124) (end -0.1016 1.80086) (layer F.SilkS) (width 0.381)) 25 | (fp_line (start -0.1016 1.80086) (end 0.09652 1.80086) (layer F.SilkS) (width 0.381)) 26 | (fp_line (start 0.09652 1.80086) (end 0.09652 2.30124) (layer F.SilkS) (width 0.381)) 27 | (fp_line (start 7.00024 -0.50038) (end 6.49986 -0.50038) (layer F.SilkS) (width 0.381)) 28 | (fp_line (start 6.49986 0.8001) (end 7.00024 0.8001) (layer F.SilkS) (width 0.381)) 29 | (fp_line (start -6.5024 0.8001) (end -7.00278 0.8001) (layer F.SilkS) (width 0.381)) 30 | (fp_line (start -6.5024 -0.50038) (end -7.00278 -0.50038) (layer F.SilkS) (width 0.381)) 31 | (fp_line (start -4.50342 -1.69926) (end -4.50342 -1.19888) (layer F.SilkS) (width 0.381)) 32 | (fp_line (start -4.50342 -1.19888) (end -6.5024 -1.19888) (layer F.SilkS) (width 0.381)) 33 | (fp_line (start -6.5024 -1.19888) (end -6.5024 2.30124) (layer F.SilkS) (width 0.381)) 34 | (fp_line (start 6.49986 2.30124) (end 6.49986 -1.19888) (layer F.SilkS) (width 0.381)) 35 | (fp_line (start 6.49986 -1.19888) (end 4.50088 -1.19888) (layer F.SilkS) (width 0.381)) 36 | (fp_line (start 4.50088 -1.19888) (end 4.50088 -1.69926) (layer F.SilkS) (width 0.381)) 37 | (fp_line (start -7.00278 -1.69926) (end -7.00278 2.79908) (layer F.SilkS) (width 0.381)) 38 | (fp_line (start 7.00024 -1.69926) (end 7.00024 2.79908) (layer F.SilkS) (width 0.381)) 39 | (fp_line (start -5.30352 -1.69926) (end -5.30352 -1.89992) (layer F.SilkS) (width 0.381)) 40 | (fp_line (start -5.30352 -1.89992) (end -5.60324 -1.89992) (layer F.SilkS) (width 0.381)) 41 | (fp_line (start -5.60324 -1.89992) (end -5.60324 -1.69926) (layer F.SilkS) (width 0.381)) 42 | (pad 1 thru_hole rect (at -5.0038 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 43 | (pad 3 thru_hole oval (at -1.00076 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 44 | (pad 2 thru_hole oval (at -3.00228 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 45 | (pad 4 thru_hole oval (at 0.99822 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 46 | (pad 5 thru_hole oval (at 2.99974 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 47 | (pad 6 thru_hole oval (at 5.00126 0) (size 1.19888 1.69926) (drill 0.70104) (layers *.Cu *.Mask F.SilkS)) 48 | (model walter/conn_jst-ph/b6b-ph-kl.wrl 49 | (at (xyz 0 0 0)) 50 | (scale (xyz 1 1 1)) 51 | (rotate (xyz 0 0 0)) 52 | ) 53 | ) 54 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name daughterfeet)(type KiCad)(uri "$(KIPRJMOD)/daughterfeet.pretty")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/gui_defaults.par: -------------------------------------------------------------------------------- 1 | 2 | (gui_defaults 3 | (windows 4 | (board_frame 5 | visible 6 | (bounds 7 | 0 23 2560 1413 8 | ) 9 | ) 10 | (color_manager 11 | not_visible 12 | (bounds 13 | 0 600 1110 126 14 | ) 15 | ) 16 | (layer_visibility 17 | not_visible 18 | (bounds 19 | 0 450 354 185 20 | ) 21 | ) 22 | (object_visibility 23 | not_visible 24 | (bounds 25 | 0 550 370 536 26 | ) 27 | ) 28 | (display_miscellanious 29 | not_visible 30 | (bounds 31 | 0 350 336 342 32 | ) 33 | ) 34 | (snapshots 35 | not_visible 36 | (bounds 37 | 0 250 214 267 38 | ) 39 | ) 40 | (select_parameter 41 | not_visible 42 | (bounds 43 | 583 352 356 464 44 | ) 45 | ) 46 | (route_parameter 47 | not_visible 48 | (bounds 49 | 0 100 356 567 50 | ) 51 | ) 52 | (manual_rules 53 | not_visible 54 | (bounds 55 | 0 2 356 205 56 | ) 57 | ) 58 | (route_details 59 | not_visible 60 | (bounds 61 | 0 2 356 248 62 | ) 63 | ) 64 | (move_parameter 65 | not_visible 66 | (bounds 67 | 0 50 412 146 68 | ) 69 | ) 70 | (clearance_matrix 71 | not_visible 72 | (bounds 73 | 0 150 760 304 74 | ) 75 | ) 76 | (via_rules 77 | not_visible 78 | (bounds 79 | 50 150 496 459 80 | ) 81 | ) 82 | (edit_vias 83 | not_visible 84 | (bounds 85 | 100 150 404 145 86 | ) 87 | ) 88 | (edit_net_rules 89 | not_visible 90 | (bounds 91 | 100 200 904 145 92 | ) 93 | ) 94 | (assign_net_rules 95 | not_visible 96 | (bounds 97 | 100 250 219 362 98 | ) 99 | ) 100 | (padstack_info 101 | not_visible 102 | (bounds 103 | 100 23 0 0 104 | ) 105 | ) 106 | (package_info 107 | not_visible 108 | (bounds 109 | 200 23 0 0 110 | ) 111 | ) 112 | (component_info 113 | not_visible 114 | (bounds 115 | 300 23 0 0 116 | ) 117 | ) 118 | (net_info 119 | not_visible 120 | (bounds 121 | 350 30 0 0 122 | ) 123 | ) 124 | (incompletes_info 125 | not_visible 126 | (bounds 127 | 400 23 0 0 128 | ) 129 | ) 130 | (violations_info 131 | not_visible 132 | (bounds 133 | 500 23 0 0 134 | ) 135 | ) 136 | ) 137 | (colors 138 | (background 139 | 255 255 255 140 | ) 141 | (hilight 1.0 142 | 0 255 0 143 | ) 144 | (incompletes 1.0 145 | 51 255 255 146 | ) 147 | (outline 148 | 100 150 255 149 | ) 150 | (component_front 151 | 153 153 255 152 | ) 153 | (component_back 154 | 255 153 153 155 | ) 156 | (violations 157 | 255 0 255 158 | ) 159 | (length_matching 1.0 160 | 0 255 0 161 | ) 162 | (traces 1.0 163 | 255 0 0 164 | 0 0 255 165 | ) 166 | (fixed_traces 1.0 167 | 255 0 0 168 | 0 0 255 169 | ) 170 | (vias 1.0 171 | 102 153 0 172 | 102 153 0 173 | ) 174 | (fixed_vias 1.0 175 | 200 200 0 176 | 200 200 0 177 | ) 178 | (pins 1.0 179 | 150 50 0 180 | 160 80 0 181 | ) 182 | (conduction 1.0 183 | 255 255 255 184 | 100 100 0 185 | ) 186 | (keepout 1.0 187 | 0 110 110 188 | 0 100 160 189 | ) 190 | (via_keepout 1.0 191 | 100 100 100 192 | 100 100 100 193 | ) 194 | ) 195 | (parameter 196 | (selection_layers 197 | all_visible 198 | ) 199 | (selectable_items 200 | TRACES VIAS PINS FIXED UNFIXED 201 | ) 202 | (via_snap_to_smd_center 203 | on 204 | ) 205 | (route_mode 206 | dynamic 207 | ) 208 | (shove_enabled 209 | on 210 | ) 211 | (drag_components_enabled 212 | on 213 | ) 214 | (hilight_routing_obstacle 215 | off 216 | ) 217 | (pull_tight_region 218 | 2147483647 219 | ) 220 | (pull_tight_accuracy 221 | 500 222 | ) 223 | (clearance_compensation 224 | off 225 | ) 226 | (ignore_conduction_areas 227 | on 228 | ) 229 | (automatic_layer_dimming 230 | 0.7 231 | ) 232 | (deselected_snapshot_attributes 233 | ) 234 | ) 235 | ) -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/io_daughterboard.pro: -------------------------------------------------------------------------------- 1 | update=Thursday, November 17, 2016 'PMt' 11:30:31 PM 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [schematic_editor] 29 | version=1 30 | PageLayoutDescrFile= 31 | PlotDirectoryName= 32 | SubpartIdSeparator=0 33 | SubpartFirstId=65 34 | NetFmtName= 35 | SpiceForceRefPrefix=0 36 | SpiceUseNetNumbers=0 37 | LabSize=60 38 | [eeschema] 39 | version=1 40 | LibDir= 41 | [eeschema/libraries] 42 | LibName1=io_daughterboard-rescue 43 | LibName2=lib/bored 44 | LibName3=power 45 | LibName4=device 46 | LibName5=transistors 47 | LibName6=conn 48 | LibName7=linear 49 | LibName8=regul 50 | LibName9=74xx 51 | LibName10=cmos4000 52 | LibName11=adc-dac 53 | LibName12=memory 54 | LibName13=xilinx 55 | LibName14=microcontrollers 56 | LibName15=dsp 57 | LibName16=microchip 58 | LibName17=analog_switches 59 | LibName18=motorola 60 | LibName19=texas 61 | LibName20=intel 62 | LibName21=audio 63 | LibName22=interface 64 | LibName23=digital-audio 65 | LibName24=philips 66 | LibName25=display 67 | LibName26=cypress 68 | LibName27=siliconi 69 | LibName28=opto 70 | LibName29=atmel 71 | LibName30=contrib 72 | LibName31=valves 73 | -------------------------------------------------------------------------------- /ECAD/io_daughterboard/pcb/lib/bored.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP Button 4 | D Button 5 | K Switch 6 | $ENDCMP 7 | # 8 | #End Doc Library 9 | -------------------------------------------------------------------------------- /ECAD/modules/DRILEGEND.CFG: -------------------------------------------------------------------------------- 1 | InputUserCfg = 1 2 | SymbolLayer = 144 3 | SymbolSize = 40 4 | SymbolWidth = 4 5 | TextSize = 70.0000 6 | TextRatio = 5 7 | IdxFnt = 0 8 | decMM = 2 9 | decMIL = 0 10 | SortHoles = 1 11 | TolPlated = 0.02 12 | TolNonPlated = 0.03 13 | PlatedStatusNot = NOT 14 | PlatedStatusBoth = BOTH 15 | PlatedStatusYes = YES 16 | VerticalChart = 1 17 | HighCellFactor = 1.10 18 | WideCellFactor = 1.10 19 | CellOutline = 4 20 | TitleOutline = 4 21 | TableOutline = 8 22 | SymbTitle = Sym 23 | ToolTitle = N° 24 | MMTitle = MM 25 | MilTitle = Mils 26 | MicTitle = Mic 27 | QtyTitle = Qty 28 | TypeTitle = Plated 29 | ToleTitle = Tol 30 | SymbRank = 1 31 | ToolRank = 2 32 | MMRank = 4 33 | MilRank = 3 34 | MicRank = 0 35 | QtyRank = 5 36 | TypeRank = 6 37 | ToleRank = 0 38 | OutputDrillRack = 0 39 | DrillRackFile = DRILLRACK.DRL 40 | Unit = 0 41 | OutputUserCfg = 1 42 | UserCfgFile = DRILEGEND.CFG 43 | -------------------------------------------------------------------------------- /ECAD/modules/disembiggen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from decimal import Decimal 4 | import fileinput 5 | import re 6 | 7 | 8 | # Pattern matches all XML attributes that are X coordinates, 9 | # e.g., x1="12.34" 10 | disembiggen_ = re.compile(r'\b(x\d?)="(.*?)"').sub 11 | 12 | 13 | # Decimal constants. We use decimal to prevent loss of precision 14 | # reading and writing numbers. 15 | d0_5 = Decimal('0.5') 16 | d3_5 = Decimal('3.5') 17 | 18 | 19 | # Replace any X coordinate with the corresponding coordinate on the 20 | # shrunken board. Undisembiggenated panels are 25 mm. Shrunken 21 | # panels are 21.5 mm. 22 | def unrighten(m): 23 | s = m.group(2) 24 | try: 25 | n = Decimal(s) 26 | except ValueError: 27 | return m.group(0) 28 | panel = n // 25 29 | if panel > 0: 30 | n -= (panel + d0_5) * d3_5 31 | return '%s="%s"' % (m.group(1), n) 32 | return m.group(0) 33 | 34 | 35 | # Find and replace all x coordinates in a single page of XML. 36 | def disembiggen(line): 37 | return disembiggen_(unrighten, line) 38 | 39 | 40 | for line in fileinput.input(): 41 | line = line.rstrip('\n') 42 | print(disembiggen(line)) 43 | -------------------------------------------------------------------------------- /ECAD/modules/embiggen-filter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from decimal import Decimal 4 | import fileinput 5 | import re 6 | 7 | 8 | # Pattern matches all XML attributes that are X coordinates, 9 | # e.g., x1="12.34" 10 | embiggen_ = re.compile(r'\b(x\d?)="(.*?)"').sub 11 | 12 | type_x = {'22.3', 13 | '22.8333375', 14 | '23.000003125', 15 | '23.33338125', 16 | '23.5', 17 | '24.5', 18 | '24.50005', 19 | '26'} 20 | 21 | cr_x = {'37.29', '38.75', '45.25', '46.71'} 22 | rd_x = {'57.79', '59.25', '65.75', '67.21'} 23 | dk_x = {'78.29', '79.75', '86.25', '36.79'} 24 | 25 | current_x = [0, 26 | 31.75 - 10.75, 27 | 52.25 - 10.75, 28 | 72.75 - 10.75, 29 | 93.25 - 10.75] 30 | 31 | desired_x = [0, 32 | 626/3 - 184, 33 | 700/3 - 184, 34 | 258 - 184, 35 | 559/2 - 184] 36 | 37 | delta = [b - a for (a, b) in zip(current_x, desired_x)] 38 | 39 | # cutoff_offset = 24+2/3 - 21 40 | # resonance_offset = 49+1/3 - 41.5 41 | # drive_offset = 74 - 62 42 | # keytrack_offset = 97.5 - 82.6 43 | 44 | # print('C', cutoff_offset) 45 | # print('R', resonance_offset) 46 | # print('D', drive_offset) 47 | # print('K', keytrack_offset) 48 | # print() 49 | 50 | cutoff_offset = delta[1] 51 | resonance_offset = delta[2] 52 | drive_offset = delta[3] 53 | keytrack_offset = delta[4] 54 | 55 | # print('C', cutoff_offset) 56 | # print('R', resonance_offset) 57 | # print('D', drive_offset) 58 | # print('K', keytrack_offset) 59 | # print() 60 | 61 | cr_offset = (cutoff_offset + resonance_offset) / 2 62 | rd_offset = (resonance_offset + drive_offset) / 2 63 | dk_offset = (drive_offset + keytrack_offset) / 2 64 | 65 | # Replace any X coordinate with the corresponding coordinate on the 66 | # enlarged board. Disembiggenated panels are 25 mm. Shrunken 67 | # panels are 21.5 mm. 68 | def unleften(m): 69 | s = m.group(2) 70 | try: 71 | x = float(s) 72 | except ValueError: 73 | return m.group(0) 74 | 75 | if s in type_x: 76 | return m.group(0) 77 | elif s in cr_x: 78 | x += cr_offset 79 | elif s in rd_x: 80 | x += rd_offset 81 | elif s in dk_x: 82 | x += dk_offset 83 | elif x < 22: # Type 84 | return m.group(0) 85 | elif x < 41: # Cutoff 86 | x += cutoff_offset 87 | elif x < 43: 88 | x += cr_offset 89 | elif x < 62: # Resonance 90 | x += resonance_offset 91 | elif x < 63: 92 | x += rd_offset 93 | elif x < 82: # Drive 94 | x += drive_offset 95 | elif x < 84: 96 | x += dk_offset 97 | elif x < 112: 98 | x += keytrack_offset 99 | else: 100 | return m.group(0) 101 | return '%s="%s"' % (m.group(1), x) 102 | 103 | 104 | # Find and replace all x coordinates in a single page of XML. 105 | def embiggen(line): 106 | return embiggen_(unleften, line) 107 | 108 | 109 | for line in fileinput.input(openhook=fileinput.hook_encoded('utf-8')): 110 | line = line.rstrip('\n') 111 | print(embiggen(line)) 112 | -------------------------------------------------------------------------------- /ECAD/modules/embiggen-normal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from decimal import Decimal 4 | import fileinput 5 | import re 6 | 7 | 8 | # Pattern matches all XML attributes that are X coordinates, 9 | # e.g., x1="12.34" 10 | embiggen_ = re.compile(r'\b(x\d?)="(.*?)"').sub 11 | 12 | type_x = {'22.3', 13 | '22.8333375', 14 | '23.000003125', 15 | '23.33338125', 16 | '23.5', 17 | '24.5', 18 | '24.50005', 19 | '26'} 20 | 21 | cr_x = {'37.29', '38.75', '45.25', '46.71'} 22 | rd_x = {'57.79', '59.25', '65.75', '67.21'} 23 | dk_x = {'78.29', '79.75', '86.25', '36.79'} 24 | 25 | current_x = [0, 26 | 31.75 - 10.75, 27 | 52.25 - 10.75, 28 | 72.75 - 10.75, 29 | 93.25 - 10.75] 30 | 31 | desired_x = [21.5 * i for i in range(5)] 32 | 33 | delta = [b - a for (a, b) in zip(current_x, desired_x)] 34 | 35 | # cutoff_offset = 24+2/3 - 21 36 | # resonance_offset = 49+1/3 - 41.5 37 | # drive_offset = 74 - 62 38 | # keytrack_offset = 97.5 - 82.6 39 | 40 | # print('C', cutoff_offset) 41 | # print('R', resonance_offset) 42 | # print('D', drive_offset) 43 | # print('K', keytrack_offset) 44 | # print() 45 | 46 | cutoff_offset = delta[1] 47 | resonance_offset = delta[2] 48 | drive_offset = delta[3] 49 | keytrack_offset = delta[4] 50 | 51 | # print('C', cutoff_offset) 52 | # print('R', resonance_offset) 53 | # print('D', drive_offset) 54 | # print('K', keytrack_offset) 55 | # print() 56 | 57 | cr_offset = (cutoff_offset + resonance_offset) / 2 58 | rd_offset = (resonance_offset + drive_offset) / 2 59 | dk_offset = (drive_offset + keytrack_offset) / 2 60 | 61 | # Replace any X coordinate with the corresponding coordinate on the 62 | # enlarged board. Disembiggenated panels are 25 mm. Shrunken 63 | # panels are 21.5 mm. 64 | def unleften(m): 65 | s = m.group(2) 66 | try: 67 | x = float(s) 68 | except ValueError: 69 | return m.group(0) 70 | 71 | if s in type_x: 72 | return m.group(0) 73 | elif s in cr_x: 74 | x += cr_offset 75 | elif s in rd_x: 76 | x += rd_offset 77 | elif s in dk_x: 78 | x += dk_offset 79 | elif x < 22: # Type 80 | return m.group(0) 81 | elif x < 41: # Cutoff 82 | x += cutoff_offset 83 | elif x < 43: 84 | x += cr_offset 85 | elif x < 62: # Resonance 86 | x += resonance_offset 87 | elif x < 63: 88 | x += rd_offset 89 | elif x < 82: # Drive 90 | x += drive_offset 91 | elif x < 84: 92 | x += dk_offset 93 | elif x < 112: 94 | x += keytrack_offset 95 | else: 96 | return m.group(0) 97 | return '%s="%s"' % (m.group(1), x) 98 | 99 | 100 | # Find and replace all x coordinates in a single page of XML. 101 | def embiggen(line): 102 | return embiggen_(unleften, line) 103 | 104 | 105 | for line in fileinput.input(openhook=fileinput.hook_encoded('utf-8')): 106 | line = line.rstrip('\n') 107 | print(embiggen(line)) 108 | -------------------------------------------------------------------------------- /Firmware/Master/Graphics/Color Text Sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Firmware/Master/Graphics/Color Text Sample.png -------------------------------------------------------------------------------- /Firmware/Master/Graphics/Color Text Sample.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170 2 | {\fonttbl\f0\fnil\fcharset0 Lato-Light;} 3 | {\colortbl;\red255\green255\blue255;\red254\green209\blue100;\red14\green0\blue45;\red250\green170\blue14; 4 | \red211\green0\blue255;\red21\green164\blue217;\red252\green22\blue95;\red144\green232\blue7;\red154\green82\blue255; 5 | \red250\green166\blue14;} 6 | \margl1440\margr1440\vieww15780\viewh10300\viewkind0 7 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl336\slmult1\pardirnatural\qc 8 | 9 | \f0\fs24 \cf2 \cb3 \ 10 | \ 11 | \cf4 Grumpy wizards make \cf5 \cb3 toxic brew\cf4 \cb3 for the evil\cf2 \cf6 Queen\cf2 \cf4 and\cf2 \cf7 Jack\cf2 .\ 12 | 13 | \fs28 \cf4 Grumpy wizards make \cf5 toxic brew\cf4 for the evil\cf2 \cf6 Queen\cf2 \cf4 and\cf2 \cf7 Jack\cf2 .\ 14 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\sl336\slmult1\pardirnatural\qc 15 | 16 | \fs36 \cf4 \cb3 Grumpy wizards make \cf5 \cb3 toxic brew\cf4 \cb3 for the evil\cf2 \cb3 \cf6 Queen\cf2 \cf4 \cb3 and\cf2 \cb3 \cf7 Jack\cf2 .\ 17 | 18 | \fs48 \cf8 \cb3 Grumpy\cf4 \cb3 wizards make \cf5 toxic brew\cf4 for the evil\cf2 \cf6 Queen\cf2 \cf4 and\cf2 \cf7 Jack\cf2 .\ 19 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qc 20 | 21 | \fs28 \cf2 \ 22 | 23 | \fs72 \cf9 Grumpy\cf10 wizards make\cf2 \cf5 toxic brew\cf2 \cf10 for the evil\cf2 \cf6 \cb3 Queen\cf2 \cb3 \cf10 and\cf2 \cf7 Jack\cf2 .\ 24 | 25 | \fs36 \ 26 | 27 | \fs96 \cf4 Grumpy wizards make \cf5 toxic brew\cf4 for the evil\cf2 \cf6 Queen\cf2 \cf4 and\cf2 \cf7 Jack\cf2 .} -------------------------------------------------------------------------------- /Firmware/Master/Graphics/Color Text Sample.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Firmware/Master/Graphics/Color Text Sample.xcf -------------------------------------------------------------------------------- /Firmware/Master/Graphics/compile.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from collections import defaultdict 4 | import itertools 5 | import PIL.Image 6 | import pprint 7 | 8 | # Simple Run-Length Encoding 9 | # 10 | # First byte determines run encoding. 11 | # 0 -> single pixel, RGB = next 3 bytes 12 | # 1..127 -> run of 1..127 pixels, RGB = next 3 bytes 13 | # 128..254 -> N = 2nd byte; run of (a - 128) << 8 | N pixels, RGB = next 3 14 | # 255-> N = 2nd byte; run of N pixels, each a different R G B. 15 | 16 | im = PIL.Image.open('Color Text Sample.png') 17 | data = im.getdata() 18 | pixels = (pix[:3] for pix in data) 19 | runs = ((len(list(run)), pix) for pix, run in itertools.groupby(pixels)) 20 | lenruns = ((l, [run[1] for run in runs]) 21 | for l, runs in itertools.groupby(runs, lambda lp: lp[0])) 22 | 23 | def dbg(*args): 24 | pass 25 | 26 | def emit_bytes(lenruns): 27 | for (count, runs) in lenruns: 28 | if count == 1 and len(runs) == 1: 29 | # Single pixel 30 | dbg('single', count, len(runs)) 31 | yield 0 32 | dbg(' pix', runs[0]) 33 | yield from runs[0] 34 | elif count == 1: 35 | # Run of different pixels 36 | dbg('mixed ', count, len(runs)) 37 | yield 255 38 | assert 1 < len(runs) < 256 39 | yield len(runs) 40 | for pix in runs: 41 | yield from pix 42 | elif count < 128: 43 | # Short run of solid color 44 | dbg('short ', count, len(runs)) 45 | assert len(runs) == 1 46 | yield count 47 | yield from runs[0] 48 | elif count <= 127 * 256: 49 | # Long run of solid color 50 | dbg('long ', count, len(runs)) 51 | dbg(' ', runs[0]) 52 | assert len(runs) == 1 53 | yield count >> 8 | 128 54 | yield count & 0xFF 55 | yield from runs[0] 56 | else: 57 | # Several long runs of solid color 58 | dbg('split ', count) 59 | assert len(runs) == 1 60 | while count: 61 | scount = min(count, 127 * 256 - 1) 62 | dbg('call', runs) 63 | yield from emit_bytes(((scount, runs),)) 64 | dbg('return') 65 | count -= scount 66 | 67 | # Testing, write bin file 68 | bi = list(emit_bytes(lenruns)) 69 | bb = bytes(bi) 70 | # bb = bytes(emit_bytes(lenruns)) 71 | with open('foo.bin', 'wb') as out: 72 | out.write(bb) 73 | 74 | def isplit(s, n): 75 | z = [] 76 | for i, x in enumerate(s): 77 | z.append(x) 78 | if i % n == n - 1: 79 | yield z 80 | z = [] 81 | if z: 82 | yield z 83 | 84 | preamble = ''' 85 | /* Automatically generated by compile.py. Do not edit. */ 86 | 87 | #include 88 | '''.lstrip() 89 | 90 | postamble = '};' 91 | 92 | with open('foo.h', 'w') as out: 93 | print(preamble, file=out) 94 | print('#define IMG_WIDTH %d' % im.size[0], file=out) 95 | print('#define IMG_HEIGHT %d' % im.size[1], file=out) 96 | print(file=out) 97 | print('uint8_t img_data[] = {', file=out) 98 | for x in isplit(bi, 12): 99 | print(' ' + ', '.join('%3d' % i for i in x) + ',', file=out) 100 | print(postamble, file=out) 101 | -------------------------------------------------------------------------------- /Firmware/Master/Graphics/show.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import PIL.Image 4 | 5 | with open('foo.bin', 'rb') as infile: 6 | bb = infile.read() 7 | 8 | def dbg(*args): 9 | pass 10 | 11 | def bytes_to_pix(bb): 12 | i = 0 13 | while i < len(bb): 14 | op = bb[i]; i += 1 15 | if op == 0: 16 | dbg('single', op) 17 | pix = bb[i:i+3]; i += 3 18 | yield pix 19 | elif op < 128: 20 | dbg('short ', op) 21 | pix = bb[i:i+3]; i += 3 22 | for j in range(op): 23 | yield pix 24 | elif op < 255: 25 | op2 = bb[i]; i += 1 26 | count = (op & ~128) << 8 | op2 27 | dbg('long ', count) 28 | pix = bb[i:i+3]; i += 3 29 | for j in range(count): 30 | yield pix 31 | else: 32 | assert op == 255 33 | op2 = bb[i]; i += 1 34 | dbg('mixed', op2) 35 | for j in range(op2): 36 | pix = bb[i:i+3]; i += 3 37 | yield pix 38 | 39 | 40 | def pix_to_ints(pixen): 41 | for pix in pixen: 42 | yield tuple(pix) 43 | 44 | im = PIL.Image.new('RGBA', (800, 480)) 45 | 46 | for i, pix in enumerate(pix_to_ints(bytes_to_pix(bb))): 47 | row = i // 800 48 | col = i % 800 49 | assert 0 <= pix[0] < 256 50 | assert 0 <= pix[1] < 256 51 | assert 0 <= pix[2] < 256, 'pix = %r' % (pix,) 52 | color = pix + (0xFF,) 53 | im.putpixel((col, row), color) 54 | 55 | 56 | im.show() 57 | -------------------------------------------------------------------------------- /Firmware/Master/reference/README.md: -------------------------------------------------------------------------------- 1 | This is a spreadsheet in Apple Numbers format. (Proprietary, but I 2 | like it.) 3 | 4 | Each SPI bus's signals can be mapped to several pins. Those are 5 | recorded. 6 | 7 | The 144 pin chip does not bring out pins PH2 and above. Those are 8 | shaded red. 9 | 10 | Most of the pins are connected to a peripheral on the STM32F429IDISCOVERY 11 | board. The pins that are not used are shaded blue in the spreadsheet. 12 | Some, but not all, of the used pins are labeled in the Discovery column. 13 | 14 | The notes column shows how I plan to use the pins, especially the 15 | SPI slave select pins. 16 | 17 | 18 | -------------------------------------------------------------------------------- /Firmware/Master/reference/STM32F429i-Discovery Pin Mapping.numbers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Firmware/Master/reference/STM32F429i-Discovery Pin Mapping.numbers -------------------------------------------------------------------------------- /Firmware/Master/reference/STM32F429i-Discovery Pin Mapping.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Firmware/Master/reference/STM32F429i-Discovery Pin Mapping.pdf -------------------------------------------------------------------------------- /Firmware/Master/src/.gdbinit: -------------------------------------------------------------------------------- 1 | # # First Discovery board 2 | # target extended-remote /dev/cu.usbmodemBED9D9E1 3 | 4 | # # Second Discovery board 5 | target extended-remote /dev/cu.usbmodemBED6C011 6 | 7 | # Black Magic Probe Mini, v1 8 | # target extended-remote /dev/cu.usbmodemBDEAA9F1 9 | 10 | monitor swdp_scan 11 | attach 1 12 | 13 | # set target-async on 14 | set confirm off 15 | set mem inaccessible-by-default off 16 | 17 | define lc 18 | load 19 | continue 20 | end 21 | define lr 22 | load 23 | run 24 | end 25 | -------------------------------------------------------------------------------- /Firmware/Master/src/Makefile: -------------------------------------------------------------------------------- 1 | LIBOPENCM3 = ../libopencm3 2 | ifeq '$(LIBOPENCM3)' '' 3 | $(error Please pass LIBOPENCM3 = the root of your libopencm3 tree) 4 | endif 5 | 6 | ######################################################################## 7 | SOURCES := main.c anim.c button.c config.c console.c delay.c gpio.c \ 8 | lcd-dma.c lcd-pwm.c midi.c modes.c sdram.c spi.c \ 9 | spi-proto.c spi-responder.c state.c systick.c usb-midi.c 10 | CFILES := $(filter %.c, $(SOURCES)) 11 | OFILES := $(CFILES:%.c=%.o) 12 | 13 | L3_INCDIR := $(LIBOPENCM3)/include 14 | L3_LIBDIR := $(LIBOPENCM3)/lib 15 | 16 | CC := arm-none-eabi-gcc 17 | 18 | DEFS := -DSTM32F4 -D_GNU_SOURCE 19 | FP_FLAGS := -mfloat-abi=hard -mfpu=fpv4-sp-d16 20 | ARCH_FLAGS := -mthumb -mcpu=cortex-m4 $(FP_FLAGS) 21 | 22 | CPPFLAGS := -MD -I$(L3_INCDIR) $(DEFS) 23 | CFLAGS := -std=gnu99 -g -Wall -Wundef -Werror \ 24 | -fno-common -ffunction-sections -fdata-sections \ 25 | $(CPPFLAGS) $(ARCH_FLAGS) \ 26 | -O0 27 | LDFLAGS := -g --static -nostartfiles \ 28 | -L$(L3_LIBDIR) \ 29 | -T stm32f429i-discovery.ld \ 30 | -Wl,-Map=master.map -Wl,--gc-sections \ 31 | $(ARCH_FLAGS) 32 | LDLIBES := -lopencm3_stm32f4 33 | LDLIBS := -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group 34 | 35 | 36 | default: master.elf 37 | 38 | master.elf: $(OFILES) 39 | $(LINK.o) $^ $(LDLIBES) $(LDLIBS) -o $@ 40 | 41 | clean: 42 | rm -f *.d *.o *.elf *.map TAGS 43 | 44 | tags: 45 | make-etags-SimplicityStudio $(LIBOPENCM3)/lib/stm32/f4/*.c $$(strings "$(LIBOPENCM3)/lib/libopencm3_stm32f4.a" | sed -n -E "s,^(\.\./common|\.\./\.\./usb)/.*\.c\$$,$(LIBOPENCM3)/lib/stm32/f4/&,p") 46 | 47 | 48 | ifeq '$(filter clean$ help,$(or $(MAKECMDGOALS),help))' '' 49 | -include $(CFILES:%.c=%.d) 50 | endif 51 | 52 | .PHONY: default clean tags 53 | -------------------------------------------------------------------------------- /Firmware/Master/src/anim.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIM_included 2 | #define ANIM_included 3 | 4 | #include 5 | #include 6 | 7 | typedef uint32_t packed_RGB; 8 | 9 | extern void anim_update(uint32_t msec); 10 | 11 | extern packed_RGB anim_module_color(size_t module_index); 12 | extern packed_RGB anim_knob_color(size_t module_index, size_t knob_index); 13 | extern uint8_t anim_choice_brightness(size_t module_index); 14 | extern uint8_t anim_assign_brightness(size_t module_index); 15 | 16 | #endif /* !ANIM_included */ 17 | -------------------------------------------------------------------------------- /Firmware/Master/src/button.c: -------------------------------------------------------------------------------- 1 | #include "button.h" 2 | 3 | #include "gpio.h" 4 | #include "midi.h" 5 | 6 | static const gpio_pin button_gpio = { 7 | .gp_port = GPIOA, 8 | .gp_pin = GPIO0, 9 | .gp_mode = GPIO_MODE_INPUT, 10 | .gp_pupd = GPIO_PUPD_NONE, // board has external pulldown resistor R22. 11 | }; 12 | 13 | void button_setup(void) 14 | { 15 | /* Button pin */ 16 | gpio_init_pin(&button_gpio); 17 | } 18 | 19 | void button_poll(void) 20 | { 21 | static uint32_t button_state = 0; 22 | 23 | /* This is a simple shift based debounce. It's simplistic because 24 | * although this implements debounce adequately it does not have any 25 | * noise suppression. It is also very wide (32-bits) because it can 26 | * be polled in a very tight loop (no debounce timer). 27 | */ 28 | uint32_t old_button_state = button_state; 29 | button_state = (button_state << 1) | (GPIOA_IDR & 1); 30 | if (!button_state != !old_button_state) { 31 | static const uint8_t note_sequence[] = { 60, 64, 69, 62, 67 }; 32 | static size_t i, j; 33 | uint8_t note = note_sequence[i]; 34 | if (j == 5) 35 | note -= 36; 36 | if (button_state) 37 | MIDI_send_note_on(MIDI_default_channel, note, 96); 38 | else { 39 | MIDI_send_note_off(MIDI_default_channel, note, 96); 40 | i = (i + 1) % sizeof note_sequence; 41 | j = (j + 1) % 6; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Firmware/Master/src/button.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTON_included 2 | #define BUTTON_included 3 | 4 | extern void button_setup(void); 5 | extern void button_poll(void); 6 | 7 | #endif /* !BUTTON_included */ 8 | -------------------------------------------------------------------------------- /Firmware/Master/src/console.c: -------------------------------------------------------------------------------- 1 | #include "console.h" 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "gpio.h" 9 | 10 | #define CONSOLE_UART USART1 11 | #define CONSOLE_BAUD 115200 12 | 13 | static const gpio_pin usart1_pins[] = { 14 | { // PA9 = TX 15 | .gp_port = GPIOA, 16 | .gp_pin = GPIO9, 17 | .gp_mode = GPIO_MODE_AF, 18 | .gp_pupd = GPIO_PUPD_NONE, 19 | .gp_af = GPIO_AF7, 20 | }, 21 | { // PA10 = RX 22 | .gp_port = GPIOA, 23 | .gp_pin = GPIO10, 24 | .gp_mode = GPIO_MODE_AF, 25 | .gp_pupd = GPIO_PUPD_NONE, 26 | .gp_af = GPIO_AF7, 27 | }, 28 | }; 29 | const size_t usart1_pin_count = (&usart1_pins)[1] - usart1_pins; 30 | 31 | void console_setup(void) 32 | { 33 | // Clock 34 | rcc_periph_clock_enable(RCC_USART1); 35 | 36 | // GPIO 37 | gpio_init_pins(usart1_pins, usart1_pin_count); 38 | 39 | // USART 40 | usart_set_baudrate(CONSOLE_UART, CONSOLE_BAUD); 41 | usart_set_databits(CONSOLE_UART, 8); 42 | usart_set_stopbits(CONSOLE_UART, USART_STOPBITS_1); 43 | usart_set_mode(CONSOLE_UART, USART_MODE_TX_RX); 44 | usart_set_parity(CONSOLE_UART, USART_PARITY_NONE); 45 | usart_set_flow_control(CONSOLE_UART, USART_FLOWCONTROL_NONE); 46 | usart_enable(CONSOLE_UART); 47 | } 48 | 49 | static void console_putc(char c) 50 | { 51 | while (!(USART_SR(CONSOLE_UART) & USART_SR_TXE)) 52 | continue; 53 | USART_DR(CONSOLE_UART) = (uint8_t)c; 54 | } 55 | 56 | static ssize_t console_write(void *cookie, const char *buf, size_t size) 57 | { 58 | for (size_t i = 0; i < size; i++) { 59 | char c = buf[i]; 60 | if (c == '\n') 61 | console_putc('\r'); 62 | console_putc(c); 63 | } 64 | return size; 65 | } 66 | 67 | void console_stdio_setup(void) 68 | { 69 | cookie_io_functions_t console_input_fns = { 70 | .read = NULL, 71 | .write = NULL, 72 | .seek = NULL, 73 | .close = NULL 74 | }; 75 | cookie_io_functions_t console_output_fns = { 76 | .read = NULL, 77 | .write = console_write, 78 | .seek = NULL, 79 | .close = NULL 80 | }; 81 | stdin = fopencookie(NULL, "r", console_input_fns); 82 | stdout = fopencookie(NULL, "w", console_output_fns); 83 | stderr = fopencookie(NULL, "w", console_output_fns); 84 | setlinebuf(stdout); 85 | setbuf(stderr, NULL); 86 | } 87 | -------------------------------------------------------------------------------- /Firmware/Master/src/console.h: -------------------------------------------------------------------------------- 1 | #ifndef CONSOLE_included 2 | #define CONSOLE_included 3 | 4 | extern void console_setup(void); 5 | extern void console_stdio_setup(void); 6 | 7 | #endif /* !CONSOLE_included */ 8 | -------------------------------------------------------------------------------- /Firmware/Master/src/delay.c: -------------------------------------------------------------------------------- 1 | #include "delay.h" 2 | 3 | #include "systick.h" 4 | 5 | // If compiled with no optimization (-O0), delay_loop uses 19 cycles 6 | // per iteration. With optimization (-O3), it uses 4 cycles. 7 | 8 | #define FAST_CYCLES 4 9 | #define SLOW_CYCLES 19 10 | #define uSEC_per_SEC 1000000 11 | 12 | static uint32_t delay_scale; 13 | 14 | static inline void delay_loop(uint32_t count) 15 | { 16 | while (count--) 17 | __asm__ volatile ( "nop" ); 18 | } 19 | 20 | void init_delay(uint32_t cpu_freq) 21 | { 22 | // Assume fast. 23 | delay_scale = cpu_freq / FAST_CYCLES / uSEC_per_SEC; 24 | 25 | // Test. 26 | uint32_t b = system_millis; 27 | delay_loop(1000 * delay_scale); 28 | uint32_t a = system_millis; 29 | 30 | if (a - b >= 2) { 31 | // Slow. 32 | delay_scale = cpu_freq / SLOW_CYCLES / uSEC_per_SEC; 33 | } 34 | } 35 | 36 | void delay_usec(uint32_t count) 37 | { 38 | delay_loop(count * delay_scale); 39 | } 40 | -------------------------------------------------------------------------------- /Firmware/Master/src/delay.h: -------------------------------------------------------------------------------- 1 | #ifndef DELAY_included 2 | #define DELAY_included 3 | 4 | #include 5 | 6 | extern void init_delay(uint32_t cpu_freq); 7 | 8 | extern void delay_usec(uint32_t count); 9 | 10 | #endif /* !DELAY_included */ 11 | -------------------------------------------------------------------------------- /Firmware/Master/src/gpio.c: -------------------------------------------------------------------------------- 1 | #include "gpio.h" 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #define GPIO_PORT_COUNT 11 9 | 10 | static uint16_t gpio_pins_used[GPIO_PORT_COUNT]; 11 | 12 | void gpio_init_pin(const gpio_pin *pin) 13 | { 14 | uint32_t port = pin->gp_port; 15 | uint16_t pinmask = pin->gp_pin; 16 | uint32_t index = ((uint32_t)port - (uint32_t)PERIPH_BASE_AHB1) >> 10; 17 | assert(index < GPIO_PORT_COUNT); 18 | 19 | if (!gpio_pins_used[index]) 20 | rcc_periph_clock_enable((0x30 << 5) | index); 21 | 22 | assert(!(gpio_pins_used[index] & pinmask)); 23 | gpio_pins_used[index] |= pinmask; 24 | 25 | gpio_mode_setup(port, 26 | pin->gp_mode, 27 | pin->gp_pupd, 28 | pinmask); 29 | 30 | if (pin->gp_mode == GPIO_MODE_OUTPUT) { 31 | if (pin->gp_level) 32 | gpio_set(port, pinmask); 33 | else 34 | gpio_clear(port, pinmask); 35 | } 36 | 37 | if (pin->gp_mode == GPIO_MODE_OUTPUT || pin->gp_mode == GPIO_MODE_AF) 38 | gpio_set_output_options(port, 39 | pin->gp_otype, 40 | pin->gp_ospeed, 41 | pinmask); 42 | 43 | if (pin->gp_mode == GPIO_MODE_AF) 44 | gpio_set_af(port, 45 | pin->gp_af, 46 | pinmask); 47 | } 48 | 49 | void gpio_init_pins(const gpio_pin *pins, size_t count) 50 | { 51 | for (size_t i = 0; i < count; i++) 52 | gpio_init_pin(&pins[i]); 53 | } 54 | -------------------------------------------------------------------------------- /Firmware/Master/src/gpio.h: -------------------------------------------------------------------------------- 1 | #ifndef GPIO_included 2 | #define GPIO_included 3 | 4 | #include 5 | 6 | #include 7 | 8 | typedef struct gpio_pin { 9 | uint32_t gp_port; // GPIOA .. GPIOF 10 | uint16_t gp_pin; // GPIO0 .. GPIO15 11 | uint8_t gp_mode : 2; // GPIO_MODE_INPUT/OUTPUT/AF/ANALOG 12 | uint8_t gp_pupd : 2; // GPIO_PUPD_NONE/PULLUP/PULLDOWN 13 | uint8_t gp_af : 4; // GPIO_AF0 .. GPIO_AF15 14 | uint8_t gp_ospeed : 2; // GPIO_OSPEED_2/25/60/100MHZ 15 | uint8_t gp_otype : 1; // GPIO_OTYPE_PP/OD (push-pull, open drain) 16 | uint8_t gp_level : 1; // 0 or 1 17 | } gpio_pin; 18 | 19 | extern void gpio_init_pin(const gpio_pin *); 20 | 21 | extern void gpio_init_pins(const gpio_pin *, size_t count); 22 | 23 | #endif /* !GPIO_included */ 24 | -------------------------------------------------------------------------------- /Firmware/Master/src/lcd-dma.h: -------------------------------------------------------------------------------- 1 | #ifndef LCD_DMA_included 2 | #define LCD_DMA_included 3 | 4 | extern void lcd_dma_setup(void); 5 | 6 | #endif /* !LCD_DMA_included */ 7 | -------------------------------------------------------------------------------- /Firmware/Master/src/lcd-pwm.c: -------------------------------------------------------------------------------- 1 | #include "lcd-pwm.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "gpio.h" 7 | 8 | // PWM brightness pin 9 | // Pin PF6 10 | // Timer TIM10, channel 1 11 | // Alt function AF3 12 | 13 | // Display On/Off pin 14 | // Pin PE4 15 | 16 | 17 | #define PWM_PORT GPIOF 18 | #define PWM_PIN GPIO6 19 | #define DISP_PORT GPIOE 20 | #define DISP_PIN GPIO4 21 | 22 | static const gpio_pin lcd_pwm_pins[] = { 23 | { 24 | .gp_port = PWM_PORT, 25 | .gp_pin = PWM_PIN, 26 | .gp_mode = GPIO_MODE_AF, 27 | .gp_af = GPIO_AF3, 28 | }, 29 | { 30 | .gp_port = DISP_PORT, 31 | .gp_pin = DISP_PIN, 32 | .gp_mode = GPIO_MODE_OUTPUT, 33 | .gp_level = 0, 34 | }, 35 | }; 36 | static const size_t lcd_pwm_pin_count = (&lcd_pwm_pins)[1] - lcd_pwm_pins; 37 | 38 | void lcd_pwm_setup(void) 39 | { 40 | // enable clock 41 | rcc_periph_clock_enable(RCC_TIM10); 42 | 43 | // init GPIOs 44 | gpio_init_pins(lcd_pwm_pins, lcd_pwm_pin_count); 45 | 46 | // configure timer 47 | timer_reset(TIM10); 48 | // timer_set_mode(TIM10, TIM_CR1_CKD_INT, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); 49 | timer_set_oc_mode(TIM10, TIM_OC1, TIM_OCM_PWM1); 50 | timer_enable_oc_output(TIM10, TIM_OC1); 51 | timer_set_oc_value(TIM10, TIM_OC1, 0); // start out dark. 52 | // XXX FAN5333BSX datasheet says PWM frequency not to exceed 1 KHz. 53 | // 168 MHz / 65536 / 3 ~= 854 Hz. 54 | timer_set_period(TIM10, 65536 - 1); 55 | timer_set_prescaler(TIM10, 3 - 1); 56 | timer_enable_counter(TIM10); 57 | } 58 | 59 | void lcd_pwm_set_brightness(uint16_t brightness) 60 | { 61 | timer_set_oc_value(TIM10, TIM_OC1, brightness); 62 | if (brightness) 63 | gpio_set(DISP_PORT, DISP_PIN); 64 | else 65 | gpio_clear(DISP_PORT, DISP_PIN); 66 | } 67 | -------------------------------------------------------------------------------- /Firmware/Master/src/lcd-pwm.h: -------------------------------------------------------------------------------- 1 | #ifndef LCD_PWM_included 2 | #define LCD_PWM_included 3 | 4 | #include 5 | 6 | extern void lcd_pwm_setup(void); 7 | 8 | extern void lcd_pwm_set_brightness(uint16_t brightness); 9 | 10 | #endif /* !LCD_PWM_included */ 11 | -------------------------------------------------------------------------------- /Firmware/Master/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include "button.h" 7 | #include "console.h" 8 | #include "delay.h" 9 | #include "lcd-dma.h" 10 | #include "lcd-pwm.h" 11 | #include "midi.h" 12 | #include "sdram.h" 13 | #include "spi.h" 14 | #include "spi-proto.h" 15 | #include "spi-responder.h" 16 | #include "state.h" 17 | #include "systick.h" 18 | #include "usb-midi.h" 19 | 20 | #define REPORT_INTERVAL_MSEC 10000 21 | 22 | #define CPU_FREQ 168000000 23 | // #define CPU_FREQ 120000000 24 | // #define CPU_FREQ 48000000 25 | 26 | static void clock_setup(void) 27 | { 28 | if (CPU_FREQ == 168000000) { 29 | // CPU = 168 MHz, min SPI =~ 328 KHz 30 | rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_168MHZ]); 31 | } else if (CPU_FREQ == 120000000) { 32 | // CPU = 120 MHz, min SPI =~ 234 KHz 33 | rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_120MHZ]); 34 | } else if (CPU_FREQ == 48000000) { 35 | // CPU = 48 MHz, min SPI =~ 94 KHz 36 | rcc_clock_setup_hse_3v3(&rcc_hse_8mhz_3v3[RCC_CLOCK_3V3_48MHZ]); 37 | } 38 | } 39 | 40 | static void adjust_LCD_brightness(uint32_t now) 41 | { 42 | static bool done; 43 | if (done) 44 | return; 45 | static uint32_t t0; 46 | if (!t0) { 47 | t0 = now + 1; 48 | return; 49 | } 50 | uint32_t b0 = (now - t0); 51 | uint32_t b1 = b0 * (b0 + 1) >> 5; 52 | if (b1 > 65535) { 53 | b1 = 65535; 54 | done = true; 55 | } 56 | lcd_pwm_set_brightness(b1); 57 | } 58 | 59 | int main() 60 | { 61 | clock_setup(); 62 | systick_setup(CPU_FREQ); 63 | lcd_pwm_setup(); // Do this early to keep the uninitialized screen dark. 64 | console_setup(); 65 | console_stdio_setup(); 66 | MIDI_setup(); 67 | usb_midi_setup(); 68 | button_setup(); 69 | spi_setup(); 70 | SPI_proto_setup(); 71 | SPI_responder_setup(); 72 | sdram_setup(); 73 | lcd_dma_setup(); 74 | init_delay(CPU_FREQ); 75 | 76 | printf("\n"); 77 | printf("Minimum Viable Firmware\n"); 78 | 79 | #ifndef NDEBUG 80 | verify_config(); 81 | printf("OK\n"); 82 | #endif 83 | 84 | uint32_t next_time = REPORT_INTERVAL_MSEC; 85 | 86 | while (1) { 87 | adjust_LCD_brightness(system_millis); 88 | usb_midi_poll(); 89 | button_poll(); 90 | 91 | if ((int32_t)(next_time - system_millis) > 0) 92 | continue; 93 | next_time += REPORT_INTERVAL_MSEC; 94 | 95 | SPI_proto_report_and_clear_stats(); 96 | // USB_midi_report_and_clear_stats(); 97 | } 98 | return 0; 99 | } 100 | -------------------------------------------------------------------------------- /Firmware/Master/src/midi-defs.h: -------------------------------------------------------------------------------- 1 | #ifndef MIDI_DEFS_included 2 | #define MIDI_DEFS_included 3 | 4 | typedef enum MIDI_status_nybble { 5 | NoteOff = 0x80, 6 | NoteOn = 0x90, 7 | PolyPress = 0xA0, 8 | ControlChange = 0xB0, 9 | ProgramChange = 0xC0, 10 | ChannelPressure = 0xD0, 11 | PitchBend = 0xE0, 12 | SystemCommon = 0xF0, 13 | } MIDI_status_nybble; 14 | 15 | #endif /* !MIDI_DEFS_included */ 16 | -------------------------------------------------------------------------------- /Firmware/Master/src/modes.h: -------------------------------------------------------------------------------- 1 | #ifndef MODES_included 2 | #define MODES_included 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define ASSIGN_TIMEOUT_MSEC 2500 9 | #define CONFIRM_TIMEOUT_MSEC 500 10 | 11 | 12 | // Query current/active modules and current/working knobs 13 | 14 | extern bool module_is_current(size_t module_index); 15 | extern bool module_is_active(size_t module_index); 16 | extern bool knob_is_current(size_t module_index, size_t knob_index); 17 | extern bool knob_is_working(size_t module_index, size_t knob_index); 18 | 19 | 20 | // Query assignment state 21 | 22 | extern bool source_is_assigned(size_t module_index); 23 | 24 | extern bool assignment_is_active(void); 25 | extern bool assignment_is_confirmed(void); 26 | extern bool module_is_active_assign_source(size_t module_index); 27 | extern bool knob_is_active_assign_dest(size_t module_index, size_t knob_index); 28 | extern bool knob_is_assign_dest(size_t module_index, size_t knob_index); 29 | extern uint32_t assignment_start_time(void); 30 | 31 | extern size_t active_source_mod_index(void); 32 | extern size_t active_dest_mod_index(void); 33 | extern size_t active_dest_knob_index(void); 34 | 35 | 36 | // Assignment mode control 37 | 38 | extern void begin_assignment(size_t src_mod_index); 39 | extern void confirm_assignment(size_t dest_mod_index, size_t dest_knob_index); 40 | extern void cancel_assignment(void); 41 | 42 | 43 | // Current module/knob control 44 | 45 | extern void set_current_knob(size_t module_index, size_t knob_index); 46 | 47 | #endif /* !MODES_included */ 48 | -------------------------------------------------------------------------------- /Firmware/Master/src/sdram.h: -------------------------------------------------------------------------------- 1 | #ifndef SDRAM_included 2 | #define SDRAM_included 3 | 4 | #define SDRAM_BASE_ADDRESS 0xd0000000 5 | 6 | void sdram_setup(void); 7 | 8 | // variable attribute to put global/static variables into SDRAM. 9 | // SDRAM is initialized to zero, so don't use with initialized variables. 10 | #define SDRAM_SECTION __attribute((section(".sdram"))) 11 | 12 | #endif /* !SDRAM_included */ 13 | -------------------------------------------------------------------------------- /Firmware/Master/src/spi-proto.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_PROTO_included 2 | #define SPI_PROTO_included 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "config.h" 9 | 10 | static const int NO_GROUP = -1; 11 | static const int NO_BUS = -1; 12 | 13 | typedef enum ss_button_bit { 14 | SBB_CHOICE = 1 << 0, 15 | SBB_ASSIGN = 1 << 1, 16 | SBB_DEST_1 = 1 << 2, 17 | SBB_DEST_2 = 1 << 3, 18 | SBB_DEST_3 = 1 << 4, 19 | SBB_DEST_4 = 1 << 5, 20 | } ss_button_bit; 21 | 22 | typedef struct slave_state { 23 | bool ss_is_valid; 24 | uint8_t ss_buttons; // ss_button_bit 25 | uint8_t ss_analog_mask; 26 | uint8_t ss_analog_values[MAX_KNOBS]; 27 | } slave_state; 28 | 29 | typedef void SPI_slave_state_handler(size_t module_index, 30 | slave_state const *, 31 | void *user_data); 32 | 33 | extern void SPI_proto_setup(void); 34 | extern void SPI_proto_register_slave_state_handler(SPI_slave_state_handler *, 35 | void *user_data); 36 | extern void SPI_proto_report_and_clear_stats(void); 37 | 38 | // Use these like this: 39 | // 40 | // for (i = 0; (g = active_spi_groups(i)) != NO_GROUP; i++) { 41 | // for (j = 0; (b = active_spi_buses(g, j)) != NO_BUS; j++) { 42 | // size_t m = spi_to_module(g, b); 43 | // do something with module m, group g, bus b. 44 | // } 45 | // } 46 | 47 | extern int active_spi_groups(uint8_t index); 48 | extern int active_spi_buses(uint8_t group, uint8_t index); 49 | extern size_t spi_to_module(int spi_group, int spi_bus); 50 | 51 | #endif /* !SPI_PROTO_included */ 52 | -------------------------------------------------------------------------------- /Firmware/Master/src/spi-responder.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_RESPONDER_included 2 | #define SPI_RESPONDER_included 3 | 4 | extern void SPI_responder_setup(void); 5 | 6 | #endif /* !SPI_RESPONDER_included */ 7 | -------------------------------------------------------------------------------- /Firmware/Master/src/spi.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_included 2 | #define SPI_included 3 | 4 | #include 5 | #include 6 | 7 | #define SPI_GROUP_COUNT 3 8 | #define SPI_BUS_RANGE 7 // bus numbers are [1 .. RANGE) 9 | #define SPI_BUS_COUNT 4 // four buses actually in use 10 | 11 | typedef void spi_completion_handler(void); 12 | 13 | extern void spi_setup(void); 14 | extern void spi_register_completion_handler(spi_completion_handler *); 15 | 16 | extern void spi_select_group(int group); 17 | extern void spi_deselect_group(int group); 18 | 19 | extern void spi_start_transfer(int spi, 20 | uint8_t const *tx_buf, 21 | uint8_t *rx_buf, 22 | size_t count); 23 | 24 | extern void spi_finish_transfer(int spi); 25 | 26 | #endif /* !SPI_included */ 27 | -------------------------------------------------------------------------------- /Firmware/Master/src/state.h: -------------------------------------------------------------------------------- 1 | #ifndef STATE_included 2 | #define STATE_included 3 | 4 | #include "config.h" 5 | 6 | typedef enum LED_pattern { 7 | LP_OFF, 8 | LP_ACTIVE, 9 | LP_CURRENT_DEST, 10 | LP_AVAIL_DEST, 11 | } LED_pattern; 12 | 13 | typedef struct choice_state { 14 | // const choice_config *cs_config; 15 | uint8_t cs_value; 16 | } choice_state; 17 | 18 | typedef struct knob_state { 19 | uint16_t ks_exported_value; 20 | uint16_t ks_actual_value; 21 | bool ks_should_export; 22 | } knob_state; 23 | 24 | typedef struct assign_state { 25 | uint8_t as_index; 26 | } assign_state; 27 | 28 | typedef struct module_state { 29 | bool ms_is_active; 30 | LED_pattern ms_LED_pattern; 31 | choice_state ms_choice; 32 | knob_state ms_knobs[MAX_KNOBS]; 33 | assign_state ms_assign; 34 | } module_state; 35 | 36 | typedef struct synth_state { 37 | char *ss_preset_name; 38 | int ss_preset_number; 39 | uint8_t ss_MIDI_channel; 40 | module_state ss_modules[MODULE_COUNT]; 41 | } synth_state; 42 | 43 | extern synth_state ss; 44 | 45 | extern void init_synth_state(void); 46 | 47 | #endif /* !STATE_included */ 48 | -------------------------------------------------------------------------------- /Firmware/Master/src/stm32f429i-discovery.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the libopencm3 project. 3 | * 4 | * Copyright (C) 2009 Uwe Hermann 5 | * Copyright (C) 2011 Stephen Caudle 6 | * Copyright (C) 2015 Piotr Esden-Tempski 7 | * 8 | * This library is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this library. If not, see . 20 | */ 21 | 22 | /* Linker script for ST STM32F429IDISCOVERY (STM32F429ZI, 2048K flash, 256K RAM). */ 23 | 24 | /* Define memory regions. */ 25 | MEMORY 26 | { 27 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 2048K 28 | ram (rwx) : ORIGIN = 0x10000000, LENGTH = 64K /* (kbob) CCM is faster */ 29 | system_ram (rwx) : ORIGIN = 0x20000000, LENGTH = 128K 30 | sdram (rwx) : ORIGIN = 0xD0000000, LENGTH = 8M 31 | } 32 | 33 | SECTIONS 34 | { 35 | .system_ram (NOLOAD) : { 36 | *(.system_ram) 37 | } >system_ram 38 | .sdram (NOLOAD) : { 39 | *(.sdram) 40 | } >sdram 41 | } 42 | /* Include the common ld script. */ 43 | INCLUDE libopencm3_stm32f4.ld 44 | -------------------------------------------------------------------------------- /Firmware/Master/src/systick.c: -------------------------------------------------------------------------------- 1 | #include "systick.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | volatile uint32_t system_millis; 8 | static systick_handler *current_handler; 9 | 10 | // This is the systick_isr. 11 | void sys_tick_handler(void) 12 | { 13 | system_millis++; 14 | if (current_handler) 15 | (*current_handler)(system_millis); 16 | } 17 | 18 | void systick_setup(uint32_t cpu_freq) 19 | { 20 | // set tick rate to 1 KHz. 21 | systick_set_reload(cpu_freq / 1000); 22 | systick_set_clocksource(STK_CSR_CLKSOURCE_AHB); 23 | systick_counter_enable(); 24 | systick_interrupt_enable(); 25 | } 26 | 27 | extern void register_systick_handler(systick_handler *handler) 28 | { 29 | assert(!current_handler); 30 | current_handler = handler; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Firmware/Master/src/systick.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSTICK_included 2 | #define SYSTICK_included 3 | 4 | #include 5 | 6 | typedef void systick_handler(uint32_t millis); 7 | 8 | extern volatile uint32_t system_millis; 9 | 10 | extern void systick_setup(uint32_t cpu_freq); 11 | 12 | extern void register_systick_handler(systick_handler *); 13 | 14 | #endif /* !SYSTICK_included */ 15 | -------------------------------------------------------------------------------- /Firmware/Master/src/usb-midi.h: -------------------------------------------------------------------------------- 1 | #ifndef USB_MIDI_included 2 | #define USB_MIDI_included 3 | 4 | #include // XXX 5 | #include 6 | #include 7 | 8 | typedef void usb_midi_packet_handler(uint8_t *pkt, size_t size, void *user_data); 9 | 10 | extern void usb_midi_setup(void); 11 | 12 | extern void usb_midi_poll(void); 13 | 14 | extern void usb_midi_send_message(uint8_t const *msg, size_t size); 15 | 16 | extern void usb_midi_report_and_clear_stats(void); 17 | 18 | #endif /* !USB_MIDI_included */ 19 | -------------------------------------------------------------------------------- /Firmware/Slave/stats.txt: -------------------------------------------------------------------------------- 1 | LEDs off, no caps 2 | 3 | Hello from Slave: 3738978 4 | 5 | 0: n=3333 min=0 max=65531 mean=65483 dev=12.89 6 | 1: n=3333 min=0 max=65535 mean=65482 dev=15.19 7 | 8 | 0: n=3333 min=65432 max=65534 mean=65483 dev=13.16 9 | 1: n=3333 min=65415 max=65535 mean=65481 dev=13.88 10 | 11 | 0: n=3333 min=65408 max=65535 mean=65483 dev=13.23 12 | 1: n=3333 min=65408 max=65535 mean=65482 dev=14.46 13 | 14 | 0: n=3333 min=65428 max=65535 mean=65484 dev=13.00 15 | 1: n=3333 min=65414 max=65535 mean=65482 dev=14.25 16 | 17 | 0: n=2731 min=33762 max=65530 mean=44002 dev=14268.42 18 | 1: n=2731 min=30571 max=65534 mean=43253 dev=15158.56 19 | 20 | 0: n=2322 min=33415 max=34279 mean=33855 dev=91.85 21 | 1: n=2322 min=30572 max=30822 mean=30701 dev=30.31 22 | 23 | 0: n=2401 min=33780 max=34297 mean=33868 dev=83.49 24 | 1: n=2401 min=30563 max=30823 mean=30703 dev=30.66 25 | 26 | 0: n=2301 min=33447 max=34281 mean=33863 dev=89.75 27 | 1: n=2301 min=30571 max=30821 mean=30707 dev=31.19 28 | 29 | 0: n=3011 min=4 max=34106 mean=4617 dev=11548.28 30 | 1: n=3011 min=4 max=30803 mean=4168 dev=10437.96 31 | 32 | 0: n=3333 min=4 max=70 mean=7 dev=8.28 33 | 1: n=3333 min=4 max=128 mean=8 dev=11.13 34 | 35 | 0: n=3333 min=4 max=67 mean=7 dev=8.16 36 | 1: n=3333 min=4 max=127 mean=8 dev=11.31 37 | 38 | 0: n=3333 min=4 max=86 mean=7 dev=8.09 39 | 1: n=3333 min=4 max=106 mean=9 dev=11.58 40 | 41 | 42 | ---------------------------------- 43 | LEDs Amber, no caps 44 | 45 | Hello from Slave: 3144479 46 | 47 | 0: n=3333 min=0 max=65535 mean=65485 dev=13.31 48 | 1: n=3333 min=0 max=65535 mean=65483 dev=14.36 49 | 50 | 0: n=3333 min=65407 max=65535 mean=65485 dev=13.34 51 | 1: n=3333 min=65404 max=65535 mean=65482 dev=14.45 52 | 53 | 0: n=3333 min=65404 max=65535 mean=65485 dev=13.16 54 | 1: n=3333 min=65405 max=65535 mean=65483 dev=13.80 55 | 56 | 0: n=3334 min=65404 max=65535 mean=65486 dev=13.11 57 | 1: n=3334 min=65401 max=65535 mean=65482 dev=14.31 58 | 59 | 0: n=2968 min=24713 max=65535 mean=47780 dev=18515.05 60 | 1: n=2968 min=25663 max=65535 mean=56509 dev=15757.36 61 | 62 | 0: n=2712 min=30341 max=31209 mean=30754 dev=85.28 63 | 1: n=2712 min=25711 max=25989 mean=25848 dev=30.89 64 | 65 | 0: n=2917 min=30426 max=31197 mean=30771 dev=72.69 66 | 1: n=2917 min=25713 max=25955 mean=25845 dev=30.61 67 | 68 | 0: n=2743 min=30343 max=31187 mean=30754 dev=76.50 69 | 1: n=2743 min=25698 max=25951 mean=25846 dev=29.74 70 | 71 | 0: n=3184 min=6 max=31202 mean=6443 dev=12449.11 72 | 1: n=3184 min=6 max=25941 mean=7310 dev=11590.15 73 | 74 | 0: n=3333 min=6 max=191 mean=13 dev=10.70 75 | 1: n=3333 min=6 max=148 mean=15 dev=12.70 76 | 77 | 0: n=3333 min=6 max=123 mean=13 dev=12.15 78 | 1: n=3333 min=6 max=169 mean=15 dev=14.08 79 | 80 | 0: n=3333 min=6 max=128 mean=13 dev=10.19 81 | 1: n=3333 min=6 max=151 mean=16 dev=14.97 82 | 83 | -------------------------------------------------------------------------------- /Front Panel/archive/Lato-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/Lato-Light.ttf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-0.2.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-0.2.zip -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-0.3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-0.3.zip -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-0.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-0.4.zip -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-both-0.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-both-0.1.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-cut-0.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-cut-0.2.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-all-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-all-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-all-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-all-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-allvec-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-allvec-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-allvec-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-allvec-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-art-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-art-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-art-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-art-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-both-0.1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-both-0.1.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-cut-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-cut-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-cut-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-cut-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-engrave-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-engrave-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-engrave-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-engrave-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-somevec-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-somevec-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-detail-somevec-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-detail-somevec-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-engrave-0.2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-engrave-0.2.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-all-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-all-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-all-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-all-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-allvec-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-allvec-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-allvec-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-allvec-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-art-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-art-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-art-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-art-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-cut-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-cut-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-cut-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-cut-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-engrave-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-engrave-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-engrave-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-engrave-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-somevec-0.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-somevec-0.3.pdf -------------------------------------------------------------------------------- /Front Panel/archive/bob-synth-full-somevec-0.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/bob-synth-full-somevec-0.4.pdf -------------------------------------------------------------------------------- /Front Panel/archive/jupiter.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/Front Panel/archive/jupiter.ttf -------------------------------------------------------------------------------- /Front Panel/render-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # VERSION=0.5 4 | PRE=bob-synth- 5 | POST="${VERSION+-${VERSION}}.pdf" 6 | 7 | all="--outline=all --engrave --cut" 8 | 9 | R="python synth-dsl.py" 10 | # R="echo $R" 11 | 12 | function render { 13 | echo $R "$@" 14 | $R "$@" 15 | } 16 | 17 | render -o "${PRE}full-art${POST}" 18 | render --flip --outline=all -o "${PRE}full-allvec${POST}" 19 | render --flip --outline=vec -o "${PRE}full-somevec${POST}" 20 | render --flip --engrave -o "${PRE}full-engrave${POST}" 21 | render --flip --cut -o "${PRE}full-cut${POST}" 22 | render --flip ${all} -o "${PRE}full-all${POST}" 23 | 24 | render --detail -o "${PRE}detail-art${POST}" 25 | render --detail --flip --outline=all -o "${PRE}detail-allvec${POST}" 26 | render --detail --flip --outline=vec -o "${PRE}detail-somevec${POST}" 27 | render --detail --flip --engrave -o "${PRE}detail-engrave${POST}" 28 | render --detail --flip --cut -o "${PRE}detail-cut${POST}" 29 | render --detail --flip ${all} -o "${PRE}detail-all${POST}" 30 | -------------------------------------------------------------------------------- /MCAD/endcap.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/MCAD/endcap.pdf -------------------------------------------------------------------------------- /MCAD/endcaps.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.4 2 | 3 | from contextlib import contextmanager 4 | from math import cos, pi, sin 5 | 6 | from reportlab.lib.pagesizes import letter 7 | from reportlab.lib.units import inch, mm 8 | from reportlab.pdfgen import canvas 9 | 10 | ANGLE = 35 11 | CHASSIS_WIDTH = 135 12 | CHASSIS_HEIGHT = 24.5 13 | OVERHANG = 2 14 | 15 | WIDTH = CHASSIS_WIDTH + 2 * OVERHANG 16 | HEIGHT = CHASSIS_HEIGHT + 2 * OVERHANG 17 | 18 | RADIUS1 = 6.35 / 2 19 | RADIUS2 = 11 / 2 20 | SCREW_POS = [34, 100] 21 | 22 | @contextmanager 23 | def state(c): 24 | c.saveState() 25 | yield c 26 | c.restoreState() 27 | 28 | @contextmanager 29 | def path(c, stroke=1, fill=0): 30 | p = c.beginPath() 31 | yield p 32 | c.drawPath(p, stroke=stroke, fill=fill) 33 | 34 | def draw_outline(c): 35 | a = ANGLE * pi / 180 36 | y1 = HEIGHT * cos(a) 37 | p2 = (WIDTH * cos(a), y1 + WIDTH * sin(a)) 38 | p3 = (p2[0] + HEIGHT * sin(a), p2[1] - y1) 39 | p4 = (p3[0], 0) 40 | c.setLineWidth(0.1) 41 | with path(c) as p: 42 | p.moveTo(0, 0) 43 | p.lineTo(0, y1) 44 | p.lineTo(*p2) 45 | p.lineTo(*p3) 46 | p.lineTo(*p4) 47 | p.lineTo(0, 0) 48 | 49 | @contextmanager 50 | def chassis_transform(c): 51 | a = ANGLE * pi / 180 52 | with state(c): 53 | c.translate(HEIGHT * sin(a), 0) 54 | c.rotate(ANGLE) 55 | c.translate(OVERHANG, OVERHANG) 56 | yield c 57 | 58 | def draw_chassis(c): 59 | with chassis_transform(c): 60 | c.setDash(2, 1) 61 | c.rect(0, 0, CHASSIS_WIDTH, CHASSIS_HEIGHT) 62 | 63 | def draw_holes(c): 64 | with chassis_transform(c): 65 | for x in SCREW_POS: 66 | with state(c): 67 | c.translate(x, CHASSIS_HEIGHT / 2) 68 | c.circle(0, 0, RADIUS1) 69 | c.circle(0, 0, RADIUS2) 70 | c.line(-15, 0, +15, 0) 71 | c.line(0, -15, 0, +15) 72 | 73 | def draw_endcap(c): 74 | with state(c): 75 | c.scale(mm, mm) 76 | c.translate(20, 20) 77 | draw_outline(c) 78 | draw_chassis(c) 79 | draw_holes(c) 80 | 81 | def draw_it_all(c): 82 | with state(c): 83 | draw_endcap(c) 84 | c.translate(8.5*inch, 11/2*inch) 85 | c.scale(-1, +1) 86 | draw_endcap(c) 87 | 88 | def render_document(): 89 | output_file = 'endcap.pdf' 90 | pagesize = letter 91 | c = canvas.Canvas(output_file, pagesize=pagesize) 92 | draw_it_all(c) 93 | c.showPage() 94 | c.save() 95 | 96 | if __name__ == '__main__': 97 | render_document() 98 | -------------------------------------------------------------------------------- /MCAD/endplug.scad: -------------------------------------------------------------------------------- 1 | eps = 0.1; 2 | X = [1, 0, 0]; 3 | Y = [0, 1, 0]; 4 | Z = [0, 0, 1]; 5 | 6 | // left endplug 7 | L = 133; 8 | H = 20 - 3; 9 | T = 4 - 1.8; 10 | BZ = 12.5; 11 | 12 | // right endplug 13 | L = 133; 14 | T = 20; 15 | H = 20 - 3; 16 | BZ = 11; 17 | 18 | module centered_cube(dims, z=0) { 19 | translate([-dims[0]/2, -dims[1]/2, z]) 20 | cube(dims); 21 | } 22 | 23 | module endplug() { 24 | difference() { 25 | centered_cube([L, 20-3, T]); 26 | for (x = [-33, +33]) 27 | translate([x, BZ - H/2, T - 1.4]) 28 | cylinder(d=4.9, h=3.4 + eps, $fs = 0.1); 29 | } 30 | } 31 | 32 | module washer() { 33 | $fs = 0.2; 34 | $fa = 6; 35 | difference() { 36 | cylinder(d=10, h=0.6); 37 | cylinder(d=5.4, h=5, center=true); 38 | } 39 | } 40 | 41 | endplug(); 42 | 43 | // for (x = [-10, +10]) 44 | // translate([x, -20, 0]) 45 | // washer(); 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MinimumViableSynth 2 | 3 | A virtual analog synthesizer with lots of knobs and buttons. 4 | 5 | ![front panel image](image/Synth_Panel_color.png?raw=true) 6 | 7 | This is a polyphonic, monotimbral, virtual analog synth. The audio 8 | engine runs as an Apple Audio Unit on a Macintosh. The control panel, 9 | shown here, will provide dedicated controls for most of the synth's 10 | functions. 11 | 12 | ![assembly animation](image/assembly.gif?raw=true) 13 | 14 | The end goal is a self contained keyboard synth with knobs and buttons 15 | with the classic connections: audio out, MIDI in/out, USB MIDI in/out. 16 | I am getting there in three phases. 17 | 18 | * **Phase 1** (complete 2015-01-01): Softsynth. The audio engine 19 | runs as an Audio Unit on a Mac. It accepts MIDI messages and 20 | produces beautiful polyphonic analog sounds. Or gritty, 21 | disturbing analog sounds. It plugs in to DAW software (I use 22 | Logic Pro X). 23 | 24 | * **Phase 2** (in progress): Knobs and buttons. I am designing and 25 | building a front panel (see above) with knobs, buttons, and an LCD 26 | touchscreen. The goal is to make it as easy as possible to 27 | understand what the synth is doing at any time. 28 | 29 | * **Phase 3** (future): Stand-alone. Build an enclosure that houses 30 | a keyboard, the knob and button panel, I/O jacks, and a processor 31 | (TBD) that can run the audio engine. I'm looking at FPGAs... 32 | 33 | 34 | ## Why? 35 | 36 | Learn stuff. Music theory, DSP, PCB layout, CAD and machining, more. 37 | 38 | 39 | ## Status 40 | 41 | Check out synth-notes.txt for my thoughts as I worked things out. 42 | 43 | 44 | #### January 7, 2017: 45 | 46 | I built 8 slave modules: the LFOs, the Controllers module, the 47 | oscillators, the noise source, mixer, and filter. I've since killed 48 | the filter module, and one of the oscillators' LED has burnt out its 49 | red component. I have parts and tools to repair those; just haven't 50 | done it yet. 51 | 52 | I have working UI for the knobs and buttons. Specifically, routing 53 | between modulators and targets works, complete with lighting effects. 54 | 55 | I made an enclosure from aluminum sheet and melamine end blocks, as 56 | illustrated above. It is flimsy, though, so that needs to be re-done. 57 | 58 | I had the master, slaves, and LCD panel connected via a breadboard. 59 | The breadboard wiring got flaky, so I stopped to design a PCB. The 60 | PCB snaps onto the back of the Discovery board, It routes video to the 61 | LCD touch screen, SPI to the slaves, and serial MIDI to a future MIDI 62 | I/O board. 63 | 64 | I am currently designing the graphics for the LCD panel. 65 | 66 | (Over a year since the last update. Oops.) 67 | 68 | 69 | #### December 17, 2015: 70 | 71 | Three slave modules have been built. (LFO1, LFO2, Controllers.) All 72 | the slave module PCBs are fabricated. 73 | 74 | The master-slave communications are working over SPI. The master 75 | generates MIDI events. 76 | [I can push a button on a slave and hear its effect on the audio 77 | engine.](https://www.youtube.com/watch?v=dZsXk2Zf6Bg) 78 | 79 | I blew up one of the LFO modules, probably with static discharge. I 80 | repaired it (swapped in a new Teensy LC), and it works now. It was an 81 | ugly repair. 82 | 83 | Current tasks: 84 | 85 | + generating more MIDI events 86 | + experimenting with the LED animation 87 | + soldering up the rest of the slave modules 88 | + designing backing plates for the new slave modules 89 | 90 | 91 | #### August 14, 2015: 92 | 93 | The audio engine has been stable since January, though it does not 94 | exactly match the front panel's feature set. 95 | 96 | The front panel was fabricated in July. I used a sheet of acrylic, 97 | painted the underside black, then engraved the artwork through the 98 | paint with a laser cutter. Then the same laser cutter cut all the 99 | holes for the controls. It looks sharp, but not mass produced. 100 | I got the work done at [InHaus Fabrication](http://inhausfabrication.com/). 101 | 102 | There is a master microcontroller, an STM32F429, and each module has a 103 | slave controller, a Teensy-LC. Each slave directly drives a few 104 | knobs, buttons, and LEDs. The master will coordinate all the slaves 105 | and provide the MIDI over USB interface. I am currently writing SPI 106 | drivers for master-slave communication. 107 | -------------------------------------------------------------------------------- /datasheets/820.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/datasheets/820.pdf -------------------------------------------------------------------------------- /datasheets/B260009.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/datasheets/B260009.pdf -------------------------------------------------------------------------------- /datasheets/Matrix_61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/datasheets/Matrix_61.gif -------------------------------------------------------------------------------- /datasheets/TL1220.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/datasheets/TL1220.pdf -------------------------------------------------------------------------------- /datasheets/WS2812.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/datasheets/WS2812.pdf -------------------------------------------------------------------------------- /image/Synth Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/image/Synth Panel.png -------------------------------------------------------------------------------- /image/Synth_Panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/image/Synth_Panel.png -------------------------------------------------------------------------------- /image/Synth_Panel_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/image/Synth_Panel_color.png -------------------------------------------------------------------------------- /image/assembly.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kbob/MinimumViableSynth/cad05a63c0aa68dd3780eeb255455a4d2f5725da/image/assembly.gif --------------------------------------------------------------------------------