Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Hayleia on January 02, 2014, 02:33:33 pm

Title: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 02, 2014, 02:33:33 pm
Latest Update: http://ourl.ca/20419/372776

First of all, AudaciTI is a play-on-words because it sounds like Audacity... when said in French, so if you have a better name (preferably not longer than 8 chars), I might take it.

Why another music player ?
Because, from what I understood, TruSound takes "too much memory" (not too much for what it plays, but too much to fit a lot of music in a calc) and runs at 15 MHz. MuseInc needs both Axe and Celtic III on the calc so it doesn't fit either on a regular 83+, same for MobileTunes which requires DoorsCS (well it fits but takes a lot of memory), TI JukeBox only plays one channel of sound, ...
(I didn't know about this one (http://chipmusic.org/forums/topic/8895/1bit-music-goes-handheld-speccy-routines-on-ti82/) until fb39ca4 told me about it, which was after I posted).

So this is why I thought we needed a player with those features:

Do you have some progress to show off ?
Yay ! Screenshot Time !
Seriously, I won't do a screenshot for a music player. But yeah, I have an executable if you want. Plays a stupid track with 8x4 notes in. If you don't have the adapter, you can always try that with Wabbitemu. The other executable (TESTNOTE) is to test notes independantly (no chord, one note at a time).
The "player" (if we can call that demo a player) supports 45 different notes for now, but I was too lazy to make a music that supports all those notes without an editor. But you can still hear most of the range in the demo, it plays the 6th note in the list and the 42th note.



Now it's my turn to ask questions ! :P

Do you think the sound you heard in that demo is crappy ?
Do you think we need such a player-editor or do we already have enough of those ?



Some documentation in spoiler, if you want to make an editor.
Spoiler For Spoiler:
The first note that my "player" supports is a F#. So whenever you want to play that F# you put 0. Then, this is not logic but you go decreasing, so the "next" note is the previous note, so a F. So whenever you want to play that F, you put 1.
Of course, it doesn't support only one F#, so 12 is also a F# (lower than the 0 one), 24 too, same for 36,... but not 48 because the player only supports 46 notes (from 0 to 45).

The first note that my player supports is a A. So whenever you want to play that A you put 0. Then the next note is obviously A#, so whenever you want to play it you put 1. And caetera until you reach 45 which is the last note my player supports.

The player reads from appvars, and you don't want to play zStart's appvar so put "AUDACITI"[00] at the beginning of your appvar.

Now that you know which note corresponds to which number, how do I play them ?
I'll make the player support more things but for now, you just put note11, note12, note13, note14, note21, note22, note23,note24,... where note1X are the components of the first chord, note2X are the component of the second chord, ... and noteX1 are played on the first channel, noteX2 are played on the second channel, ...
And you end with a 255.

So the thing you hear in the demo is just that:
   "AUDACITI"[00]
   Data( 45-18, 45-42, 45-30, 45-06 ) .do  do  do  do
   Data( 45-19, 45-40, 45-26, 45-09 ) .si  re  mi  la
   Data( 45-21, 45-38, 45-28, 45-07 ) .la  mi  re  si
   Data( 45-23, 45-37, 45-25, 45-11 ) .sol fa  fa  sol
   Data( 45-25, 45-35, 45-26, 45-09 ) .fa  sol mi  la
   Data( 45-26, 45-33, 45-23, 45-13 ) .mi  la  sol fa
   Data( 45-28, 45-31, 45-23, 45-11 ) .re  si  sol sol
   Data( 45-30, 45-30, 45-23, 45-11 ) .do  do  sol sol
   Data( 255)

(sorry for the "45-X", this is due to a previous way of storing notes).

Planned:
-change the length of notes
-silences
-change the position of channels
-mute channels (to save space when only one note at a time is played)
-"drums"
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 02, 2014, 02:35:47 pm
I am working on TRAXE version 2 which is a chiptune tracker with 3 channels and it will be used in combination with the TIMID soundchip. I want it to have calculator generated sound as well for those who don't have the soundchip. Send me a pm and maybe you can help me with that.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: fb39ca4 on January 02, 2014, 02:41:08 pm
Not bad. You should consider adding a noise channel. I did it in Bad Apple by reading from the r register, but having a properly random sequence of bits should sound better.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 02, 2014, 02:41:29 pm
I am working on TRAXE version 2 which is a chiptune tracker with 3 channels and it will be used in combination with the TIMID soundchip. I want it to have calculator generated sound as well for those who don't have the soundchip. Send me a pm and maybe you can help me with that.
Erm, I didn't understand everything in that post due to the presence of too precise English words :P
What is a "chiptune tracker" exactly ?
Is a soundchip external hardware (external from the point of vue of the calculator) ?

Not bad. You should consider adding a noise channel. I did it in Bad Apple by reading from the r register, but having a properly random sequence of bits should sound better.
A noise channel ? That would be a channel with random noise on it ??
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: fb39ca4 on January 02, 2014, 02:46:16 pm
Not bad. You should consider adding a noise channel. I did it in Bad Apple by reading from the r register, but having a properly random sequence of bits should sound better.
A noise channel ? That would be a channel with random noise on it ??
Yes. It's commonly used in 1 bit music as a substitute for drums. Here's how I used it in Bad Apple: https://mediacru.sh/0YlhBMdyRnVn.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 02, 2014, 02:48:11 pm
I am working on TRAXE version 2 which is a chiptune tracker with 3 channels and it will be used in combination with the TIMID soundchip. I want it to have calculator generated sound as well for those who don't have the soundchip. Send me a pm and maybe you can help me with that.
Erm, I didn't understand everything in that post due to the presence of too precise English words :P
What is a "chiptune tracker" exactly ?
Is a soundchip external hardware (external from the point of vue of the calculator) ?

Not bad. You should consider adding a noise channel. I did it in Bad Apple by reading from the r register, but having a properly random sequence of bits should sound better.
A noise channel ? That would be a channel with random noise on it ??
It's basically an arduino which runs a SID soundchip emulator.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 02, 2014, 02:50:37 pm
Not bad. You should consider adding a noise channel. I did it in Bad Apple by reading from the r register, but having a properly random sequence of bits should sound better.
A noise channel ? That would be a channel with random noise on it ??
Yes. It's commonly used in 1 bit music as a substitute for drums. Here's how I used it in Bad Apple: https://mediacru.sh/0YlhBMdyRnVn.
Oh wow, that would be a nice addition indeed !
Thanks for the tip, I'll consider that.

It's basically an arduino which runs a SID soundchip emulator.
SID is not any clearer :P
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 02, 2014, 03:01:35 pm
The soundchip in the commodore 64 computer from the 80's
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 02, 2014, 03:03:43 pm
Ah ok.
And what do you need help with exactly (because as you can see, I don't know a lot about soundchips :P) ?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 02, 2014, 04:53:32 pm
@ Hayleia, I think it's a cool idea. I'll give it a listen later. I also love the name. It works well in English too. :D
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 02, 2014, 05:20:33 pm
I tried it in wabbit. There seems to be some sort of weird modulation going on instead of clean separated channels.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 02, 2014, 05:26:13 pm
Yea, wabbit's sound emulation isn't correct. I think the pitch is off too.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 02, 2014, 05:27:41 pm
The pitch can be off, but all channels should still be in tune when only the base frequency is changed.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: fb39ca4 on January 02, 2014, 06:53:27 pm
I'd be interested in knowing how you are combining multiple channels on a single output pin. The method I'm using for BA, where I alternate between ANDing and ORing the two channels, sounds fine in Wabbitemu.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: DJ Omnimaga on January 02, 2014, 08:35:03 pm
I like how it sounds so far, especially considering you have multiple channels. It would be nice to hear a longer sound sample, though, such as a SMB1 sample.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 03, 2014, 02:55:07 am
@ Hayleia, I think it's a cool idea. I'll give it a listen later. I also love the name. It works well in English too. :D
I like how it sounds so far, especially considering you have multiple channels. It would be nice to hear a longer sound sample, though, such as a SMB1 sample.
Thanks :D
And for the longer sample, you'll have to wait until the editor comes because I really don't feel like writing that by hand for now :P

I think the pitch is off too.
Ah, I only tried on Wabbitemu so I don't know -.-
I don't have the adapter in fact :P

I'd be interested in knowing how you are combining multiple channels on a single output pin. The method I'm using for BA, where I alternate between ANDing and ORing the two channels, sounds fine in Wabbitemu.
I only use OR so I guess this is why there are some problems. I store all 4 states (take two bits each) in one byte then OR all those and send them to the port.

         ld a,(states)
         ld c,a
         srl c
         srl c
         or c
         srl c
         srl c
         or c
         srl c
         srl c
         or c
         and %00000011      ;this is probably useless
         out (00h),a

You said it would be better with some ANDs ? Would that still be better considering that channels can change their positions (I mean, channel one can be on the right ear or the left one, or both, I just have to change two bits) or would it be better if they had given positions and never change ?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 03, 2014, 03:44:42 am
I meant that the sound was wrong in wabbit (most likely). I Haven't had a chance to listen to it on hardware yet.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 03, 2014, 03:46:43 am
Ah so that causes the weird modulation effect. You should use PWM instead.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 03, 2014, 04:10:44 am
I meant that the sound was wrong in wabbit (most likely). I Haven't had a chance to listen to it on hardware yet.
Same for me, I really should get an adapter -.-

Ah so that causes the weird modulation effect. You should use PWM instead.
But isn't PWM for "complicated" waves ? My player only supports squares, not sines.

Also, I edited the first post. You now have some quick documentation and an executable to test each note independantly.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Sorunome on January 04, 2014, 06:02:00 am
Sounds interesting, now let's make it possible having bg-music for games :P
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on January 04, 2014, 07:00:49 am
On it
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 04, 2014, 07:50:26 am
Ok, so I can't find my adapter at the moment. I'm sure it's hidden somewhere in the bowels of my room. I'll look again after I clean up today.
Quoting myself from another thread, cause it's relevant here too. :P
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Juju on January 04, 2014, 11:26:04 pm
So I tried your test program and I noticed note 0 is actually a G5 (784Hz)? Someone can confirm?

And just to clarify, are all 4 channels square waves? Or you're gonna add a noise channel?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: fb39ca4 on January 05, 2014, 12:53:30 am
Ok, so I can't find my adapter at the moment. I'm sure it's hidden somewhere in the bowels of my room. I'll look again after I clean up today.
Quoting myself from another thread, cause it's relevant here too. :P
We have the opposite problem, then. I have an adapter, but I don't have a calculator. :P
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 05, 2014, 02:41:24 am
And just to clarify, are all 4 channels square waves? Or you're gonna add a noise channel?
They are all square waves, except the first channel which supports (in the next update) square waves+drums. For some reason though, the drums are very low-pitched.

So I tried your test program and I noticed note 0 is actually a G5 (784Hz)? Someone can confirm?
I think I'll add a calibration option -.-
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: utz on January 05, 2014, 08:45:21 am
Very nice. Always good to see someone working on TI sound ;)
I might try to implement the sound routine in HoustonTracker, considering it seems to consume fairly little memory.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 05, 2014, 01:56:53 pm
Very nice. Always good to see someone working on TI sound ;)
I might try to implement the sound routine in HoustonTracker, considering it seems to consume fairly little memory.
It consumes little memory indeed, but it doesn't support more than 46 notes and that was only with the tests I made. With a calibration option, I think that number will be even more reduced. But thanks :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 08, 2014, 02:54:53 am
UPDATE


Please tell me if it still plays wrong notes :)

Not done yet:


Warning:
If you had read the documentation on the first post, read it again (after I edit it) because some things changed (like the order of the notes).
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 08, 2014, 12:38:03 pm
Sorry for double posting, but I had to post this as soon as possible.

UPDATE


Here is the first screenshot ever for that program, since for once, there is something that you can see (and you can't hear).
(http://tiplanet.org/forum/download/file.php?id=1112)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TheMachine02 on January 08, 2014, 12:41:57 pm
who  :o  it's a super great menu !
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 08, 2014, 12:50:01 pm
Thanks ^^
(and glad not to hear you say "the iTi looks like the Autobots logo" :P)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 08, 2014, 04:07:03 pm
UPDATE
Sorry for double posting again, but you noticed that I wrote update in red this time.
Bug fix. The calibration menu actually calibrated at the first launch of the program, but for all other launches, it didn't calibrate anything.
I also changed the length of the appvar so please delete your old AudaciTI appvar before using this update.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: DJ Omnimaga on January 08, 2014, 04:49:30 pm
Sorry for double posting, but I had to post this as soon as possible.

UPDATE
  • Wonderful titlescreen


Here is the first screenshot ever for that program, since for once, there is something that you can see (and you can't hear).
(http://tiplanet.org/forum/download/file.php?id=1112)
Wow nice menu, although it's Calibrate, not Galibrate. :P

Just kidding (I know the fonts being so close together at such small resolution can cause this). I'll have to try the newest version soon. Btw you should upload a copy on ticalc.org then a link in Omni downloads section at one point so it's more visible. :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 08, 2014, 04:53:40 pm
Thanks ^^
And lol yeah, I had to shrink words to fit in 4 bytes so sorry for Galibrate :P

Also, I didn't upload it in any website's archives because it is still an early demo, it can only play one stupid music because there is no editor yet and previous versions even played wrong notes when playing that music :P
But yeah, once I have an editor, even a basic one, I'll start uploading it to some places :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 08, 2014, 05:03:42 pm
I know in IRC you asked about dividing an 8-bit number by the 12th root of 2. I have to rush to work in 9 minutes, so I didn't have time to test or convert to hex, but I think this might work:
Code: [Select]
ld b,h
ld c,l
xor a
ld d,a
add hl,hl ;2
add hl,bc ;3
add hl,hl ;6
add hl,bc ;7
add hl,hl ;14
add hl,hl ;28
add hl,hl ;56
add hl,bc ;57
add hl,hl ;114
add hl,hl ;228
add hl,bc ;229
add hl,hl \ rla ;458
add hl,bc \ adc a,d ;459
add hl,hl \ rla ;918
add hl,bc \ adc a,d ;919
add hl,hl \ rla ;1838
add hl,bc \ adc a,d ;1839
add hl,hl \ rla ;3678
neg
ld l,a
ld h,d
It assumes HL is the input and HL<256 (and also positive).

EDIT: Hopefully no typos or anything missed:
Code: [Select]
Asm(444DAF57290929092929092929092917098A2917098A2917098A2917ED446F62)258 t-states, you can also make it round for a few extra t-states...
EDIT2: 2 days later, I found the typos in the hex code, sorry.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 09, 2014, 09:16:04 am
That doesn't seem to work :-\
I replaced this:
   For(63)
    {+°Sqrt122}Select(,->{A+1->A})
   End

with that:
   For(63)
    Asm(444DAF57290929092929092929092917298A2917298A2917298A2917ED446F62)
    Select(,->{A+1->A})
   End

and now when I play a music (the only available one -.-), all notes are the same.

But that is not a big problem. Since the editor will probably eat RAM (due to the currently editing appvar being unarchived), the program will surely be an app (except if it is really small) so some wasted space due to using a LUT is not that much of a problem.

Thanks for helping anyway :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 09, 2014, 10:35:23 am
EDIT: This is still buggy, see the next post for a working version, that also rounds.
oh, oops, I forgot to include "sub c" before the "neg", sorry:
Code: [Select]
Asm(444DAF57290929092929092929092917298A2917298A2917298A291791ED446F62)
At the end, before the ED44, there is now a 91. The asm code is:
Code: [Select]
ld b,h
ld c,l
xor a
ld d,a
add hl,hl ;2
add hl,bc ;3
add hl,hl ;6
add hl,bc ;7
add hl,hl ;14
add hl,hl ;28
add hl,hl ;56
add hl,bc ;57
add hl,hl ;114
add hl,hl ;228
add hl,bc ;229
add hl,hl \ rla ;458
add hl,bc \ adc a,d ;459
add hl,hl \ rla ;918
add hl,bc \ adc a,d ;919
add hl,hl \ rla ;1838
add hl,bc \ adc a,d ;1839
add hl,hl \ rla ;3678
sub c
neg
ld l,a
ld h,d
It rounds down, but because of rounding troubles, this is off on two values:
0 returns 255 (-1) instead of 0
196 returns 185, when it should round down to 184 (actual value is like 184.999365...)

196 isn't too much of a problem, but 0 is, so if that is an allowed value, you can fix it with an If statement, or for only four bytes:
Code: [Select]
Asm(7DB72821444DAF57290929092929092929092917298A2917298A2917298A291791ED446F62)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 09, 2014, 11:07:59 am
Thanks for working again on it, it works better (it plays different notes, and higher notes are indeed higher) but unfortunately they seem to be all wrong :-\
But as I said, if you have other projects or work or something, no absolute need for that, my LUT works :)
So if you want to work on it, well you can (and you'll get credited) but otherwise I'm ok right now :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 09, 2014, 09:54:35 pm
To make sure, you are using x*2^(-1/12), right? I tested that against my code and it gives exactly int(x*2^(-1/12)) for all but the two values mentioned...
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 10, 2014, 01:06:45 am
Well then I don't know what's going on :(
Here's the full source code, in attachement (removed :P, I may put it again when everything is cleaner, and you still can ask me for bits of it anyway ;)) (And yeah, there are some completely unoptimzed Text commands, like groups of three Text commands that could be a stdDev, but they are here for testing purposes for now (like in the Edit menu where I was checking if coordinates were right) or in menus that are not in their final form (like the appvar menu) so I didn't bother optimizing it at all. Same in the Calibrate menu where I was checking if lines fitted in the screen). See the "Lbl Calibrate", not so far from the return, you have both our codes (one being commented, the other one not being commented). I even added some push and pop commands around your code to be sure it doesn't destroy anything, but there is still a problem when playing notes :(
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 10, 2014, 09:23:13 am
Okay, it seems like your LUT uses rounded values?
For that, I have:
Code: [Select]
Asm(AF555F444D290929444D2929290929092929172917098B29172917098B298B92ED446F63)

The only value that is off is for the input 98, which is off by 1 after rounding (but only actually off by a rounded value of <1/3000). This routine can be easily modified to give the 8.8 fixed point result in case you need more accuracy. I forgot if you are building a table with this routine? If so, more accuracy during the calculations can help prevent larger rounding errors. Since my routine actually throws away 10 bits of extra accuracy (it has 18 bits of accuracy) you can do:
Code: [Select]
;263 t-states, 36 bytes
Asm(AF555F444D290929444D2929290929092929172917098B29172917098BCB256C67EBED52)
It is the same size and speed and the error is less than 1/256 from the actual for all inputs.

Also, I just looked at the previous hex codes I gave you. I did make typos >.> A bunch of "29"s where supposed to be 09. I also forgot one of the 29s. That's why my tests were working (I just compiled the assembly with ORG to do a quick test) but yours weren't. Sorry :/

EDIT:
It is 281263 t-states for the 8.8 fixed point version.
EDIT2: Optimised by using the formula X-(6X*613)/65536 instead of X-3678X/65536. The difference is that I split up the multiplication to multiply by 6, then 613. 1 byte smaller, 18 t-states faster.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 10, 2014, 09:12:31 pm
I tried the most recent version you posted. It works and has good volume on hardware. :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 11, 2014, 05:56:39 am
I forgot if you are building a table with this routine?
Yes, that's what I do.

And thanks, the first one (the one which finishes with 63) works :D
The second one doesn't however, but I didn't find any precision problem for now in the test music I have with that :)
Thanks :D

I tried the most recent version you posted. It works and has good volume on hardware. :)
And did the calibration fix the wrong notes or was the first A too low to fit in the proposed range ?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on January 11, 2014, 07:41:27 am
I'm not really sure to be honest. The demo just sounded like a short sequence of random notes.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 11, 2014, 08:13:37 am
Ah ?
Which version (from which post) did you try ? It is meant to play this:
do  do  do  do  (this is the first chord)
si  re  mi  la  (this is the second chord)
la  mi  re  si  (etc)
sol fa  fa  sol
fa  sol mi  la
mi  la  sol fa
re  si  sol sol
do  do  sol sol
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 15, 2014, 09:24:32 am
Sorry for not posting with an update, but I just wanted you to know that I got an adapter :D
And indeed, this has good volume O.O

However, the calculator is a lot faster than Wabbitemu and the calibration screen seems not to include any A o.O
Seems that I have to change that.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 15, 2014, 02:45:23 pm
And thanks, the first one (the one which finishes with 63) works :D
The second one doesn't however, but I didn't find any precision problem for now in the test music I have with that :)
Thanks :D
Remember that the second one is fixed-point, not an integer. I actually tested that code this time and it worked :) For example, 77→18606 = 72.6796875 instead of 73. The actual value is about 72.67832208.

And yup, the calculators are loud on actual hardware :P
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 15, 2014, 02:58:03 pm
And thanks, the first one (the one which finishes with 63) works :D
The second one doesn't however, but I didn't find any precision problem for now in the test music I have with that :)
Thanks :D
Remember that the second one is fixed-point, not an integer. I actually tested that code this time and it worked :) For example, 77→18606 = 72.6796875 instead of 73. The actual value is about 72.67832208.
But I never worked with fixed point variables before o.o
How do I convert the hl it returns into a "regular" integer ?

And yup, the calculators are loud on actual hardware :P
In fact I was surprised because when I tried TruSound (with the someone else's adapter), the volume was really low.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Matrefeytontias on January 15, 2014, 03:04:07 pm
You convert a 8.8 number to an integer by dividing it by 256. The way it works is a 8.8 number uses 8 bits as the integer part, and 8 bits as a decimal part, where the decimal unit is 1/256.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 15, 2014, 03:04:07 pm
You just divide by 256. In this case, if you do that, it would round down, though.

In Axe, if you do 3.5→A, it actually stores 896 to A (896/256=3.5). Then if you do A**A, you get 3136. 3136/256=12.25.

If you are doing 12root(X) times or divided by anything, then using Axe's fixed point will give you better accuracy in the end result. If you are only doing addition and subtraction, you won't gain accuracy.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Matrefeytontias on January 15, 2014, 03:05:22 pm
:ninja:

Also yeah, prefer 8.8 arithmetic in this case.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 15, 2014, 03:06:28 pm
Ok, thanks :)
But that also means that I have to multiply my first integer by 256, right ?
I'll try that when my exams are over -.-
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Xeda112358 on January 15, 2014, 09:37:34 pm
But that also means that I have to multiply my first integer by 256, right ?
It depends on what you mean. The routine I gave takes an 8-bit integer and returns an 8.8 fixed point number. To multiply that by something else, you would need to multiply the other number by 256 (which is 3 bytes, 11 cycles in Axe).
So what I mean is, if you want to multiply A/21/12*B, where A and B are integers, you would do:
Code: [Select]
AAsm(<code>)**(B*256)
In asm, this could be optimised a bit, maybe even in Axe (not sure). However, this part of your code probably doesn't need to be really fast.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on January 16, 2014, 01:56:44 am
Ah ok, I thought it took a 8.8 fixed point number as input. Ok, I get it, thanks :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on February 01, 2014, 11:31:19 am
UPDATE

Beginnings of an editor


To do next: make the calibration calibrate low enough for the player to play right notes -.-
For now, only Wabbitemu plays right notes, calculators are too fast and play higher notes.
Also, add drums once and for all, in all channels instead of having them hidden in the first one.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: utz on February 02, 2014, 05:42:08 am
Hotdammit Hayleia, that piano roll editor looks pretty awesome, congrats.
Just one question, how do I delete an individual note?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Eiyeron on February 02, 2014, 05:55:34 am
QUestion can you edit the cannel seetings? Like Attack/Sustain/Release/Decay?
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Sorunome on February 02, 2014, 06:02:16 am
Wow, that editor is looking awesome indeed O.O
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Keoni29 on February 02, 2014, 06:21:26 am
Looks cool. I will definitely check it out once I fix my pc.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on February 02, 2014, 06:37:54 am
Hotdammit Hayleia, that piano roll editor looks pretty awesome, congrats.
Wow, that editor is looking awesome indeed O.O
Looks cool. I will definitely check it out once I fix my pc.
Thanks :D

Just one question, how do I delete an individual note?
You can't. My player supports 4 channels, which obviously means "no more" but also "no less" :-\
Maybe that will change in the future but for now it is like that.
However, if you want to play less notes, you can simply put two notes on the same level and your chord now only has 3 notes in it ;)

QUestion can you edit the cannel seetings? Like Attack/Sustain/Release/Decay?
I didn't understand any of the 4 interesting words o.o°
To me, Sustain means "longer note", Release means "shorter note", and the other ones mean nothing :P
Longer and shorter notes are on my to do list, if that answers part of your question.
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: MGOS on February 02, 2014, 06:57:16 am
Wow that looks indeed pretty fancy awesome!

Attack/Decay/Sustain/Release (short ADSR) are parameters defining the envelope curve of a note. Every basic synthesizer has 4 pots - one for each value.
Attack is the time the tone needs to go to full amplitude. Decay is the time the amplitude drops to a certain Sustain level, where the note rests until it is being released. After the note is released, the Release time specifies how long the tone needs to fade away.

This diagram (from Wikipedia) illustrates that quite nicely:
(http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/ADSR_parameter.svg/800px-ADSR_parameter.svg.png)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: Hayleia on February 02, 2014, 07:14:59 am
Ah, well thanks for the explanation :)
Now to answer Eiyeron's question properly, no :P
My player only supports "simple" notes, with constant amplitude (gets to its maximum as soon as you start playing it, stops playing as soon as you stop playing it (no joke !)).
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: TIfanx1999 on February 02, 2014, 07:47:19 am
The editor looks like it's coming along quite nicely. :)
Title: Re: AudaciTI - 4 channel music player and editor (in the works)
Post by: utz on February 02, 2014, 08:32:21 am
Full ADSR is nearly impossible to pull off with Pulse Interleaving (which is most likely the synthesis method used here).
You could, however, support at least 2 different volume levels by allocating non-equal time slots to the channels. The difference needs to be pretty pronounced though, because the human ear perceives volumes in a logarithmic way. So, just talking about 2 channels, distribute timing so it spends approx. 2 thirds on the first channel and 1 third on the second one, and you get a decent volume difference, good enough for creating nice echos and similar effects.
Hope that explanation wasn't too convoluted...

ed: Check this track (https://soundcloud.com/irrlicht-project/endgames-1bit) of mine, about 55 seconds in. This is a 3-channel pulse interleaving engine with pwm support and 3 different volume levels. 1st channel frame is about half as long as the 2nd one, which is in turn half as long as the 3rd channel frame.