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)

Search the Community

Showing results for tags 'breaking'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • OpenComputers
    • Announcements
    • Feedback
    • IRC
  • Code Central
    • Support
    • Showcase
    • Tutorials
  • Addons & More
    • Addons Mods
    • Architectures
    • OpenEngineering Task Force
  • General
    • Lounge
    • Forum Games
    • Showcase
    • Servers
  • Archives
    • Public Archives

Found 1 result

  1. 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.
×