Have you started sending these out yet?

Hi,
Didn't you get my email on 13 march? I have sent the shield on 9 march. I have sent you the tracking information. The tracking said, the package is in your country, but on its way.
I hope you have the shield soon.
Let me know if you received my mail.

Regards, Pim.

Sent a PM. because im interested too. Can you also send the sourcecode. since I'd like to modify the Code so it can use CC instead of Sysex messages. So you can change  the parameters in a DAW or so.

--Masl

I got this shield. You get all the necessary code with it (you need it anyway to upload to your arduino board, which is not provided).
I also made a (linux) shell script which can convert from the instruments format for the VOPM vst to this board (you can find packs of instruments ripped from hundreds of games)

garvalf wrote:

I got this shield. You get all the necessary code with it (you need it anyway to upload to your arduino board, which is not provided).
I also made a (linux) shell script which can convert from the instruments format for the VOPM vst to this board (you can find packs of instruments ripped from hundreds of games)

Hello garvalf, could you please share the converter script?
it's great!
Thx

cyberic wrote:

Hello garvalf, could you please share the converter script?
it's great!
Thx

sure.

It's not very clean or use-friendly at the moment, but here is what I did:

First, find some vopm instruments (or design them yourself with the vst plugin, but it's probably easier to use the Ctrlr tool made by synthy if it's for this purpose).

The cool thing is you can find some 1300 instruments (or games) packed from this link: https://www.youtube.com/watch?v=EKQDpWZWIDU (which link to there: http://www.mediafire.com/download.php?od9s1zgbk4ig125)

The vopm will export to something like that:

LFO: 0 0 0 0 0
CH: 64 7 2 0 0 120 0
M1: 31 6 0 1 1 33 2 0 3 0 0
C1: 28 5 0 5 5 37 2 3 3 0 0
M2: 27 31 0 3 0 31 1 0 3 0 0
C2: 13 3 0 6 0 25 1 0 3 0 0

copy it to a vopm.txt file.

Then you can use this vopm2arduino script:

cat vopm.txt |\
perl -pe 's|LFO:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|LFRQ = \1;\n\/\/AMS = \2;\n\/\/PMS = \3;\nLWav = \4;\nNFRQ = \5;\n|' | \
perl -pe 's|CH:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|PA = \1;\nFB = \2;\nCON = \3;\nAMS = \4;\nPMS = \5;\nLMod = \6;\nNoise = \7;\n|' |\
perl -pe 's|M1:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|AR[0] = \1;\nD1R[0] = \2;\nD2R[0] = \3;\nRR[0] = \4;\nD1L[0] = \5;\nTL[0] = \6;\nKS[0] = \7;\nMUL[0] = \8;\nDT1[0] = \9;\nDT2[0] = 000;\n\/\/AMS-EN = \g11;\n|' |\
perl -pe 's|C1:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|AR[1] = \1;\nD1R[1] = \2;\nD2R[1] = \3;\nRR[1] = \4;\nD1L[1] = \5;\nTL[1] = \6;\nKS[1] = \7;\nMUL[1] = \8;\nDT1[1] = \9;\nDT2[1] = 000;\n\/\/AMS-EN = \g11;\n|' |\
perl -pe 's|M2:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|AR[2] = \1;\nD1R[2] = \2;\nD2R[2] = \3;\nRR[2] = \4;\nD1L[2] = \5;\nTL[2] = \6;\nKS[2] = \7;\nMUL[2] = \8;\nDT1[2] = \9;\nDT2[2] = 000;\n\/\/AMS-EN = \g11;\n|' |\
perl -pe 's|C2:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|AR[3] = \1;\nD1R[3] = \2;\nD2R[3] = \3;\nRR[3] = \4;\nD1L[3] = \5;\nTL[3] = \6;\nKS[3] = \7;\nMUL[3] = \8;\nDT1[3] = \9;\nDT2[3] = 000;\n\/\/AMS-EN = \g11;\n|' 
# remplace 000 by \g10 with perl 22

in my current pearl implementation, \g10 is not supported, but this DT2 is not much used so it's not a problem.

The script will output to the terminal, which you can redirect to a file. Then copy/paste this output to a DefaultInstrument.h file you can put into your arduino project (midi_in_ym2151).
Call this file (#include "DefaultInstrument.h";) from the part after:

   sysexValue[5] = 59;
   sysexValue[6] = 15-RR[3];
   MIDI.sendSysEx(8,sysexValue, true);

and before

 YM2151.write(0x0f,(Noise<<8) + NRFQ);

When you compile the arduino sketch, it will make the instrument defined in the vopm.txt file as default. You can still alter this with the ctrlr panel. The problem is it's quite tedious to change from one instrument to an other (you have to compile the sketch). You also cannot output from the perl script to the DefaultInstrument.h file, because the arduino IDE doesn't reload if you modify the file externally. You can problably compile it with avrdude directly.

i've tried a few instruments from famous games, and compare them with the original songs, and they sound very close, so it's quite great. It would be even cooler if it could change the values into to ctrlr panels

So I've thought it would be better to use SysEx to change the values on the fly (it's what Ctrlr does by the way).

I made another script, for converting to SysEx:

cat vopm.txt | \
perl -pe 's|LFO:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|\
 printf("F0 00 00 00 00 08 ") ; printf("%x ",$1*2) ; printf("F7 "); printf("F0 00 00 00 00 07 ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 06 ") ; printf("%x ",$6) ; printf("F7 ");  |e' | \
perl -pe 's|CH:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*| printf("F0 00 00 00 00 09 ") ; printf("%x ",$1) ; printf("F7 "); printf("F0 00 00 00 00 01 ") ; printf("%x ",$2) ; printf("F7 "); printf("F0 00 00 00 00 0B ") ; printf("%x ",$3) ; printf("F7 "); printf("F0 00 00 00 00 04 ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 05 ") ; printf("%x ",$5) ; printf("F7 "); printf("F0 00 00 00 00 0A ") ; printf("%x ",$6) ; printf("F7 "); printf("F0 00 00 00 00 03 ") ; printf("%x ",$7) ; printf("F7 "); |e' |\
perl -pe 's|M1:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|printf("F0 00 00 00 00 18 ") ; printf("%x ",$1) ; printf("F7 "); printf("F0 00 00 00 00 19 ") ; printf("%x ",$2) ; printf("F7 "); printf("F0 00 00 00 00 1B ") ; printf("%x ",$3) ; printf("F7 "); printf("F0 00 00 00 00 1D ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 1C ") ; printf("%x ",$5) ; printf("F7 "); printf("F0 00 00 00 00 16 ") ; printf("%x ",$6) ; printf("F7 "); printf("F0 00 00 00 00 17 ") ; printf("%x ",$7) ; printf("F7 "); printf("F0 00 00 00 00 15 ") ; printf("%x ",$8) ; printf("F7 "); printf("F0 00 00 00 00 14 ") ; printf("%x ",$9) ; printf("F7 "); printf("F0 00 00 00 00 1A ") ; printf("%x ",00) ; printf("F7 "); |e' |\
perl -pe 's|C1:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|printf("F0 00 00 00 00 22 ") ; printf("%x ",$1) ; printf("F7 "); printf("F0 00 00 00 00 23 ") ; printf("%x ",$2) ; printf("F7 "); printf("F0 00 00 00 00 25 ") ; printf("%x ",$3) ; printf("F7 "); printf("F0 00 00 00 00 27 ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 26 ") ; printf("%x ",$5) ; printf("F7 "); printf("F0 00 00 00 00 20 ") ; printf("%x ",$6) ; printf("F7 "); printf("F0 00 00 00 00 21 ") ; printf("%x ",$7) ; printf("F7 "); printf("F0 00 00 00 00 1F ") ; printf("%x ",$8) ; printf("F7 "); printf("F0 00 00 00 00 1E ") ; printf("%x ",$9) ; printf("F7 "); printf("F0 00 00 00 00 24 ") ; printf("%x ",00) ; printf("F7 "); |e' |\
perl -pe 's|M2:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|printf("F0 00 00 00 00 2C ") ; printf("%x ",$1) ; printf("F7 "); printf("F0 00 00 00 00 2D ") ; printf("%x ",$2) ; printf("F7 "); printf("F0 00 00 00 00 2F ") ; printf("%x ",$3) ; printf("F7 "); printf("F0 00 00 00 00 31 ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 30 ") ; printf("%x ",$5) ; printf("F7 "); printf("F0 00 00 00 00 2A ") ; printf("%x ",$6) ; printf("F7 "); printf("F0 00 00 00 00 2B ") ; printf("%x ",$7) ; printf("F7 "); printf("F0 00 00 00 00 29 ") ; printf("%x ",$8) ; printf("F7 "); printf("F0 00 00 00 00 28 ") ; printf("%x ",$9) ; printf("F7 "); printf("F0 00 00 00 00 2E ") ; printf("%x ",00) ; printf("F7 "); |e' |\
perl -pe 's|C2:\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*(\d+)\s*|printf("F0 00 00 00 00 36 ") ; printf("%x ",$1) ; printf("F7 "); printf("F0 00 00 00 00 37 ") ; printf("%x ",$2) ; printf("F7 "); printf("F0 00 00 00 00 39 ") ; printf("%x ",$3) ; printf("F7 "); printf("F0 00 00 00 00 3B ") ; printf("%x ",$4) ; printf("F7 "); printf("F0 00 00 00 00 3A ") ; printf("%x ",$5) ; printf("F7 "); printf("F0 00 00 00 00 34 ") ; printf("%x ",$6) ; printf("F7 "); printf("F0 00 00 00 00 35 ") ; printf("%x ",$7) ; printf("F7 "); printf("F0 00 00 00 00 33 ") ; printf("%x ",$8) ; printf("F7 "); printf("F0 00 00 00 00 32 ") ; printf("%x ",$9) ; printf("F7 "); printf("F0 00 00 00 00 38 ") ; printf("%x ",00) ; printf("F7 "); |e' | perl -pe 's|\s(\d{1}?)\s| 0$1 |g' | perl -pe 's|\s([abcdef])\s| 0$1 |g'  
# remplace 00 in printf("%x ",00) by $10 with perl 22
# 

Again, it output to the console, whic you can redirect to a sysex.txt file.
And you can send the sysex to the shield by using the amidi command line:

amidi -p hw:0 -S 'F0 00 00 00 00 0B 05 F7 F0 00 00 00 00 16 00 F7 etc.'

Then, after we send the values, the shield remains silent. We can get the sound if we reset the arduino. But then, the sound is not very accurate. I hadn't tested enough but I think it doesn't work, or it sends partial data. Maybe i made a mistake in the values in the script, or it's too much data at the same time...

I've made a last script, which convert the whole bunch of data from the systex.txt file to a one operation at a time:

cat sysex.txt | perl -pe 's|\s(\d{1}?)\s| 0$1 |g' | perl -pe 's|\s([abcdef])\s| 0$1 |g' | \
perl -pe "s/F0(.*?)F7/amidi -p hw:0 -S 'F0\1F7'\n/g"

so we get something like that at the end:

amidi -p hw:0 -S 'F0 00 00 00 00 36 0d F7'
amidi -p hw:0 -S 'F0 00 00 00 00 37 03 F7'
amidi -p hw:0 -S 'F0 00 00 00 00 39 00 F7'
amidi -p hw:0 -S 'F0 00 00 00 00 3B 06 F7'

but it's not better...

please tell me if you can improve this...

(getting multivoice would be cool as well)

HI,
yeah, the Original code also only has one Voice. But it would not be difficult to add multiple voices. You can have a Maximum of 8 Voices at once, so you only have to save, what notes play and set the right register or set the Channel silent when the note stops. I will look into this IF I have my Board. You could also implement some kind of Patch Loading and Saving. So you can change to different patches on the fly and save them to the EEPROM (lets say 16 Patches or so), or load patches with another long sysex command.

I will maybe write a little Java-Converter Tool, to convert the Files, so everybody then can load the Patches, without installing Perl and CYGWIN or MinGW

Last edited by masl (Apr 21, 2016 8:22 pm)

@masi: it would be great! (both converter and multiple voices)

I will rewrite the PC Controller Tool (Java) and will Modify the Code for the Arduino, so it will:
- support opening/saving the vopm files directly in the PC Tool
- send Midi-CC Data instead of Sysex
- allow to Load and Save Patches to Arduino
- allow to change the "Patches" on the Fly in your DAW (16 or 8 Patches saved on the Arduinos EEPROM. Change happens through Midi-CC)
- (Multivoice Support)

Last edited by masl (Apr 23, 2016 3:54 pm)

masl wrote:

I will rewrite the PC Controller Tool (Java) and will Modify the Code for the Arduino, so it will:
- support opening/saving the vopm files directly in the PC Tool
- send Midi-CC Data instead of Sysex
- allow to Load and Save Patches to Arduino
- allow to change the "Patches" on the Fly in your DAW (16 or 8 Patches saved on the Arduinos EEPROM. Change happens through Midi-CC)
- (Multivoice Support)

thanks! and thank you @garvalf!
I really need to get an arduino now! :-)

just in case, some arduino clone are not working with this shield. But what is strange is for me, the official arduino board is not working either... (yet the official one work for synthy). Maybe it's just mine...
Anyway, the dccduino clone is working well for me.

Do you think it could be possible to make the shield play VGM files (such as the ones exported from DefleMask). I've found a mdx player (about mdx: https://github.com/vampirefrog/mdxtools … cs/MDX.md) there: http://www.ooishoo.org/?page_id=15
I'll try to test it asap.

Hi,
the one from ooishoo.org should work, as it is the same Board. For the VGM Files, only these for the YM2151 could work. but someone would have to write a Tool for PC and Firmware to Transmit the File to the Arduino (possibly a long Sysex) and then Play the File to the YM2151.

Btw: As far as it looks right now, I will have to rewrite most of the Code for the shield to receive CC-Midi, and make the code more compact, because right now very "Copy-Paste'ish". So it might work for you on an original Arduino if I'm done. Which Arduino do you use?

I still don't understand why some boards dont' work out of the box, because they should behave the same (and they have the same atmega chip, either in DIP or quad flat package). I have a dccduino, a saintsmart and a genuine arduino (I don't remember if the saintsmart is working or not, I should give it a new try). And a bunch of nano clones (smaller so not usable with the shield).

I've tryed the mdx player (called ArduinoFileUploader), but I get an "Abort: InvalidVersion" error (and some click click in the shield so there is something which is happening at last). The mdx are recognised because the full title and infos are displayed in the uploader. I suspect an incompatibility with the arduino code (which is quite old, using the .pde extension, and I had to adapt with my limited skills)

Last edited by garvalf (Apr 24, 2016 8:50 am)

Does the DIN connector need to be installed on the shield? Or can the Arduino board itself send signals? (sorry if this sounds dumb, I'm new to Arduino.) hmm

@garvalf

Are you using an Arduino UNO? Now I'm worried. sad

@garvalf
I tried the older Firmware from the Original Creator of the Board (http://www.ooishoo.org/?page_id=15) and it workes for me on the Arduino Uno. But you will have to do some fiddling around, until it compiles. (Here you can Download the Version which I changed so it Compiles: https://drive.google.com/file/d/0B-_HMI … =sharing). The new Firmware from synthy did not work for me.

EDIT:
I just tried to use the Midi.h/Midi.c from the Old Project and put it into the project from Synthy and it workes (Except for Sysex, because I would have to rewrite the hole part and I want to use CC instead of Sysex, I will not do it) (Download: https://drive.google.com/file/d/0B-_HMI … p=sharing)

Last edited by masl (Apr 30, 2016 11:44 am)

@Arc-Demon : For the connector, you can't install a DIN plug on the shield. Just salvage an old midi DIN cable and solder 2 female pin on the 2 midi signal wire (the ones in red (4) and yellow (5) on this pic: http://www.philrees.co.uk/pix/midiplug.gif ). Don't do the same mistake I did, connecting 2 and 5, like on some other midi arduino projects (CheapSynth by Fakebit Polytechnic for example).

If you prefer to keep your midi cable, you can also plug a classic male wire pin (like the ones used with breadboard) into a female midi connector, but it might not fit very well.

Also don't worry about the UNO, I've tried again this morning, and this time it's working. For my new arduino sketch I've mixed the original code with Synthy's one so maybe it's the reason (by Synthy has an arduino uno and it works for him so I don't really know).

@masi I'll check your code and compare it with mine...