Author Topic: Sound with nspire Lua  (Read 19592 times)

0 Members and 1 Guest are viewing this topic.

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Sound with nspire Lua
« Reply #30 on: July 29, 2011, 11:32:50 am »
I have played "Come as you are" of Nirvana. ;) I'll post the list here soon.
And I'm playing with a code to generate random frequency list. That's very amusing. ^^
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sound with nspire Lua
« Reply #31 on: July 29, 2011, 12:34:56 pm »
Very nice!
I'm starting to think of another method, one that allows me to update the screen sometimes.
That way I might be able to make a little music player.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #32 on: July 30, 2011, 01:14:34 am »
Ok, my Music Composer is in very good shape, I made it during my Salt-Lake-City -> Miami travel :P

it's 501 lines of code right now and there's still a lot to be done.

The main stuff work but need to be greatly improved for a release.

So, I just wanted to know that I export the "music" with my own format, and then I'd have to write a little converter (which will be included in the program, don't worry to convert to jimbauwens' format.

Here's my syntax :

Quote
-- final string syntax : table of "[Note][Octave][Length][Alteration]", for example : "C342"
-- with C the note, 3 for the 3rd octave (middle of a regular piano keyboard I think), 4 for the eight-note length
-- (whole note is 1, half is 2, fourth is 3, sixteenth is 5), 2 for sharp (1 is flat, 0 is natural)

Screenshots :





btw, quick bonus for you guys, just so you're scared :
here's a non-optimized-beacause-i'm-lazy-right-now thing I have in the code :
Code: [Select]
if notelen > 3 then
gc:drawArc(x-8*scale+test(y>90)*12*scale,y-test(y>90)*30*scale+test(y<90)*10*scale,scale*18,scale*20,0,90-180*test(y<90))
if notelen == 5 then
gc:drawArc(x-8*scale+test(y>90)*12*scale,y-test(y>90)*20*scale,scale*18,scale*20,0,90-180*test(y<90))
end
end

%)
« Last Edit: July 30, 2011, 01:20:32 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sound with nspire Lua
« Reply #33 on: July 30, 2011, 01:23:17 am »
Wow, nice!
And please don't make it convert to my format,as it was just a basic example and needs lots of work if you want to use it in real life applications.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #34 on: July 30, 2011, 01:27:05 am »
Well my Music Composer would be used so games programmers for example can quickly generate music for their game and include the final "encoded music string" in their application and use your play() routine to play sounds in their apps.

Maybe you can yourself adapt your program/routine to understand my format ?

(just asking :P)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sound with nspire Lua
« Reply #35 on: July 30, 2011, 01:30:19 am »
Sure, but I don't think this would be useful in games, as you can't do anything while its playing.
I could try to implant it a bit different, but I don't know if the way I have in my mind will work good.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #36 on: July 30, 2011, 01:32:19 am »
Sure, but I don't think this would be useful in games, as you can't do anything while its playing.
I could try to implant it a bit different, but I don't know if the way I have in my mind will work good.

even with a coroutine task ? (I dont know, just asking)

I'm not sure but I'll ask TI directly about that, as it could be very intersting.... but shhh I can't talk about all that (or Can I ?, since I've never talked about sound with Lua to TI lol)
« Last Edit: July 30, 2011, 01:32:44 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sound with nspire Lua
« Reply #37 on: July 30, 2011, 01:36:12 am »
No, not even with that :/
It would be cool if TI added something specially for sound, but I doubt that will happen.
But you can always try :D

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #38 on: July 30, 2011, 01:48:42 am »
Well, you know, it's not necessarily a problem if the sound has to be played on itself and nothing else can be done at the same time, if it's a short sound, it's ok for fights starts/noises/endings, and for Credits, game over FX etc.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Sound with nspire Lua
« Reply #39 on: July 30, 2011, 01:51:55 am »
Well, we have a little problem.
print adds \r\n, and that itself makes a little weird noise.
Ah, but I'm sure it will be usefull for something.
« Last Edit: July 30, 2011, 01:52:33 am by jimbauwens »

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Sound with nspire Lua
« Reply #40 on: July 30, 2011, 07:10:53 am »
Wow ! Looks very nice !! :D
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Sound with nspire Lua
« Reply #41 on: July 31, 2011, 03:08:59 pm »
Those screenshots look quite excellent!  Amazing work! :)


Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #42 on: July 31, 2011, 09:17:08 pm »
Thanks ;)


BTW, does somebody hère wanna be an alpha/bera tester ? I Will need some :P
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Loulou 54

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 165
  • Rating: +39/-0
    • View Profile
    • Mes programmes sur TI bank.
Re: Sound with nspire Lua
« Reply #43 on: August 01, 2011, 10:22:54 am »
I think I could do that.. :)
Some of my program available here.. :)
http://ti.bank.free.fr/index.php?mod=archives&ac=voir2&id=1471

     

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: Sound with nspire Lua
« Reply #44 on: August 01, 2011, 01:42:58 pm »
All right, I think I'll just put my stuff on GitHub in a few days so it'll be easier to manage
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation