
stryd_one
Frequent Writer-
Posts
8,840 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Blogs
Gallery
Everything posted by stryd_one
-
Why not? We have mixers, KVM switches, virtualisation... what more do you need?
-
Just saw these on ebay...bit more expensive though! Thought I'd post them in case futurlec runs out or something. PCF8583 Real Time Clock Mini Board DS1307 MCU Add-On Board DS1307 Real Time Clock
-
ALPS motorfader with lin and log tracks? SOURCE???
stryd_one replied to Roelli's topic in Parts Questions
Yeh exactly, but for a midibox you want 10k lin and 100k log, not the other way round... -
ALPS motorfader with lin and log tracks? SOURCE???
stryd_one replied to Roelli's topic in Parts Questions
That's not for a midibox, right? -
<scratchin> wik-wik-*whack*
-
typedef and union are actually two separate things, but TK is using them together. I'm guessing that you're looking at a bitfield. Here's an example, I'll break it down. First we have typedef. It's used to define a variable type. You'll already know about types like 'unsigned char' which is 8bit, or 'signed int' which is 16b. Typedef allows you to create your own customised types. You can do typedef char MyType_t; Which creates a type named MyType_t, and makes it a char (which will be unsigned by default). Now, you can create as many variables as you need, using this type: unsigned char Example; unsigned char Example1; int Example2; MyType_t MyVar; MyType_t MyVar1; MyType_t Foo; Now your type can be just about anything you specify. For example we could create a struct: struct MyStruct { unsigned char Foo; unsigned char Foo1; unsigned int Bah; unsigned int Black; unsigned char Sheep; }; What this makes is a set of variables which you access like so: MyStruct.Foo = 0x69; MyStruct.Sheep = 0; Now, you can also create bitfields with the struct keyword, by specifying the member name and how many bits it should have assigned to it: struct MyStatus { unsigned RUN:1; unsigned PAUSE:1; unsigned START_REQ:1; unsigned STOP_REQ:1; unsigned CONT_REQ:1; }; This creates a struct called MyStatus which is 5 bits in size, with one bit assigned to each member. So: MyStatus.RUN = 1; Sets a one-bit 'flag' that your app can use to tell if the Status is running. You can combine this with the typedef like so: typedef struct { unsigned RUN:1; unsigned PAUSE:1; unsigned START_REQ:1; unsigned STOP_REQ:1; unsigned CONT_REQ:1; } MyStatus_t; This creates a type called MyStatus_t, which you can then use to declare several variables as the same 5-bit bitfield: MyStatus_t Status1; MyStatus_t Status2; So now, you have for example: Status1.RUN = 1; Status2.RUN = 0; Status2.START_REQ = 1; etc etc... Now, onto union... union instructs the compiler (SDCC) to assign the same memory address to two different variables. A simple example is: union { unsigned char foo; unsigned char bah; } Example_u Now if the two unsigned chars, foo and bah, share the same physical memory. That means that whatever you write to one, you also write to the other, so if you do: Example_U = 0x10; return bah; Then this function will return the value of bah, which is 0x10. If the above declaration of the MyStatus type looked like this: typedef union { struct { unsigned ALL:5; } struct { unsigned RUN:1; unsigned PAUSE:1; unsigned START_REQ:1; unsigned STOP_REQ:1; unsigned CONT_REQ:1; } } MyStatus_t Now we have created a type, which is a union, of two 5-bit bitfields. In order to make sure that the data is properly asigned with the 8-bit memory, it's best to make it 8-bit, so we do this: // status of midi clock typedef union { struct { unsigned ALL:8; }; struct { unsigned RUN:1; unsigned PAUSE:1; unsigned START_REQ:1; unsigned STOP_REQ:1; unsigned CONT_REQ:1; }; } mclock_state_t; (Look familiar?) ;) Notice that the 'ALL' member is now 8 bits wide. It is in a union with the 5-bit bitfield, so three bits are unused by the bitfield but still accessible by the ALL union member. Once this type is defined, then you use the type to declare the variable: mclock_state_t mclock_state; You could use this type as many times as you need: mclock_state_t mclock1_state; mclock_state_t mclock2_state; mclock_state_t Some_Other_state; Now, it is possible to address the individual flags like so: mclock_state.RUN = 1; Or you can access them all by making use of the union. For example, you can clear all the flags when you initialise the clock: mclock_state.ALL = 0; How's your head? It's 0130 here, I'm out! PS Maybe this thread could be split off into the C programming forum? Edit: BITFIELDS!! (sorry, it's an in-joke between me and another forum member. couldn't help it)
-
%2B = + The method used for your seq, a linear seq, or th0mas' seq are all the same at the core, but yeh, time for another thread.
-
StateX = !StateX; Is a comparator (a logical NOT) and might not work quite the way you're thinking. That's more for stuff like: If (StateX != foo) then bar(); It's logical as in true/false. You might want an operator (a bitwise NOT, aka, one's complement) like this: StateX = ~StateX; Which inverts the bits of the variable given. http://www.phim.unibe.ch/comp_doc/c_manual/C/CONCEPT/expressions.html Good summary. Check out the rest of the site. http://www.midibox.org/forum/index.php?topic=6981.msg45080#msg45080 Nibbles thread of goodness. Check this out for grabbing one nibble of a byte (EG 0x94 broken into 0x90 or 0x04). I updated the cheat sheets tonight.
-
Yeh it's like reaktor for video :) Die orcs die.
-
kris does that mean you didn't like vvvv? I thought it was awesome!
-
Congrats TK!
-
I'm guessing you could use MAX for that....
-
Hey I spotted this the other day, was pretty damned impressed, have you guys seen vvvv?
-
Introductions, and sequencer suggestions for this wicked case?
stryd_one replied to creatorlars's topic in Design Concepts
Well I'm pretty sure the MB808 sequencer is in the works as a part of that project (a whole synth/'groovebox') and may be ready soon... It is a cut down/modded version of MBSeq v2, so seqv3 will have more features but may be missing some mods you'd like to have.... I guess that comes down to taste. moogah is the man to give the details on that one. I'm still working on my sequencer and it'll be finished fairly soon, but I wouldn't hold my breath. Let's say that life is perfect and everything is wonderful, I will have it done before '08.. but even then, although it is designed to be extremely flexible, that comes at the expense of power. While it will be able to run patterns like most other step seqs do, you'll get more tracks out of an MBseq. I'd definitely recommend the BLM extension (4x16 bicolour LEDs and switches) for you... Not sure how it'll work out in that case though. The sneakthief sequencer is for mixing premade loops, so I don't think it's what you're after. -
MBCV/Analog Toobox?
-
Introductions, and sequencer suggestions for this wicked case?
stryd_one replied to creatorlars's topic in Design Concepts
Welcome aboard mate :) At present, it's the MBSEQ and SneakThief's seq only... The rest are in the works. -
It really depends on what you're after... If they "gotta be real nice" then you'll need to try before you buy, so buy one of many types, and try them out until you find 'the one'.
-
My 2c.... This is the only way to fly: ___ _ N||==========================| L |---|B| U||==========================| D |---|B| T||==========================|_S_|---|B| B = Bridge, NUT = ,well, nut... LDS = Laser Distance Sensors. 6 of. Mount in the body facing up the neck to measure 'string' length. --- = Guitar strings tensioned through peizos or pressure sensors or something, for actuation. I hate to think of the work and money involved... if the LDS can even be made to fit in a space that small....
-
My advice to you is that eBay is a bad place to buy switches unless they are a brand name and you know what you're getting.
-
Who was it that wanted encoder style knobs for 1/8" shaft?
-
hijacking = talking about something off topic, in someone else's thread, thereby kinda stealing the thread from them. I don't think we're doing that anyway because we're talking about midi recording just like that which would be used in this project. Give me a shout when you find that source :)
-
Ahh okay I guess this is a terminology mixup... We have TWO meanings for the word "programming" :D Anjuta, like codeblocks or xcode or notepad++ or ultraedit, is an IDE, which you use for writing C code. This application development is known as 'programming' because you construct the program you want to run. More often it's known as 'coding' because you write code. Then, there is 'programming' the chip, as in, 'burning' your program to the chip's ROM. In our case, it is only necessary to burn the bootloader, and which application you use for this may depend on what hardware (MBHP-Burner or JDM module) you are using to burn the chip. Once the bootloader is burned using a JDM/burner, then you can "burn" the operating system and application by sending it over MIDI. You should definitely have a look on the wiki :)
-
Thanks mate, that confirmed that it was my reader that had gone mental - it's fixed now :) The wiki feed seems to be broken though :( It tells me: No input file specified. Edit: It would be really nice if the forum feed had the last 20 or so posts! :)
-
I'm sure it will prove to be useful thanks man :) Don't stress about the details of wiki editing. I would rather do a little cleanup of good documentation, than have no documentation at all :) As for sharing those ideas, yes, please do! You (or anyone) can create a user projects page and put all of their little tidbits on there. I'll be happy to upload as required.