+ Reply to Thread
Results 1 to 6 of 6

Thread: [E2]Basic Wire DJ Expression

  1. #1
    Wire Noob Danneh's Avatar
    Join Date
    Mar 2009
    Posts
    4

    Default Resolved: [E2]Basic Wire DJ Expression

    Resolved
    ---
    Hey everyone.

    I'm a noob to E2 and decided to learn it. So far it's been awesome, heaps better and easier than E2 (Especially considering it's a lot like C, I'm used to that syntax).
    So the first thing I decided to make was a wire DJ expression that let you play songs. It's been going well so far, but I can't get it to stop songs once they've started.

    Here's my code to stop a song, the played song index is 1 as well
    [highlight=e2]if(InStop==1) {
    soundStop(1,1)
    }[/highlight]

    Here's the speaker code to see if there are any bigger errors in my code, any constructive critisism welcome
    [highlight=e2]@name MusicPlayerSpeaker
    @inputs InSong:string InPlay InStop InHelp
    @outputs
    @persist
    @trigger InPlay InStop InHelp

    if(first()==1) {
    hint("Need help to connect a speaker a DJ booth?",5.5)
    hint("Just connect a button to InHelp and get pressing!",6)
    }
    if(InHelp==1) {
    hint("Speaker Input - DJ Output",5.5)
    hint("InSong - SongPath[STRING]",6)
    hint("InPlay - OutPlay",6.5)
    hint("InStop - OutStop **BROKEN**"7)
    hint("InHelp to view this help"7)
    }
    if(InStop==1) {
    soundStop(1,1)
    }
    if(InPlay==1) {
    soundPlay(1,2000,InSong)
    }
    [/highlight]
    Last edited by Danneh; 03-21-2009 at 10:28 AM. Reason: Making the help section clearer

  2. #2
    Wirererer malum's Avatar
    Join Date
    Feb 2009
    Posts
    217

    Default Re: [E2]Basic Wire DJ Expression

    but I can't get it to stop songs once they've started.
    Why would you want to do that? Unless you mean you cant get the old song to stop when you do a new song?

  3. #3
    Wire Noob Danneh's Avatar
    Join Date
    Mar 2009
    Posts
    4

    Default Re: [E2]Basic Wire DJ Expression

    Quote Originally Posted by malum View Post
    Why would you want to do that? Unless you mean you cant get the old song to stop when you do a new song?
    Wait, you've actually got a point there.
    I don't need a button to stop songs mid-play.

    And because the songs all run off an index of 1, the new one simply replaces the old one when the next one is played.

    But I'm just curious anyways, incase I wanna try and stop sounds in any other application
    Thanks for the reply malcum
    Last edited by Danneh; 03-21-2009 at 06:34 AM. Reason: Adding info

  4. #4
    Wirererer malum's Avatar
    Join Date
    Feb 2009
    Posts
    217

    Default Re: [E2]Basic Wire DJ Expression

    Well, you cant because of what you said (they all write to directory 1)
    if you wrote them to directory 2, you could just do "soundStop(1,1)"
    soundPurge() also works.(I think)
    I'm an e2 noob. Just wait for someone smarter than me to come around :S

  5. #5
    Wire Noob jlj1's Avatar
    Join Date
    Mar 2009
    Posts
    20

    Default Re: [E2]Basic Wire DJ Expression

    Good work but I am fairly sure that == 1 isn't needed you can just do (first())
    or (Button) etc

  6. #6
    Wire Noob Danneh's Avatar
    Join Date
    Mar 2009
    Posts
    4

    Default Re: [E2]Basic Wire DJ Expression

    Quote Originally Posted by jlj1 View Post
    Good work but I am fairly sure that == 1 isn't need you can just do (first())
    or (Button) etc
    Aah yeah,forgot that it'll just put the button's value in there, so you don't need the ==1.

    Thanks for the help!

    Quote Originally Posted by malum View Post
    Well, you cant because of what you said (they all write to directory 1)
    if you wrote them to directory 2, you could just do "soundStop(1,1)"
    soundPurge() also works.(I think)
    I'm an e2 noob. Just wait for someone smarter than me to come around :S
    Ahh k, I can't test it at the moment because my comp's dead but I will when I can.
    Thanks for the help!

    Edit:
    Thanks for the help, but it turns out my E2 was mucked up elsewhere, and fixing that fixed the sound stopping.
    Thanks for helping!
    Last edited by Danneh; 03-21-2009 at 10:24 AM. Reason: Fixing quote tag, Resolved

+ Reply to Thread

Similar Threads

  1. Basic Expression Problem
    By Vaego in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 12-18-2008, 01:37 PM
  2. BASIC expression gate
    By Squeakyneb in forum Ideas & Suggestions
    Replies: 16
    Last Post: 08-27-2008, 05:04 PM
  3. Need Some Not-So-Basic Help
    By DarthRogue in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 08-05-2008, 05:08 AM
  4. Basic and Advanced Wire
    By joeyjo0 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 5
    Last Post: 11-01-2007, 01:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots