Programming the FV-1/what language/how hard???

Started by loss1234, December 30, 2009, 10:36:01 AM

Previous topic - Next topic

loss1234

hi there. i dont know if this has been covered but i cant seem to find if there are any higher level languages you can program the FV-1 in.

as i am not a programmer, i want to figure out which language to start focusing on learning to program this chip.

i have only programmed in basic (long ago) BUT i feel like for a cool chip, i would be willing to learn.

SO...

1. what is the name of the language that is native to the chip?

2. does the software allow you to use other languages?

3. is there a good book on using this language OR is it specific to this chip?

(i looked at some of the commands and i was wondering if i could find definitions for things like the accumulator and ACC in a programming book.

thanks for ANY help and sorry if this is too basic a question

cloudscapes

#1
according to this page:
http://www.spinsemi.com/knowledge_base/inst_syntax.html
it's a form of assembly, which is as low-level as you can get. unfortunatelly, ASM is also one of the hardest to learn thoroughly.

however, I believe there are samples, and if you can learn enough to change "variables" (though asm uses no variables, but memory addresses) here in there, you can probably tweak sample reverbs a bit.

I dont think these exampels are complete projects, but it'll help yo uto grasp the structure
http://www.spinsemi.com/knowledge_base/coding_examples.html

I don't know ASM either. I just know Basic well(ish) and have been using basic compilers for AVR and dsPIC so far. I can read some C but I'm not at all comfortable with it. still, it's easier to understand C than it is ASM
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

loss1234

thanks

i have actually been reading the code examples and their forum all morning, and i must say (without sounding overly optimistic or foolish) that it
seems like you need to basically start understanding what each opcode does, learn the proper syntax, figure out a plan for what you want your program to acheive, and then figure out the hardware portion.

in theory it sounds like it could be learned over time by trial and error with their spinASM assmebler program.

however, i really need to learn more about what the opcodes mean and how registers work,etc.

it sounds like a worthy thing to spend a year of my life on though.

thanks for any help...i really do want to figure this out ;)

octfrank

That is basically how to do it. For a book, look for one that covers the basic structure of micros as well as their code. Which micro is not so important (choose a book for one you think you may use in the future) as the philosophy of asm coding is the same for all, the syntax will change but that can be looked up in the docs for the chip.

Post questions here or on the Spin forum, I try to check both a few times a day. We will be visiting NAMM (no booth, just attending) and are happy to meet with anyone that has questions, etc.
Frank Thomson
Experimental Noize

Taylor

Oops, well I posted this in your other thread:

http://www.diystompboxes.com/smfforum/index.php?topic=81210.msg672489#msg672489

But the simple answer is that it's not that hard, and you definitely don't need to devote a year to it to start hearing usable musical results.

JKowalski

Quote from: cloudscapes on December 30, 2009, 11:00:40 AM
I don't know ASM either. I just know Basic well(ish) and have been using basic compilers for AVR and dsPIC so far. I can read some C but I'm not at all comfortable with it. still, it's easier to understand C than it is ASM

I suppose I am just weird but I like learning ASM much better than I liked learning C.

I tried learning C a bit ago, gave up on it, got a PIC programmer, started learning ASM and took off from there. I'll have to go back to C after learning ASM to see if my feelings toward it have changed  :icon_lol:

Then again I have not gotten through doing overly complex programs in ASM yet   :icon_eek:

PRR

The FV-1 is not a general-purpose computer. It is not programmed in a general-purpose language.

It is possible to do "any" problem with not much more than ADD, MOV, STO, and JMP. It gets very tedious. A few more opcodes simplify a little. Macros (prepared opcode routines) help. Conceptually, macros extend to subroutines, which may invoke other subroutines.

The FV-1 is a dedicated audio delay. Instead of you MOVing and ADDing individual words over and over, it is pre-wired to do that. You have to "adjust the knobs" for the effect you want; this is done by setting values in registers. You may want to compute those values; they give you the basic opcodes. Conceptually it may be a full-blown computer. But it is strongly oriented to delay-line problems.

I learned a little machine language when FORTRAN was new (I'm always behind the leading edge). I can not make sense of the FV-1's documentation. I think the author knows "too much" about how you do delay and related effects, and even when writing-down is several steps above my reach.

> definitions for things like the accumulator

The display in a pocket calculator.

1+2=3

CLEAR (accumulator)
STORE 1
ADD 2
(accumulator now says 3)

Actually, the calc display is not quite the naked accumulator, since while entering a number it shows that number, not the accumulator. You can find PC calculators with visible accumulator.

In a larger machine, the accumulator is not directly "visible". You use a computer for long chains of problems. Partial answers can be MOVed to storage for later use. The final answer would be moved to the input register of a display or printer.
  • SUPPORTER

MoltenVoltage

Quote from: JKowalski on January 01, 2010, 09:30:10 PM
Then again I have not gotten through doing overly complex programs in ASM yet   :icon_eek:

Even making a routine to divide in asm is a chore if you do it from scratch.

Once you decide to do anything beyond that, you will want to switch back to C.

What took me a while to figure out, but made life much simpler, is to learn to call asm routines from C for doing tasks that require accurate timing.

You just have to learn to keep your ; and // straight!
MoltenVoltage.com for PedalSync audio control chips - make programmable and MIDI-controlled analog pedals!

peterv999

Quote from: loss1234 on December 30, 2009, 10:36:01 AM
hi there. i dont know if this has been covered but i cant seem to find if there are any higher level languages you can program the FV-1 in.

as i am not a programmer, i want to figure out which language to start focusing on learning to program this chip.

i have only programmed in basic (long ago) BUT i feel like for a cool chip, i would be willing to learn.

SO...

1. what is the name of the language that is native to the chip?

2. does the software allow you to use other languages?

3. is there a good book on using this language OR is it specific to this chip?

(i looked at some of the commands and i was wondering if i could find definitions for things like the accumulator and ACC in a programming book.

thanks for ANY help and sorry if this is too basic a question

I guess it's all depending upon what you need to get created with this perfect device. If you're heavy in filters and other complex means it's a hurdle in any DSP to produce. If you, like me, emphasize on the delay possebilties of this device it's rather simple...

The actual manual SPINAsm & FV-1 instruction set is loaded with samples. Spin Semiconductor  is also featuring a couple of support modes and last but most important those OCT guy's are very helpful supporting there customers!! It seems that reading through the mentioned material is your first step to success!!

-Peter

cloudscapes

the problem I have with ASM is that it doesnt look like real words. I guess thats just how I roll. the more it looks like some soviet war code from the 40s, the more I'll forget the details of that one line a minute later.  ;)

~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

SeanCostello

Assembly language tends to be unique to every processor, so a general book on programming microprocessors (or microcontrollers, or other DSPs) with assembly won't be that helpful. Plus, the FV-1 has some very specific instructions, that aren't really relevant to non-audio effects.

Having said that, there are only 28 possible instructions, and you can only program 128 total instructions in a given program. This is very limited, compared to the vast infinity of options of assembly, C or C++ on a higher end DSP. To me, this is a GOOD thing. I've come up with some awesome algorithms working with these limitations, that I may not have developed when working with generic C++ on a modern Intel CPU. Plus, you don't have to worry about things like updating the delay pointers, incrementing any for() loops - this is all part of the architecture.

I would start by taking an existing program, and figuring out how to alter it in a way that is pleasing to you. For example, try changing one of the example reverbs so you can get infinite reverb out of it. This is usually done by turning the feedback gain up to 1.0, so figure out where this happens. Try doubling the maximum modulation speeds of different algorithms, making a smaller reverb by multiplying every delay length by 0.5, that sort of thing.

Sean Costello
http://www.valhalladsp.com



Digital Larry

#11
Sorry for bumping this zombie thread.   :icon_mrgreen: As with many things in life I was a bit late to the game with the FV-1.  As I started programming a few things earlier this year I was struck by the bits of code that would show up again and again and I started really resenting having to type them in OVER and OVER and (yes I've heard of copy-paste).

Anyway, I found Andrew Kilpatrick's "ElmGen" Java wrapper for the Spin FV-1 assembly language, and I hunkered down hard and figured out how to get it working.  Thanks again Andrew!  After banging on it awhile the possibilities exploded within my mind and then from February to June of this year I cranked out "SpinCAD Designer" in my spare time.  I also managed to clean up the SIN/COS LFO simulation but the RAMP LFO simulation remains... strange... though I'm sure some wish that the chip could actually make those noises!   ;D

Please note: this program does not teach you how to program a unique and amazing effect.  It does allow you to very easily combine the blocks that I have provided into different combinations.  If you are clever you could take some code generated by SpinCAD Designer and graft it to something of your own design.  Most of the blocks I have provided were taken from the Spin knowledge base or forum code examples.   I have some other ideas up my sleeve; however my current set of beta testers is so shy and quiet that I'm not convinced any of them care.  I'm taking a break from further development to do something else for awhile.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer

SISKO

Digital Larry, this is something Ive been following for some time but never had the time to look any deeper (ie; registering on the forum or an intesive search).
Does SpinCad offer audio simulation? Like testing the code within the pc?
--Is there any body out there??--

SISKO

#13
I think this post answerd it!
http://holycityaudio.com/forum/viewtopic.php?f=32&t=1205&sid=307362dd7e744f881c0d1336182d7b0b

Ill download and play with it

------------------------------------------------------------------------------------------------------------
*Edit*: I donwloaded it and its runnig! I tested some block and seem to work perfectly. Now, lets try some ideas... ;)

Great work!
--Is there any body out there??--

Digital Larry

Thanks for the feedback SISKO.  ;D    Please drop any questions you have about using it, or suggestions for blocks you'd like to see implemented, over at the other forum.
Digital Larry
Want to quickly design your own effects patches for the Spin FV-1 DSP chip?
https://github.com/HolyCityAudio/SpinCAD-Designer