Hi, I posted recently about this very cool C#Synth project at http://csharpsynthproject.codeplex.com/ Project Description A synthesizer made in C# that will allow midi functionality using only the compact framework for any .net device: (windows pc, xbox, or phone). Find attached a port to Unity + simple sample scene. Read the comments for a guide. The C# Express 2010 .net framework 3.5 project is inside the plugins folder, so you may want to move it out before rebuilding and just point the build directory to the Unity project plugins folder. I left a number of Unity debug statements turned on so it runs slightly slower but if you check the console you can see what is going on on load/play. Make sure the project you import the package into a full .net 2.0 under the build settings, not the subset or you will get some errors. Edit: Q: Does this work on Unity Free? A: I don't know. It should, as it's a C# plugin not native, but you have all you need to test it for yourself. Please report your findings below for others. ty! The porting process was quite interesting and my notes are below for those who would like to do it themselves as a useful learning exercise in creating an external C# dll. If you are interested in contributing please contact the developer or just post anything in here. Have fun! To begin download the latest non-Unity version from http://csharpsynthproject.codeplex.com/ (the version in the attached package does NOT include his demo files or instrument builder) Open the C#Synth project in C# Express 2010 Right click, select properties, change to Target Framework .Net Framework 3.5 You can also set the build directory to your Unity plugins folder here. Close/Reopen project - Check references for yellow flags and remove if necessary Add UnityEngine as a reference. You will need to add using UnityEngine to all files you modify with Unity specific code. Immediately see 2 errors on BW.Dispose in WaveFileReader/Writer - comment them out for now. BW.Close() ok. See http://sshnet.codeplex.com/discussions/269633 for discussion on this. Tag all changes with //UnitySynth so we can do a global find at any time to track changes we made Next step is analyse the example demo project WindowsDirectSoundTest classes Form1.cs and SynthThread.cs to see how it works and emulate the same behaviour in Unity. Find all System.Diagnostics.Debug.WriteLine replace with Debug.Log Basically we have two things to load. A soundbank, which can be dsp or sample based, and a midi file. So we need to locate the asset loading code in the project and replace it with Unity specific asset loading code, also keeping in mind the correct extensions needed for the text assets to load correctly http://unity3d.com/support/documentation/Components/class-TextAsset.html Firstly we need to allocate a StreamSynthesizer.cs. The default here is to calculate the samplebuffer size based on a parameter bufferSizeInMilliseconds but lets just change this to a simple int parameter of buffersize to be consistent with the unity audio allocation. Keeps it simple. Next we need to convert the sample byte methods to float to match the Unity methods See public void GetNext(byte buffer) and private void ConvertBuffer(float[,] from, byte to) for the float equivalents. Next, lets look at the loading of the sample definition files and sample loading. First up is InstrumentBank.cs public void loadBank(string bankfile) needs to load a stream from Assets, as does public void loadBank(byte Programs, byte DrumPrograms) Next is SFZInstrument.cs where we need to convert the constructor to load a UnityAsset We also need to check the Sample.cs and WaveFileReader.cs loading, convert to Unity asset loading format Finally MidiFile constructor needs to load the file as a UnityAsset Additionally a small file reader modification to FMInstrument.cs was made if you want to test the fm instrument The core Unity function to get the audio to play is by using the OnAudioFilterRead method. See the C#Synth Demo project SynthThread.fillerThread() method for the equivalent code. By routing the buffer into OnAudioFilterRead you can do procedural audio and synthesis on the fly. See http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnAudioFilterRead.html Now go make some noisy apps!