Jump to content




Iron Note Block Music Player + ccTunes + Noteblock Hero


  • You cannot reply to this topic
57 replies to this topic

#1 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 14 February 2013 - 05:04 PM

Iron Note Block Music Player + ccTunes + Noteblock Hero
This program uses RichardG867's miscperipherals or austinv11's Peripherals++ as well as MysticT's NBSConverter
ccTunes for advance computers created by pingoleon60.
Note: API only required to us the NBSConveter to convert the music. Once you have the file no API's are required to play it.


Video of it in action: https://www.youtube....h?v=0Y2x9gmmqWI

Posted Image

More Pics
Spoiler


This program can play NB files (Created via MysticT's NBSConveter) and play it on up 20 different channles on 5 Iron Noteblocks.

How to use.
Spoiler

How to convert songs.
Spoiler

The player:

pastebin get 45zqrWfX musicplayer

http://www.pastebin.com/45zqrWfX

Example Song:
These link here are meant for quick viewing and It's not recommend that you download the songs here as it's easier to either use ccTunes or the link to download the songs in .zip files below

Music/Nyancat
http://www.lozengia....m/Music/Nyancat
Instrument/Nyancat
http://www.lozengia....terment/Nyancat





--Playlist
Spoiler

-- Note Block Hero [Music][Game]
A Guitar Hero/Rock band/Rythem Zone/other clones of it clone

Select song just like note block player.

Try to press 1-5 keys on time with the notes to get points.

Song mutes when you miss notes.

pastebin get XNVgGNQn noteblockhero
http://www.pastebin.com/XNVgGNQn


-- Advanced CC Tunes by pingoleon60 [Color][Mouse][Monitor][HTTP][Downloads]

pingoleon60 made a better gui for ccTunes taking advantage of advance computers color and mouse support.

pastebin get 86cAwfta ccTunes

Just type ccTunes and click the arrows to naviagte the menu untill you see the song you like. Click the get/put button to switch between uploading and downloading.

Also works on Monitors.

-- CC Tunes [HTTP][Downloads]

pastebin get r0jes7TF ccTunes

You can now use ccTunes to upload and download your music.

To download music just type in ccTunes

To upload music type "ccTunes upload" to open the menu or "ccTunes upload song_name" to upload song_name.

You can also get to ccTunes going to "cctunes.com" in firebox


-- Song List [Web Browser]

Go to: here and you can download songs in a zip from your browser.

Edited by Left4Cake, 24 May 2015 - 05:46 PM.


#2 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 18 February 2013 - 08:47 AM

Made a few updates.

- Now it has a menu, if you don't define an argument
- Will show song info.
- Song rate is based on NB file now not my Interment file
- Change directory structure for Instrument file.
- Instrument file now not required but will get only piano if not present.

#3 Shrooblord

  • Members
  • 24 posts

Posted 18 February 2013 - 02:00 PM

This is great stuff, man!
I was wondering two things: is it possible to make this automated? Can you, for example, call a function within a computer's startup file so that it automatically starts playing as soon as the computer boots?
And can you loop files seemlessly? I want to have a tune play continuously without pauses - is that possible?

I love it already - you've definitely saved me the effort of trying to make something like this myself. Thanks!

#4 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 18 February 2013 - 03:34 PM

Well I look into native playlist support of some sort. There no reason why it couldn't work I will just have to decide how I want to do it.

For now:
It is possible to make it automated right now since you can write a program that launches what ever song you want, with shell.run("musicplayer", "song_name"), however as far as an endless loop it is not you can use "while true loop" but I recommend NOT doing that with your startup file, (unless you have an external way of accessing your computer like single player or being the server admin)

Edit: Just found out that all the channels could come out of the same note block. So that opens up some side to have disk drives connected to theme.

Edit2: Now it has play list support. As far as automatically starting you will still need to use shell.run but now you can create a playlist for the song(s) to indefinitely loop. (until terminated)

#5 JustPingo

  • Members
  • 108 posts
  • LocationFrance

Posted 19 February 2013 - 03:08 AM

AWESOME !
I waited a program like this !
I maked "Want You Gone" and "Code Lyoko Theme" (lol), and it works great !

Imagine if you add a HTTP Api function, which allow users to upload their music and download others musics from others peoples, like iTune (MineTune).

#6 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 19 February 2013 - 03:17 AM

View Postpingoleon60, on 19 February 2013 - 03:08 AM, said:

like iTune (MineTune).
Or ccTunes.

#7 JustPingo

  • Members
  • 108 posts
  • LocationFrance

Posted 19 February 2013 - 03:35 AM

Yeah, it's better (Mine it's for Vanilla, yurk).

If you want to do this, I can help you for the PHP.

(Oh ! Your avatar is a cake ! xD)

#8 Shrooblord

  • Members
  • 24 posts

Posted 19 February 2013 - 04:14 AM

View PostLeft4Cake, on 18 February 2013 - 03:34 PM, said:

For now:
It is possible to make it automated right now since you can write a program that launches what ever song you want, with shell.run("musicplayer", "song_name"), however as far as an endless loop it is not you can use "while true loop" but I recommend NOT doing that with your startup file, (unless you have an external way of accessing your computer like single player or being the server admin)

Edit: Just found out that all the channels could come out of the same note block. So that opens up some side to have disk drives connected to theme.
For my own purposes, I already played around with your code a bit to try and make it endlessly loop. That's near impossible, I seem to have figured out, because the way Note Blocks play are always altered by some tiny randomness factor that will never make all the notes on-time perfectly. I think also the loading time of the music file might be a factor. However, I managed to free up all but two sides of the computer so I could have two Iron Note Blocks and three more spaces for a Disk Drive and two redstone wires (in- and outputs). I tried playing around with putting your 'play code' in a function and making it loop like so
if playSong() == false then
    os.sleep(song["delay"])
    i = 0
    playSong()
end
(I put a 'return false' statement after the end of your while loop so it would return false once the song was finished playing)

And that would of course only loop it once, but the result of the test was that I could never get it to loop perfectly, no matter how much I adjusted that factor song["delay"] at the end.

#9 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 04:35 AM

Well the delay is the music player reading the file. My RL computer can seemly loop on peaceful (no mobs spawned) and its not raining in minecraft. (atleast with the graphics turned up.) So it really depend on your RL computers (or you servers + connection on multiplayer) specs that can determine how accurate of a loop you can get. (that and how much stress your minecraft world happens to be putting on your computer/server at the time.)

Spoiler

Quote

Imagine if you add a HTTP Api function, which allow users to upload their music and download others musics from others peoples, like iTune (MineTune).

;)

#10 Shrooblord

  • Members
  • 24 posts

Posted 19 February 2013 - 04:40 AM

Yes, I noticed. I really appreciate what you've done - it's a lot of fun playing around with it, but maybe I should look into something less dependant on performance for what I'm trying to do.
Thanks anyway!

#11 Shrooblord

  • Members
  • 24 posts

Posted 19 February 2013 - 06:05 AM

I'm sorry to double-post, but I ran into something perculiar:



I'm having trouble converting one of my NBS files. This is the original file:
http://host-a.net/u/...rd/Moonsong.nbs

(Here's a screenshot for reference:)
Spoiler

Now, the file output by the NBSConverter has this as the first few entries:
{[1]={[1]={[1]=12,[2]=16,},[2]={[1]=12,},},[2]={},[3]={[1]={[1]=12,},},[4]={},[5]={[1]={[1]=11,},},[6]={},[7]={},[8]={[1]={[1]=4,},},[9]={[1]={[1]=7,[2]=11,},[2]={[1]=9,},},

which is, spaced out:
Spoiler

I can clearly see that the first thing it's writing down is three notes. It's got two entries for instrument 1 (which it calls [1]) and one for instrument 2 ([2]). During playback, however, it seems to be skipping anything larger than two notes at a time. Strangely enough, it's not that it simply isn't counting instruments 3 and 4; the A# at position 7, just before the F-D#-C# combo, is played, but not the F at position 8, because there's already a C# and D# being played. It really doesn't like multiple instances of (the same?) instruments playing if this number is greater than two.

Is this something I can change by altering the code? I need to have the maximum of four voices in this piece playing at the same time. The song sounds rather bland without them.

Here's a screen of the in-game playback. You can see it's not displaying one of the three first notes and neither is it playing all the notes at position 8 (and also I do not hear them, so it is in fact not playing them back).
Spoiler

I think what has happened because of your new code, is that it's now trying to assign one instrument, [1], two seperate notes to play and the single Iron Note Block doesn't like it. Is there some way to solve this problem, with this in mind?

Thank you!

#12 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 06:35 AM

It as to due with some of the notes being in [i][1][2] and my code is only playing notes from [i][1][1].

The NB converter seems to group note from the same chord that are played by the same insterment together. When I first programed it I thought each note block coulde only handle one note at a time, so I chose the limitation of the root of each chord rather then only having 1 chord.

Its really simple to fix. (in fact I will upload this change in a moment) but instead of
if song[i][1] then
note1 = song[i][1][1]
ironblock.playNote(int1,note1)
end

it should look like for each "if song[i][#] then"
if song[i][1] then
note1 = song[i][1][1]
ironblock.playNote(int1,note1)

if song[i][1][2] then
note1 = song[i][1][2]
ironblock.playNote(int1,note1)
end

end

Well ok, I will try to optimize it a bit before I upload it but that would work for your exact song.

Edit:
Ok wow, made a lot more changes then I thought. Its back to the five not configuration but, this time each iron note block will play notes that the NBSconveter group together. So now it can have potently 20 channels provided the converter groups them in such a way that they are 5 groups of 5.

Oh and now I uploaded ccTunes to allow uploading and downloading songs.

#13 Shrooblord

  • Members
  • 24 posts

Posted 19 February 2013 - 07:59 AM

Excellent!

Do you think it would be possible to make it so that you can choose how many Iron Note Blocks you attach? Say you only attach two instead of five. As of now, the program would crash as it couldn't find the other three. Wouldn't it be nice if you could attach two and the program would handle itself with only the two blocks?

I've been having a lot of fun fiddling around with your code, Cake. Somehow I managed to get it to infinitely loop seemlessly even though I didn't add the loop myself (I'll have to look at what's going on there...).

#14 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 08:19 AM

Fixed up the whole crashing if you don't have an ironnote block in every spot thing. (nothing a few if statements didn't fix)

Also fixed ccTunes so that it points to my online server and not localhost. (fail on my part.)

#15 JustPingo

  • Members
  • 108 posts
  • LocationFrance

Posted 19 February 2013 - 09:54 AM

Great, you have made ccTune yet.
I test it, and I will say you what I think about.

Félicitations !

EDIT : It's look nice; but how did you download music ? xD I see them but I don't know what it want to I done.
EDIT 2 : I'm stupid xD I've upload a test file in error, it's Untitled. Can you delete it ? I think it good that we can manage our uploads.
EDIT 3 : Ok I found how to download.
EDIT 4 : OMG A GUY HAD UPLOAD A WONDERFUL VERSION OF STILL ALIVE !

#16 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 10:15 AM

View Postpingoleon60, on 19 February 2013 - 09:54 AM, said:

I think it good that we can[t] manage our uploads.

Making code to upload files is easy, but file management tad harder then that.

Also you don't need more then 5 ints in the files since there are only really five channels. (Its the way the NBS converter groups them so that the same interment is all together.)

#17 JustPingo

  • Members
  • 108 posts
  • LocationFrance

Posted 19 February 2013 - 10:18 AM

(sorry for the "t", it's not that I said, but I'm French, you understand...)
I know, but it's a suggestion like an other.

#18 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 10:21 AM

View Postpingoleon60, on 19 February 2013 - 10:18 AM, said:

(sorry for the "t", it's not that I said, but I'm French, you understand...)
I know, but it's a suggestion like an other.

I did not say no, I just don't want anyone getting their hopes up.

#19 JustPingo

  • Members
  • 108 posts
  • LocationFrance

Posted 19 February 2013 - 10:25 AM

Ok.
An other suggestion : you can create a Statistics line, which say how many times the music was downloaded.

EDIT : And an other other suggestion xD : in the player, it would be cool to mute a line if it's wrong from converting.

#20 Left4Cake

  • Members
  • 272 posts
  • LocationEarth

Posted 19 February 2013 - 12:07 PM

Well you can see how many hits a given song has now.

Not that this is relevant to weather a mute button for different lines is a good idea or not but, what do you mean by "if it's wrong from converting" since I have not had a problem with it yet.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users