forked from libpd/libpd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
15,038 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> | ||
<PropertyGroup> | ||
<ProjectGuid>{DC510CBA-CD9F-4C7A-BD04-C37AE01FC90B}</ProjectGuid> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>LibPDBindingTest</RootNamespace> | ||
<AssemblyName>LibPDBindingTest</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> | ||
<SignAssembly>False</SignAssembly> | ||
<DelaySign>False</DelaySign> | ||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> | ||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
<NoStdLib>False</NoStdLib> | ||
<WarningLevel>4</WarningLevel> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
<RunCodeAnalysis>False</RunCodeAnalysis> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> | ||
<RegisterForComInterop>False</RegisterForComInterop> | ||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> | ||
<BaseAddress>4194304</BaseAddress> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<FileAlignment>4096</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>Full</DebugType> | ||
<Optimize>False</Optimize> | ||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DebugSymbols>False</DebugSymbols> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
<DefineConstants>TRACE</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> | ||
<RegisterForComInterop>False</RegisterForComInterop> | ||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> | ||
<BaseAddress>4194304</BaseAddress> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<FileAlignment>4096</FileAlignment> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="NUnit.Framework"> | ||
<HintPath>$(SharpDevelopBinPath)\Tools\NUnit\NUnit.Framework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xml.Linq"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="LibPDTests.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\csharp\LibPDBinding.csproj"> | ||
<Project>0D2EF933-6094-4DE1-9D63-9B43786C06AE</Project> | ||
<Name>LibPDBinding</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="test_csharp.pd"> | ||
<CopyToOutputDirectory>Never</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. | ||
* | ||
* | ||
* Created by SharpDevelop. | ||
* User: Tebjan Halm | ||
* Date: 03.05.2012 | ||
* Time: 16:54 | ||
* | ||
* | ||
*/ | ||
|
||
using System; | ||
using NUnit.Framework; | ||
|
||
using LibPDBinding; | ||
|
||
namespace LibPDBindingTest | ||
{ | ||
[TestFixture] | ||
public class LibPDTests | ||
{ | ||
private static int patch; | ||
|
||
[SetUp] | ||
public static void loadPatch() | ||
{ | ||
LibPD.OpenAudio(2, 3, 44100); | ||
//LibPD.Subscribe("eggs"); | ||
patch = LibPD.OpenPatch(@"..\..\test_csharp.pd"); | ||
LibPD.ComputeAudio(true); | ||
LibPD.Print += new LibPDPrint(LibPD_Print); | ||
} | ||
|
||
private static string Msg; | ||
static void LibPD_Print(string text) | ||
{ | ||
Msg = text; | ||
} | ||
|
||
[TearDown] | ||
public static void closePatch() | ||
{ | ||
LibPD.Release(); | ||
} | ||
|
||
[Test] | ||
public virtual void testAudio() | ||
{ | ||
float[] @in = new float[256]; | ||
float[] @out = new float[768]; | ||
for (int i = 0; i < 256; i++) | ||
{ | ||
@in[i] = i; | ||
} | ||
int err = LibPD.Process(2, @in, @out); | ||
Assert.AreEqual(0, err); | ||
for (int i = 0; i < 128; i++) | ||
{ | ||
Assert.AreEqual(2 * i, @out[3 * i], 0.0001); | ||
Assert.AreEqual(-6 * i, @out[3 * i + 1], 0.0001); | ||
Assert.AreEqual(Math.Cos(2 * Math.PI * 440 / 44100 * i), @out[3 * i + 2], 0.0001); | ||
} | ||
for (int i = 384; i < 768; i++) | ||
{ | ||
Assert.AreEqual(0, @out[i], 0); | ||
} | ||
} | ||
|
||
[Test] | ||
public virtual void testBlockSize() | ||
{ | ||
Assert.AreEqual(64, LibPD.BlockSize); | ||
} | ||
|
||
[Test] | ||
public virtual void testDollarZero() | ||
{ | ||
Assert.AreEqual(1004, patch); | ||
} | ||
|
||
[Test] | ||
public virtual void testPrint() | ||
{ | ||
var msg = ""; | ||
LibPD.Print += delegate(string text) { msg = text; }; | ||
LibPD.SendFloat("foo", 0); | ||
Assert.AreEqual("0", msg); | ||
LibPD.SendFloat("foo", 42); | ||
Assert.AreEqual("42", msg); | ||
LibPD.SendSymbol("foo", "don't panic"); | ||
Assert.AreEqual("don't panic", msg); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#N canvas 128 522 535 471 10; | ||
#X obj 18 16 r spam; | ||
#X obj 18 37 s eggs; | ||
#X obj 19 72 notein; | ||
#X obj 16 96 noteout; | ||
#X obj 73 75 ctlin; | ||
#X obj 71 95 ctlout; | ||
#X obj 122 75 pgmin; | ||
#X obj 119 96 pgmout; | ||
#X obj 167 34 bendin; | ||
#X obj 167 96 bendout; | ||
#X obj 222 76 touchin; | ||
#X obj 218 96 touchout; | ||
#X obj 278 75 polytouchin; | ||
#X obj 275 95 polytouchout; | ||
#X obj 91 18 r foo; | ||
#X obj 91 39 print; | ||
#X obj 160 57 - 8192; | ||
#N canvas 0 22 450 300 (subpatch) 0; | ||
#X array array1 128 float 2; | ||
#X coords 0 1 127 -1 200 140 1; | ||
#X restore 16 153 graph; | ||
#X obj 245 172 adc~; | ||
#X obj 260 201 *~ -3; | ||
#X obj 247 231 dac~ 1 2 3; | ||
#X obj 304 170 osc~ 440; | ||
#X obj 301 328 s foo; | ||
#X msg 402 216 hello; | ||
#X obj 451 161 metro 1000; | ||
#X obj 464 102 loadbang; | ||
#X connect 0 0 1 0; | ||
#X connect 2 0 3 0; | ||
#X connect 2 1 3 1; | ||
#X connect 2 2 3 2; | ||
#X connect 4 0 5 0; | ||
#X connect 4 1 5 1; | ||
#X connect 4 2 5 2; | ||
#X connect 6 0 7 0; | ||
#X connect 6 1 7 1; | ||
#X connect 8 0 16 0; | ||
#X connect 8 1 9 1; | ||
#X connect 10 0 11 0; | ||
#X connect 10 1 11 1; | ||
#X connect 12 0 13 0; | ||
#X connect 12 1 13 1; | ||
#X connect 12 2 13 2; | ||
#X connect 14 0 15 0; | ||
#X connect 16 0 9 0; | ||
#X connect 18 0 19 0; | ||
#X connect 18 0 20 0; | ||
#X connect 19 0 20 1; | ||
#X connect 21 0 20 2; | ||
#X connect 23 0 22 0; | ||
#X connect 24 0 23 0; | ||
#X connect 25 0 24 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> | ||
<PropertyGroup> | ||
<ProjectGuid>{60EA10B2-F0F4-4948-B6BB-9DCC803D6F68}</ProjectGuid> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>LibPDBinding</RootNamespace> | ||
<AssemblyName>LibPDExample</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> | ||
<NoStdLib>False</NoStdLib> | ||
<WarningLevel>4</WarningLevel> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<RegisterForComInterop>False</RegisterForComInterop> | ||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> | ||
<BaseAddress>4194304</BaseAddress> | ||
<FileAlignment>4096</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>Full</DebugType> | ||
<Optimize>False</Optimize> | ||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DebugSymbols>False</DebugSymbols> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
<DefineConstants>TRACE</DefineConstants> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="NAudio"> | ||
<HintPath>dependencies\NAudio.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Windows.Forms" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="LibPDWaveProvider.cs" /> | ||
<Compile Include="MainForm.cs" /> | ||
<Compile Include="MainForm.Designer.cs"> | ||
<DependentUpon>MainForm.cs</DependentUpon> | ||
</Compile> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="MainForm.resx"> | ||
<DependentUpon>MainForm.cs</DependentUpon> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\csharp\LibPDBinding.csproj"> | ||
<Project>0D2EF933-6094-4DE1-9D63-9B43786C06AE</Project> | ||
<Name>LibPDBinding</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> | ||
</Project> |
Oops, something went wrong.