This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CrazedProgrammer's profile picture

wave-amp - A fully featured music player

Started by CrazedProgrammer, 18 December 2016 - 10:01 PM
CrazedProgrammer #1
Posted 18 December 2016 - 11:01 PM
wave-amp is a fully-featured music player for ComputerCraft, powered by wave.

Features:
- Plays NBS (Note Block Studio) files
- Cool UI
- Music visualiser
- Different play modes (normal, stop, repeat, shuffle)
- Custom themes
- Flexibility through command-line arguments

Requirements:
- Either a Command Computer (all MC versions) or a MinimalPeripherals Iron Note Block (MC 1.10+)

You can get a bunch of music from the Note Block Studio website, or check out Cranium's site.
wave-amp will automatically load all .nbs files on your ComputerCraft computer.

Download:
pastebin get pAEiHKK1 wave-amp

Theme downloads:
pastebin get HYrhP1yN darktheme
pastebin get EP0vBAa5 redtheme

Command line arguments:
SpoilerYou can also view this by typing

wave-amp -h

-l				   lists all outputs connected to the computer.
-c <config file>	 loads the parameters from a file.
parameters are separated by newlines.
-t <theme file>	  loads the theme from a file.
-f <filter[:second]> sets the note filter for the outputs.
examples:
-f 10111			sets the filter for all outputs to remove the bass instrument.
-f 10011:01100	  sets the filter so the bass and basedrum instruments only come out of the second output
-v <volume[:second]> sets the volume for the outputs.
--nrm --stp --rep --shf   sets the play mode.
--noui --noinput	 disables the ui/keyboard input

Keyboard bindings:
Spoiler

space			 play/pause
N				 next song
P				 previous song
M				 mute/unmute
left arrow		go back 10 seconds
right arrow	   go forward 10 seconds
up arrow		  increase volume by 10%
down arrow		decrease volume by 10%
J				 scroll down
K				 scroll up
page up		   scroll up
page down		 scroll down
left shift		change mode
backspace		 exit

Screenshots:

Custom themes:
Spoiler
Edited on 10 May 2017 - 08:33 PM
Bye. #2
Posted 18 December 2016 - 11:08 PM
As always, nice work!
Test time soon ;)/>
Bomb Bloke #3
Posted 18 December 2016 - 11:11 PM
The visualiser's pretty cool. :)/>

This command might be useful for those who want some pre-packaged songs:

pastebin run cUYTGbpb get CYRmLz78 Songs
Emma #4
Posted 18 December 2016 - 11:28 PM
Absolutely beautiful!
Great work, works flawlessly.
Pyuu #5
Posted 19 December 2016 - 03:33 AM
Really good looking program. Unfortunately I can't test it as I can't run Minecraft on my PC. I wish there was a youtube video so I could hear how well the audio plays (haven't experimented with the iron note block much).

The visualization looks really neat! I have a basic question though: How many channels (or instruments) can be played by the program?
CrazedProgrammer #6
Posted 19 December 2016 - 01:35 PM
Thanks for the responses :D/>

The visualiser's pretty cool. :)/>

This command might be useful for those who want some pre-packaged songs:

pastebin run cUYTGbpb get CYRmLz78 Songs
That's indeed very useful, thanks!

Really good looking program. Unfortunately I can't test it as I can't run Minecraft on my PC. I wish there was a youtube video so I could hear how well the audio plays (haven't experimented with the iron note block much).

The visualization looks really neat! I have a basic question though: How many channels (or instruments) can be played by the program?
It can play 5 different instruments, and there's no limit on the amount of notes/channels.
Edited on 19 December 2016 - 08:51 PM
CrazedProgrammer #7
Posted 19 December 2016 - 10:05 PM
[media]http://www.youtube.com/watch?v=WbqqnGeDplU[/media]
A little showcase if your PC can't run Minecraft :P/>
bartar46 #8
Posted 21 December 2016 - 04:59 AM
When I try to run the program it just says no tracks found. Any ideas?
Bomb Bloke #9
Posted 21 December 2016 - 06:08 AM
Put some tracks on the computer?
Pyuu #10
Posted 21 December 2016 - 10:08 PM
A little showcase if your PC can't run Minecraft :P/>

This is really neat! Glad to hear how well it plays. I noticed that the bars correlate to which instrument is being played. The only problems seem to happen on higher BPM (where notable lag with playing the audio starts happening. like at 1:26 of the video)

Thanks for the video btw.
Sewbacca #11
Posted 04 March 2017 - 07:19 PM
Looks really nice!
I tested it with BBs playlist (Thanks!), but i got the impression, that sometimes notes doesn't appear in the same rythm, maybe because the computer is overhelmed with draw instructions?
However, you did a really good job! Specially i like your visualizer.
Edited on 04 March 2017 - 06:20 PM
AyScorch #12
Posted 14 March 2017 - 06:54 PM
Can't find tracks when I have songs
Any fix? :huh:/>
MrObsidy #13
Posted 19 April 2017 - 06:38 PM
window:94: Arguments must be the same length

Doesn't work for me, and yes, I am on a command computer.
Anavrins #14
Posted 19 April 2017 - 10:57 PM
window:94: Arguments must be the same length

Doesn't work for me, and yes, I am on a command computer.
This mostly comes from missing graphics that CC versions prior to 1.75 doesn't have, use a newer CC version if possible.
Larry84 #15
Posted 26 April 2017 - 10:31 PM
window:94: Arguments must be the same length

Doesn't work for me, and yes, I am on a command computer.
This mostly comes from missing graphics that CC versions prior to 1.75 doesn't have, use a newer CC version if possible.

I have the same problem, and I'm running CC 1.75. Any ideas? :(/>
Anavrins #16
Posted 26 April 2017 - 11:15 PM
I have the same problem, and I'm running CC 1.75. Any ideas? :(/>/>
Shoot, meant 1.76, unfortunately no version of MC1.7.10 has this fixed.
If I can make a suggestion to the dev, it would be to detect whether to print special characters or not with fixwindow = _G._HOST == nil to add compatibility with older CC version.
Edit: Looks like it's already that way, but is still not working for some reason…
Edited on 26 April 2017 - 09:19 PM
Bomb Bloke #17
Posted 27 April 2017 - 01:34 AM
A workaround should be to stick this at the top of the code:

term.redirect( term.native() )
Larry84 #18
Posted 27 April 2017 - 07:57 AM
A workaround should be to stick this at the top of the code:

term.redirect( term.native() )
Thanks BB, that worked, though with some graphical bugs I'm ok with.

EDIT:
I've modified the program so that it uses - instead of those nice lines ( :(/> ) But now also the progression bar works! :P/>
Edited on 27 April 2017 - 06:21 AM
Cranium #19
Posted 02 May 2017 - 05:49 PM
I've got a bunch of songs that I'd like to try out. I've previously used BombBlokes NOTE program, and I'd like to see how well this works out.
CrazedProgrammer #20
Posted 02 May 2017 - 07:21 PM
I've got a bunch of songs that I'd like to try out. I've previously used BombBlokes NOTE program, and I'd like to see how well this works out.
Whoa, that's a really nice selection!
I'll add the link to the topic post :D/>
I also apologise for the broken CC1.75- compatibility, I probably missed checking for the version when drawing one or two special characters.
Will make a fix soon.
Kazza #21
Posted 11 October 2018 - 01:25 AM
Is there any chance of this getting updated to use Speakers?
Bomb Bloke #22
Posted 11 October 2018 - 08:37 AM
CrazedProgrammer hasn't logged in to these boards for a while, but I would guess a search'n'replace of "iron_noteblock" to "speaker", followed by a tweak to line 201, would do the trick:

nb.playNote(wave._newSoundMap[note], volume, math.pow(2, (pitch - 12) / 12))

Spoiler… or, shameless pitch, you could just use Note: this works with vanilla speakers, Iron Note Blocks from Computronics or MoarPeripherals, and Command Computers. You can also run it through most any type of computer, including Neural Interfaces!
Edited on 11 October 2018 - 07:59 AM