SoundMaker 0.1.0
Suggested Alternatives
Additional Details
Release note: https://github.com/AutumnSky1010/SoundMaker/releases/tag/SoundMaker-ver.2.0.0
Documentation: https://github.com/AutumnSky1010/SoundMaker/wiki
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SoundMaker --version 0.1.0
NuGet\Install-Package SoundMaker -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoundMaker" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoundMaker --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SoundMaker, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoundMaker as a Cake Addin #addin nuget:?package=SoundMaker&version=0.1.0 // Install SoundMaker as a Cake Tool #tool nuget:?package=SoundMaker&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SoundMaker(alpha version)
言語(Language)
概要
本ライブラリを用いると、以下の事が可能です。
- チップチューンサウンド?を作成する
- waveファイルにサウンドを書き込む
ドキュメント
準備中
要件
.NET 6
インストール方法
リポジトリをクローンするか。dllを使ってください。
簡単な使い方
using SoundMaker.Sounds;
using SoundMaker.Sounds.Score;
using SoundMaker.Sounds.SoundChannels;
using SoundMaker.WaveFile;
namespace YourNamespace;
public static class YourClass
{
private static void Main()
{
// サウンドの形式を作成する。
var soundFormat = new SoundFormat(SoundMaker.Sounds.SamplingFrequencyType.FourtyEightKHz, SoundMaker.Sounds.BitRateType.SixteenBit, SoundMaker.Sounds.ChannelType.Stereo);
StereoWave wave = MakeStereoWave(soundFormat);
// ファイルに書き込む。
var sound = new SoundWaveChunk(wave.GetBytes(soundFormat.BitRate));
var waveFileFormat = new FormatChunk(SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz, SoundMaker.WaveFile.BitRateType.SixteenBit, SoundMaker.WaveFile.ChannelType.Stereo);
var writer = new WaveWriter(waveFileFormat, sound);
string filePath = "sample.wav";
writer.Write(filePath);
}
private static StereoWave MakeStereoWave(SoundFormat format)
{
// 一分間の四分音符の個数
int tempo = 100;
// まず、音のチャンネルを作成する必要がある。
// 現段階では矩形波、三角波に対応している。
var rightChannel = new SquareSoundChannel(tempo, format, SquareWaveRatio.Point25, PanType.Right);
var rightChannel2 = new SquareSoundChannel(tempo, format, SquareWaveRatio.Point125, PanType.Right);
var leftChannel = new TriangleSoundChannel(tempo, format, PanType.Left);
// ISoundComponentを実装したクラスのオブジェクトをチャンネルに追加していく。
// 現段階では普通の音符、休符、タイ、連符を使うことができる。
rightChannel.Add(new Note(Scale.C, 5, LengthType.Eighth, isDotted: true));
rightChannel.Add(new Tie(new Note(Scale.D, 5, LengthType.Eighth), LengthType.Eighth));
var notes = new List<BasicSoundComponentBase>()
{
new Note(Scale.E, 5, LengthType.Eighth),
new Note(Scale.F, 5, LengthType.Eighth),
new Note(Scale.G, 5, LengthType.Eighth),
};
rightChannel.Add(new Tuplet(notes, LengthType.Quarter));
rightChannel2.Add(new Note(Scale.C, 4, LengthType.Eighth, isDotted: true));
rightChannel2.Add(new Note(Scale.D, 4, LengthType.Quarter));
rightChannel2.Add(new Rest(LengthType.Quarter));
leftChannel.Add(new Note(Scale.C, 3, LengthType.Eighth, isDotted: true));
leftChannel.Add(new Note(Scale.D, 3, LengthType.Quarter));
leftChannel.Add(new Rest(LengthType.Quarter));
var channels = new List<ISoundChannel>() { rightChannel, rightChannel2, leftChannel };
// ミックスは'StereoMixer'クラスで行う。
return new StereoMixer(channels).Mix();
}
}
詳細
出力形式
サンプリング周波数
- 48000Hz
- 44100Hz
量子化ビット数
- 16bit
- 8bit
チャンネル数
- Stereo 2ch
- Monaural 1ch
作った人のツイッター
ライセンス
MIT License
Overview
You can do The following content with this library.
- make the sound of chiptune
- export sound to a file of wave format.
Documentation
In preparation.
Requirement
.NET 6
Installation
Clone the repository or use dll.
Usage
using SoundMaker.Sounds;
using SoundMaker.Sounds.Score;
using SoundMaker.Sounds.SoundChannels;
using SoundMaker.WaveFile;
namespace YourNamespace;
public static class YourClass
{
private static void Main()
{
// make sound format.
var soundFormat = new SoundFormat(SoundMaker.Sounds.SamplingFrequencyType.FourtyEightKHz, SoundMaker.Sounds.BitRateType.SixteenBit, SoundMaker.Sounds.ChannelType.Stereo);
StereoWave wave = MakeStereoWave(soundFormat);
// write.
var sound = new SoundWaveChunk(wave.GetBytes(soundFormat.BitRate));
var waveFileFormat = new FormatChunk(SoundMaker.WaveFile.SamplingFrequencyType.FourtyEightKHz, SoundMaker.WaveFile.BitRateType.SixteenBit, SoundMaker.WaveFile.ChannelType.Stereo);
var writer = new WaveWriter(waveFileFormat, sound);
string filePath = "sample.wav";
writer.Write(filePath);
}
private static StereoWave MakeStereoWave(SoundFormat format)
{
// number of quarter notes per minute.
int tempo = 100;
// first, you should make the channel of sound.
// can use square wave and triangle wave at this stage.
var rightChannel = new SquareSoundChannel(tempo, format, SquareWaveRatio.Point25, PanType.Right);
var rightChannel2 = new SquareSoundChannel(tempo, format, SquareWaveRatio.Point125, PanType.Right);
var leftChannel = new TriangleSoundChannel(tempo, format, PanType.Left);
// add the object implemented 'ISoundComponent' to the channel.
// can use Note, Rest, Tuplet, Tie at this stage.
rightChannel.Add(new Note(Scale.C, 5, LengthType.Eighth, isDotted: true));
rightChannel.Add(new Tie(new Note(Scale.D, 5, LengthType.Eighth), LengthType.Eighth));
var notes = new List<BasicSoundComponentBase>()
{
new Note(Scale.E, 5, LengthType.Eighth),
new Note(Scale.F, 5, LengthType.Eighth),
new Note(Scale.G, 5, LengthType.Eighth),
};
rightChannel.Add(new Tuplet(notes, LengthType.Quarter));
rightChannel2.Add(new Note(Scale.C, 4, LengthType.Eighth, isDotted: true));
rightChannel2.Add(new Note(Scale.D, 4, LengthType.Quarter));
rightChannel2.Add(new Rest(LengthType.Quarter));
leftChannel.Add(new Note(Scale.C, 3, LengthType.Eighth, isDotted: true));
leftChannel.Add(new Note(Scale.D, 3, LengthType.Quarter));
leftChannel.Add(new Rest(LengthType.Quarter));
var channels = new List<ISoundChannel>() { rightChannel, rightChannel2, leftChannel };
// can mix with StereoMixer class.
return new StereoMixer(channels).Mix();
}
}
Features
Output format
Sampling frequency
- 48000Hz
- 44100Hz
Bit rate
- 16bit
- 8bit
Number of Channels
- Stereo 2ch
- Monaural 1ch
Author
License
SoundMaker is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.