Notice: A non well formed numeric value encountered in /sites/ on line 96 Notice: A non well formed numeric value encountered in /sites/ on line 96 Notice: A non well formed numeric value encountered in /sites/ on line 96 Deprecated: Function create_function() is deprecated in /sites/ on line 104 Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /sites/ on line 845 Deprecated: Function create_function() is deprecated in /sites/ on line 111 FS#10022 : Beatbox fix



FS#10022 - Beatbox fix

Attached to Project: Rockbox
Opened by Tony Huynh (insanepotato) - Saturday, 14 March 2009, 06:27 GMT
Task Type Patches
Category Plugins
Status Unconfirmed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Version 3.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


This should hopefully make beatbox compile and run on any target with enough buttons.

All it needed was some key mappings (and some typo fixes). I'm assuming the function declaration for synthSamaples() simply changed over time, as the original code was missing an 's' on the end of function name and looked like this:
synthSamples(&synthtemp[0], &synthtemp[1]);
The second param should be the sample size or something, but it was passed an address.

If it doesn't work on a particular target due to lack of a key map, please add one, or tell me the target and i'll stick a keymap in ^_^

Patch from within root rockbox source folder.

Hopefully this works for you all, its many hours of fun =D
This task depends upon

Comment by Nils Wallménius (nls) - Saturday, 14 March 2009, 09:10 GMT
something is funny with this patch, it rewrites the entire beatbox.c a line ending thing perhaps?
Comment by Tony Huynh (insanepotato) - Saturday, 14 March 2009, 09:15 GMT
I noticed that when I inspected the patch myself. I thought it was because I changed quite a few lines at the beginning of the file (key maps), but I think you're right. I DID get a warning when compiling about no line end or something, but I don't know why. When I look in the file, it ends with a new line. Might be because Im working on windows (cygwin).
Comment by Dominik Riebeling (bluebrother) - Saturday, 14 March 2009, 11:24 GMT
A missing line ending is something different -- gcc expects source files to end with a single empty line, and sounds like this is what you described. Are you editing the file using a windows text editor (i.e. not something from cygwin)? I suspect your editor silently changing all line endings. You should try to use the "-b" option when creating the diff (svn diff -x "-bu" when using svn).
Comment by Tony Huynh (insanepotato) - Sunday, 15 March 2009, 00:36 GMT
Thanks, -x"-bu" seems to have done the trick.
Comment by Tony Huynh (insanepotato) - Sunday, 15 March 2009, 04:13 GMT
oh no! that patch cleared all the newlines.
What happened was, i thought Unix newline was CR but its LF. I my editor to use LF and re-spaced the file so its easy to read.

I edited the macro for the drum name position, so it fits on screens with height less than 100.
Added a menu when you press exit, borrowed from chopper (thanks!) =]
The order of drawing functions has also been changed, such that drawDrumName() is called last, ensures its drawn on top properly
Some of the functions have been renamed because they used mixed case identifiers, which contradicts CONTRIBUTING (only changed some of them)
And rudimentary Saving and Loading has been added, which means it can be used as a viewer ^o^
Comment by Nils Wallménius (nls) - Saturday, 28 March 2009, 08:25 GMT
hi, it's good to see someone working on this forgotten plugin! :)
Your patch mixes style and whitespace changes with functional changes.
Please separate the functional changes from the others so they are easier to review.
Comment by Tony Huynh (insanepotato) - Friday, 10 April 2009, 09:10 GMT
This patch is trimmed. No stylistic/white space changes, only functional changes.
Comment by Tony Huynh (insanepotato) - Friday, 10 April 2009, 09:52 GMT
whoops, sorry I left a few lines of code in the previous file.

I made the cursor wrap around edges in this file and changed the last instrument (virba slap) to Muted triangle =]
Comment by Gman (Thecoolgman) - Monday, 04 May 2009, 04:01 GMT
I have a 5th Gen iPod and the patch fails at compiling. Am I the only one with this problem?
Comment by Gman (Thecoolgman) - Monday, 04 May 2009, 04:02 GMT
And I have version 3.2 if that makes a diffrence
Comment by Shawn Kingston (selectohh) - Monday, 04 May 2009, 13:01 GMT
sorry is this the wrong place to ask what this plugin does? i was thinking about attempting to write a beat box plugin where you can hit buttons and drum samples come out (not a sequencer). can anyone elaborate a bit, or point me to a proper description
Comment by Tony Huynh (insanepotato) - Tuesday, 05 May 2009, 09:56 GMT
Its a drum kit sequencer. There's a grid, each row corresponds to a drum/instrument, each column corresponds to a moment in time. =D
Comment by Marc Guay (Marc_Guay) - Tuesday, 05 May 2009, 16:41 GMT
There's a typo in beatbox.c. When defining BUTTON_PLAY, "#ifdef BUTTON_SCROLL_FWD" defines BEATBOX_PLAY as BUTTON_SCROLL_BACK rather than forward. This causes a compilation failure because of a doubly-defined case. Testing the fix now....
Comment by Tony Huynh (insanepotato) - Wednesday, 06 May 2009, 07:28 GMT
I changed play to Scroll forward and stop to Scroll back, thanks for pointing that out Marc Guay =]

Ipods dont have up/down so no key mapping existed. I made a keymap for the ipods:
Scroll back = up
Scroll forward = down
Left = left
Right = Right
Center = seletc
Menu(top button) = stop/menu
Play(bottom) = play
Comment by Marc Guay (Marc_Guay) - Wednesday, 06 May 2009, 13:21 GMT

- rockbox_style identifiers.
- /* rockbox style comments */
- e200 keymap (i'm not sure how effective your automatic keymap finder will end up being)


- the tempo speeds up and slows down depending on how many samples are being played
- the drum name leaves a residue on the screen when the progress bar moves over it. there should be a way to clear it properly.

Mistakes in this patch:

- multiple declaration of num_samples and number_of_samples

Comment by Tony Huynh (insanepotato) - Thursday, 07 May 2009, 07:06 GMT
The key mapper thing was an experiment. I think it would be more effective if it was put after the "manual overrides". That way it would only guess a key map if one doesn't exist.
Comment by Gman (Thecoolgman) - Monday, 22 June 2009, 04:10 GMT
I was wondering if you could clear up all the errors. Also I was wondering what is the possibility of making the grid extend. Like the default grid you view is just a part of the song you make.