Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate

Primary tabs

  • View
  • Collections
  • Comments(active tab)
  • Followers
  • Friends
  • Favorites
Oh sorry no I actually
Tuesday, October 16, 2018 - 12:11

Oh sorry no I actually attached a video to this I re-upload it. It actually showed up differently for me.

Here is the code I made. I
Sunday, October 7, 2018 - 00:52

Here is the code I made. I did use someone else's code but the majority of it is my own.

 

cmajorscale = {0,2,4,5,7,9,11}

 gmajorscale = {7,9,11,0,2,4,6}

 dmajorscale = {2,4,6,7,9,11,1}

 amajorscale = {9,11,1,2,4,6,8}

 emajorscale = {4,6,8,9,11,1,3}

 bmajorscale = {11,1,3,4,6,8,10}

 fsharpmajorscale = {6,8,10,11,1,3,5}

 csharpmajorscale = {1,3,5,6,8,10,0}

 gsharpmajorscale = {8,10,0,1,3,5,6,7}

 eflatmajorscale = {3,5,6,7,8,10,2}

 bflatmajorscale = {10,2,3,5,6,7,9}

 fmajorscale = {5,6,7,9,10,2,4}

 

function playscales(sfxnum,scale)

 local rand = 1

 srand(s)

 local rand2 

 

 local shift = 12

 

 local rand3 = 1

 

 local rand4 = 7

 

 local arpeggio = 1

 

 local vol

 

 local tempo = 20

 

 

 

vol = 1

 

 

 for t=0,31 do

  

rand2 = rnd()

 

rand = flr(rnd(3))+1

  

  if rand2 > .5 then

  if(t >  0) then

if(arpeggio == 1) then

  arpeggio = 3

  shift = 12

  

elseif arpeggio == 3 then

  arpeggio = 5

  shift = 12

  

elseif arpeggio == 5 then

arpeggio = 7

shift = 12

 

elseif arpeggio == 7 then

arpeggio = 1

shift = 12

 

end

  else arpeggio = 1

  

end

 

 

if(scale == 1) then

note=make_note(cmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 2) then

note=make_note(gmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 3) then

note=make_note(dmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 4) then

note=make_note(amajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 5) then

note=make_note(emajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 6) then

note=make_note(bmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 7) then

note=make_note(fsharpmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 8) then

note=make_note(csharpmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 9) then

note=make_note(gsharpmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 10) then

note=make_note(eflatmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 11) then

note=make_note(bflatmajorscale[arpeggio]+shift-12,rand4,vol,0)

elseif(scale == 12) then

note=make_note(fmajorscale[arpeggio]+shift-12,rand4,vol,0)

end

 set_note(sfxnum+26,t,note)

 

  set_speed(sfxnum+26,tempo) 

 

else

  t += 1

end  

end  

 

 vol = 1

 

for t=0,31 do

rand2 = rnd()

 

rand = flr(rnd(3))+1

 

 

if(rand2 > .5) then 

  

   if(t >  0) then

   

  

   if rand3 == 1 then

    if rand == 1 then rand3 = 3 

    elseif rand == 2 then rand3 = 7 

    elseif rand == 3 then rand3 = 4 end

   elseif rand3 == 2 then

    if rand == 1 then rand3 = 4

    elseif rand == 2 then rand3 = 6 

    elseif rand == 3 then rand3 =  1 end

   elseif rand3 == 3 then

    if rand == 1 then rand3 = 5 

    elseif rand == 2 then rand3 = 7 

    elseif rand == 3 then rand3 = 1 end

   elseif rand3 == 4 then

    if rand == 1 then rand3 = 6 

    elseif rand == 2 then rand3 = 3

    elseif rand == 3 then rand3 = 1 end

   elseif rand3 == 5 then

    if rand == 1 then rand3 = 2

    elseif rand == 2 then rand3 = 1

    elseif rand == 3 then rand3 = 7 end

   elseif rand3 == 6 then

    if rand == 1 then rand3 = 4 

    elseif rand == 2 then rand3 =  2

    elseif rand == 3 then rand3 = 1 end

   elseif rand3 == 7 then

    if rand == 1 then rand3 = 5 

    elseif rand == 2 then rand3 = 3

    elseif rand == 3 then rand3 = 2 end

   end

    else arpeggio = 1 

    

   end

 

  if(scale == 1) then

note=make_note(cmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 2) then

note=make_note(gmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 3) then

note=make_note(dmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 4) then

note=make_note(amajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 5) then

note=make_note(emajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 6) then

note=make_note(bmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 7) then

note=make_note(fsharpmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 8) then

note=make_note(csharpmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 9) then

note=make_note(gsharpmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 10) then

note=make_note(eflatmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 11) then

note=make_note(bflatmajorscale[rand3]+shift,rand4,vol,0)

elseif(scale == 12) then

note=make_note(fmajorscale[rand3]+shift,rand4,vol,0)

end

set_note(sfxnum,t,note)

 

set_speed(sfxnum,tempo)

else t+=1

 end

 

end

end

 

function write_new_song()

 local i = flr(rnd(12))+1

 local rand = flr(rnd(3))+1

 

 for index = 1, 12 do

 for y = 1, 2 do

  if(y == 1) then

  if(i <= 11) then 

   if rand == 1 then i+=1

   elseif rand == 2 then 

    if i > 2 then i = i - 1 

    else i = 12 end

   elseif rand == 3 then

    if(i+9 <= 11) then i = i + 9

    elseif i-4 >= 1 then i = i - 4 

    elseif i-4 <= 0 then

      i = i-4 + 13

    end

   end   

  else i = 1 end

  end

  playscales(index+1+y,i)

 end

 end

 music(3,-300)

end

 

function make_note(pitch, instr, vol, effect)

  return { pitch + 64*(instr%4) , 16*effect + 2*vol + flr(instr/4) } -- flr may be redundant when this is poke'd into memory

end

 

function get_note(sfx, time)

  local addr = 0x3200 + 68*sfx + 2*time

  return { peek(addr) , peek(addr + 1) }

end

 

function set_note(sfx, time, note)

  local addr = 0x3200 + 68*sfx + 2*time

  poke(addr, note[1])

  poke(addr+1, note[2])

end

 

function get_speed(sfx)

  return peek(0x3200 + 68*sfx + 65)

end

 

function set_speed(sfx, speed)

  poke(0x3200 + 68*sfx + 65, speed)

end

 

function get_loop_start(sfx)

  return peek(0x3200 + 68*sfx + 66)

end

 

function get_loop_end(sfx)

  return peek(0x3200 + 68*sfx + 67)

end

 

function set_loop(sfx, start, endt)

  local addr = 0x3200 + 68*sfx

  poke(addr + 66, start)

  poke(addr + 67, endt)

end

 

A community as musicians
Thursday, August 9, 2018 - 09:05

A community of musicians that want to get their music out there. 

I plan on using this for my
Wednesday, August 8, 2018 - 19:38

I plan on using this for my game https://gamejolt.com/games/space-plus-plus/359184

If you make ten songs I'll
Wednesday, August 8, 2018 - 19:27

If you make ten songs I'll add it to my game! https://opengameart.org/forumtopic/who-would-like-to-like-there-music-pu...

I know this was quick but I
Tuesday, August 7, 2018 - 15:20

I know this was quick but I came out with a new version 0.1.2. decreased the volume of all the music and made a beginner script in Lua for those who do not get how to begin coding. 

update 0.1.1 out 
Tuesday, August 7, 2018 - 14:09

update 0.1.1 out 

Just got this method after I
Tuesday, August 7, 2018 - 13:51

Just got this message after I made an update. I'll try to balance the music eq for the music on the next update. I posted mega ships into the game that require higher levels.

Love the song spring I just
Monday, August 6, 2018 - 17:31

Love the song spring I just downloaded deflemask.

I agree with Out-Of_Names you
Monday, July 30, 2018 - 11:28

I agree with Out-Of_Names you have to learn about the C# language first. This guy's youtube channel covers from beginner to advanced.  https://youtu.be/SXmVym6L8dw

I would highly suggest learning how to use interfaces which makes your code professional. It is not just a tool that makes your code follow strict guidelines. It allows data that is unrelated to have something in common. For example, you can store two very different objects in the same data structure with interfaces. 

Pages

  • « first
  • ‹ previous
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • …
  • next ›
  • last »