I know dcs already has a media player but I thought, "What the hell..." soI started a project called music maker that allows you to create music using different frequencies and lengths. Although I need to find a way to get the input. WordIntegers would work but it would take too long.I might be able to use a ByteInteger and multiply the input by 256 but it seems a huge jump. I might just use text input and hope they type a number. tell me your thoughts
So I suggest four entries: a one-character text input box for the note name (A-G), a ByteInput for the octave of the note, a three-radio-button set for Normal/Sharp/Flat, and a ByteInput for the length of the note in (sixteenth? eight? quarter?) notes. How does that sound to you?
Brilliant!of course it'll mean a little more work on my part but I'm going for it
xenonparadox wrote:
Brilliant!of course it'll mean a little more work on my part but I'm going for it
Awesome, I can't wait to see some screenshots. Let me know if you need any assistance with the API.
The Hz frequencies of real notes dont match the inputs for playsound, it turns out their SIMPLER!The only bad part is that the scale is reverse.At any rate I might finish this in about 1-2 weeks

I noticed there are about 12 scales between 0-256 and since i hardly doubt someone would use any lower notes im going to use a 1 byte integer for a note.that should cut down song size by 1/4
xenonparadox wrote:
I noticed there are about 12 scales between 0-256 and since i hardly doubt someone would use any lower notes im going to use a 1 byte integer for a note.that should cut down song size by 1/4
Please try not to double-post. Smile

Here's the mt3notes.inc that corresponds to the PlaySound routine:


Code:
#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
My phone will only let me type so much, then I get a mem err so I had no choice.Anyway, thanks for the sheet. That cut down a few days trying to compare notes. Oh, how is the data for a media tunes song organized, for compatability reasons?

Yet another doublepost fixed by Kerm:
I figured as smoothly as the project is going I'd add a feature that draws the song as sheet music on the screen. Please dont hound me about the double post ive only stated the problem a billion times
I quote directly from the mobileTunes3 readme:


Code:
The best way to show this is to look at one of the existing files, but here's a
simplified "song":

  | .org $0000
  | #include "mt3notes.inc"
  |     .db $BB,$6D
  |     .db $C9
  |     .db $31,$80
  |     .db 0,1,4
  | title:  .db "Sample Song",0
  | artist: .db "BR & KM",0
  | album:  .db "The REadMeIX 2007",0
  |
  | song:                    ;you must have this label!
  | tempo = 100
  |
  |     playsection(intro)
  |     playsection(verse)
  |     playsection(chorus)
  |     playsection(verse)
  |     playsection(chorus)
  |     playsection(ending)
  |     endsong
  |
  |
  | intro:
  |     note(f0,f1, c3,f3, sixteenth)
  |     note(f0,f1, c3,f3, sixteenth)
  |     note(g0,g1, d3,g3, sixteenth)
  |     note(g0,g1, d3,g3, quarter)
  |     endsection
  |
  | verse:
  |     note(f0,f1, c3,f3, sixteenth)
  |     note(g0,g1, d3,g3, sixteenth)
  |     note(g0,g1, d3,g3, quarter)
  |     endsection
  |
  | chorus:
  |     note(f0,f1, c3,f3, sixteenth)
  |     note(g0,g1, d3,g3, sixteenth)
  |     note(g0,g1, d3,g3, quarter)
  |     note(g0,g1, d3,g3, sixteenth)
  |     note(g0,g1, d3,g3, quarter)
  |     note(g0,g1, d3,g3, sixteenth)
  |     note(g0,g1, d3,g3, quarter)
  |     endsection
  |
  | ending:
  |     note(d0,d1, a2,d3, sixteenth)
  |     note(d0,d1, rest,rest, sixteenth)
  |     note(d1,d2, a2,d3, sixteenth)
  |     note(d0,d1, rest,rest, sixteenth)
  |     endsection
  |
  | .end
One Q, when MT plays the note() command is it playing the notes sequentially or in a 4-part channel?
xenonparadox wrote:
One Q, when MT plays the note() command is it playing the notes sequentially or in a 4-part channel?
It's a quadraphonic player, so it plays all four at once, two in the left channel and two in the right channel. For a single note in both ears, try note(mynote,rest,mynote,rest).
Sad Dang that sucks...here I was hoping i'd get off easy using the playsound...well, back to the drawing board.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement