Page 1 of 1

Options for Simulation {Newbie Alert}

Posted: Mon Apr 06, 2020 6:04 pm
by daeg
Hey guys, just getting started with this stuff and would like to start testing code snippets.

What I'm looking for is a way to take ASM programs, and simulate them on a wave file. Linux compatibility is a big plus.

Spincad Designer does this beautifully with real-time pot adjustment, but doesn't support you writing your own code. Elmgen is beyond me and I don't get what it's for or is supposed to do.

Re: Options for Simulation {Newbie Alert}

Posted: Mon Apr 06, 2020 7:52 pm
by Digital Larry
ElmGen is a 1:1 representation of the SpinASM language, but in Java. It was developed by Andrew Kilpatrick. I built SpinCAD Designer on top of it, which allows you to treat SpinASM as an object oriented language. That's how the block concept of SpinCAD Designer was made possible.

I wrote a companion to SpinCAD Designer, called SpinCAD Builder. This lets you make your own blocks in the SpinCAD Designer program, starting from Spin ASM. Conceivably you could make a block which was the entire program you want to simulate, minus the input/output and then compile that and connect it to the I/O blocks and then simulate it.

Couple things to note:

a) This isn't exactly easy
b) The ElmGen simulator might have a few remaining bugs

DL

Re: Options for Simulation {Newbie Alert}

Posted: Tue Apr 07, 2020 1:13 pm
by daeg
Thanks for the thought out response. I've played around with Spincad Designer and it's brilliant work. The ability to loop a wave file and adjust the parameters in real-time quite special.

So if I'm understanding you correctly; there is no currently no way to just write some ASM code and test it without having a FV-1 and EEPROM present.
Both the ElmGen and SpinCAD methods would require writing the effect / patch code in Java rather than the Spin ASM.

Re: Options for Simulation {Newbie Alert}

Posted: Tue Apr 07, 2020 1:35 pm
by Digital Larry
If you use SpinCAD Builder, you can add blocks into SpinCAD Designer which are based on Spin ASM, not Java.

The earliest SpinCAD blocks were written in Java until I figured out how to do them with SpinCAD Builder.

See:
https://github.com/HolyCityAudio/SpinCA ... CADBuilder

and the documentation for how to set all this up:
https://github.com/HolyCityAudio/SpinCA ... signer.zip

DL

Re: Options for Simulation {Newbie Alert}

Posted: Tue Apr 14, 2020 12:46 pm
by potul
I've done this is the past. Create a block in SpinCAD that contains a full program, and test it in spincad.

There are some caveats though. One is that some of the CHO instructions are not usable right away, you need to add some spincad pseudocode that is quite undocumented.

Re: Options for Simulation {Newbie Alert}

Posted: Thu Apr 23, 2020 6:30 am
by Digital Larry
I'd be a little suspicious about the simulation in SpinCAD for pitch shift and chorus, some of those I never managed to get working correctly. But hey, as I'm fond of saying, it's open source so go for it! To make them work better, you'll either need to be very good at guessing how the FV-1 works internally, or actually know for a fact how it works internally.

DL

Re: Options for Simulation {Newbie Alert}

Posted: Fri Apr 24, 2020 3:45 am
by potul
I wouldn't use it to fine tune an algorithm, or to evaluate the sound quality of the effect, but it's a handy resource to test ideas and at least see that your code is in the right path.

It has been very useful for me in the past, as I travel a lot for work, and it allows me to still work on some stuff while I'm away of the physical device. (nowadays with the lockdown my office is next to my FV1 board... so I don't need it anymore)

Re: Options for Simulation {Newbie Alert}

Posted: Wed May 06, 2020 9:23 am
by Digital Larry
potul wrote: Tue Apr 14, 2020 12:46 pm There are some caveats though. One is that some of the CHO instructions are not usable right away, you need to add some spincad pseudocode that is quite undocumented.
@potul what did you mean exactly? While I'm not about to launch into a documentation project for SpinCAD etc. I don't mind answering questions here and there about it.

DL

Re: Options for Simulation {Newbie Alert}

Posted: Wed May 06, 2020 11:50 am
by potul
I mean that some instructions cannot be used directly in the "dummy block".
I.e, you cannot use the CHO RDA instruction, but use the @readChorusTap instruction.
Not a big deal once you figure out, but it's not as easy as copy your code in a block and run.

Re: Options for Simulation {Newbie Alert}

Posted: Sat May 16, 2020 9:02 am
by Digital Larry
Ah OK. It's been so long I forget some of these things. Yeah some things had to be adapted in order to work with relocatable addresses. That's one of the main reasons that generated SpinASM from SpinCAD looks incomprehensible. Win some, lose some. :D

DL

Re: Options for Simulation {Newbie Alert}

Posted: Sun May 17, 2020 2:50 am
by Digital Larry
While it's not exactly documentation, for some insight into the SpinCAD builder language, here's the parser definition.
https://github.com/HolyCityAudio/SpinCA ... nCAD.xtext

And the primary code generator (turns SpinASM and SpinCAD Builder language into "ElmGen" Java):
https://github.com/HolyCityAudio/SpinCA ... ator.xtend

Some of the things that you see in the included SpinCAD Builder based blocks found here:
https://github.com/HolyCityAudio/SpinCA ... CADBuilder

leverage "macros" which I invented for commonly used situations to make life easier. As far as I know, most existing Spin ASM code can be parsed without resorting to use of macros. I think pot skip code is not handled well if at all. If you want details on any of this let me know.

DL

Re: Options for Simulation {Newbie Alert}

Posted: Sun May 17, 2020 10:52 pm
by potul
thanks for the info. I will take a look at it.

Re: Options for Simulation {Newbie Alert}

Posted: Fri Jul 10, 2020 10:08 am
by knutolai
Haven't tried this, but there exists a FV1 module for the VCV eurorack DAW (software eurorack) where you can enter your own algorithms. Maybe someone who has tried this could chime in with their experience?

https://vcvrack.com/

Re: Options for Simulation {Newbie Alert}

Posted: Tue Jul 14, 2020 2:57 am
by potul
Wow, this was a good one.
I tried VCV rack and the FV1 plugin yesterday.... Some spn were working fine, some others will not load. I haven't investigated much yet on why...