Omnimaga

Calculator Community => Other Calculators => Topic started by: ztrumpet on November 18, 2010, 01:41:16 pm

Title: Mobile Tunes 3 with Mimas
Post by: ztrumpet on November 18, 2010, 01:41:16 pm
I would like to be able to make songs for Mobile Tunes 3 on my calc, through Mimas.  In order to do this, I need the inc file from MT3, "mt3notes", to be an AppVar include file recognized by Mimas.  I'm not sure how to do it, but I know someone will know how.  Thanks! ;D

Content of "mt3notes" for those who can't download Mobile Tunes 3:
Spoiler For Spoiler:
Quote
#define note(l1,l2,r1,r2,time) .dw l1+(l2*256)\.dw r1+(r2*256)\.dw time
#define   endsection .dw 0,0,0
#define endsong .dw 0
#define playsection(section) .dw section-song

#define quarter         6400/tempo      ;quarter note length
#define whole         quarter*4      ;whole note length
#define half         quarter*2      ;half note length
#define eighth         quarter/2      ;eighth note length
#define sixteenth      quarter/4      ;sixteenth note length
#define thirtysecond      quarter/8      ;thirtysecond note length
#define sixtyfourth      quarter/16      ;sixtyfourth note length

#define quarterd      quarter+eighth
#define wholed         whole+half
#define halfd         half+quarter
#define eighthd         eighth+sixteenth
#define sixteenthd      sixteenth+thirtysecond
#define thirtysecondd      thirtysecond+sixtyfourth


#define half3         whole/3         ;half note triplets
#define quarter3      half/3         ;quarter note triplets
#define eighth3         quarter/3      ;eighth note triplets
#define sixteenth3      eighth/3      ;sixteenth note triplets
#define thirtysecond3      sixteenth/3      ;thirtysecond note triplets
#define sixtyfourth3      thirtysecond/3      ;sixtyfourth note triplets

#define   c0   255
#define   cs0   242
#define   d0   228
#define   eb0   215
#define   e0   203
#define   f0   192
#define   fs0   181
#define   g0   171
#define   ab0   161
#define   a0   152
#define   bb0   144
#define   b0   136
#define   c1   128
#define   cs1   121
#define   d1   114
#define   eb1   108
#define   e1   102
#define   f1   96
#define   fs1   90
#define   g1   85
#define   ab1   81
#define   a1   76
#define   bb1   72
#define   b1   68
#define   c2   64
#define   cs2   60
#define   d2   57
#define   eb2   54
#define   e2   51
#define   f2   48
#define   fs2   45
#define   g2   43
#define   ab2   40
#define   a2   38
#define   bb2   36
#define   b2   34
#define   c3   32
#define   cs3   30
#define   d3   28
#define   eb3   27
#define   e3   25
#define   f3   24
#define   fs3   23
#define   g3   21
#define   ab3   20
#define   a3   19
#define   bb3   18
#define   b3   17
#define   c4   16
#define   cs4   15
#define   d4   14
#define   eb4   13
#define   e4   13
#define   f4   12
#define   fs4   11
#define   g4   11
#define   ab4   10
#define   a4   9
#define   bb4   9
#define   b4   8
#define   c5   8
#define   cs5   8
#define   d5   7
#define   eb5   7
#define   e5   6
#define   f5   6
#define   fs5   6
#define   g5   5
#define   ab5   5
#define   a5   5
#define   bb5   4
#define   b5   4
#define   c6   4
#define   cs6   4
#define   d6   4
#define   eb6   3
#define   e6   3
#define   f6   3
#define   fs6   3
#define   g6   3
#define   ab6   3
#define   a6   2
#define   bb6   2
#define   b6   2
#define   c7   2
#define   cs7   2
#define   d7   2
#define   eb7   2
#define   e7   2
#define   f7   1
#define   fs7   1
#define   g7   1
#define   ab7   1
#define   a7   1
#define   bb7   1
#define   b7   1
#define   rest   0

Links:
Mobile Tunes 3.2:  www.cemetech.net/programs/index.php?mode=file&path=/83plus/asm/sound/mt3.zip
Mimas:  www.ticalc.org/archives/files/fileinfo/431/43140.html

Thanks in advance! :)
Title: Re: Mobile Tunes 3 with Mimas
Post by: FloppusMaximus on November 18, 2010, 09:59:49 pm
As a general matter, you can use the 'asmto8xv' tool to convert .asm and .inc files into Mimas format.  In this case, mt3notes.inc uses #define macros instead of normal equates, so to create the file below, I had to change the #defines into equates.

As you probably know, Mimas doesn't currently support macros at all, so instead of this:
Code: [Select]
song:
playsection(startbit)
playsection(lastA)
playsection(startbit)
playsection(lastB)
endsong

startbit:
note(rest,rest, c3,f2, eighth)
note(f2,a2, c3,f2, eighth)
...
endsection
you'd need to write something like this:
Code: [Select]
song:
RORG 0
DW startbit
DW lastA
DW startbit
DW lastB
DW 0      ; end of song

startbit:
DB rest, rest, c3, f2
DW eighth
DB f2, a2, c3, f2
DW eighth
...
DW 0, 0, 0     ; end of section

I haven't tested this, but it should work.  Hope this helps.
Title: Re: Mobile Tunes 3 with Mimas
Post by: tloz128 on November 18, 2010, 11:31:24 pm
I am sensing a potential future song creator for Mobile Tunes 3...
(I couldn't do it, but to anybody else who wishes to attempt this please do!)
Title: Re: Mobile Tunes 3 with Mimas
Post by: DJ Omnimaga on November 18, 2010, 11:32:46 pm
I wish there was an actual song editor so we don't need to install a computer IDE to compile ASM and we have an easier way to make songs.

Btw welcome back tloz28, I noticed you were away for a while.
Title: Re: Mobile Tunes 3 with Mimas
Post by: ztrumpet on November 19, 2010, 08:03:03 pm
Thanks Floppus!

How do I define tempo?

For the computer, it's defined like:
tempo = <insert tempo here>
Do I do it that way in Mimas?
Title: Re: Mobile Tunes 3 with Mimas
Post by: FloppusMaximus on November 21, 2010, 05:21:50 pm
Yes, that's right.  (The '=' character can be found in the 2nd+MATH menu, as in the BASIC program editor.)  You can also write 'EQU' instead of =, if you prefer.
Title: Re: Mobile Tunes 3 with Mimas
Post by: Munchor on November 22, 2010, 08:38:16 am
One day...
One day...

We'll be watching HD videos with high quality sound on calculators...

...probably not Texas calculator's though.

But mobile tunes? Still great! :)