Adafruit #570 in Inc 5000 & #11 in manufacturing - fastest-growing private companies in America - INC 5000 - Read more!

Firmware: A newby here has initial questions

by mario1089 on Wed Sep 19, 2012 7:29 am

Hi all,

I`m currently waiting to get my x0xb0x. I have developed quite a bunch of complex sequencer and audio stuff for well known companies, and I`m definitively going to adjust the x0xb0x to my personal needs as a producer. I`ll share anything with you (if anything good comes out).

At this point I have 2 questions:

1) I`d like to have a midi mode, where the thing start to play a pattern exactly on any incoming MIDI-NoteOn (from start, so that the noteOn defines the downbeat), and stops to play when no MIDI notes are held anymore. Perfectly a part of the 127 note range would switch the pattern (maybe the 8 of a bank), while a 2nd range of the note range changes the pattern`s root note (repitches the pattern up and down).
Which of these things are possible in general with a reasonable effort? (starting on noteOn and switching patterns have higher prio as repitching could be handled by different patterns).

2) I`m very much into randomizations. I want to do a much more complex randomizing section, creating useful, musically reasonable patterns, that also relate - with adjustable amout - to the current state of the pattern. I`ve done things like that a lot, but the really good stuff can take 100s or 1000s of lines of c-code to be 'it'. So when I read you talking about "167 bytes left" that sounds like a problem:(.
So, what can I expect here? Is there big chunks of code, that I may not need (special sync modes for example) that are easy to take out to make space for complex randomizing? Or what?

Thanx!
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Wed Sep 19, 2012 9:45 am

hi, and welcome ;]

what you describe in #1 is what i wanted to add eventually, i called it "Midi Trigger mode"
it's easy to do, btw there are 128 notes, so it covers all the 128 patterns on the x0x perfectly, (tho the x0x can have more patterns)
as for transposing them - i don't quite get your idea, you could use the note velocity maybe, but it won't be very nice
you can leave transposing to the x0x buttons as it is now

#2 - i'm the same type of guy, i wanted to put all my uber pattern manipulation algos into my firmware, but.. well long story..
it has only a few in the last beta release.. like reorder notes, reorder time data.. (i don't even remember)
well, don't be sorry for me, all these things - i already implemented them, but in my software synth, so i'm still a happy little bastard :mrgreen:

there isn't much space left on the microcontroller
you can cut-away some of the code, but you'd be making compromises and .. it's constraining
due to this, we came up with the idea "what if we change the microcontroller with a bigger one?" and the guys here began thinkering and.. well then something happened and that project freezed almost when it was finished
still no cpu mod
maybe it'll be resurected some day

the x0x cpu has 16kB flash (the bootloader takes 512 of these bytes)
the cpu mod was going to replace that with a bigger cpu with 256kB flash !!!
no need to wonder whether your ideas would fit in it :wink:
i still wish this happens some day

i hope this helps
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Wed Sep 19, 2012 11:26 am

Thank you for answering! Exciting to become part of this story!

About MIDI-transposing: For example note 0-64 trrigger the first 64 patterns, then note 65-127 transpose the pattern "live", so not the sequence data itself changes, but the pitch the synth is actual playing, like semi-tone offsets to the sequence. I`m not sure whether this is possible in general - to what layer has the digital part of the device control over the tuning? Is there a place in the code able to add offsets to the tuning per event, depending on MIDI input?

About the space: I`d say I`m fine with cutting away code, as I normally tend to have one preferred workflow and anything else could just go. Especially any track editing I don`t need at all, as all of that will be done by MIDI trigger-notes. I want to edit patterns and tweak knobs on the hardware, but all the rest I want to edit in the MIDI host. So would it be easy to, say, remove all track-related stuff to get place for more complex randomize algo`s?
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Wed Sep 19, 2012 1:58 pm

the cpu note output is 6bit - range 0 to 63.. so you can't do any fancy stuff

transposing.. you can use another midi channel for that
channel1 - trigger patterns (all 128 of them)
channel2 - transpose, other stuff..
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Wed Sep 19, 2012 4:00 pm

Ok, got that.
Thought about that channel concept, too - but from a DAW user´s perpective it`s more handy to have all control you need on one channel. Better have 64 patterns + transpose control on channel 1 and the other 64 patterns + pitch control on channel 2.

Again, thanx for reply. Ill do that MIDI trigger mode soon after my device arrives and let you know. Looking forward..
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Wed Sep 19, 2012 6:35 pm

ehm, for transpose you don't need to reserve 64 midi notes
the Transpose feature in the TB-303 (in Pattern Play mode) only transposes upwards, up to 1 octave (thus 13 value)

the x0x firmware does Transpose both ways (one octave down, to one octave up)
but the the pattern itself has 1 octave extended transpose range (that's per note)
and you already exceed the possible range to output from the cpu (thus, notes get clipped)
one thing that could be done (i tried it, and it worked) is to use the lower notes, this means, using the full lower range of notes that the cpu can output for the lowest octave, and then you can have a total range of 5 full octaves (61 keys, with 3 spare)
this requires tweaking TM4 to compensate
and since the lowest notes are shifted, the opamp (IC11) which deals with the pitch must be able to produce near-to-zero voltages propperly, i had to desolder mine (which was 6562) put a socket, and found a TS272 to do a better job in that lower range of notes

so in short, it's not much worth it.. just 12 semitones up is enough

as for using 2 midi channels - i do exactly that in my soft synth, we'll see how bad it is soon
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Thu Sep 20, 2012 3:27 am

Now I`m afraid I don´t get it:(
Let me clarify what I actually want to achieve:

If have a pattern programmed, I want - by MIDI notes - to transpose it by some semi tones up or down. Typically because of chord changes in the song. 7 up, 5 down would actually be enough. So is that possible with easy modifications in the firmware? I guess if the pattern itself is already using the full range of possible notes, some notes may fall out of range, but that`s totally fine for me - a mod is allowed to have its limitations:).-
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Thu Sep 20, 2012 4:43 am

yes, you can transpose it in semitones
you process the midi data, then you can do whatever crazy math you like (integers please) with it
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Fri Sep 21, 2012 1:17 am

sorry, this is a bit stupid, but could someone point me to the really basic things:
(Maybe there is a thread somewhere with all that stuff?)

1) Where is the code? -- I searched for quite a while, only finding 2.0 beta. Is there an official place with the current released state?
2) How to build? -- What I found in the "manual" seems a bit outdated, at least with Atmel Studio 6 it didn`t really work out the way desrcibed, I think the makefile doesnt really match or something. Which AVR is recommended?
3) And what windows is recommended? Is 7 64 fine, or better use rock solid XP ( I have both ).

Thanx,
Mario
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Fri Sep 21, 2012 2:45 am

the stock firmware (from adafruit) is v1.05, it's available at sourceforge
sokkos is derived from it afaik

i build with WINAVR on my winXP machine, i think sokkan is on linux (or maybe osx)
just use the Makefile, it should produce the precious .hex file
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Fri Sep 21, 2012 3:01 am

And where is sokkos 1.9.1 ? Or no point using it, as 2.0 beta is just fine?

Ah, and thanx for answering!
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by mario1089 on Fri Sep 21, 2012 9:32 am

Ok, sokkos 2.0 compiles. Easy job. Hex has same size than delivered one, so all fine. Thanx for the help. Will start removing all track-related code soon, to make space for cool stuff.
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Fri Sep 21, 2012 10:02 am

sokkos v2 has already a number of additional features, like triplet patterns, shuffle, tap-tempo and even midi sysex iirc
so it's probably at the maximum already
you may wanna check out the stock firmware, since it is shorter on features

specifically for developing firmware, i suggest c0nb0x instead of c0ntr0l, since it has some helpful info about the .hex actual size, and how much space will remain on the x0x, it also works more stable.. has progress meters and so on..
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1

Re: Firmware: A newby here has initial questions

by mario1089 on Fri Sep 21, 2012 10:18 am

Guess I like those new features in 2.0, but what I`ll never need at all is track-editing and track-play( I`ll add a mode doing exactly what I need for arranging from the host). Judging from code size, removing all track related things should give some space. There was another thread here stating that only few users use track-play, so the majority may be also fine with that, too. Could not see any other big chunk of code that would be easy to remove - do you have suggestions?
mario1089
 
Posts: 196
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: A newby here has initial questions

by antto on Fri Sep 21, 2012 11:31 am

well, trackmode is only the interface, since it reuses the actual playing code from PatPlay mode (in do_tempo)
next thing is the smaller stuff like Random mode, and so on (but i bet in sokkos they are already removed) ... don't expect wonders
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. http://forums.adafruit.com/viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: http://forums.adafruit.com/viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 1348
Joined: Thu Apr 15, 2010 2:21 pm
Location: 127.0.0.1