Back at SC for the DX7 and midi

I used SC over 14 years ago,
Im back to using it because I remembered a wonderful DX7 model done by someone, It sounded so close to a real DX7. I really wanted to sample it.
this one;

I had to install an older version of SC and its plugins from around the time he stopped updating it. I remember it didnt work after that.

Long story long. How do I play the thing with my midi keyboard?

There are two pages. The Synth. The Giant DX7, And he has a page that plays through random presets. I just want to pick a preset and play it with my keyboard
below is one note played, how do I play it with midi, tho?
thank you

// Supercollider DX7 Clone v1.0
// Implemented by Aziz Ege Gonul for more info go to
// Under GNU GPL 3 as per SuperCollider license


( // init
	// Server.killAll
    ~mainCaller = ("./DX7.scd").loadRelative.wrapAt(-1);

( // Note On 80 message with velocity value 100 and preset value 10000
    ~mainCaller.value(60, 100, 1447);

( // Note Off message
	~mainCaller.value(80, 0);

I would suggest to have a look at this tutorial which explains how to create a polyphonic midi synthesizer:

I can’t figure it out

This works for me. The code expects the midi device to use channel 0 (supercollider numbers from 0, on your keyboard it may be number 1 instead). You can switch to a different preset by calling ~changepreset.(number_of_the_preset); as shown at the end of the code:

You have to make sure the and DX7.afx files are present in the same folder as in which you save this code. (You must save it to file before running it, or it won’t work at all).

	var min;

	~presetz = Array.fill(2, 1);
	~mainCaller = ("./DX7.scd").loadRelative.wrapAt(-1);
	~changepreset = {
		| value |
		~presetz[0] = (value >> 2);
		~presetz[1] = (value & 127);


	if (MIDIClient.initialized.not) {

	min = MIDIIn.connectAll;

	MIDIdef.noteOn(\DX7, {arg vel, note;
		~mainCaller.value(note, vel, (~presetz[0] * 128) + ~presetz[1]);

	MIDIdef.noteOff(\DX7off, {arg vel, note;
		~mainCaller.value(note, 0);


~changepreset.(6); // change to preset 6