artrag Posted November 21, 2015 Share Posted November 21, 2015 (edited) About missing features, this is my quick list: a) function to poll if the current song is still playing or if the music has ended (is there a peek() to get this info already now ?) b) volume control for music (at compile time is easy, but having it at run time would allow fade in and out effects) c) sfx replayer (better if using the format from AYFX Editor v0.4 https://shiru.untergrund.net/software.shtml ) d) virtual mixer between music and sfxs (play one or more sfx at the same time with the music, by comparing the volumes of samples: only the 3 loudest samples are played) is there already a workaround for a) ? [EDIT] I have forgotten the last one, a tool to generate Intellivoice samples. I have been studying a bit and it is not trivial, but I think that intellivoice could be used also for SFX and "music" with very little effort for the CPU. LPC encoding is well documented, the real tricky part is how the parameters of the AR filter are encoded and how they are updated programing the SPO256 (that has its own assembly) Once one does a tool able to output data and code for SPO256 from a wave file, one could also do music with it https://en.wikipedia.org/wiki/Linear_predictive_coding The complexity is high but the steps should be more or less these: 1) segment the input wav file in frames ( use windowing in time and overlap the tails) 2) decide how to code each frame (voiced sounds - with periodic pulse in input to the filter or unvoiced sounds - with noise in input to the filter) 3) compute the parameters for that frame according to the model chosen 4) decide how to code the SP0256 in order to update the current parameters to the new ones (and this implies to code a compiler apart) 5) save data and code and repeat from 1) [EDIT2] This is done using LPC encoding, the SPO256 could do something very close at cost of few bytes per second https://www.youtube.com/watch?v=ecm5PKTiVhw Edited November 21, 2015 by artrag 1 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted November 21, 2015 Author Share Posted November 21, 2015 A quick, untested and dirty way in assembler to test for music over: ... inside PROCEDURE IF USR musicfinished THEN GOTO do_something ... REM this goes outside any PROCEDURE asm ; Returns 1 when music playing, 0 when not playing asm MUSICFINISHED: PROC asm BEGIN asm MVI _music_p,R4 asm MVI@ R4,R0 asm SUBI #$FE,R0 ; The end? asm BEQ @@1 asm MVII #1,R0 asm @@1: asm RETURN asm ENDP 1 Quote Link to comment Share on other sites More sharing options...
+fdr4prez Posted November 21, 2015 Share Posted November 21, 2015 (edited) I have another reason! I have a rare sickness: my elbow sticks to my knees (literal translation of an Italian joke) More ore less: the general idea is that you are sitting still with your elbow on the knees doing nothing and that you cannot do anithing else due to the fact your elbows are stuck to your knees That's neat. I'd like to know the original Italian non-literal translation version I have dealings with a factory about 45-minutes outside of Venice, and at times I'd certainly like to get them off their butt, and now I know their elbows are stuck to their knees Edit: sorry - don't mean to hijack the thread here Edited November 21, 2015 by fdr4prez Quote Link to comment Share on other sites More sharing options...
artrag Posted November 21, 2015 Share Posted November 21, 2015 (edited) "Embe? Che c'hai? Ti si attacca il gomito al ginocchio? Datti 'na mossa!" So, what's your problem? Do you have your elbow stuck to your knees? Move on! But be aware, the expression is used in Rome and its suburbs I can't tell if it is used in Venice Edited November 21, 2015 by artrag Quote Link to comment Share on other sites More sharing options...
+fdr4prez Posted November 21, 2015 Share Posted November 21, 2015 Sweet, thanks! Now I need the Italian Rosetta Stone Quote Link to comment Share on other sites More sharing options...
artrag Posted November 21, 2015 Share Posted November 21, 2015 A quick, untested and dirty way in assembler to test for music over: ... inside PROCEDURE IF USR musicfinished THEN GOTO do_something ... REM this goes outside any PROCEDURE asm ; Returns 1 when music playing, 0 when not playing asm MUSICFINISHED: PROC asm BEGIN asm MVI _music_p,R4 asm MVI@ R4,R0 asm SUBI #$FE,R0 ; The end? asm BEQ @@1 asm MVII #1,R0 asm @@1: asm RETURN asm ENDP From what I understand (not a lot) the value pointed by _music_p is $FE when music has ended. Is it correct? Quote Link to comment Share on other sites More sharing options...
+nanochess Posted November 22, 2015 Author Share Posted November 22, 2015 From what I understand (not a lot) the value pointed by _music_p is $FE when music has ended. Is it correct? That's right. It's the code generated by MUSIC STOP. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.