Pointers for digital FM synthesis
If the case with two sines is clear (sine wave modulation of a sine wave carrier) then consider expanding any other shape (such as the ramp) into its Fourier components and then superimposing the result of each.
Any waveform with sharp transitions (such as a ramp) requires an infinite number of frequency components, so better to work with smoothed waveforms where the higher frequency components are essentially filtered out.
Another tip when simulating carrier modulation is to not actually simulate the carrier but use a complex baseband signal instead (what you simulate their will match what would occur at any carrier frequency and doesn't require as high of a sampling rate to simulate). This requires understanding the baseband equivalent analytic signal, but would be the recommended next step regarding understanding DSP concepts.