├── .gitignore
├── 64klang2.png
├── FileProperties_Security_Unblock.png
├── LICENSE
├── Player
├── Player.sln
└── Player
│ ├── 64k2Patch.h
│ ├── 64k2Song.h
│ ├── Player.vcxproj
│ ├── Player.vcxproj.filters
│ ├── Synth.cpp
│ ├── Synth.h
│ ├── SynthAllocator.cpp
│ ├── SynthAllocator.h
│ ├── SynthNode.cpp
│ ├── SynthNode.h
│ ├── main.cpp
│ ├── sample_t.cpp
│ └── sample_t.h
├── README.md
├── VSTiPlugin
└── 64klang2.zip
└── VSTiPluginSourceCode
├── 64klang2.sln
├── 64klang2Core
├── 64klang2Core.vcxproj
├── 64klang2Core.vcxproj.filters
├── Synth.cpp
├── Synth.h
├── SynthAllocator.cpp
├── SynthAllocator.h
├── SynthController.cpp
├── SynthController.h
├── SynthNode.cpp
├── SynthNode.h
├── sample_t.cpp
├── sample_t.h
├── tinystr.cpp
├── tinystr.h
├── tinyxml.cpp
├── tinyxml.h
├── tinyxmlerror.cpp
└── tinyxmlparser.cpp
├── 64klang2GUI
├── 64klang2Config.xml
├── 64klang2GUI.csproj
├── ArpeggiatorEdit.xaml
├── ArpeggiatorEdit.xaml.cs
├── BitPattern.xaml
├── BitPattern.xaml.cs
├── GUISynthNode.xaml
├── GUISynthNode.xaml.cs
├── GUISynthNodeEdit.xaml
├── GUISynthNodeEdit.xaml.cs
├── Knob.xaml
├── Knob.xaml.cs
├── ModeButton.xaml
├── ModeButton.xaml.cs
├── MultiParse
│ ├── DefaultCasts
│ │ ├── MPBooleanCast.cs
│ │ ├── MPByteCast.cs
│ │ ├── MPCharCast.cs
│ │ ├── MPDecimalCast.cs
│ │ ├── MPDoubleCast.cs
│ │ ├── MPInt16Cast.cs
│ │ ├── MPInt32Cast.cs
│ │ ├── MPInt64Cast.cs
│ │ ├── MPSByteCast.cs
│ │ ├── MPSingleCast.cs
│ │ ├── MPStringCast.cs
│ │ ├── MPUInt16Cast.cs
│ │ ├── MPUInt32Cast.cs
│ │ └── MPUInt64Cast.cs
│ ├── DefaultDataTypes
│ │ ├── MPBoolean.cs
│ │ ├── MPByte.cs
│ │ ├── MPChar.cs
│ │ ├── MPDecimal.cs
│ │ ├── MPDouble.cs
│ │ ├── MPInt16.cs
│ │ ├── MPInt32.cs
│ │ ├── MPInt64.cs
│ │ ├── MPSByte.cs
│ │ ├── MPSingle.cs
│ │ ├── MPString.cs
│ │ ├── MPUInt16.cs
│ │ ├── MPUInt32.cs
│ │ ├── MPUInt64.cs
│ │ └── MPVariable.cs
│ ├── DefaultFunctions
│ │ ├── MPAbs.cs
│ │ ├── MPAcos.cs
│ │ ├── MPAsin.cs
│ │ ├── MPAtan.cs
│ │ ├── MPAtan2.cs
│ │ ├── MPCeiling.cs
│ │ ├── MPCos.cs
│ │ ├── MPCosh.cs
│ │ ├── MPExp.cs
│ │ ├── MPExp2.cs
│ │ ├── MPFloor.cs
│ │ ├── MPIfThen.cs
│ │ ├── MPIn0.cs
│ │ ├── MPIn1.cs
│ │ ├── MPLerp.cs
│ │ ├── MPLog.cs
│ │ ├── MPLog10.cs
│ │ ├── MPLog2.cs
│ │ ├── MPMax.cs
│ │ ├── MPMaxTime.cs
│ │ ├── MPMin.cs
│ │ ├── MPPi.cs
│ │ ├── MPPow.cs
│ │ ├── MPPulse.cs
│ │ ├── MPRand.cs
│ │ ├── MPRound.cs
│ │ ├── MPSign.cs
│ │ ├── MPSin.cs
│ │ ├── MPSqr.cs
│ │ ├── MPSqrt.cs
│ │ ├── MPTan.cs
│ │ ├── MPTanh.cs
│ │ ├── MPTau.cs
│ │ ├── MPTautime.cs
│ │ ├── MPTriSaw.cs
│ │ ├── MPTruncate.cs
│ │ ├── MPVAftertouch.cs
│ │ ├── MPVFrequency.cs
│ │ ├── MPVGate.cs
│ │ ├── MPVNote.cs
│ │ ├── MPVTrigger.cs
│ │ └── MPVVelocity.cs
│ ├── DefaultOperators
│ │ ├── MPAddition.cs
│ │ ├── MPAssignment.cs
│ │ ├── MPComplement.cs
│ │ ├── MPConditionalAnd.cs
│ │ ├── MPConditionalOr.cs
│ │ ├── MPDivision.cs
│ │ ├── MPEquality.cs
│ │ ├── MPInequality.cs
│ │ ├── MPLeftShift.cs
│ │ ├── MPLogicalAnd.cs
│ │ ├── MPLogicalOr.cs
│ │ ├── MPLogicalXOr.cs
│ │ ├── MPModulo.cs
│ │ ├── MPMultiplication.cs
│ │ ├── MPNegative.cs
│ │ ├── MPNot.cs
│ │ ├── MPPositive.cs
│ │ ├── MPRelationalLarger.cs
│ │ ├── MPRelationalLargerEqual.cs
│ │ ├── MPRelationalSmaller.cs
│ │ ├── MPRelationalSmallerEqual.cs
│ │ ├── MPRightShift.cs
│ │ └── MPSubtraction.cs
│ ├── Expression.cs
│ ├── MPDataType.cs
│ ├── MPDefault.cs
│ ├── MPFunction.cs
│ ├── MPOperator.cs
│ ├── MPSpecialCharacters.cs
│ └── ParseException.cs
├── Properties
│ └── AssemblyInfo.cs
├── SynthCanvas.xaml
├── SynthCanvas.xaml.cs
├── SynthWindow.xaml
├── SynthWindow.xaml.cs
├── TouchScrolling.cs
├── VUMeter.xaml
├── VUMeter.xaml.cs
├── WaveFileConfig.xaml
├── WaveFileConfig.xaml.cs
├── WaveFileDialog.xaml
├── WaveFileDialog.xaml.cs
└── WaveformTimeline.cs
├── 64klang2VSTi
├── 64klang2VSTi.vcxproj
├── vstplugmain.cpp
├── vstxsynth.cpp
├── vstxsynth.h
└── vstxsynthproc.cpp
├── 64klang2Wrapper
├── 64klang2Wrapper.cpp
├── 64klang2Wrapper.h
├── 64klang2Wrapper.vcxproj
├── 64klang2Wrapper.vcxproj.filters
├── ReadMe.txt
├── dllmain.cpp
├── stdafx.cpp
├── stdafx.h
└── targetver.h
├── DebugExe
├── DebugExe.vcxproj
├── Exe.cpp
├── Exe.h
├── Exe.ico
├── Exe.rc
├── Exe.vcxproj.filters
├── ReadMe.txt
├── Resource.h
├── small.ico
├── stdafx.cpp
├── stdafx.h
└── targetver.h
├── Setup
├── 64klang2_Setup.exe
├── Setup.isl
└── Setup.isproj
├── readme.txt
├── stk
├── include
│ ├── ADSR.h
│ ├── Asymp.h
│ ├── BandedWG.h
│ ├── BeeThree.h
│ ├── BiQuad.h
│ ├── Blit.h
│ ├── BlitSaw.h
│ ├── BlitSquare.h
│ ├── BlowBotl.h
│ ├── BlowHole.h
│ ├── BowTable.h
│ ├── Bowed.h
│ ├── Brass.h
│ ├── Chorus.h
│ ├── Clarinet.h
│ ├── Cubic.h
│ ├── Delay.h
│ ├── DelayA.h
│ ├── DelayL.h
│ ├── Drummer.h
│ ├── Echo.h
│ ├── Effect.h
│ ├── Envelope.h
│ ├── FM.h
│ ├── FMVoices.h
│ ├── FileLoop.h
│ ├── FileRead.h
│ ├── FileWrite.h
│ ├── FileWvIn.h
│ ├── FileWvOut.h
│ ├── Filter.h
│ ├── Fir.h
│ ├── Flute.h
│ ├── FormSwep.h
│ ├── FreeVerb.h
│ ├── Function.h
│ ├── Generator.h
│ ├── Granulate.h
│ ├── Guitar.h
│ ├── HevyMetl.h
│ ├── Iir.h
│ ├── InetWvIn.h
│ ├── InetWvOut.h
│ ├── Instrmnt.h
│ ├── JCRev.h
│ ├── JetTable.h
│ ├── LentPitShift.h
│ ├── Mandolin.h
│ ├── Mesh2D.h
│ ├── Messager.h
│ ├── MidiFileIn.h
│ ├── Modal.h
│ ├── ModalBar.h
│ ├── Modulate.h
│ ├── Moog.h
│ ├── Mutex.h
│ ├── NRev.h
│ ├── Noise.h
│ ├── OnePole.h
│ ├── OneZero.h
│ ├── PRCRev.h
│ ├── PercFlut.h
│ ├── Phonemes.h
│ ├── PitShift.h
│ ├── PluckTwo.h
│ ├── Plucked.h
│ ├── PoleZero.h
│ ├── ReedTable.h
│ ├── Resonate.h
│ ├── Rhodey.h
│ ├── RtAudio.h
│ ├── RtError.h
│ ├── RtMidi.h
│ ├── RtWvIn.h
│ ├── RtWvOut.h
│ ├── SKINI.msg
│ ├── SKINI.tbl
│ ├── Sampler.h
│ ├── Saxofony.h
│ ├── Shakers.h
│ ├── Simple.h
│ ├── SineWave.h
│ ├── SingWave.h
│ ├── Sitar.h
│ ├── Skini.h
│ ├── Socket.h
│ ├── Sphere.h
│ ├── StifKarp.h
│ ├── Stk.h
│ ├── TapDelay.h
│ ├── TcpClient.h
│ ├── TcpServer.h
│ ├── Thread.h
│ ├── TubeBell.h
│ ├── Twang.h
│ ├── TwoPole.h
│ ├── TwoZero.h
│ ├── UdpSocket.h
│ ├── Vector3D.h
│ ├── VoicForm.h
│ ├── Voicer.h
│ ├── Whistle.h
│ ├── Wurley.h
│ ├── WvIn.h
│ └── WvOut.h
└── src
│ ├── ADSR.cpp
│ ├── Asymp.cpp
│ ├── BandedWG.cpp
│ ├── BeeThree.cpp
│ ├── BiQuad.cpp
│ ├── Blit.cpp
│ ├── BlitSaw.cpp
│ ├── BlitSquare.cpp
│ ├── BlowBotl.cpp
│ ├── BlowHole.cpp
│ ├── Bowed.cpp
│ ├── Brass.cpp
│ ├── Chorus.cpp
│ ├── Clarinet.cpp
│ ├── Delay.cpp
│ ├── DelayA.cpp
│ ├── DelayL.cpp
│ ├── Drummer.cpp
│ ├── Echo.cpp
│ ├── Envelope.cpp
│ ├── FM.cpp
│ ├── FMVoices.cpp
│ ├── FileLoop.cpp
│ ├── FileRead.cpp
│ ├── FileWrite.cpp
│ ├── FileWvIn.cpp
│ ├── FileWvOut.cpp
│ ├── Fir.cpp
│ ├── Flute.cpp
│ ├── FormSwep.cpp
│ ├── FreeVerb.cpp
│ ├── Granulate.cpp
│ ├── Guitar.cpp
│ ├── HevyMetl.cpp
│ ├── Iir.cpp
│ ├── InetWvIn.cpp
│ ├── InetWvOut.cpp
│ ├── JCRev.cpp
│ ├── LentPitShift.cpp
│ ├── Mandolin.cpp
│ ├── Mesh2D.cpp
│ ├── Messager.cpp
│ ├── MidiFileIn.cpp
│ ├── Modal.cpp
│ ├── ModalBar.cpp
│ ├── Modulate.cpp
│ ├── Moog.cpp
│ ├── Mutex.cpp
│ ├── NRev.cpp
│ ├── Noise.cpp
│ ├── OnePole.cpp
│ ├── OneZero.cpp
│ ├── PRCRev.cpp
│ ├── PercFlut.cpp
│ ├── Phonemes.cpp
│ ├── PitShift.cpp
│ ├── PluckTwo.cpp
│ ├── Plucked.cpp
│ ├── PoleZero.cpp
│ ├── Resonate.cpp
│ ├── Rhodey.cpp
│ ├── RtAudio.cpp
│ ├── RtMidi.cpp
│ ├── RtWvIn.cpp
│ ├── RtWvOut.cpp
│ ├── Sampler.cpp
│ ├── Saxofony.cpp
│ ├── Shakers.cpp
│ ├── Simple.cpp
│ ├── SineWave.cpp
│ ├── SingWave.cpp
│ ├── Sitar.cpp
│ ├── Skini.cpp
│ ├── Socket.cpp
│ ├── Sphere.cpp
│ ├── StifKarp.cpp
│ ├── Stk.cpp
│ ├── TapDelay.cpp
│ ├── TcpClient.cpp
│ ├── TcpServer.cpp
│ ├── Thread.cpp
│ ├── TubeBell.cpp
│ ├── Twang.cpp
│ ├── TwoPole.cpp
│ ├── TwoZero.cpp
│ ├── UdpSocket.cpp
│ ├── VoicForm.cpp
│ ├── Voicer.cpp
│ ├── Whistle.cpp
│ ├── Wurley.cpp
│ └── include
│ ├── FunctionDiscoveryKeys_devpkey.h
│ ├── asio.cpp
│ ├── asio.h
│ ├── asiodrivers.cpp
│ ├── asiodrivers.h
│ ├── asiodrvr.h
│ ├── asiolist.cpp
│ ├── asiolist.h
│ ├── asiosys.h
│ ├── dsound.h
│ ├── ginclude.h
│ ├── iasiodrv.h
│ ├── iasiothiscallresolver.cpp
│ ├── iasiothiscallresolver.h
│ └── soundcard.h
└── vstsdk
├── interfaces
├── aeffect.h
├── aeffectx.h
└── vstfxstore.h
├── source
├── aeffeditor.h
├── audioeffect.cpp
├── audioeffect.h
├── audioeffectx.cpp
└── audioeffectx.h
└── vstplug.def
/.gitignore:
--------------------------------------------------------------------------------
1 | # Visual Studio 2015/2017 cache/options directory
2 | .vs/
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 |
8 | # Build results
9 | [Dd]ebug/
10 | [Rr]elease/
11 | [Bb]in/
12 | [Oo]bj/
13 |
14 |
15 |
--------------------------------------------------------------------------------
/64klang2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gopher-atz/64klang/fc95541ceff3e6022b1a18deca5df0ecde1bdc16/64klang2.png
--------------------------------------------------------------------------------
/FileProperties_Security_Unblock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gopher-atz/64klang/fc95541ceff3e6022b1a18deca5df0ecde1bdc16/FileProperties_Security_Unblock.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Dominik Ries
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Player/Player.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2036
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Player", "Player\Player.vcxproj", "{D5AA23B1-586D-4D6A-863A-DF1E75328AE9}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Debug|x64.ActiveCfg = Debug|x64
17 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Debug|x64.Build.0 = Debug|x64
18 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Debug|x86.ActiveCfg = Debug|Win32
19 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Debug|x86.Build.0 = Debug|Win32
20 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Release|x64.ActiveCfg = Release|x64
21 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Release|x64.Build.0 = Release|x64
22 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Release|x86.ActiveCfg = Release|Win32
23 | {D5AA23B1-586D-4D6A-863A-DF1E75328AE9}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BD815C56-E2D1-4830-A56A-1E6B3D1D434F}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Player/Player/Player.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 |
35 |
36 | Header Files
37 |
38 |
39 | Header Files
40 |
41 |
42 | Header Files
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Player/Player/Synth.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 | // 64klang core interface functions for playback, plugin and authoring
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4 |
5 | #ifndef __SYNTH_H__
6 | #define __SYNTH_H__
7 |
8 | #include
9 |
10 | void _64klang_Init (BYTE* songStream, void* patchData, DWORD const1Offset, DWORD const2Offset, DWORD maxoffset);
11 | int _64klang_ACMConvert (void* srcFormat, void* dstFormat, LPBYTE srcBuffer, DWORD srcBufferSize, LPBYTE& dstBuffer, DWORD& dstBufferSize);
12 | #ifdef COMPILE_VSTI
13 | void _64klang_NoteOn (DWORD channel, DWORD note, DWORD velocity);
14 | void _64klang_NoteOff (DWORD channel, DWORD note, DWORD velocity);
15 | void _64klang_NoteAftertouch(DWORD channel, DWORD note, DWORD value);
16 | void _64klang_MidiSignal (DWORD channel, int value, DWORD cc);
17 | void _64klang_SetBPM (float bpm);
18 | void _64klang_Tick (float* left, float* right, DWORD samples);
19 | #else
20 | void _64klang_Render(float* dstbuffer);
21 | bool _64klang_RenderDone();
22 | #ifdef AUTHORING
23 | int _64klang_CurrentBufferSample();
24 | #endif
25 | #endif
26 |
27 | #endif
--------------------------------------------------------------------------------
/Player/Player/SynthAllocator.cpp:
--------------------------------------------------------------------------------
1 | #include "SynthAllocator.h"
2 | #ifdef COMPILE_VSTI
3 | #include "SynthController.h"
4 | #endif
5 |
6 | #ifndef COMPILE_VSTI
7 | void* SynthFreeList[65536];
8 | int SynthFreeCounter = 0;
9 | #endif
10 |
11 | void* __fastcall SynthMalloc(int size)
12 | {
13 | // always allocate 16 bytes more than requested
14 | int* ptr = (int*)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, size + 16);
15 | // step forward 16 bytes
16 | ptr += 4;
17 | // not 16byte aligned?
18 | if ((uintptr_t)ptr & 0x08)
19 | {
20 | // go back 8 bytes for the pointer to be 16 byte aligned
21 | ptr -= 2;
22 | // to know we had originally unaligned mem, store the pointer as marker in the 8 bytes before (start of original memory block)
23 | *((uintptr_t*)(ptr-2)) = (uintptr_t)ptr;
24 | }
25 | return ptr;
26 | }
27 |
28 | void __fastcall SynthFree(void* ptr)
29 | {
30 | int* fptr = (int*)ptr;
31 | // check if initial malloc returned an 8 byte aligned address by checking for pointer to self at the beginning of the (see above)
32 | if (*((uintptr_t*)(fptr-2)) == (uintptr_t)fptr)
33 | {
34 | fptr -= 2;
35 | }
36 | // initial malloc was 16 bytes aligned
37 | else
38 | {
39 | // step back 16 bytes
40 | fptr -= 4;
41 | }
42 |
43 | #ifndef COMPILE_VSTI
44 | SynthFreeList[SynthFreeCounter++] = fptr;
45 | #else
46 | SynthController::instance()->AddDeferredFreeNode(fptr);
47 | #endif
48 | }
49 |
50 | void __fastcall SynthDeferredFree()
51 | {
52 | #ifndef COMPILE_VSTI
53 | while (SynthFreeCounter)
54 | GlobalFree(SynthFreeList[--SynthFreeCounter]);
55 | #endif
56 | }
57 |
58 | void __fastcall SynthMemSet(void* mptr, int s, int v)
59 | {
60 | char* pdst = (char*)mptr;
61 | while(s--)
62 | pdst[s] = v;
63 | }
64 |
65 | void __fastcall SynthMemCopy(void* dst, void* src, int s)
66 | {
67 | char* psrc = (char*)src, * pdst = (char*)dst;
68 | while (s--)
69 | pdst[s] = psrc[s];
70 | }
--------------------------------------------------------------------------------
/Player/Player/SynthAllocator.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 | // custom memory allocation for 64klang's SSE based data. takes care of memory alignment
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4 |
5 | #ifndef _SYNTH_ALLOCATOR_H_
6 | #define _SYNTH_ALLOCATOR_H_
7 |
8 | #include "windows.h"
9 |
10 | void* __fastcall SynthMalloc(int size);
11 | void __fastcall SynthFree(void* ptr);
12 | void __fastcall SynthDeferredFree();
13 | void __fastcall SynthMemSet(void* ptr, int size, int value);
14 | void __fastcall SynthMemCopy(void* dst, void* src, int s);
15 |
16 | #endif
--------------------------------------------------------------------------------
/Player/Player/main.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gopher-atz/64klang/fc95541ceff3e6022b1a18deca5df0ecde1bdc16/Player/Player/main.cpp
--------------------------------------------------------------------------------
/VSTiPlugin/64klang2.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gopher-atz/64klang/fc95541ceff3e6022b1a18deca5df0ecde1bdc16/VSTiPlugin/64klang2.zip
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2Core/Synth.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 | // 64klang core interface functions for playback, plugin and authoring
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4 |
5 | #ifndef __SYNTH_H__
6 | #define __SYNTH_H__
7 |
8 | #include
9 |
10 | #ifdef USE_BLOBS
11 | void _64klang_Init (BYTE* songStream, void* patchData);
12 | #else
13 | void _64klang_Init (BYTE* songStream, void* patchData, DWORD const1Offset, DWORD const2Offset, DWORD maxoffset);
14 | #endif
15 | int _64klang_ACMConvert (void* srcFormat, void* dstFormat, LPBYTE srcBuffer, DWORD srcBufferSize, LPBYTE& dstBuffer, DWORD& dstBufferSize);
16 | #ifdef COMPILE_VSTI
17 | void _64klang_NoteOn (DWORD channel, DWORD note, DWORD velocity);
18 | void _64klang_NoteOff (DWORD channel, DWORD note, DWORD velocity);
19 | void _64klang_NoteAftertouch(DWORD channel, DWORD note, DWORD value);
20 | void _64klang_MidiSignal (DWORD channel, int value, DWORD cc);
21 | void _64klang_SetBPM (float bpm);
22 | void _64klang_Tick (float* left, float* right, DWORD samples);
23 | #else
24 | void _64klang_Render(float* dstbuffer);
25 | bool _64klang_RenderDone();
26 | #ifdef AUTHORING
27 | int _64klang_CurrentBufferSample();
28 | #endif
29 | #endif
30 |
31 | #endif
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2Core/SynthAllocator.cpp:
--------------------------------------------------------------------------------
1 | #include "SynthAllocator.h"
2 | #ifdef COMPILE_VSTI
3 | #include "SynthController.h"
4 | #endif
5 |
6 | #ifndef COMPILE_VSTI
7 | void* SynthFreeList[65536];
8 | int SynthFreeCounter = 0;
9 | #endif
10 |
11 | void* __fastcall SynthMalloc(int size)
12 | {
13 | // always allocate 16 bytes more than requested
14 | int* ptr = (int*)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, size + 16);
15 | // step forward 16 bytes
16 | ptr += 4;
17 | // not 16byte aligned?
18 | if ((uintptr_t)ptr & 0x08)
19 | {
20 | // go back 8 bytes for the pointer to be 16 byte aligned
21 | ptr -= 2;
22 | // to know we had originally unaligned mem, store the pointer as marker in the 8 bytes before (start of original memory block)
23 | *((uintptr_t*)(ptr-2)) = (uintptr_t)ptr;
24 | }
25 | return ptr;
26 | }
27 |
28 | void __fastcall SynthFree(void* ptr)
29 | {
30 | int* fptr = (int*)ptr;
31 | // check if initial malloc returned an 8 byte aligned address by checking for pointer to self at the beginning of the (see above)
32 | if (*((uintptr_t*)(fptr-2)) == (uintptr_t)fptr)
33 | {
34 | fptr -= 2;
35 | }
36 | // initial malloc was 16 bytes aligned
37 | else
38 | {
39 | // step back 16 bytes
40 | fptr -= 4;
41 | }
42 |
43 | #ifndef COMPILE_VSTI
44 | SynthFreeList[SynthFreeCounter++] = fptr;
45 | #else
46 | SynthController::instance()->AddDeferredFreeNode(fptr);
47 | #endif
48 | }
49 |
50 | void __fastcall SynthDeferredFree()
51 | {
52 | #ifndef COMPILE_VSTI
53 | while (SynthFreeCounter)
54 | GlobalFree(SynthFreeList[--SynthFreeCounter]);
55 | #endif
56 | }
57 |
58 | void __fastcall SynthMemSet(void* mptr, int s, int v)
59 | {
60 | char* pdst = (char*)mptr;
61 | while(s--)
62 | pdst[s] = v;
63 | }
64 |
65 | void __fastcall SynthMemCopy(void* dst, void* src, int s)
66 | {
67 | char* psrc = (char*)src, * pdst = (char*)dst;
68 | while (s--)
69 | pdst[s] = psrc[s];
70 | }
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2Core/SynthAllocator.h:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 | // custom memory allocation for 64klang's SSE based data. takes care of memory alignment
3 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
4 |
5 | #ifndef _SYNTH_ALLOCATOR_H_
6 | #define _SYNTH_ALLOCATOR_H_
7 |
8 | #include "windows.h"
9 |
10 | void* __fastcall SynthMalloc(int size);
11 | void __fastcall SynthFree(void* ptr);
12 | void __fastcall SynthDeferredFree();
13 | void __fastcall SynthMemSet(void* ptr, int size, int value);
14 | void __fastcall SynthMemCopy(void* dst, void* src, int s);
15 |
16 | #endif
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2Core/tinyxmlerror.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | www.sourceforge.net/projects/tinyxml
3 | Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
4 |
5 | This software is provided 'as-is', without any express or implied
6 | warranty. In no event will the authors be held liable for any
7 | damages arising from the use of this software.
8 |
9 | Permission is granted to anyone to use this software for any
10 | purpose, including commercial applications, and to alter it and
11 | redistribute it freely, subject to the following restrictions:
12 |
13 | 1. The origin of this software must not be misrepresented; you must
14 | not claim that you wrote the original software. If you use this
15 | software in a product, an acknowledgment in the product documentation
16 | would be appreciated but is not required.
17 |
18 | 2. Altered source versions must be plainly marked as such, and
19 | must not be misrepresented as being the original software.
20 |
21 | 3. This notice may not be removed or altered from any source
22 | distribution.
23 | */
24 |
25 | #include "tinyxml.h"
26 |
27 | // The goal of the seperate error file is to make the first
28 | // step towards localization. tinyxml (currently) only supports
29 | // english error messages, but the could now be translated.
30 | //
31 | // It also cleans up the code a bit.
32 | //
33 |
34 | const char* TiXmlBase::errorString[ TiXmlBase::TIXML_ERROR_STRING_COUNT ] =
35 | {
36 | "No error",
37 | "Error",
38 | "Failed to open file",
39 | "Error parsing Element.",
40 | "Failed to read Element name",
41 | "Error reading Element value.",
42 | "Error reading Attributes.",
43 | "Error: empty tag.",
44 | "Error reading end tag.",
45 | "Error parsing Unknown.",
46 | "Error parsing Comment.",
47 | "Error parsing Declaration.",
48 | "Error document empty.",
49 | "Error null (0) or unexpected EOF found in input stream.",
50 | "Error parsing CDATA.",
51 | "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
52 | };
53 |
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2GUI/ModeButton.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2GUI/ModeButton.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Windows;
6 | using System.Windows.Controls;
7 | using System.Windows.Data;
8 | using System.Windows.Documents;
9 | using System.Windows.Input;
10 | using System.Windows.Media;
11 | using System.Windows.Media.Imaging;
12 | using System.Windows.Navigation;
13 | using System.Windows.Shapes;
14 |
15 | namespace _64klang2GUI
16 | {
17 | ///
18 | /// Interaction logic for ModeButton.xaml
19 | ///
20 | public partial class ModeButton : RadioButton
21 | {
22 | public ModeButton()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/VSTiPluginSourceCode/64klang2GUI/MultiParse/DefaultCasts/MPBooleanCast.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace MultiParse.Default
6 | {
7 | public class MPBooleanCast : MPOperator
8 | {
9 | ///
10 | /// Constructor
11 | ///
12 | public MPBooleanCast()
13 | : base("(bool)", PrecedenceUnary, false)
14 | {
15 | }
16 |
17 | ///
18 | /// Find byte cast
19 | ///
20 | ///
21 | ///
22 | ///
23 | public override int Match(string expression, object previousToken)
24 | {
25 | if (!IsUnary(previousToken))
26 | return -1;
27 | Match m = Regex.Match(expression, @"^\((bool|Boolean)\)");
28 | if (m.Success)
29 | return m.Length;
30 | return -1;
31 | }
32 |
33 | ///
34 | /// Execute byte cast
35 | ///
36 | ///
37 | public override void Execute(Stack