Jump to content




[MC 1.7.10] [CC 1.65] Immibis's Peripherals


432 replies to this topic

#101 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 16 November 2012 - 01:24 AM

You can run Forth programs on the speakers. They run independently on each player's client. This feature probably isn't that useful, but you could use it to prevent network lag from affecting your tune if you want.

Raw API: ("speaker" is the wrapped peripheral)
speaker.execute(address) - begin running code at the given address
speaker.startup() - equivalent to speaker.execute(0)
speaker.shutdown() - stops running code and stops all playing sounds
speaker.reboot() - equivalent to speaker.shutdown() followed by speaker.startup()
speaker.setAttenuation(db) - sets the attenuation (negative volume) in dB. A good default seems to be 20.
speaker.write(address, data...) - writes data. multiple data words may be given, and they will be written to sequential addresses
speaker.getMemorySize() - returns the size of memory, in words (this cannot be changed except by editing the mod's code)
speaker.debugOn() - turns on debug mode - any output from the code will be printed to the chat of the player who placed the speaker.
speaker.debugOff() - turns off debug mode


Speaker test program, including a reusable Forth compiler:
http://dl.dropbox.co...peaker-test.lua

Note: With this compiler, the entry point is a word called MAIN, which must exist.
At the end, commented out, is a short piece of code which shows the effect of debug mode.
"Forth streaming" compiles the tune to chunks of Forth, then executes them.
"Direct streaming" uses the simple API to send notes directly to clients.
Do whatever you want with that whole file.

APIs in the reusable code block:
- speaker.compileForth(sourcecode)
   Returns compiled code (as a table of numbers)
- speaker.uploadForth(code, side, hot)
   Uploads the given compiled code to the speaker on the given side, then starts it executing.
   If "hot" is true (defaults to false), it will not shut down the speaker so notes continue to play.
- speaker.streamTuneUsingForth(tune, side)
   Implements the test program's Forth streaming mode.
- speaker.streamTuneDirectly(tune, side)
   Implements the test program's direct streaming mode.

For streamTuneUsingForth and streamTuneDirectly, the tune is a table containing a list of "commands" (nested tables) of the forms:
{"p", channel, frequency} - starts a note
{"s", channel} - stops a note
{"w", ticks} - waits some ticks

Non-standard FORTH words:
TICK ( -- ) waits a tick.
PLAY ( frequency channel -- ) starts playing a note
STOP ( channel -- ) stops playing a note


#102 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 16 November 2012 - 01:33 AM

50.2.0:
  • Added speakers.
  • Fixed rendering of dropped item-stacks of >1 item.
  • Fixed darkened rendering of part of the RFID writer as an item.
  • Added config options for all recipes, for added flexibility when installing on servers.

Speakers seem out of place in a mod that previously only had access cards. Does anyone else feel that way?

#103 J15t98J

  • Members
  • 30 posts
  • LocationPlanet Earth, the Universe

Posted 16 November 2012 - 06:28 AM

It does seem a bit out of place. Btw, the speaker spoiler on the OP is inside the mag-card spoiler.

#104 Asuleath

  • New Members
  • 6 posts

Posted 16 November 2012 - 06:32 AM

Don't seem out of place for me. It's Immibis's Peripherals, not Immibis's Cards.
And I don't see the problem of having new features in a mod(as long as they don't break anything), no one should complain about too much features. I mean, even if people don't use some features, there's no problem of having them included in the same mod.

But actually, where's the download link ? I don't see it on you webpage.

#105 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 17 November 2012 - 12:28 AM

Fixed the download link and the spoiler.

#106 MaHuJa

  • Members
  • 26 posts

Posted 17 November 2012 - 03:59 AM

View PostAsuleath, on 16 November 2012 - 06:32 AM, said:

as long as they don't break anything), no one should complain about too much features

Except when some of those features break in a minecraft update, causing the rest, that you do use, to be unavailable. (See also redpower - except I was using almost all of it.)


I like the speaker though; and indeed, it's not out of place in a peripherals pack.

What was that about tapes?

#107 Asuleath

  • New Members
  • 6 posts

Posted 17 November 2012 - 07:33 AM

I just tested the speakers. They're cool.
I'm trying to make my own Jukebox right now. :)/>

#108 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 17 November 2012 - 08:36 PM

View PostMaHuJa, on 17 November 2012 - 03:59 AM, said:

View PostAsuleath, on 16 November 2012 - 06:32 AM, said:

as long as they don't break anything), no one should complain about too much features

Except when some of those features break in a minecraft update, causing the rest, that you do use, to be unavailable. (See also redpower - except I was using almost all of it.)


I like the speaker though; and indeed, it's not out of place in a peripherals pack.

What was that about tapes?

A while ago I had an idea to add tape drives, that would be like the built-in disk drives, but: (+ denotes advantages, - disadvantages, * neither)
  • + Store more data
  • * Not be bootable
  • - Only be accessed sequentially - i.e. you can only read/write the tape from the start to the end, and jumping to a different location takes time.
  • - Not have a built-in filesystem, so the whole tape would work like a single file on a disk, but with the ability to seek (slowly) to different locations in the file and a fixed size.

Then I realised that one floppy disks is already big enough to fit all the data you'll ever have in ComputerCraft, so they'd be pointless.

#109 TehSomeLuigi

  • Members
  • 70 posts

Posted 18 November 2012 - 07:26 AM

Crash when using the speaker
2012-11-17 18:24:55 [INFO] [STDERR] java.lang.RuntimeException: javax.sound.sampled.LineUnavailableException: Audio Device Unavailable
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.ccperiphs.speaker.ClientSpeaker.startChannel(ClientSpeaker.java:245)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.ccperiphs.speaker.ClientSpeaker.stream(ClientSpeaker.java:364)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.ccperiphs.speaker.ClientSpeaker.stream(ClientSpeaker.java:119)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.ccperiphs.speaker.PacketSpeakerStream.onReceived(PacketSpeakerStream.java:53)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.core.net.OneTwoFiveNetworking.onReceivePacket(OneTwoFiveNetworking.java:105)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.core.net.OneTwoFiveNetworking.access$0(OneTwoFiveNetworking.java:95)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.core.net.OneTwoFiveNetworking$1.onPacketData(OneTwoFiveNetworking.java:123)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.core.porting.ClientProxy142$3.onPacketData(ClientProxy142.java:146)
2012-11-17 18:24:55 [INFO] [STDERR]     at cpw.mods.fml.common.network.NetworkRegistry.handlePacket(NetworkRegistry.java:249)
2012-11-17 18:24:55 [INFO] [STDERR]     at cpw.mods.fml.common.network.NetworkRegistry.handleCustomPacket(NetworkRegistry.java:239)
2012-11-17 18:24:55 [INFO] [STDERR]     at cpw.mods.fml.common.network.FMLNetworkHandler.handlePacket250Packet(FMLNetworkHandler.java:78)
2012-11-17 18:24:55 [INFO] [STDERR]     at awr.a(NetClientHandler.java:1341)
2012-11-17 18:24:55 [INFO] [STDERR]     at da.a(SourceFile:59)
2012-11-17 18:24:55 [INFO] [STDERR]     at bw.b(MemoryConnection.java:78)
2012-11-17 18:24:55 [INFO] [STDERR]     at awr.d(NetClientHandler.java:104)
2012-11-17 18:24:55 [INFO] [STDERR]     at awz.b(WorldClient.java:72)
2012-11-17 18:24:55 [INFO] [STDERR]     at net.minecraft.client.Minecraft.l(Minecraft.java:1826)
2012-11-17 18:24:55 [INFO] [STDERR]     at net.minecraft.client.Minecraft.J(Minecraft.java:854)
2012-11-17 18:24:55 [INFO] [STDERR]     at net.minecraft.client.Minecraft.run(Minecraft.java:779)
2012-11-17 18:24:55 [INFO] [STDERR]     at java.lang.Thread.run(Thread.java:662)
2012-11-17 18:24:55 [INFO] [STDERR] Caused by: javax.sound.sampled.LineUnavailableException: Audio Device Unavailable
2012-11-17 18:24:55 [INFO] [STDERR]     at com.sun.media.sound.HeadspaceMixer.nResume(Native Method)
2012-11-17 18:24:55 [INFO] [STDERR]     at com.sun.media.sound.HeadspaceMixer.implOpen(HeadspaceMixer.java:346)
2012-11-17 18:24:55 [INFO] [STDERR]     at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:286)
2012-11-17 18:24:55 [INFO] [STDERR]     at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:323)
2012-11-17 18:24:55 [INFO] [STDERR]     at com.sun.media.sound.MixerClip.open(MixerClip.java:162)
2012-11-17 18:24:55 [INFO] [STDERR]     at immibis.ccperiphs.speaker.ClientSpeaker.startChannel(ClientSpeaker.java:233)
2012-11-17 18:24:55 [INFO] [STDERR]     ... 19 more
2012-11-17 18:25:05 [INFO] [STDOUT] Stopping!
2012-11-17 18:25:06 [INFO] [STDOUT] SoundSystem shutting down...
2012-11-17 18:25:06 [INFO] [STDOUT]	 Author: Paul Lamb, www.paulscode.com
2012-11-17 18:25:06 [INFO] [STDERR] Exception in thread "Minecraft main thread" org.lwjgl.LWJGLException: X Error - disp: 0x6da79460 serial: 52454 error: BadWindow (invalid Window parameter) request_code: 2 minor_code: 0
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:276)
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.opengl.LinuxKeyboard.nSetDetectableKeyRepeat(Native Method)
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.opengl.LinuxKeyboard.setDetectableKeyRepeat(LinuxKeyboard.java:152)
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.opengl.LinuxKeyboard.destroy(LinuxKeyboard.java:163)
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.opengl.LinuxDisplay.destroyKeyboard(LinuxDisplay.java:1054)
2012-11-17 18:25:06 [INFO] [STDERR]     at org.lwjgl.input.Keyboard.destroy(Keyboard.java:349)
2012-11-17 18:25:06 [INFO] [STDERR]     at net.minecraft.client.Minecraft.e(Minecraft.java:731)
2012-11-17 18:25:06 [INFO] [STDERR]     at net.minecraft.client.Minecraft.run(Minecraft.java:809)
2012-11-17 18:25:06 [INFO] [STDERR]     at java.lang.Thread.run(Thread.java:662)



(script used where top=speaker)
s=peripheral.wrap('top')
s.start(1, 2000)
sleep(1)
s.stop(1)
(^ if the script is all wrong; I'm expermineting)

#110 Asuleath

  • New Members
  • 6 posts

Posted 18 November 2012 - 08:36 AM

View PostTehSomeLuigi, on 18 November 2012 - 07:26 AM, said:

Crash when using the speaker
[...]
(script used where top=speaker)
s=peripheral.wrap('top')
s.start(1, 2000)
sleep(1)
s.stop(1)
(^ if the script is all wrong; I'm expermineting)
Tried the same program, but it worked fine.

#111 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 19 November 2012 - 12:37 AM

View PostTehSomeLuigi, on 18 November 2012 - 07:26 AM, said:

Crash when using the speaker
What's your operating system and Java version? The code is fine.

#112 Khalamov

  • Members
  • 17 posts

Posted 20 November 2012 - 02:36 PM

View Postimmibis, on 08 October 2012 - 01:27 AM, said:

View Postwjykk, on 06 October 2012 - 06:44 AM, said:

I can't for the life of me get this thing to run. I'm using it with Minecraft 1.2.5 (because I'm using Technic and too lazy to do it myself and blah blah blah) with version 49 and followed the instructions... but I just get a white screen.

Full log at http://pastebin.com/rP9nBk7J, but it's rather long. Some points of interest include that it crashes as soon as the peripherals mod is being initialized, and if I take it out but leave the core mod, it starts up fine. I don't think it has anything to do with Railcraft anymore, but just in case I added a "z_" to the start of both mods (i.e. core and peripherals). Any help?

There's no crash in that log. If that's FML's log, can you post your launcher log as well? (in .techniclauncherlogslauncher_0.log)

wjykk, I had the exact same problem running Technic and trying to get this mod to work.

You need to update immibis-core_49.1.1 to immibis-core_49.2.2 in your mods folder and everything will run fine.

#113 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 20 November 2012 - 03:22 PM

I know this says 1.4x, but does it work with CC 1.47 for 1.4.4?

#114 Tiin57

    Java Lunatic

  • Members
  • 1,412 posts
  • LocationIndiana, United States

Posted 20 November 2012 - 04:15 PM

View PostShnupbups100, on 20 November 2012 - 03:22 PM, said:

I know this says 1.4x, but does it work with CC 1.47 for 1.4.4?
Unless you see a specific download for 1.4.4, probably not. Any 1.4.4 download will work with 1.4.5; however, the obfuscation changed from 1.4.2 to 1.4.4. Sorry.

#115 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 22 November 2012 - 12:55 AM

51.0.0:
  • Updated to 1.4.5.
  • Ended support for 1.2.5, 1.3.2 and 1.4.2.


#116 PrinzJuliano

  • Members
  • 89 posts
  • LocationGermany

Posted 27 November 2012 - 08:03 AM

Great mod. I like the idea.... and the GUIs are perfectly ;), :P

#117 sirdabalot

  • Members
  • 115 posts

Posted 27 November 2012 - 09:54 AM

Imah' gettin' this error:

Spoiler

Help, pwease? ^_^

#118 immibis

    Lua God

  • Members
  • 1,033 posts
  • LocationWellington, New Zealand

Posted 27 November 2012 - 11:52 PM

View Postsirdabalot, on 27 November 2012 - 09:54 AM, said:

Imah' gettin' this error:

Spoiler

Help, pwease? ^_^/>
Are you using the 1.4.5 version in 1.4.2?

#119 Goof

  • Members
  • 751 posts

Posted 29 November 2012 - 02:18 AM

Can someone make a tutorial, on how to install this Peripheral??? because... i tried to just put the

IMMIBIS PERIPHERALS 50.2.0
and the

IMMIBIS-core_50.2.4

into Mods folder..


but minecraft just get blacked out... (this mean, i get black screen for a LOOOOOOONG time)



thanks :D

_________________________________
-Mikk809h

ComputerCraft is Awesome

#120 sirdabalot

  • Members
  • 115 posts

Posted 29 November 2012 - 05:06 AM

View Postimmibis, on 27 November 2012 - 11:52 PM, said:

View Postsirdabalot, on 27 November 2012 - 09:54 AM, said:

Imah' gettin' this error:

Spoiler

Help, pwease? ^_^/>
Are you using the 1.4.5 version in 1.4.2?

No, however, I was using the 1.4.2 version in 1.4.5, sorry for wasting your time. :(





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users