244 Mono Audio Line Output
244-mono-audio-line-output.mc describes a small single-supply buffer for an already biased mono audio signal. It is a line-output stage: its purpose is to isolate a source from a following high-impedance line input and remove the buffer's DC output level before the signal reaches the connector. It is not a speaker power amplifier and is not presented as a headphone driver.
Functional blocks:
PWRcreates the illustrative 5 V supply and ground reference.U_BUFis anAMP.BUFFERwithIN,OUT,DC.VCC, andDC.VEEmember paths from the standard library.C_DECOUPLEis a local 100 nF ceramic supply decoupling capacitor.C_OUTis a 1 uF film capacitor in series with the output signal.R_OUT_REFis a 100 kΩ resistor from the connector-side output node to ground.J_LINE_OUTis a two-pinAUDIO.RCAconnector whoseCentercarries the signal and whoseShieldconnects to ground.
The power and ground path is explicit:
PWR.1 -> V5V
PWR.2 -> GND
V5V -> U_BUF.DC.VCC
U_BUF.DC.VEE -> GND
V5V -> C_DECOUPLE -> GNDThe buffer therefore uses the 5 V rail as its positive supply and ground as its negative supply reference. C_DECOUPLE spans those same two rails. Its 100 nF value is illustrative; a real buffer's datasheet determines the required local decoupling, bulk capacitance, placement, and grounding.
The complete signal path is:
AUDIO_IN -> U_BUF.IN
U_BUF.OUT -> C_OUT -> AUDIO_LINE_OUT
AUDIO_LINE_OUT -> J_LINE_OUT.Center
J_LINE_OUT.Shield -> GNDAUDIO_IN represents an external mono analog signal that is already biased to stay within the selected buffer's valid single-supply input range. This recipe does not create that bias or verify the allowed common-mode and signal swing. The specific source must be checked against the selected buffer datasheet.
C_OUT is a DC-blocking output coupling capacitor. It separates any DC level at U_BUF.OUT from AUDIO_LINE_OUT while allowing the audio-frequency AC signal to continue toward the connector. R_OUT_REF is deliberately connected from AUDIO_LINE_OUT, on the connector side of C_OUT, to GND:
AUDIO_LINE_OUT -> R_OUT_REF -> GNDThis placement gives the exposed output a defined DC reference and discharge path without bypassing the coupling capacitor. The capacitor, resistor, and downstream input impedance form a high-pass response in real hardware, but MCode does not simulate its cutoff frequency or waveform behavior. The 1 uF and 100 kΩ values are illustrative.
A line output is intended to feed a high-impedance input on another audio device. Headphone outputs must supply more current into relatively low impedances, while speaker outputs require a power amplifier capable of driving an even more demanding load. AMP.BUFFER records illustrative input impedance, maximum output current, and supply-voltage specifications, but MCode does not prove gain, clipping level, frequency response, stability, output impedance, load current, or thermal performance. This recipe must not be used to claim support for passive speakers, low-impedance headphones, or high-power loads.
The preferred connector was AUDIO.TRS_35MM("mono"). The library definition declares a conditional mono variant with Tip and Sleeve, but the current MCC Pass 2 instantiation retains the default stereo pin set even when the configuration spec resolves to "mono". The recipe therefore uses the unconditional two-pin AUDIO.RCA definition, whose Center and Shield pins resolve correctly. This keeps the example runnable without inventing a codec, microphone, speaker, power amplifier, or unsupported connector behavior.
Production designs also need a selected buffer part and its reference circuit, input and output protection, source and load impedance checks, bias generation, power sequencing, pop/click control, connector ESD protection, grounding and layout review, tolerance analysis, and verification of capacitor dielectric and voltage ratings. None of those checks is implied by this conceptual recipe.
Related examples include 00-getting-started/003-decoupling-capacitor.mc for supply decoupling, 01-basic-circuits/012-rc-low-pass-filter.mc for a series/shunt passive signal path, 04-functions-and-reuse/044-decoupling-library-method.mc for library decoupling helpers, and 90-language-reference/907-conditions-and-dynamic-pins.mc for a small example of conditional component pins.
Parse 244-mono-audio-line-output.mc and print both Pass 1 and Pass 2:
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 24-board-level-recipes/244-mono-audio-line-output.mc --lib mcode --pass1 --pass2Generate HTML for 244-mono-audio-line-output.mc:
eval "$(../mcc/scripts/mcc-slot.sh)"
MCC_SYSTEM_ROOT="$(cd .. && pwd)" "$MCC_BIN" --local parse 24-board-level-recipes/244-mono-audio-line-output.mc --lib mcode --viz -o 24-board-level-recipes/244-mono-audio-line-output.htmlSource
// Example: Mono Audio Line Output
// Goal: Buffer an already biased mono audio signal and expose an AC-coupled line output.
// Library focus: DC, AMP.BUFFER, CAP.MLCC, CAP.FILM, RES, AUDIO.RCA.
// AUDIO_IN must remain within the buffer supply range and already include any required DC bias.
// All ratings and values are illustrative; this recipe does not model analog performance.
use mcfam.analog/amp.mc
module main
{
io AUDIO_IN
io AUDIO_LINE_OUT
io GND
io V5V
DC.SRC PWR(5V, 100mA)
AMP.BUFFER U_BUF(100000R, 10mA, 5V)
CAP.MLCC C_DECOUPLE(100nF, 10V)
CAP.FILM C_OUT(1uF, 10V)
RES R_OUT_REF(100000R, 50V)
AUDIO.RCA J_LINE_OUT
PWR.1 -> V5V
PWR.2 -> GND
V5V -> U_BUF.DC.VCC
U_BUF.DC.VEE -> GND
V5V -> C_DECOUPLE -> GND
AUDIO_IN -> U_BUF.IN
U_BUF.OUT -> C_OUT -> AUDIO_LINE_OUT
AUDIO_LINE_OUT -> R_OUT_REF -> GND
AUDIO_LINE_OUT -> J_LINE_OUT.Center
J_LINE_OUT.Shield -> GND
}