public FmSoundCard() { this.synth = new FmSynthesizer((int)this.audioPlayer.Format.SampleRate); this.generateThread = new System.Threading.Thread(this.GenerateWaveforms) { IsBackground = true, Priority = System.Threading.ThreadPriority.AboveNormal }; }
/// <summary> /// Initializes a new instance of the Operator class. /// </summary> /// <param name="baseAddress">Base operator register address.</param> /// <param name="opl">FmSynthesizer instance which owns the operator.</param> public Operator(int baseAddress, FmSynthesizer opl) { this.operatorBaseAddress = baseAddress; this.opl = opl; this.envelopeGenerator = new AdsrCalculator(opl); }
/// <summary> /// Initializes a new instance of the TopCymbal class. /// </summary> /// <param name="opl">FmSynthesizer instance which owns the operator.</param> public TopCymbal(FmSynthesizer opl) : base(0x15, opl) { }
/// <summary> /// Initializes a new instance of the TopCymbal class. /// </summary> /// <param name="baseAddress">Base operator register address.</param> /// <param name="opl">FmSynthesizer instance which owns the operator.</param> protected TopCymbal(int baseAddress, FmSynthesizer opl) : base(baseAddress, opl) { }
/// <summary> /// Initializes a new instance of the Channel4 class. /// </summary> /// <param name="baseAddress">Base address of the channel's registers.</param> /// <param name="o1">First operator in the channel.</param> /// <param name="o2">Second operator in the channel.</param> /// <param name="o3">Third operator in the channel.</param> /// <param name="o4">Fourth operator in the channel.</param> /// <param name="opl">FmSynthesizer instance which owns the channel.</param> public Channel4(int baseAddress, Operator o1, Operator o2, Operator o3, Operator o4, FmSynthesizer opl) : base(baseAddress, opl) { this.op1 = o1; this.op2 = o2; this.op3 = o3; this.op4 = o4; }
/// <summary> /// Initializes a new instance of the NullChannel class. /// </summary> /// <param name="opl">FmSynthesizer instance which owns the channel.</param> public NullChannel(FmSynthesizer opl) : base(0, opl) { }
/// <summary> /// Initializes a new instance of the HighHat class. /// </summary> /// <param name="opl">FmSynthesizer instance which owns the operator.</param> public HighHat(FmSynthesizer opl) : base(0x11, opl) { }
public BassDrum(FmSynthesizer opl) : base(6, new Operator(0x10, opl), new Operator(0x13, opl), opl) { }
/// <summary> /// Initializes a new instance of the Channel2 class. /// </summary> /// <param name="baseAddress">Base address of the channel's registers.</param> /// <param name="o1">First operator in the channel.</param> /// <param name="o2">Second operator in the channel.</param> /// <param name="opl">FmSynthesizer instance which owns the channel.</param> public Channel2(int baseAddress, Operator o1, Operator o2, FmSynthesizer opl) : base(baseAddress, opl) { this.op1 = o1; this.op2 = o2; }
/// <summary> /// Initializes a new instance of the SnareDrum operator. /// </summary> /// <param name="opl">FmSynthesizer instance which owns the operator.</param> public SnareDrum(FmSynthesizer opl) : base(0x14, opl) { }
/// <summary> /// Initializes a new instance of the RhythmChannel class. /// </summary> /// <param name="baseAddress">Base address of the channel's registers.</param> /// <param name="o1">First operator in the channel.</param> /// <param name="o2">Second operator in the channel.</param> /// <param name="opl">FmSynthesizer instance which owns the channel.</param> public RhythmChannel(int baseAddress, Operator o1, Operator o2, FmSynthesizer opl) : base(baseAddress, o1, o2, opl) { }
/// <summary> /// Initializes a new instance of the Channel class. /// </summary> /// <param name="baseAddress">Base address of the channel's registers.</param> /// <param name="opl">FmSynthesizer instance which owns the channel.</param> public Channel(int baseAddress, FmSynthesizer opl) { this.channelBaseAddress = baseAddress; this.opl = opl; }