Harmoni という名前の iOS アプリを App Store にサブミットしました。このシンセアプリはゲームエンジン Unity を使って実装されています。
ここでは Unity を使ってシンセを実装するにあたっての心得(?)について記します。
サンプリングベースのリズムマシン等であれば basic 版でも実装可能ですが、スクリプトで合成した波形を使うには、Pro 版でないとキツいです。後述しますが、実装にオーディオフィルタを使うためです。
Harmoni という名前の iOS アプリを App Store にサブミットしました。このシンセアプリはゲームエンジン Unity を使って実装されています。
ここでは Unity を使ってシンセを実装するにあたっての心得(?)について記します。
サンプリングベースのリズムマシン等であれば basic 版でも実装可能ですが、スクリプトで合成した波形を使うには、Pro 版でないとキツいです。後述しますが、実装にオーディオフィルタを使うためです。
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.IO; | |
public class BuildScript | |
{ | |
const string kAssetBundlesOutputPath = "AssetBundles"; | |
// アセットバンドル化するフォルダの設置場所 |
#ifndef __LAB_COLORSPACE__ | |
#define __LAB_COLORSPACE__ | |
/* | |
* Conversion between RGB and LAB colorspace. | |
* Import from flowabs glsl program : https://code.google.com/p/flowabs/source/browse/glsl/?r=f36cbdcf7790a28d90f09e2cf89ec9a64911f138 | |
*/ | |
float3 rgb2xyz( float3 c ) { | |
float3 tmp; |
using UnityEngine; | |
using UnityEditor; | |
public class AssetDatabaseHelper | |
{ | |
// Editor スクリプト : 指定パスに指定アセットを書き込む. ない場合は新規作成. | |
// AssetDatabase.CreateAsset() ですでにあるアセットを作成すると、管理IDが変わってしまうために参照切れ(missing)が起こる。 | |
void CreateAsset(Object newAsset,string path,System.Type type) | |
{ | |
var asset = AssetDatabase.LoadAssetAtPath(path,type); |
using UnityEngine; | |
using System.Collections; | |
using System; | |
using System.Runtime.InteropServices; | |
namespace Utils { | |
// ここからコードを拝借させてもらいました! | |
// http://answers.unity3d.com/questions/13523/is-there-a-way-to-set-the-position-of-a-standalone.html |
using UnityEngine; | |
#if UNITY_EDITOR | |
using UnityEditor; | |
#endif | |
using System.IO; | |
using System.Collections; | |
namespace mattatz.Utils { |
Through Bluetooth sniffing, using this method I've been able to (semi reliably) control the SP110e controller via Homebridge.
You can find this controller for very cheap here: https://www.aliexpress.com/item/4000773623427.html?spm=a2g0o.productlist.0.0.4f09329cJ7C1H4&algo_pvid=542e757b-587f-4540-8652-2195883f1349&algo_expid=542e757b-587f-4540-8652-2195883f1349-0&btsid=0bb0622a16012309671478585ed4bd&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_
This entire guide is for Bluetooth LE libraries, and uses hexidecimal.