Firmware: Need a little advice to get into processing architecture

Discuss mods, hacks, tweaks, etc.

Moderators: Altitude, adafruit_support_bill, adafruit, phono, mome rath

Firmware: Need a little advice to get into processing architecture

Postby mario1089 » Fri Oct 12, 2012 2:38 am

Hello,

while most of the code is kinda easy to get, I find a bit hard to understand how sync /clocks / play status is working, espcecially without step-into-debugging.
What I basically want to do - besides other things that I found easy to achieve - is to change the MIDI sync mode in way, that it starts playing not on MIDI-Beat-Clock-Start command, but on "the first noteOn" (numHeldNotes>0) to arrive, and stopping playback after "the last NoteOff" ( numHeldNotes<1). That way I plan to have a nice integration of the whole thing into song-projects, having anything (start/stop, pattern select, current transposition) automatable from MIDI DAW.

A little hacky approach may be to just block the final sending-the-notes (and maybe also block the LED`s lightning), so that it runs silently for numHeldNotes<1, but I wouldn`t mind doing a more proper solution..

Could someone drop me a few sentences how this basically would be done?


Thanx in advance!
mario1089
 
Posts: 187
Joined: Wed Sep 19, 2012 7:11 am

Re: Firmware: Need a little advice to get into processing architecture

Postby antto » Fri Oct 12, 2012 8:13 am

in pattern_play.c
you can find the code responsible for starting/stoping the internal sequencer
(it's somewhere near the end of the file)

to disable it to react to midi start/stop messages remove these conditions:
((sync == MIDI_SYNC) && (midi_cmd == MIDI_STOP))
((sync == MIDI_SYNC) && ((midi_cmd == MIDI_START) || (midi_cmd == MIDI_CONTINUE)))

then, right above that code you'll see a condition: if (sync == MIDI_SYNC) { ... midi_recv_cmd(); }
so this is a good place to process midi messages
We are here too: irc.freenode.net >>> #x0xb0x
..:: c0nb0x v1.00 ::.. viewtopic.php?f=7&t=29282 (new control app - win/osx)
VCO Tuning: viewtopic.php?f=12&t=24759 (do it the EASY way)
User avatar
antto
 
Posts: 978
Joined: Thu Apr 15, 2010 2:21 pm

Re: Firmware: Need a little advice to get into processing architecture

Postby mario1089 » Fri Oct 12, 2012 10:05 am

Perfect, thanx!
Strange I haven`t found that myself:) Should have done more searching..
mario1089
 
Posts: 187
Joined: Wed Sep 19, 2012 7:11 am


Return to x0xm0dz

Who is online

Users browsing this forum: mibignistinly and 2 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [105]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]