Quick Sign In:  

Forum: VirtualDJ Skins

Topic: microphone (deck) behaving odd

This topic is old and might contain outdated or incorrect information.

I have assigned my third deck to the microphone input (linein) to be able to record and playback the mic.



In VDJ7 these buttons functioned as intended:

This button turns the mic on and off:
<button action="linein & volume 100%">
<size width="93" height="45"/>
<pos x="741" y="435"/>
<up x="741" y="435"/>
<selected x="900" y="1349"/>
</button>

This button turns the input recording on and off:
<button action="linein_rec">
<pos x="692" y="484"/>
<up x="692" y="484"/>
<size width="93" height="45"/>
<selected x="853" y="1411"/>
</button>

This button play the recorded sound while pressed:
<button action="play while_pressed & play ? on : off">
<pos x="789" y="484"/>
<up x="789" y="484"/>
<size width="93" height="45"/>
<down x="951" y="1411"/>
</button>

In VDJ8 the play button will light up when turning on the microphone (linein). That's a strange behaviour.



Furthermore, after recording my voice, the microphone cannot be turned on again. Very strange behaviour.

The above mentioned buttons are placed inside the deck container.

Can anyone shed some light on these peculiar problems?
 

Posted Mon 25 Jan 16 @ 11:35 am
For starters this: <button action="play while_pressed & play ? on : off"> can be changed to this in version 8:
<button action="play while_pressed" query="play">
This means that in version 8 you can specify a different action for the button and a different condition for the graphics to turn on:
<button action="play while_pressed" query="line_in ? off : play">

Also on VirtualDj 8 once you have something recorded on a deck you need to unload it before you can re-enable input or record again.

So you need to change your "record" button to this:
<button action="linein_rec ? linein_rec : unload & linein & linein_rec" query="linein_rec">

Hope this helps
 

Posted Mon 25 Jan 16 @ 1:49 pm
Appreciate the input, George!

I'm not so happy with the way the recording and replaying is going in VDJ8. The playback is waaay louder than the actual mic volume. And all three buttons light up when recording (can't get them to light up independently, as in VDJ7). And I can't record something, then use the microphone again and then play back the recorded sample (because the deck has to be cleared first)... No such problems in VDJ7 that i can remember...

This is what I have now:

<button action="toggle '$MIC' & var '$MIC' ? unload & linein : linein" query="linein">

<button action="toggle '$REC' & var '$REC' ? unload & linein_rec : linein_rec" query="linein_rec">

<button action="play while_pressed" query="play">

I'll experiment a bit more...
 

Posted Mon 25 Jan 16 @ 3:50 pm
I've seperated the unload command from the others...



... having to push the "clear" button to switch from recording to talking (mic)... don't like that much, to be honest...

...but things are a bit better. The MIC button still lights up when recording, but I guess that can't be helped... What bothers me (a lot) is the difference in volume between the mic and the recording of the mic (much louder). Is there a code for the linein recording volume?
 

Posted Mon 25 Jan 16 @ 4:17 pm
A workaround for the volume difference I found:

<button action="volume 100% & linein">

<button action="unload & on while_pressed">

<button action="linein_rec">

<button action="volume 10% & play while_pressed" query="play">

 

Posted Mon 25 Jan 16 @ 4:28 pm
Your volume issue derives from the fact that you record your mic in a low volume. Decks have auto gain active which means they will try to match the recorded sound to the target set by your zerodb setting
 

Posted Mon 25 Jan 16 @ 4:33 pm
What do you mean by "recording the mic in a low volume"?
I have no way of setting the recording volume, and the mic volume is always 100%...

Another side effect from the "having to unload the deck" issue is that if you have an effect activated for the microphone, this effect is turned off when unloading... So you have to make a workaround in the button for that:

<button action="linein_rec ? off : toggle '$MIC' & var '$MIC' ? off & effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : on & effect_active 'echo' ? linein & effect_active 'echo' : linein">

A bit silly, if you ask me. I liked the VDJ7 behaviour better and don't see any advantages to the VDJ8 way of doing things with linein...
 

Posted Mon 25 Jan 16 @ 6:16 pm
Let's brake down your script:
linein_rec ? off : toggle '$MIC' & var '$MIC' ? off & effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : on & effect_active 'echo' ? linein & effect_active 'echo' : linein

linein_rec ? off You query if the deck is recording, and if it's recording then you say it to turn off. Turn off what ? The way it is it will turn off the "led" (on state of the button) if a query expression is not used. It would be better to use nothing instead.
Let's keep on
: toggle '$MIC' & if the deck is NOT recording, toggle a global variable (why global ? it would make sense to be per deck) and...
var '$MIC' ? query the variable, and if variable is true then
off & effect_active 'echo' ? Turn off again. Turn off what ? Since your next step is to query an effect, off is not needed at all, so this could be just effect_active 'echo' ?. So we keep on querying an effect and if the effect is active we
unload & volume 100% & linein & effect_active 'echo' Unload the deck, put the volume on 100% enable line input & turn on effect.
So basically up to this point:
If the deck is not recording from line in we toggle a variable and if the variable is true if echo is active we unload the deck, put the volume on 100%, turn on line input & turn on echo.
Let's keep on:
: unload & volume 100% & linein else if echo is not active, unload the deck, put the volume on 100% & enable line input
: on & effect_active 'echo' ? else if global variable $MIC is not set we turn on (turn on what ?) and query the echo effect
linein & effect_active 'echo' if echo is active we toggle line input and toggle echo
: linein else we toggle line input.

It's an almost correct script, but way too complex for what it's supposed to do...

First of all let's clear it up a little:
linein_rec ? nothing : toggle 'MIC' & var 'MIC' ? effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : effect_active 'echo' ? linein & effect_active 'echo' : linein

In theory this script now (assuming that the deck is not recording something) on first click it unloads the deck and enables line input.
Then on second press it stops line input.
However that won't be the case with effects. On first press if echo is active already the script will correctly re-enable it (since unloading the deck will turn off the effect) On second press though if echo is active it will be deactivated since "effect_active 'echo'" command toggles the effect state. If that's that you want then the script is correct. If you want the echo to remain on (if it's already active) then you need to change the last part:

linein_rec ? nothing : toggle 'MIC' & var 'MIC' ? effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : linein

That was your script and your way around enabling inputs and recording the mic.

Let me try to take another approach here:
mic_rec ? mic_rec : effect_active 'echo' ? unload & mic_rec & effect_active 'echo' : unload & mic_rec

That's one button that does anything in one place. You see, you don't have to "enable input" first on a deck in order to record. If you say on the deck that you want to record, then the deck enables input automatically.
Finally if you just want to toggle live input of the mic on a deck all you need is a button with the following code:
linein 'mic'
If we add the effects query then it becomes:
linein 'mic' on ? linein 'mic' : effect_active 'echo' ? linein 'mic' & effect_active 'echo' : linein 'mic'

A few remarks:
1. When you toggle line input on a deck it restores the previously loaded track
2. Since you want to work with a mic it's better to use mic related commands
3. Recording a source (mic or line) on a deck stops the restoration of the previously loaded track (the deck considers you have a "new" track loaded.
 

Posted Mon 25 Jan 16 @ 8:24 pm
I'm baffled - and truly grateful - at your interest to invest so much time in this...

I understand what you are saying, and I'm pretty sure my lack of scripting knowledge makes me write unneccessarily complicated codes sometimes.

Having said that, I think you misunderstood what I was trying to do... Again, thank you so much for trying to help me.

What I need is a button to turn the linein on and off. It's that simple. Or is it? Well, as it turns out, in VDJ8 it isn't that simple anymore. Now you've got to unload the deck your linein is on, because otherwise you can't turn the linein on. And when you unload the deck, any effect that was running gets turned off, of course... So you need to unload and re-activate any running effect, when turning on the linein.

I don't use "mic" because I never could get that to work. I have my microphone connected to a (custom built-in) microphone amplifier (with phantom power supply), which in turn is connected to a linein of my sound card. So I need to activate the linein to have the microphone working...

Back to my mic button. This is what I have now:

<button action="linein_rec ? off : toggle '$MIC' & var '$MIC' ? off & effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : on & effect_active 'echo' ? linein & effect_active 'echo' : linein">

linein_rec ? off = to make sure the button doesn't light up when recording: It's the mic on/off button, not the mic rec button, after all! (For some strange reason VDJ8 turns it on when recording or playing back :( which I find terribly confusing)

toggle '$MIC' & var '$MIC' ? = just my way of making sure the button lights up when it should. Query doesn't always work for me, but that may be because I don't know all the syntax possibilities of this new verb...

effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein = unload the deck and turn on the linein... and if the echo effect is turned on, keep it on!

effect_active 'echo' ? linein & effect_active 'echo' : linein = turn of the linein, and if the echo effect is on, leave it on.

It's not perfect yet, but I'm getting there. The replay button still lights up when I turn on the microphone linein.

You are correct. I also found out that in VDJ8 the linein does not have to be activated to be able to record.
And again: thank you for all your effort!!! Appreciating that!!!

P.S.
My linein (microphone) runs on a dedicated deck: deck 3. All code is inside that deck container.
 

Posted Tue 26 Jan 16 @ 9:37 am
Just to make sure, I've tried the query verb again, but it doesn't work... Maybe I'm not using it right?

<button action="toggle '$MIC' & var '$MIC' ? effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : effect_active 'echo' ? linein & effect_active 'echo' : linein" query="linein">

<button action="linein_rec ? linein_rec : unload & linein_rec" query="linein_rec">

<button action="play while_pressed" query="play">

When the linein button is pressed, the play button also lights up. And when the record button is pressed, both the mic and play buttons light up. I'll try the old way and see if I can get what I need, namely that buttons only light up when they have been pressed. I'll let you know when I arrive at a good code for that.
 

Posted Tue 26 Jan 16 @ 10:00 am
I'VE GOT IT!!!

This way the buttons only light up when pressed:

<button action="toggle '$MIC' & var '$MIC' ? off & effect_active 'echo' ? unload & volume 100% & linein & effect_active 'echo' : unload & volume 100% & linein : effect_active 'echo' ? linein & effect_active 'echo' : on & linein">

<button action="toggle '$REC' & var '$REC' ? off & unload & linein_rec : on & linein_rec">

<button action="linein ? off : linein_rec ? off : play while_pressed">

:)
 

Posted Tue 26 Jan 16 @ 10:30 am


(Old topics and forums are automatically closed)