Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • Announcements

    • Lizzy Trickster

      Latest Stable OpenComputers Version   11/26/16

      The latest released version of OpenComputers is version 1.7.1 for MC 1.7.10, 1.10.2, 1.11.2 & 1.12.1. See more information here! Beta/Dev builds can be found at the Jenkins Build Server (ci.cil.li)
    • Lizzy Trickster

      !!FORUM DOWNTIME!!   01/16/18

      On 2018-01-27 the forums will be going down at around 1100 GMT0 for up-to 5 hours to allow for hardware configuration changes on the system that hosts these forums as well as various updates to patch recently publicised CPU vulnerabilities. Apologies for the inconvenience that this will cause.  If you would like to keep up-to-date on the progress of the work, join our IRC channel (http://webchat.esper.net/?nick=&channels=oc) or our Discord ( https://discord.gg/0hVukoQ2KYifZFCA ).

ManIkWeet

Members
  • Content count

    7
  • Joined

  • Last visited

  1. Boot OpenOS without GPU/Screen?

    Seems to work, but documentation is terrible... Spent 30 minutes figuring out what to place in rc.cfg Thank you
  2. Boot OpenOS without GPU/Screen?

    I wrote a program that basically needs to read/write a file and trigger one of 9 note blocks, this file is managed externally. Because of the 9 note blocks I am running out of component space. The perfect solution to this would be to boot my program without a screen (it doesn't need a screen to function). I tried booting OpenOS without a GPU/Screen, but it seems to freeze at some point and OpenOS will not run any programs I've configured to autorun. Preferably I'd like a minimal setup, which only loads what I need and runs without a GPU/Screen, I have the following requires in my program: require("serialization") require("component") require("filesystem") require("shell") require("event") Which I guess is basically the complete OpenOS suite... So simple question: how to boot without a GPU/Screen and run my program?
  3. Playing multiple notes instantly, also memory leak?

    Multiple computers would be a solution, but it is not exactly a very eco-friendly (aka survival) solution, sadly I think I have to give up on this project...
  4. Playing multiple notes instantly, also memory leak?

    But vanilla noteblocks are so much cooler Thanks on the heads up of the memory leak btw.
  5. Playing multiple notes instantly, also memory leak?

    I have made a small video displaying the issue I have: I have used the following programs: ComputerCraft: sleep(2) local note1 = peripheral.wrap("left") local note2 = peripheral.wrap("right") function play1() note1.triggerNote() end function play2() note2.triggerNote() end c1 = coroutine.create(play1) c2 = coroutine.create(play2) coroutine.resume(c1) coroutine.resume(c2) OpenComputers: local component = require("component") local keyboard = require("keyboard") local computer = require("computer") local event = require("event") local mbs = {} for k,v in pairs(component.list()) do if v == "musicblock" then table.insert(mbs,component.proxy(k)) end end t1 = function() local note = 1 while true do --local note = 1 mbs[1].trigger( note ) note = ( note + 1 ) % 24 + 1 coroutine.yield() end end t2 = function() local note = 1 while true do --local note = 4 mbs[2].trigger( note ) note = ( note + 1 ) % 24 + 1 coroutine.yield() end end c1 = coroutine.create( t1 ) c2 = coroutine.create( t2 ) play = function() os.sleep(2) --while true do --if keyboard.isKeyDown(keyboard.keys.p) then --for i=1, 10 do coroutine.resume(c1) coroutine.resume(c2) --end --end --event.pull() --end end play() So clearly there's a difference between how ComputerCraft handles noteblocks and how OpenComputers handles noteblocks... Still looking for the solution for OpenComputers Also, you're welcome for the inspiration
  6. Playing multiple notes instantly, also memory leak?

    The solution that you propose doesn't fire the 2 noteblocks at once, there still is a slight delay between them... Sadly OpenPeripherals (the mod to get Noteblocks to CC) doesn't work in 1.7.10 yet, so I have to downgrade to this horrible 1.6.4 that noone likes to demonstrate... will do that in a little while when I got more time... If you fire the 2 noteblocks with a redstone signal, you hear a single sound, I want to replace the redstone with the computer... Here's your code in a more readable and fixed matter: local component = require("component") local keyboard = require("keyboard") local computer = require("computer") local event = require("event") local mbs = {} for k,v in pairs(component.list()) do if v == "musicblock" then table.insert(mbs,component.proxy(k)) end end t1 = function() local note = 1 while true do --local note = 1 mbs[1].trigger( note ) note = ( note + 1 ) % 24 + 1 coroutine.yield() end end t2 = function() local note = 4 while true do --local note = 4 mbs[2].trigger( note ) note = ( note + 1 ) % 24 + 1 coroutine.yield() end end c1 = coroutine.create( t1 ) c2 = coroutine.create( t2 ) play = function() while true do if keyboard.isKeyDown(keyboard.keys.p) then --for i=1, 10 do coroutine.resume(c1) coroutine.resume(c2) --end end event.pull() end end play()
  7. Hi, I am new to OC, coming from CC and I want to make my music player in OC... The issue I had with CC was that it was not possible to play multiple notes at the same time, but this was fixed with the information here: http://www.computercraft.info/forums2/index.php?/topic/18995-openperipherals-play-2-or-more-noteblocks-at-the-same-time/ Now the 2 solutions available for CC don't seem to be available in CC so I tried around a bit with events... Didn't work as intended and even got a crashing computer out of it... Here's my code: local component = require("component") local counter = 1 local noteblocks = {} for address, componentType in component.list("music") do print(tostring(address) .. "," .. componentType) noteblocks[counter] = component.proxy(address) counter = counter + 1; end for _,nb in pairs(noteblocks) do nb.trigger(10) end local computer = require("computer") local event = require("event") function trigger() component.musicblock.trigger(15) end event.listen("note", trigger) for i=1, 10 do computer.pushSignal("note") end event.pull() print("finish") To replicate my issue, just place an adapter anywhere with one or more noteblocks connected to it. If you run the program you'll hear a clear delay between each note, music will need multiple notes at once... Preferably I want multiple notes to play instantly out of one single noteblock, but if that's impossible then I guess multiple will have to do... As for the memory leak: Running this part of the code local computer = require("computer") local event = require("event") function trigger() component.musicblock.trigger(15) end event.listen("note", trigger) for i=1, 10 do computer.pushSignal("note") end event.pull() Multiple times it will: 1. keep playing more and more notes at the end. 2. eventually crash, saying it ran out of memory.
×