Question: I am developing an iPhone app. here in my App I have included Google maps.I am showing the highlighted path in map.

Now my Question is how to calculate distance between two point as per path as Apple"s native map App is showing routes with distance. 

Thanks in Advance.

Answer: 
On Ubuntu, [`sf2extract`](http://manpages.ubuntu.com/manpages/bionic/man1/sf2extract.1.html) in the `gigtools` package can extract all the samples from an SF2 file as WAVs.
I've written a simple tool for this. Node.js is required to be installed.

Instructions for Linux (adapt for other OS):

1. Create new nodejs module:

```sh
mkdir midigen && cd midigen && npm init -y && npm i --save midi-writer-js

```
2. Create `index.js` with the following content: 

```js
const fs = require('fs');
const MidiWriter = require('midi-writer-js');

for (let octave = 0; octave <= 8; octave++) {
  for (const note of ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#',  'G', 'G#', 'A', 'A#', 'B']) {
    const track = new MidiWriter.Track();
    track.addEvent(new MidiWriter.ProgramChangeEvent({ instrument: 10 }));
    track.addEvent(new MidiWriter.NoteEvent({ pitch: [`${note}${octave}`], duration: '8', velocity: 100 }));
    fs.writeFileSync(`${note}${octave}.mid`, new MidiWriter.Writer(track).buildFile());
  }
}

```
3. Feel free to modify octave range, instrument type (to match your SoundFont), duration and volume (velocity)
4. Run `node .`
5. [Install your SoundFont](https://wiki.archlinux.org/index.php/Timidity#SoundFonts)
6. Convert generated midi files to wav files:

```sh
for f in *.mid; do timidity $f -Ow -o ${f%.mid}.wav; done

```