SoundMaker 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SoundMaker --version 2.0.0
NuGet\Install-Package SoundMaker -Version 2.0.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="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoundMaker --version 2.0.0
#r "nuget: SoundMaker, 2.0.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=2.0.0

// Install SoundMaker as a Cake Tool
#tool nuget:?package=SoundMaker&version=2.0.0

SoundMakerCover

🗺️言語(Language)

  1. 日本語
  2. English

🎵概要

本ライブラリを用いると、以下の事が可能です。

  • チップチューンサウンド?を作成する
  • waveファイルにサウンドを書き込む

📑ドキュメント

Wiki

⛰️要件

.NET 6

⏬インストール方法

NuGet

SoundMaker

🎶簡単な使い方

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

🍄作った人のツイッター

Twitter

©️ライセンス

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

Wiki

⛰️Requirement

.NET 6

⏬Installation

NuGet

SoundMaker

🎶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

Twitter

©️License

SoundMaker is licensed under the MIT License.

Product 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.

Version Downloads Last updated
2.2.0 502 10/29/2023
2.1.0 581 8/14/2023
2.0.1 776 12/15/2022
2.0.0 761 12/11/2022
1.0.1 835 11/17/2022
1.0.0 811 11/14/2022
0.2.0 865 11/4/2022
0.1.0 843 11/4/2022