tag:blogger.com,1999:blog-5504797954308181088.post3398282899041150399..comments2013-12-05T06:10:38.529+01:00Comments on Syncuino - An Arduino-based Step-Sequencer: 9) Syncuino: Cleared Code - Same FunctionUnknownnoreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5504797954308181088.post-6901382703081080612013-12-05T06:10:38.529+01:002013-12-05T06:10:38.529+01:00I'm about to do a complete build of your Syncu...I'm about to do a complete build of your Syncuino, with a few additions and changes of my own. Would it be possible to switch the Ps/2 transpose to a midi keyboard instead? Jabberwalkyhttps://www.blogger.com/profile/04729611821915115473noreply@blogger.comtag:blogger.com,1999:blog-5504797954308181088.post-83392744097494472582011-12-21T02:03:51.394+01:002011-12-21T02:03:51.394+01:00I haven't done any Arduino coding, but some ti...I haven't done any Arduino coding, but some tips based on how most languages work:<br /><br />Variables for return values: If you use the return value at all, most compilers will optimize so declaring a function-level variable or not results in the same amount of stack space used.<br /><br />You have a lot of variables which look like constants (values which never change). Use constants or better yet, #define macros (if the Arduino supports them like C), use those instead.<br /><br />Have you considered using a switch statement in the code which checks the keyboard key code? Even better, given that there's a simply relationship between the key code and the transpose number, you can probably do somethinf like transpose = (int)(c - 10) or whatever "10" ends up being (the difference between the key code and the transpose number)<br /><br />You have code that recalculates Note1 (and the others). Seems redundant. Might be a better way to do that with the shuffle delay.<br /><br />Hope that helps you dig up even more code space on the chip :)<br /><br />PetePetehttp://10rem.netnoreply@blogger.com