Skip to content

Commit

Permalink
1.0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Mar 2, 2014
1 parent 165a884 commit 313537c
Show file tree
Hide file tree
Showing 39 changed files with 1,030 additions and 310 deletions.
36 changes: 36 additions & 0 deletions Faders/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Faders")]
[assembly: AssemblyDescription("Mygod")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mygod")]
[assembly: AssemblyProduct("Faders")]
[assembly: AssemblyCopyright("Copyright © Mygod 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("3a71495b-5104-44b4-8c99-93c27fe0c7e6")]

// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.1")]
[assembly: AssemblyFileVersion("1.0.2.1")]
59 changes: 59 additions & 0 deletions Faders/Faders.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;

namespace Mygod.Musicript.VolumeControllers.Faders
{
/// <summary>
/// 线性衰减器。
/// </summary>
public class LinearFader
{
private double speed;

/// <summary>
/// 设置衰减速度。
/// </summary>
/// <param name="value">衰减速度。</param>
public void SetSpeed(string value)
{
speed = double.Parse(value);
}

/// <summary>
/// 控制指定时刻的音量。
/// </summary>
/// <param name="time">时刻。</param>
/// <returns>指定时刻的音量。</returns>
public double GetVolume(double time)
{
var temp = 1 - time * speed;
return temp < 0 ? 0 : temp;
}
}

/// <summary>
/// 对数衰减器。
/// </summary>
public class LogarithmicFader
{
private double speed;

/// <summary>
/// 设置衰减速度。
/// </summary>
/// <param name="value">衰减速度。</param>
public void SetSpeed(string value)
{
speed = double.Parse(value);
}

/// <summary>
/// 控制指定时刻的音量。
/// </summary>
/// <param name="time">时刻。</param>
/// <returns>指定时刻的音量。</returns>
public double GetVolume(double time)
{
return Math.Exp(-time * speed);
}
}
}
48 changes: 48 additions & 0 deletions Faders/Faders.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Mygod.Musicript.VolumeControllers.Faders</RootNamespace>
<AssemblyName>Faders</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Musicript\Presets\VolumeControllers\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\Musicript\Presets\VolumeControllers\Faders.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Faders.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions Inflection/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Inflection")]
[assembly: AssemblyDescription("Mygod")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Mygod")]
[assembly: AssemblyProduct("Inflection")]
[assembly: AssemblyCopyright("Copyright © Mygod 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("4f5749a4-a3f2-43d2-acdd-4dbc1d324554")]

// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.2.1")]
[assembly: AssemblyFileVersion("1.0.2.1")]
65 changes: 65 additions & 0 deletions Inflection/Inflection.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
using System;

namespace Mygod.Musicript.Interpolators.Inflection
{
/// <summary>
/// 线性变调插值。
/// </summary>
public sealed class LinearInflection
{
private static double speed;

/// <summary>
/// 设置变调速度。
/// </summary>
/// <param name="value"></param>
public void SetSpeed(string value)
{
speed = double.Parse(value);
}

/// <summary>
/// 插值。
/// </summary>
/// <param name="frequency">原频率。</param>
/// <param name="time">时刻。</param>
/// <returns>插值后映射到的时刻。</returns>
public double Interpolate(double frequency, double time)
{
var result = time * (frequency + speed * time / 2);
if (speed >= 0) return result;
var temp = -frequency / speed;
return time > temp ? temp * frequency / 2 : result;
}
}

/// <summary>
/// 对数变调插值。
/// </summary>
public sealed class LogarithmicInflection
{
private static double speed;

/// <summary>
/// 设置变调速度。
/// </summary>
/// <param name="value"></param>
public void SetSpeed(string value)
{
speed = double.Parse(value);
}

/// <summary>
/// 插值。
/// </summary>
/// <param name="frequency">原频率。</param>
/// <param name="time">时刻。</param>
/// <returns>插值后映射到的时刻。</returns>
public double Interpolate(double frequency, double time)
{
if (Math.Abs(speed) < 1e-8) return frequency * time;
// no inflection
return frequency * (Math.Exp(speed * time) - 1) / speed;
}
}
}
48 changes: 48 additions & 0 deletions Inflection/Inflection.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Mygod.Musicript.Interpolators.Inflection</RootNamespace>
<AssemblyName>Inflection</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Musicript\Presets\Interpolators\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>..\Musicript\Presets\Interpolators\Inflection.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Inflection.cs" />
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
40 changes: 40 additions & 0 deletions Musicript.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,83 @@ VisualStudioVersion = 12.0.30110.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Musicript", "Musicript\Musicript.csproj", "{0587A090-24B0-462E-B1E7-A932E56FC42A}"
ProjectSection(ProjectDependencies) = postProject
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B} = {330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF} = {037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}
{2A09E67B-423E-4164-83EF-7542CF0A9D42} = {2A09E67B-423E-4164-83EF-7542CF0A9D42}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MygodLibrary", "..\MygodLibrary\MygodLibrary\MygodLibrary.csproj", "{D915CED8-AC3F-40D6-8C95-4D176C924A61}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Waves", "Waves\Waves.csproj", "{2A09E67B-423E-4164-83EF-7542CF0A9D42}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Inflection", "Inflection\Inflection.csproj", "{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faders", "Faders\Faders.csproj", "{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Debug|Mixed Platforms.Build.0 = Debug|x86
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Debug|x86.ActiveCfg = Debug|Any CPU
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|Any CPU.Build.0 = Release|Any CPU
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|Mixed Platforms.ActiveCfg = Release|x86
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|Mixed Platforms.Build.0 = Release|x86
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|x86.ActiveCfg = Release|x86
{0587A090-24B0-462E-B1E7-A932E56FC42A}.Release|x86.Build.0 = Release|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|Mixed Platforms.Build.0 = Debug|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|x86.ActiveCfg = Debug|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Debug|x86.Build.0 = Debug|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|Any CPU.Build.0 = Release|Any CPU
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|Mixed Platforms.ActiveCfg = Release|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|Mixed Platforms.Build.0 = Release|x86
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|x86.ActiveCfg = Release|Any CPU
{D915CED8-AC3F-40D6-8C95-4D176C924A61}.Release|x86.Build.0 = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Debug|x86.ActiveCfg = Debug|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|Any CPU.Build.0 = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|x86.ActiveCfg = Release|Any CPU
{2A09E67B-423E-4164-83EF-7542CF0A9D42}.Release|x86.Build.0 = Release|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Debug|x86.ActiveCfg = Debug|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Release|Any CPU.Build.0 = Release|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{037D134F-FCDC-4FC8-8A8D-FF808BDC5AEF}.Release|x86.ActiveCfg = Release|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Debug|x86.ActiveCfg = Debug|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Release|Any CPU.Build.0 = Release|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{330A8B06-12C6-482C-8AA3-AD9A4C4BA77B}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
5 changes: 3 additions & 2 deletions Musicript/App.xaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<Application x:Class="Mygod.Musicript.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml"
<Application x:Class="Mygod.Musicript.App" StartupUri="MainWindow.xaml"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DispatcherUnhandledException="OnUnhandledException" />
Loading

0 comments on commit 313537c

Please sign in to comment.