Author Topic: AudaciTI - 4 channel music player and editor (in the works)  (Read 19990 times)

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #30 on: January 08, 2014, 12:50:01 pm »
Thanks ^^
(and glad not to hear you say "the iTi looks like the Autobots logo" :P)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #31 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.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #32 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).

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. :)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #33 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 :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #34 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.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #35 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 :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #36 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)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #37 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 :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #38 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...

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #39 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 :(
« Last Edit: January 10, 2014, 11:30:27 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #40 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.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #41 on: January 10, 2014, 09:12:31 pm »
I tried the most recent version you posted. It works and has good volume on hardware. :)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #42 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 ?
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #43 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.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: AudaciTI - 4 channel music player and editor (in the works)
« Reply #44 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
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s