Commit graph

50 commits

Author SHA1 Message Date
Solomon Peachy
ed724fecb1 Midiplay plugin ehancements
- Improved robustness
 - Improved sound quality
 - Use mixer and DSP

Patch by Igor Poretsky

Change-Id: I6fa617158cbaa53ae842295cdbdbe3a478e49ded
2019-08-05 20:48:40 +02:00
Bertrik Sikken
8a87b663ed midi plugin: make local functions static where possible
Change-Id: I702755529f98015586b5b9592ced75cf7591880c
2012-02-18 12:06:48 +01:00
Nils Wallménius
2afc175a4e midi: make the patch sample data pointer a *int16_t to get rid of some ugly casting and drop an acessor macro to make caching the pointer in the synthVoice loop possible. Speeds up midi by 1-2% on cf and 3-5% on PP.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30438 a1c6a512-1295-4272-9138-f99709370657
2011-09-06 10:34:20 +00:00
Michael Chicoine
e024198305 Replace remaining printf in midi plugin (fix yellow/red)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27563 a1c6a512-1295-4272-9138-f99709370657
2010-07-25 19:47:07 +00:00
Andrew Mahone
23d9812273 loader-initialized global plugin API:
struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api

the loader uses this pointer to initialize rb before calling entry_point

entry_point is no longer passed a pointer to the plugin API

all plugins, and pluginlib functions, are modified to refer to the
global rb

pluginlib functions which only served to copy the API pointer are
removed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
2009-01-16 10:34:40 +00:00
Nils Wallménius
4c43f7be0a Rearrange the main synth loop a little and move some tests around for a ~5% speedup on c200, increase the output buffer size to make skips less likely, playback of simple midi files should now be mostly skip free on pp based players
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19207 a1c6a512-1295-4272-9138-f99709370657
2008-11-24 21:32:08 +00:00
Nils Wallménius
95cf600b6c Macros should be ALL CAPS, so rename (un)likely() to (UN)LIKELY()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19181 a1c6a512-1295-4272-9138-f99709370657
2008-11-22 16:56:20 +00:00
Nils Wallménius
7ef2a053b8 Turns out that using likely in the loop condition gives a nice little speedup to so let's do it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19168 a1c6a512-1295-4272-9138-f99709370657
2008-11-21 14:23:34 +00:00
Nils Wallménius
1284c127f8 Introduce likely() and unlikely() macros, use to give gcc hints about which branch is likely to be taken in a conditional, use them in the midi player for a small speedup, use instead of similar EXPECT macros in tremor and use in mpegplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19162 a1c6a512-1295-4272-9138-f99709370657
2008-11-20 20:20:43 +00:00
Nils Wallménius
8df332c062 Oops, revert unrelated changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18139 a1c6a512-1295-4272-9138-f99709370657
2008-07-27 20:40:20 +00:00
Nils Wallménius
2d337dab7f FS#9221 by Christopher Williams fixing a couple of bugs in keybox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18138 a1c6a512-1295-4272-9138-f99709370657
2008-07-27 20:36:45 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
later. We still need to hunt down snippets used that are not. 1324 modified
files...
http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-28 18:10:04 +00:00
Nils Wallménius
65331f1749 Revert some changes that broke looping in midiplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15631 a1c6a512-1295-4272-9138-f99709370657
2007-11-15 21:20:29 +00:00
Nils Wallménius
0fd4c2e455 Rearrange logic in the synthVoice loop to do less tests and remove need of a struct member for a small speedup, move some memory lookups out of the loop for a small speedup, further cosmetic changes to the synthVoice function. Change isUsed to a bool for clearer logic and also a tiny speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15563 a1c6a512-1295-4272-9138-f99709370657
2007-11-11 01:02:45 +00:00
Stepan Moskovchenko
cd963d84ca MIDI: Allow seeking forward and backward using the left/right keys. Currently seeks in 5 second
increments, but this can be set to any amount. Also implemented a counter for playing time, which can 
pretty easily be used to determine the length of the file, in seconds, before playing it. The time 
isn't displayed anywhere right now, but all this can be useful if this thing is turned into a codec, or 
at least gets a nice UI.



git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15418 a1c6a512-1295-4272-9138-f99709370657
2007-11-03 04:09:38 +00:00
Nils Wallménius
2d91cf3ea3 Increase temp buffer size to fit more samples, put in simple safeguard to avoid memory corruption when writing to the temp buffer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15253 a1c6a512-1295-4272-9138-f99709370657
2007-10-21 22:50:10 +00:00
Stepan Moskovchenko
47d8323deb MIDI: Fix ringing/beeks in music caused by improper parsing of some pitch bend events.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15252 a1c6a512-1295-4272-9138-f99709370657
2007-10-21 19:47:33 +00:00
Nils Wallménius
ab5a38db92 Clean out an unused struct member from the synthObject struct
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15189 a1c6a512-1295-4272-9138-f99709370657
2007-10-18 13:43:13 +00:00
Stepan Moskovchenko
d33645ba13 MIDI: Optimize the new pitch bending code for a small speedup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15160 a1c6a512-1295-4272-9138-f99709370657
2007-10-17 03:48:24 +00:00
Stepan Moskovchenko
1515ff8522 MIDI: At long last, though quick and dirty, pitch bend depth! Or, I think it works. Tested on two
files. Let me know if anyone discovers any problems with this. This commit also includes Nils's synth 
loop optimization patch. I hope committing it does not cause problems.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15112 a1c6a512-1295-4272-9138-f99709370657
2007-10-15 05:11:37 +00:00
Nils Wallménius
f619f81676 Change loop structure for sample synthesizing. Gives a nice speedup on both coldfire and arm targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15036 a1c6a512-1295-4272-9138-f99709370657
2007-10-08 19:28:41 +00:00
Nils Wallménius
8219f2801a Make synthVoice return int instead of short, gives a nice speed up also add a comment
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14988 a1c6a512-1295-4272-9138-f99709370657
2007-10-05 11:15:04 +00:00
Nils Wallménius
e1940b87b0 Optimisation of the midi player, reducing the number of multiplications and memory accesses inside a very frequently executed loop, also does shifting of the whole sample when synthing is done which improves accurracy slightly, ~10% fewer buffer misses
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14983 a1c6a512-1295-4272-9138-f99709370657
2007-10-04 19:36:42 +00:00
Nils Wallménius
6386dbe861 static/inline/iram raid gives nice speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14915 a1c6a512-1295-4272-9138-f99709370657
2007-09-30 11:21:25 +00:00
Stepan Moskovchenko
414724e2f4 MIDI: Kick up number of voices and decrease the decay rate, taking
advantage of the recent speedups. Some instruments sound a lot more 
natural now.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14910 a1c6a512-1295-4272-9138-f99709370657
2007-09-30 09:01:38 +00:00
Stepan Moskovchenko
aaf3e3269c MIDI: Fix off by one error with the guitar. Wow, I can't believe the off-keyness is finally fixed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14897 a1c6a512-1295-4272-9138-f99709370657
2007-09-29 03:07:31 +00:00
Stepan Moskovchenko
d1e306077f MIDI: Fix two year old loop bug that caused distortion on some instruments. I been looking for this one
for at least 6 months.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14896 a1c6a512-1295-4272-9138-f99709370657
2007-09-29 02:20:49 +00:00
Nils Wallménius
6888db3240 Do not duplicate const table, make getEvent function static inline, gives about a ~1.5% speedup, put tick function in iram, ~3.5% speedup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14873 a1c6a512-1295-4272-9138-f99709370657
2007-09-27 20:17:38 +00:00
Stepan Moskovchenko
8b6d28790e Some MIDI changes, and add a new musical plugin I'm working on... Not fully done yet, so commented out
of SUBDIRS. (If people are against having half-baked plugins in SVN, please let me know and I will 
remove it).


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14863 a1c6a512-1295-4272-9138-f99709370657
2007-09-27 03:59:33 +00:00
Nils Wallménius
0e49605aaa Move all of midiplay into its subdir and add a Makefile for it, add header files as necessary.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14841 a1c6a512-1295-4272-9138-f99709370657
2007-09-24 15:57:32 +00:00
Nils Wallménius
04b3435afd Clean up hard-coded paths
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14662 a1c6a512-1295-4272-9138-f99709370657
2007-09-10 09:46:36 +00:00
Jens Arnold
b1f0049307 Fix the undefined char symbols appearing in many output lines. This printf does neither support nor need \n.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13229 a1c6a512-1295-4272-9138-f99709370657
2007-04-21 05:35:17 +00:00
Linus Nielsen Feltzing
7c4b786851 Some quick and dirty MIDI player optimizations, now it works on the X5 and M5 too
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13108 a1c6a512-1295-4272-9138-f99709370657
2007-04-11 10:48:50 +00:00
Jens Arnold
79c8a8cbbe Let GCC check arguments of some more printf-style functions, also for plugins and codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12815 a1c6a512-1295-4272-9138-f99709370657
2007-03-17 09:02:53 +00:00
Jens Arnold
4d6374c923 Get rid of the 'center' parameter for splashes. There were only 2 of almost 500 splashes which were not centered.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12807 a1c6a512-1295-4272-9138-f99709370657
2007-03-16 21:56:08 +00:00
Stepan Moskovchenko
94d9d152b6 More ADSR related voodoo. Hopefully will get to patch prescaler soon.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11118 a1c6a512-1295-4272-9138-f99709370657
2006-10-03 23:27:44 +00:00
Stepan Moskovchenko
c84461fb8f More adsr related nonsense, argh! Fix adsr related problem on some notes being stopped instead of
looped. Ramping code still not quite right, but dont want to lose this.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11117 a1c6a512-1295-4272-9138-f99709370657
2006-10-03 21:09:47 +00:00
Stepan Moskovchenko
ba0d55510f Get rid of old junk and fix warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11106 a1c6a512-1295-4272-9138-f99709370657
2006-10-02 04:30:19 +00:00
Stepan Moskovchenko
80b4882922 I have an iRiver again, yay! Make notes ramp down in a better way. Fix
note-off pop/click due to waveform index out of bounds access.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11105 a1c6a512-1295-4272-9138-f99709370657
2006-10-02 04:13:33 +00:00
Stepan Moskovchenko
68af7bae87 Added ability to adjust the volume during playback.
Gracefully fail if no soundset installed.
Yet more messing with the ramping code. I swear, that will be the end of
me.
Basic skipping support- skip foreward a bit if Right is pressed.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9883 a1c6a512-1295-4272-9138-f99709370657
2006-05-07 07:12:07 +00:00
Stepan Moskovchenko
28b5afd05a Optimize synth code by pre-computing the volume scaling for each note.
Scaling is now calculated once per MIDI event at the most, instead of
once per sample. Increase voice ramping speed, increase number of
active voices a little.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9870 a1c6a512-1295-4272-9138-f99709370657
2006-05-03 19:32:22 +00:00
Stepan Moskovchenko
47efba8bbf Fix file descriptor leak that would cause a hard lockup every 7 files
played. A few other cosmetic changes. please, please no red build =)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9865 a1c6a512-1295-4272-9138-f99709370657
2006-05-03 05:18:18 +00:00
Stepan Moskovchenko
b2f1b5dd18 ----------------------------------------------------------------------
Added Karl Kurbjun's sound output patch, cleaned up some output.
Main file is now midiplay.c, midi2wav is still in there for anyone who
wants it. Set sampling rate to 22k, and increased note decay time.
Reduced number of concurrent active voices and made new notes replace
used voices if none are available. This makes lag less apparent.
I really hope this wont go red. (turns around and runs)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9858 a1c6a512-1295-4272-9138-f99709370657
2006-05-01 23:22:59 +00:00
Stepan Moskovchenko
fb3e9a4073 Fix error/warning, change pitch bend to 9 bits
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7288 a1c6a512-1295-4272-9138-f99709370657
2005-08-07 22:20:40 +00:00
Tomas Salfischberger
2ed84ec2ca The synthVoice() function declaration was wrong (caused a warning). And because of that GCC didn't notice the error on line 390: synthVoice(currentVoice).
In revision 1.4 Steven made currentVoice global, so the function declaration should be: synthVoice(void), wich fixes a warning. And the call should be just synthVoice() wich fixes a hidden error.

Hope I saw this right... please correct me if this isn't the way you ment is Seven.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6708 a1c6a512-1295-4272-9138-f99709370657
2005-06-14 16:17:11 +00:00
Stepan Moskovchenko
9ec1ff8cf5 Fixed warnings, adapted to Rockbox coding style, optimized to 78% realtime.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6329 a1c6a512-1295-4272-9138-f99709370657
2005-04-20 21:07:13 +00:00
Stepan Moskovchenko
1f5fb99819 Some shifting optimizations. Working code. 50% realtime.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6323 a1c6a512-1295-4272-9138-f99709370657
2005-04-19 15:57:07 +00:00
Stepan Moskovchenko
4b773c0c4c Added xxx2wav support, an icon, and some optimizations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6306 a1c6a512-1295-4272-9138-f99709370657
2005-04-16 03:35:20 +00:00
Stepan Moskovchenko
5811214b0c Code cleanup, fix warnings, error checking, add midi2wav to viewers.config
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6304 a1c6a512-1295-4272-9138-f99709370657
2005-04-15 20:27:04 +00:00
Stepan Moskovchenko
215e492a12 Added MIDI synthesizer plugin
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6287 a1c6a512-1295-4272-9138-f99709370657
2005-04-15 06:08:55 +00:00