lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do we specify the midi instrument sine wave in Lilypond


From: Martin Tarenskeen
Subject: Re: How do we specify the midi instrument sine wave in Lilypond
Date: Thu, 31 Mar 2016 22:51:20 +0200 (CEST)
User-agent: Alpine 2.20 (LFD 67 2015-01-07)



On Thu, 31 Mar 2016, salil kashyap wrote:

In the lilypond source file, yes we can specify the instrument as 'flute',
but how do we let the soundsource replace the corresponding programchange
number with that of a sinewave.

If you have some lilypond source file where you have done that, could you
please send me the source file, so that I can take a look and understand.

It can be done with THE minimal example:

{ c' }

But I guess that doesn't help you much :-)

You have to understand that:

- MIDI does not really produce sound, only commands.

- If you select instrument "flute" in your LilyPond source, this only means that the MIDI output will send a Midi Program Change message Nr. 74 (or 73 if you count from 0 to 127) on one of the 16 Midi channels.

- If then this MIDI file is played by a MIDI player that uses a GM compatible soundsource (musicsynth, soundfont) you will hear a flute.

But a pure sinewave is not part of the GM soundset.

One way to produce a sinewave is to use an FM synth like Yamaha's DX7, or a free VST plugin like Dexed or VOPM and use the synth as soundsource. Such FM-synths are very suitable for this task. An initialized DX7, Dexed, or VOPM voice is a Sine Wave patch. Use Google to find Dexed and VOPM.

I think these plugins can respond to Program Change messages. But the "flute" (GM Program #74) was just an example. Easier is if you don't specify any instrument at all in your LilyPond code, so that it will use the default number 1 instrument "acoustic grand". And then assign a Sine Wave to the very first program in your FM synth, and be sure it is set to the correct MIDI channel. Then you must set your MIDI player to use this plugin as soundsource.

You now should understand why in that case

{c'}

will produce a sinewave. In other words: the trick is not in LilyPond, it is in the soft- and/or hardware that will eventually play the MIDI file. If you do specify "flute" as midi instrument in your LilyPond file, than you should assign a sine wave to program number 74 (73) in your (soft- or hardware) synthesizer.

--

MT



reply via email to

[Prev in Thread] Current Thread [Next in Thread]